@sakuzu/maplibre-gl-draw-ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/LICENSE +661 -0
- package/README.md +267 -0
- package/THIRD_PARTY_NOTICES.md +350 -0
- package/dist/controls.d.ts +36 -0
- package/dist/index.d.ts +96 -0
- package/dist/index.js +15336 -0
- package/dist/index.js.map +1 -0
- package/dist/inspector/attributes.d.ts +46 -0
- package/dist/inspector/measure.d.ts +25 -0
- package/dist/inspector/operations.d.ts +44 -0
- package/dist/inspector/sections.d.ts +20 -0
- package/dist/inspector/style.d.ts +57 -0
- package/dist/inspector/types.d.ts +121 -0
- package/dist/inspector/view.d.ts +84 -0
- package/dist/layers/legend.d.ts +36 -0
- package/dist/layers/move.d.ts +30 -0
- package/dist/layers/tree.d.ts +87 -0
- package/dist/locales/en.d.ts +3 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/maplibre-gl-draw-ui.js +13988 -0
- package/dist/maplibre-gl-draw-ui.js.map +1 -0
- package/dist/messages.d.ts +211 -0
- package/dist/padding.d.ts +33 -0
- package/dist/shortcuts.d.ts +7 -0
- package/dist/store.d.ts +21 -0
- package/dist/style.css +3 -0
- package/dist/theme.d.ts +23 -0
- package/dist/tools.d.ts +56 -0
- package/dist/types.d.ts +237 -0
- package/package.json +88 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ArrowLeft","ArrowUpRight","ChevronDown","ChevronLeft","ChevronRight","CircleAlert","CircleCheck","CornerUpRight","GripVertical","Settings2","Share2","Trash2","TriangleAlert","EyeOff","LockOpen","Undo2"],"sources":["../../node_modules/@lucide/svelte/dist/utils/defaultAttributes.js","../../node_modules/@lucide/svelte/dist/utils/mergeClasses.js","../../node_modules/@lucide/svelte/dist/utils/buildLucideIconNode.js","../../node_modules/@lucide/svelte/dist/utils/hasA11yProp.js","../../node_modules/@lucide/svelte/dist/context.js","../../node_modules/@lucide/svelte/dist/Icon.svelte","../../node_modules/@lucide/svelte/dist/icons/layers.svelte","../../node_modules/@lucide/svelte/dist/icons/moon.svelte","../../node_modules/@lucide/svelte/dist/icons/sun.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Actions.svelte","../../node_modules/@sakuzu/kata/dist/svelte/messages.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Counter.svelte","../../node_modules/@lucide/svelte/dist/icons/arrow-left.svelte","../../node_modules/@lucide/svelte/dist/icons/arrow-up-right.svelte","../../node_modules/@lucide/svelte/dist/icons/check.svelte","../../node_modules/@lucide/svelte/dist/icons/chevron-down.svelte","../../node_modules/@lucide/svelte/dist/icons/chevron-left.svelte","../../node_modules/@lucide/svelte/dist/icons/chevron-right.svelte","../../node_modules/@lucide/svelte/dist/icons/circle-alert.svelte","../../node_modules/@lucide/svelte/dist/icons/circle-check.svelte","../../node_modules/@lucide/svelte/dist/icons/copy.svelte","../../node_modules/@lucide/svelte/dist/icons/corner-up-right.svelte","../../node_modules/@lucide/svelte/dist/icons/ellipsis.svelte","../../node_modules/@lucide/svelte/dist/icons/eye.svelte","../../node_modules/@lucide/svelte/dist/icons/eye-off.svelte","../../node_modules/@lucide/svelte/dist/icons/funnel.svelte","../../node_modules/@lucide/svelte/dist/icons/globe.svelte","../../node_modules/@lucide/svelte/dist/icons/grip-vertical.svelte","../../node_modules/@lucide/svelte/dist/icons/image.svelte","../../node_modules/@lucide/svelte/dist/icons/info.svelte","../../node_modules/@lucide/svelte/dist/icons/lock.svelte","../../node_modules/@lucide/svelte/dist/icons/lock-open.svelte","../../node_modules/@lucide/svelte/dist/icons/pencil.svelte","../../node_modules/@lucide/svelte/dist/icons/pipette.svelte","../../node_modules/@lucide/svelte/dist/icons/plus.svelte","../../node_modules/@lucide/svelte/dist/icons/search.svelte","../../node_modules/@lucide/svelte/dist/icons/settings-2.svelte","../../node_modules/@lucide/svelte/dist/icons/share-2.svelte","../../node_modules/@lucide/svelte/dist/icons/trash.svelte","../../node_modules/@lucide/svelte/dist/icons/triangle-alert.svelte","../../node_modules/@lucide/svelte/dist/icons/undo-2.svelte","../../node_modules/@lucide/svelte/dist/icons/ungroup.svelte","../../node_modules/@lucide/svelte/dist/icons/x.svelte","../../node_modules/@sakuzu/kata/dist/svelte/glyphs/Arrow.svelte","../../node_modules/@sakuzu/kata/dist/svelte/glyphs/Point.svelte","../../node_modules/@sakuzu/kata/dist/svelte/glyphs/Polygon.svelte","../../node_modules/@sakuzu/kata/dist/svelte/glyphs/Polyline.svelte","../../node_modules/@sakuzu/kata/dist/svelte/glyphs/StickyNote.svelte","../../node_modules/@sakuzu/kata/dist/svelte/icons.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Icon.svelte","../../node_modules/@sakuzu/kata/dist/svelte/lib/host.js","../../node_modules/@sakuzu/kata/dist/svelte/lib/tipPlace.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Tooltip.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Button.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Dropdown.svelte","../../node_modules/@sakuzu/kata/dist/svelte/lib/menuModel.js","../../node_modules/@sakuzu/kata/dist/svelte/lib/viewport.svelte.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Menu.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/MenuDivider.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/MenuHead.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/MenuItem.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/MenuList.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Block.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/InlineEdit.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Pair.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Kv.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/LinkAction.svelte","../../node_modules/@sakuzu/kata/dist/svelte/lib/clampTip.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Text.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/TextInput.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/AttributeList.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Banner.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Stack.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/ColorGrid.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/NumberInput.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Row.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Select.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/ColorPicker.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Spinner.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/State.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Footer.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Toolbar.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Modal.svelte","../../node_modules/@sakuzu/kata/dist/svelte/lib/fitBar.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Drawbar.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/InspectorRow.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/NativeSelect.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/ReadValue.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Segmented.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Slider.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Swatch.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Toggle.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/FieldList.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Floating.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Panel.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Tabs.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/InspectorFrame.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/SectionHeader.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/InspectorSection.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Kbd.svelte","../../node_modules/sortablejs/modular/sortable.esm.js","../../node_modules/@sakuzu/kata/dist/svelte/sortable.js","../../node_modules/@sakuzu/kata/dist/svelte/components/Markbox.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Tree.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/ListItem.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/TreeRow.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/LayerTree.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/List.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Sheet.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Progress.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/ProcessDialog.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Section.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Stat.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Stats.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/SelectionSummary.svelte","../../node_modules/@sakuzu/kata/dist/svelte/lib/shortcuts.js","../../node_modules/@sakuzu/kata/dist/svelte/components/ShortcutsModal.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Veil.svelte","../../node_modules/@sakuzu/kata/dist/svelte/components/Shell.svelte","../../node_modules/@lucide/svelte/dist/icons/circle.svelte","../../node_modules/@lucide/svelte/dist/icons/magnet.svelte","../../node_modules/@lucide/svelte/dist/icons/mouse-pointer-2.svelte","../src/components/MarkupIcon.svelte","../src/tools.ts","../src/shortcuts.ts","../src/store.ts","../src/inspector/sections.ts","../src/inspector/attributes.ts","../src/inspector/measure.ts","../src/inspector/operations.ts","../src/inspector/style.ts","../src/inspector/view.ts","../src/locales/en.ts","../src/locales/ja.ts","../src/messages.ts","../src/components/BufferDialog.svelte","../src/components/CustomSection.svelte","../src/components/StyleFields.svelte","../src/components/FeatureInspector.svelte","../src/components/GroupInspector.svelte","../src/components/LayerInspector.svelte","../src/components/SelectionInspector.svelte","../src/components/Inspector.svelte","../../node_modules/@lucide/svelte/dist/icons/pen-line.svelte","../../node_modules/@lucide/svelte/dist/icons/group.svelte","../../node_modules/@lucide/svelte/dist/icons/shapes.svelte","../src/layers/tree.ts","../src/layers/move.ts","../src/components/LayerPanel.svelte","../src/layers/legend.ts","../src/components/Legend.svelte","../src/components/LeftPanel.svelte","../src/components/Toolbar.svelte","../src/components/DrawUI.svelte","../src/controls.ts","../src/padding.ts","../src/theme.ts","../src/index.ts"],"sourcesContent":["/**\n * @file\n * @license @lucide/svelte v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\nconst defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\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};\nexport default defaultAttributes;\n","/**\n * @file\n * @license @lucide/svelte v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n/**\n * Merges classes into a single string\n *\n * @param {array} classes\n * @returns {string} A string of classes\n */\nexport const mergeClasses = (...classes) => classes\n .filter((className, index, array) => {\n return (Boolean(className) &&\n className.trim() !== '' &&\n array.indexOf(className) === index);\n})\n .join(' ')\n .trim();\n","/**\n * @file\n * @license @lucide/svelte v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses } from '../utils/mergeClasses.js';\nfunction isDefined(value) {\n return value !== null && value !== undefined;\n}\n/**\n * Creates a Lucide icon node (an svgson-like format) from a Lucide icon object.\n *\n * @param icon The icon to build.\n * @param params Additional build parameters.\n */\nfunction buildLucideIconNode(icon, params = {}) {\n const attributeNames = params.attributeNames ?? {};\n const getAttributeName = (attributeName) => attributeNames[attributeName] ?? attributeName;\n const viewBoxWidth = icon.size ?? icon.width ?? defaultAttributes['width'];\n const viewBoxHeight = icon.size ?? icon.height ?? defaultAttributes['height'];\n const aliasClassNames = icon.aliases\n ?.filter((alias) => typeof alias === 'string' && alias.trim() !== '')\n .map((alias) => `lucide-${alias}`) ?? [];\n const iconClassNames = [...(icon.name ? [`lucide-${icon.name}`] : []), ...aliasClassNames];\n const classNamesFromClassName = params.className?.split(' ').filter(Boolean) ?? [];\n const className = params.includeDefaultClasses === false\n ? mergeClasses(...classNamesFromClassName)\n : mergeClasses('lucide', ...iconClassNames, ...classNamesFromClassName);\n const calculatedStrokeWidth = params.absoluteStrokeWidth\n ? (Number(params.strokeWidth ?? defaultAttributes['stroke-width']) *\n Number(icon.size ?? icon.width ?? defaultAttributes['width'])) /\n Number(params.size ?? params.width ?? defaultAttributes['width'])\n : (params.strokeWidth ?? defaultAttributes['stroke-width']);\n const attributes = {\n ...Object.entries(defaultAttributes).reduce((attrs, [attrName, value]) => {\n attrs[getAttributeName(attrName)] = value;\n return attrs;\n }, {}),\n ...('color' in params &&\n params.color && {\n [getAttributeName('stroke')]: params.color,\n }),\n ...('size' in params &&\n isDefined(params.size) && {\n [getAttributeName('width')]: params.size,\n [getAttributeName('height')]: params.size,\n }),\n ...('width' in params &&\n isDefined(params.width) && {\n [getAttributeName('width')]: params.width,\n }),\n ...('height' in params &&\n isDefined(params.height) && {\n [getAttributeName('height')]: params.height,\n }),\n [getAttributeName('stroke-width')]: calculatedStrokeWidth,\n ...(className && {\n [getAttributeName('class')]: className,\n }),\n [getAttributeName('viewBox')]: `0 0 ${viewBoxWidth} ${viewBoxHeight}`,\n ...(params.hasA11yProp === false\n ? {\n [getAttributeName('aria-hidden')]: 'true',\n }\n : {}),\n ...('attributes' in params && params.attributes),\n };\n return [\n 'svg',\n attributes,\n icon.node.map((child) => {\n const [name, attrs, children] = child;\n const nextAttrs = params.nonScalingStroke\n ? { [getAttributeName('vector-effect')]: 'non-scaling-stroke', ...attrs }\n : attrs;\n return children ? [name, nextAttrs, children] : [name, nextAttrs];\n }),\n ];\n}\nexport default buildLucideIconNode;\n","/**\n * @file\n * @license @lucide/svelte v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n/**\n * Check if a component has an accessibility prop\n *\n * @param {object} props\n * @returns {boolean} Whether the component has an accessibility prop\n */\nexport const hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith('aria-') || prop === 'role' || prop === 'title') {\n return true;\n }\n }\n return false;\n};\n","/**\n * @file\n * @license @lucide/svelte v1.49.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\nimport { getContext, setContext } from 'svelte';\nconst LucideContext = Symbol('lucide-context');\nexport const setLucideProps = (globalProps) => setContext(LucideContext, globalProps);\nexport const getLucideContext = () => getContext(LucideContext);\n","<script lang=\"ts\">import buildLucideIconNode from './utils/buildLucideIconNode.js';\nimport { hasA11yProp } from './utils/hasA11yProp.js';\nimport { getLucideContext } from './context.js';\nimport { mergeClasses } from './utils/mergeClasses.js';\nconst globalProps = getLucideContext() ?? {};\nconst { color = globalProps.color ?? 'currentColor', size = globalProps.size ?? 24, width = size, height = size, strokeWidth = globalProps.strokeWidth ?? 2, absoluteStrokeWidth = globalProps.absoluteStrokeWidth ?? false, nonScalingStroke = globalProps.nonScalingStroke ?? false, iconNode = [], icon = {\n node: iconNode,\n aliases: [],\n size: 24,\n}, class: propsClass, children, ...props } = $props();\nconst hasAccessibleProp = $derived(Boolean(children) || hasA11yProp(props));\nconst [, svgAttributes, builtIconNode = []] = $derived(buildLucideIconNode(icon, {\n color,\n width,\n height,\n strokeWidth,\n absoluteStrokeWidth,\n nonScalingStroke,\n // @TODO: maybe drop the extra `lucide-icon` class altogether.\n className: mergeClasses('lucide-icon', globalProps.class),\n hasA11yProp: hasAccessibleProp,\n attributes: props,\n}));\nconst iconAttributes = $derived({\n ...svgAttributes,\n class: [...svgAttributes.class.split(' '), propsClass],\n});\n</script>\n\n<svg {...iconAttributes}>\n {#each builtIconNode as [tag, attrs]}\n <svelte:element\n this={tag as string}\n {...attrs}\n />\n {/each}\n {@render children?.()}\n</svg>\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"layers\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\" }], [\"path\", { \"d\": \"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\" }], [\"path\", { \"d\": \"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\" }]], \"aliases\": [\"layers-3\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/layers\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"moon\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/moon\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"sun\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"4\" }], [\"path\", { \"d\": \"M12 2v2\" }], [\"path\", { \"d\": \"M12 20v2\" }], [\"path\", { \"d\": \"m4.93 4.93 1.41 1.41\" }], [\"path\", { \"d\": \"m17.66 17.66 1.41 1.41\" }], [\"path\", { \"d\": \"M2 12h2\" }], [\"path\", { \"d\": \"M20 12h2\" }], [\"path\", { \"d\": \"m6.34 17.66-1.41 1.41\" }], [\"path\", { \"d\": \"m19.07 4.93-1.41 1.41\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/sun\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Actions: a row of actions at the end of a container that has no Footer. The actions sit at the\n // right end, secondary then primary; lead sits at the left end (a status, or a third outcome). It\n // has no height of its own and no line, unlike Footer. Neighbours are gap-sm apart.\n //\n // <Actions>\n // {#snippet secondary()}<Button>Cancel</Button>{/snippet}\n // {#snippet primary()}<Button variant=\"primary\">Save</Button>{/snippet}\n // </Actions>\n let {\n lead,\n secondary,\n primary,\n }: {\n /** A status or an action at the left end */\n lead?: Snippet;\n secondary?: Snippet;\n primary?: Snippet;\n } = $props();\n</script>\n\n<div class=\"actions\" data-role=\"actions\">\n {#if lead}<div class=\"lead\">{@render lead()}</div>{/if}\n {@render secondary?.()}\n {@render primary?.()}\n</div>\n\n<style>.actions {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--kata-gap-sm);\n min-width: 0;\n}\n\n.lead {\n margin-right: auto;\n display: flex;\n align-items: center;\n min-width: 0;\n}</style>\n","// The strings that components show on their own (the names of built-in actions, accessible names,\n// the labels of settings). kata ships English defaults. An application replaces any of them with\n// setMessages(), once at startup and again when its language changes. Components read them through\n// getMessages(), which is reactive: setMessages() updates the components already on screen.\nimport { createSubscriber } from 'svelte/reactivity';\nconst english = {\n close: 'Close',\n color: 'Color',\n colorRed: 'Red',\n colorOrange: 'Orange',\n colorGold: 'Gold',\n colorGreen: 'Green',\n colorBlue: 'Blue',\n colorPurple: 'Purple',\n colorBlack: 'Black',\n colorBrown: 'Brown',\n colorWhite: 'White',\n colorCode: 'Color code',\n eyedropper: 'Eyedropper',\n hue: 'Hue',\n saturation: 'Saturation',\n lightness: 'Lightness',\n saturationValue: 'Saturation and value',\n saturationValueText: ({ s, v }) => `Saturation ${s}%, value ${v}%`,\n fontScaleDefault: 'Default',\n fontScaleLarge: 'Large',\n fontScaleLarger: 'Larger',\n fontScaleLargest: 'Largest',\n fontScaleMax: 'Maximum',\n removeValue: 'Remove',\n pagination: 'Pages',\n previousPage: 'Previous page',\n nextPage: 'Next page',\n page: ({ page }) => `Page ${page}`,\n participants: ({ count }) => (count === 1 ? '1 participant' : `${count} participants`),\n showMore: ({ count }) => `Show ${count} more`,\n searchByName: 'Search by name',\n searchParticipants: 'Search the participants',\n noParticipants: 'No one matches.',\n you: '(you)',\n roleEditor: 'Can edit',\n roleViewer: 'Can view',\n sortAscending: 'Sort ascending',\n sortDescending: 'Sort descending',\n clearSort: 'Clear the sort',\n back: 'Back',\n cancel: 'Cancel',\n confirm: 'Confirm',\n sheetHeight: 'Sheet height',\n actions: 'Actions',\n settings: 'Settings',\n share: 'Share',\n linkShare: 'Link sharing',\n duplicate: 'Duplicate',\n move: 'Move',\n ungroup: 'Ungroup',\n delete: 'Delete',\n expand: 'Expand',\n collapse: 'Collapse',\n filters: 'Filters',\n removeFilter: ({ label }) => `Remove ${label}`,\n more: 'More',\n hide: 'Hide',\n show: 'Show',\n lock: 'Lock',\n unlock: 'Unlock',\n rename: 'Name',\n add: 'Add',\n menu: 'Menu',\n comments: 'Comments',\n noComments: 'No comments yet.',\n openThread: 'Open',\n resolve: 'Resolve',\n reopen: 'Reopen',\n resolved: 'Resolved',\n replies: ({ count }) => (count === 1 ? '1 reply' : `${count} replies`),\n writeComment: 'Write a comment',\n post: 'Post',\n search: 'Search',\n noMatches: 'Nothing matches.',\n versions: 'Versions',\n noVersions: 'No versions yet.',\n restore: 'Restore',\n backToLatest: 'Back to the latest',\n selected: ({ count }) => `${count} selected`,\n run: 'Run',\n running: 'Running',\n keyboardShortcuts: 'Keyboard shortcuts',\n dockHeight: 'Dock height',\n closePanes: 'Close the panels',\n addName: 'Add a name',\n mixed: 'Mixed',\n noAttributes: 'No attributes.',\n attributeName: 'Attribute name',\n attributeValue: 'Value',\n addValue: 'Add a value',\n addAttribute: 'Add an attribute',\n removeAttribute: ({ key }) => `Remove ${key}`,\n locked: 'Locked',\n};\n/** The English defaults */\nexport const defaultMessages = Object.freeze({ ...english });\nlet current = { ...english };\nconst listeners = new Set();\nconst subscribe = createSubscriber((update) => {\n listeners.add(update);\n return () => listeners.delete(update);\n});\n/**\n * Replaces some or all of the strings. The keys that are not given keep their current value; with\n * `{ reset: true }` they return to the English defaults first.\n */\nexport function setMessages(partial, options = {}) {\n current = { ...(options.reset ? defaultMessages : current), ...partial };\n for (const notify of listeners)\n notify();\n}\n/** The strings in effect. Read inside a component or an effect, it tracks later changes. */\nexport function getMessages() {\n subscribe();\n return current;\n}\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Counter: a count on the solid surface, such as the number of unread items. Its height and its\n // least width are the square of an icon; with two digits it grows sideways only (pad-2xs at the\n // sides). The application rounds 100 and more to \"99+\". The text is a glyph, trimmed to its ink and\n // centred. A ring of two lines in the panel color separates it from an icon it sits on; alone,\n // the ring does not show.\n //\n // <Counter>3</Counter> <Counter>99+</Counter>\n let { children }: { children: Snippet } = $props();\n</script>\n\n<span data-role=\"mark\" data-h=\"icon\" class=\"counter\"><span class=\"t\">{@render children()}</span></span>\n\n<style>.counter {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n padding-inline: var(--kata-pad-2xs);\n background: var(--kata-color-solid);\n font-size: var(--kata-text-size-glyph);\n line-height: var(--kata-text-leading-glyph);\n letter-spacing: var(--kata-text-tracking-glyph);\n font-weight: 600;\n color: var(--kata-color-on-solid);\n font-variant-numeric: tabular-nums;\n flex: none;\n box-shadow: 0 0 0 calc(var(--kata-border-width) * 2) var(--kata-color-panel);\n}\n\n.t {\n display: block;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}</style>\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"arrow-left\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m12 19-7-7 7-7\" }], [\"path\", { \"d\": \"M19 12H5\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/arrow-left\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"arrow-up-right\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M7 7h10v10\" }], [\"path\", { \"d\": \"M7 17 17 7\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/arrow-up-right\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"check\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M20 6 9 17l-5-5\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/check\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"chevron-down\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m6 9 6 6 6-6\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/chevron-down\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"chevron-left\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m15 18-6-6 6-6\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/chevron-left\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"chevron-right\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m9 18 6-6-6-6\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/chevron-right\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"circle-alert\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"line\", { \"x1\": \"12\", \"x2\": \"12\", \"y1\": \"8\", \"y2\": \"12\" }], [\"line\", { \"x1\": \"12\", \"x2\": \"12.01\", \"y1\": \"16\", \"y2\": \"16\" }]], \"aliases\": [\"alert-circle\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle-alert\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"circle-check\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"m16 9-5.5 5.5L8 12\" }]], \"aliases\": [\"check-circle-2\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle-check\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"copy\", \"size\": 24, \"node\": [[\"rect\", { \"width\": \"14\", \"height\": \"14\", \"x\": \"8\", \"y\": \"8\", \"rx\": \"2\", \"ry\": \"2\" }], [\"path\", { \"d\": \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/copy\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"corner-up-right\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m15 14 5-5-5-5\" }], [\"path\", { \"d\": \"M4 20v-7a4 4 0 0 1 4-4h12\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/corner-up-right\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"ellipsis\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"19\", \"cy\": \"12\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"5\", \"cy\": \"12\", \"r\": \"1\" }]], \"aliases\": [\"more-horizontal\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/ellipsis\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"eye\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" }], [\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"3\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/eye\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"eye-off\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" }], [\"path\", { \"d\": \"M14.084 14.158a3 3 0 0 1-4.242-4.242\" }], [\"path\", { \"d\": \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" }], [\"path\", { \"d\": \"m2 2 20 20\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/eye-off\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"funnel\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\" }]], \"aliases\": [\"filter\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/funnel\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"globe\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\" }], [\"path\", { \"d\": \"M2 12h20\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/globe\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"grip-vertical\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"9\", \"cy\": \"12\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"9\", \"cy\": \"5\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"9\", \"cy\": \"19\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"15\", \"cy\": \"12\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"15\", \"cy\": \"5\", \"r\": \"1\" }], [\"circle\", { \"cx\": \"15\", \"cy\": \"19\", \"r\": \"1\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/grip-vertical\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"image\", \"size\": 24, \"node\": [[\"rect\", { \"width\": \"18\", \"height\": \"18\", \"x\": \"3\", \"y\": \"3\", \"rx\": \"2\", \"ry\": \"2\" }], [\"circle\", { \"cx\": \"9\", \"cy\": \"9\", \"r\": \"2\" }], [\"path\", { \"d\": \"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/image\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"info\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }], [\"path\", { \"d\": \"M12 16v-4\" }], [\"path\", { \"d\": \"M12 8h.01\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/info\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"lock\", \"size\": 24, \"node\": [[\"rect\", { \"width\": \"18\", \"height\": \"11\", \"x\": \"3\", \"y\": \"11\", \"rx\": \"2\", \"ry\": \"2\" }], [\"path\", { \"d\": \"M7 11V7a5 5 0 0 1 10 0v4\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/lock\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"lock-open\", \"size\": 24, \"node\": [[\"rect\", { \"width\": \"18\", \"height\": \"11\", \"x\": \"3\", \"y\": \"11\", \"rx\": \"2\", \"ry\": \"2\" }], [\"path\", { \"d\": \"M7 11V7a5 5 0 0 1 9.9-1\" }]], \"aliases\": [\"unlock\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/lock-open\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"pencil\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" }], [\"path\", { \"d\": \"m15 5 4 4\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/pencil\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"pipette\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12\" }], [\"path\", { \"d\": \"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z\" }], [\"path\", { \"d\": \"m2 22 .414-.414\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/pipette\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"plus\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M5 12h14\" }], [\"path\", { \"d\": \"M12 5v14\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/plus\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"search\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m21 21-4.34-4.34\" }], [\"circle\", { \"cx\": \"11\", \"cy\": \"11\", \"r\": \"8\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/search\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"settings-2\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M14 17H5\" }], [\"path\", { \"d\": \"M19 7h-9\" }], [\"circle\", { \"cx\": \"17\", \"cy\": \"17\", \"r\": \"3\" }], [\"circle\", { \"cx\": \"7\", \"cy\": \"7\", \"r\": \"3\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/settings-2\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"share-2\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"18\", \"cy\": \"5\", \"r\": \"3\" }], [\"circle\", { \"cx\": \"6\", \"cy\": \"12\", \"r\": \"3\" }], [\"circle\", { \"cx\": \"18\", \"cy\": \"19\", \"r\": \"3\" }], [\"line\", { \"x1\": \"8.59\", \"x2\": \"15.42\", \"y1\": \"13.51\", \"y2\": \"17.49\" }], [\"line\", { \"x1\": \"15.41\", \"x2\": \"8.59\", \"y1\": \"6.51\", \"y2\": \"10.49\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/share-2\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"trash\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M10 11v6\" }], [\"path\", { \"d\": \"M14 11v6\" }], [\"path\", { \"d\": \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\" }], [\"path\", { \"d\": \"M3 6h18\" }], [\"path\", { \"d\": \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\" }]], \"aliases\": [\"trash-2\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/trash\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"triangle-alert\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" }], [\"path\", { \"d\": \"M12 9v4\" }], [\"path\", { \"d\": \"M12 17h.01\" }]], \"aliases\": [\"alert-triangle\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/triangle-alert\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"undo-2\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M9 14 4 9l5-5\" }], [\"path\", { \"d\": \"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/undo-2\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"ungroup\", \"size\": 24, \"node\": [[\"rect\", { \"x\": \"11\", \"y\": \"14\", \"width\": \"10\", \"height\": \"7\", \"rx\": \"2\" }], [\"rect\", { \"x\": \"3\", \"y\": \"3\", \"width\": \"10\", \"height\": \"7\", \"rx\": \"2\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/ungroup\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"x\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M18 6 6 18\" }], [\"path\", { \"d\": \"m6 6 12 12\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/x\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<script lang=\"ts\">\n // An arrow: a line with a dot at its tail and a filled triangle at its head (Lucide's\n // arrow-up-right reads as an external link).\n // A 24-unit grid like Lucide's; Icon passes the class that sizes it.\n let {\n size = 24,\n strokeWidth = 1.75,\n style,\n class: cls,\n }: { size?: number; strokeWidth?: number; style?: string; class?: string } = $props();\n</script>\n\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n {style}\n class={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width={strokeWidth}\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n>\n <line x1=\"4\" y1=\"20\" x2=\"16.5\" y2=\"7.5\" />\n <circle cx=\"4\" cy=\"20\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <polygon points=\"21 3 19.2 11.2 12.8 4.8\" fill=\"currentColor\" stroke=\"none\" />\n</svg>\n","<script lang=\"ts\">\n // A point: a small filled circle, as a drawing tool draws a point. It differs from the circle\n // tool (a hollow ring) by fill and size.\n // A 24-unit grid like Lucide's; Icon passes the class that sizes it.\n let {\n size = 24,\n strokeWidth = 1.75,\n style,\n class: cls,\n }: { size?: number; strokeWidth?: number; style?: string; class?: string } = $props();\n</script>\n\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n {style}\n class={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n>\n <circle cx=\"12\" cy=\"12\" r=\"5.5\" fill=\"currentColor\" />\n</svg>\n","<script lang=\"ts\">\n // An irregular polygon with its vertices shown as dots, so that it does not read as a square.\n // A 24-unit grid like Lucide's; Icon passes the class that sizes it.\n let {\n size = 24,\n strokeWidth = 1.75,\n style,\n class: cls,\n }: { size?: number; strokeWidth?: number; style?: string; class?: string } = $props();\n</script>\n\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n {style}\n class={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width={strokeWidth}\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n>\n <polygon points=\"11 3 21 9 17 21 6 20 3 9\" />\n <circle cx=\"11\" cy=\"3\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"21\" cy=\"9\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"17\" cy=\"21\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"6\" cy=\"20\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"3\" cy=\"9\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n</svg>\n","<script lang=\"ts\">\n // A polyline: straight segments between vertices, with the vertices shown as dots.\n // A 24-unit grid like Lucide's; Icon passes the class that sizes it.\n let {\n size = 24,\n strokeWidth = 1.75,\n style,\n class: cls,\n }: { size?: number; strokeWidth?: number; style?: string; class?: string } = $props();\n</script>\n\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n {style}\n class={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width={strokeWidth}\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n>\n <polyline points=\"3 17 8 11 14 14 21 6\" />\n <circle cx=\"3\" cy=\"17\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"8\" cy=\"11\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"14\" cy=\"14\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n <circle cx=\"21\" cy=\"6\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\" />\n</svg>\n","<script lang=\"ts\">\n // A sticky note: a square with a folded corner and two lines of writing.\n // A 24-unit grid like Lucide's; Icon passes the class that sizes it.\n let {\n size = 24,\n strokeWidth = 1.75,\n style,\n class: cls,\n }: { size?: number; strokeWidth?: number; style?: string; class?: string } = $props();\n</script>\n\n<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n {style}\n class={cls}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width={strokeWidth}\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n>\n <path d=\"M5 3h14a2 2 0 0 1 2 2v9l-7 7H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Z\" />\n <path d=\"M21 14h-5a2 2 0 0 0-2 2v5\" />\n <line x1=\"8\" y1=\"8.5\" x2=\"17\" y2=\"8.5\" />\n <line x1=\"8\" y1=\"12.5\" x2=\"13\" y2=\"12.5\" />\n</svg>\n","// The icons that the components draw on their own, by name. Each Lucide icon is imported on its own\n// so that a bundle keeps only the icons in use. The drawing glyphs (point, polyline, polygon, arrow,\n// sticky-note) are kata's own, drawn on the same grid, for the shapes Lucide does not have.\n//\n// Icon and the components that take an icon accept a name from this list or any icon component\n// (a Lucide icon, or a component that accepts `class`).\nimport ArrowLeft from '@lucide/svelte/icons/arrow-left';\nimport ArrowUpRight from '@lucide/svelte/icons/arrow-up-right';\nimport Check from '@lucide/svelte/icons/check';\nimport ChevronDown from '@lucide/svelte/icons/chevron-down';\nimport ChevronLeft from '@lucide/svelte/icons/chevron-left';\nimport ChevronRight from '@lucide/svelte/icons/chevron-right';\nimport CircleAlert from '@lucide/svelte/icons/circle-alert';\nimport CircleCheck from '@lucide/svelte/icons/circle-check';\nimport Copy from '@lucide/svelte/icons/copy';\nimport CornerUpRight from '@lucide/svelte/icons/corner-up-right';\nimport Ellipsis from '@lucide/svelte/icons/ellipsis';\nimport Eye from '@lucide/svelte/icons/eye';\nimport EyeOff from '@lucide/svelte/icons/eye-off';\nimport Funnel from '@lucide/svelte/icons/funnel';\nimport Globe from '@lucide/svelte/icons/globe';\nimport GripVertical from '@lucide/svelte/icons/grip-vertical';\nimport Image from '@lucide/svelte/icons/image';\nimport Info from '@lucide/svelte/icons/info';\nimport Lock from '@lucide/svelte/icons/lock';\nimport LockOpen from '@lucide/svelte/icons/lock-open';\nimport Pencil from '@lucide/svelte/icons/pencil';\nimport Pipette from '@lucide/svelte/icons/pipette';\nimport Plus from '@lucide/svelte/icons/plus';\nimport Search from '@lucide/svelte/icons/search';\nimport Settings2 from '@lucide/svelte/icons/settings-2';\nimport Share2 from '@lucide/svelte/icons/share-2';\nimport Trash2 from '@lucide/svelte/icons/trash-2';\nimport TriangleAlert from '@lucide/svelte/icons/triangle-alert';\nimport Undo2 from '@lucide/svelte/icons/undo-2';\nimport Ungroup from '@lucide/svelte/icons/ungroup';\nimport X from '@lucide/svelte/icons/x';\nimport Arrow from './glyphs/Arrow.svelte';\nimport Point from './glyphs/Point.svelte';\nimport Polygon from './glyphs/Polygon.svelte';\nimport Polyline from './glyphs/Polyline.svelte';\nimport StickyNote from './glyphs/StickyNote.svelte';\nexport const icons = {\n 'arrow-left': ArrowLeft,\n 'arrow-up-right': ArrowUpRight,\n check: Check,\n 'chevron-down': ChevronDown,\n 'chevron-left': ChevronLeft,\n 'chevron-right': ChevronRight,\n 'circle-alert': CircleAlert,\n 'circle-check': CircleCheck,\n copy: Copy,\n 'corner-up-right': CornerUpRight,\n ellipsis: Ellipsis,\n funnel: Funnel,\n globe: Globe,\n 'grip-vertical': GripVertical,\n image: Image,\n info: Info,\n pencil: Pencil,\n pipette: Pipette,\n plus: Plus,\n search: Search,\n 'settings-2': Settings2,\n 'share-2': Share2,\n 'trash-2': Trash2,\n 'triangle-alert': TriangleAlert,\n ungroup: Ungroup,\n x: X,\n eye: Eye,\n 'eye-off': EyeOff,\n lock: Lock,\n 'lock-open': LockOpen,\n 'undo-2': Undo2,\n point: Point,\n polyline: Polyline,\n polygon: Polygon,\n arrow: Arrow,\n 'sticky-note': StickyNote,\n};\n/** The component for a name or a component */\nexport function iconComponent(source) {\n return typeof source === 'string' ? icons[source] : source;\n}\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { type IconSource, iconComponent } from '../icons.js';\n\n // Icon: a line icon, a square of the root size, in the current text color. In a list item or a\n // line of text it is centred by the flex layout; its white space is never cancelled with a\n // negative margin. A button with an icon and no text is an icon button with an aria-label.\n //\n // <Icon name=\"image\" /> <Icon name={Search} tone=\"muted\" />\n let {\n name,\n tone,\n }: {\n /** A name from the icons list, or an icon component */\n name: IconSource;\n /** A hue (blue: in progress or done, yellow: warning, red: failure, green: success) or muted */\n tone?: 'blue' | 'yellow' | 'red' | 'green' | 'muted';\n } = $props();\n const Cmp = $derived(iconComponent(name));\n</script>\n\n<Cmp class={tone ? `kata-icon tone-${tone}` : 'kata-icon'} />\n\n<style>:global(svg.kata-icon) {\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n flex: none;\n stroke-width: 1.5;\n display: block;\n}\n\n:global(svg.kata-icon.tone-blue) {\n color: var(--kata-color-blue-ink);\n}\n\n:global(svg.kata-icon.tone-yellow) {\n color: var(--kata-color-yellow-ink);\n}\n\n:global(svg.kata-icon.tone-red) {\n color: var(--kata-color-red-ink);\n}\n\n:global(svg.kata-icon.tone-green) {\n color: var(--kata-color-green-ink);\n}\n\n:global(svg.kata-icon.tone-muted) {\n color: var(--kata-color-muted);\n}</style>\n","// The element that kata puts things into when they have to leave the component that shows them:\n// the tooltips (Tooltip, clampTip) and the hidden probes that measure a token.\n//\n// On a page that kata owns, it is the body. When kata is embedded in a page it does not own, the\n// tokens are scoped to a root element instead of :root, and that root declares itself with the\n// attribute data-kata-root: everything kata appends outside a component goes into the nearest such\n// root, where the tokens, the language and the theme apply.\n//\n// <div class=\"app-root\" data-kata-root lang=\"en\">…</div>\n/** The attribute that marks the root element of kata embedded in a page it does not own */\nexport const KATA_ROOT_ATTRIBUTE = 'data-kata-root';\n/**\n * The host of what kata appends outside a component on behalf of an element: the nearest ancestor\n * (or the element itself) with data-kata-root, else the body.\n */\nexport function hostOf(el) {\n return el?.closest(`[${KATA_ROOT_ATTRIBUTE}]`) ?? document.body;\n}\n","// Places a tooltip next to its anchor. The description tooltip and the full text of a clipped line\n// (clampTip) share this one rule.\n//\n// The tooltip goes above the anchor, centred, gap-sm away. When it does not fit above it goes below,\n// then to the right, then to the left; it never covers the anchor or the pointer. Below, the gap is\n// gap-lg, because the pointer's image hangs about one line below its hot spot.\n//\n// \"Fits\" means inside the nearest ancestor with data-tip-bounds, or inside the window. The distances\n// are read from the tokens at run time, so they follow the text size setting.\nimport { hostOf } from './host.js';\n/**\n * Where to insert the tooltip: the host of its anchor (hostOf: the nearest data-kata-root, else the\n * body). Inside an open modal dialog that is in the host it goes into the dialog: a dialog opened\n * with showModal() is drawn in the top layer, above everything in the body whatever its z-index.\n */\nexport function tipHost(anchorEl) {\n const host = hostOf(anchorEl);\n const dialog = anchorEl?.closest('dialog[open]');\n return dialog && host.contains(dialog) ? dialog : host;\n}\n/**\n * The rectangle a pointer can hit. A borderless icon button is hit in the square of a small button,\n * which is larger than the icon it shows, so its visible rectangle is grown to that square.\n */\nexport function hitRect(el, role) {\n const r = el.getBoundingClientRect();\n if (role !== 'icon-button')\n return r;\n const h = tokenPx('--kata-height-button-sm', el);\n const top = Math.min(r.top, r.top + r.height / 2 - h / 2);\n const left = Math.min(r.left, r.left + r.width / 2 - h / 2);\n return new DOMRect(left, top, Math.max(r.width, h), Math.max(r.height, h));\n}\n/** The rectangle of the nearest ancestor with data-tip-bounds, or undefined for the window */\nexport function tipBounds(anchorEl) {\n return anchorEl.closest('[data-tip-bounds]')?.getBoundingClientRect();\n}\n/**\n * The length of a token in px, measured with a hidden element, so that calc and rem resolve. The\n * probe goes into the host of the element it measures for, where the tokens are defined.\n */\nexport function tokenPx(name, context) {\n const probe = document.createElement('div');\n probe.style.cssText = `position:fixed;left:-9999px;top:0;width:0;visibility:hidden;height:var(${name})`;\n hostOf(context).appendChild(probe);\n const h = probe.getBoundingClientRect().height;\n probe.remove();\n return h;\n}\nconst clamp = (v, min, max) => Math.max(min, Math.min(v, max));\n/**\n * Places a tooltip (an element with position: fixed) outside its anchor and returns the side it\n * chose.\n */\nexport function placeTip(node, anchor, bounds) {\n const gap = tokenPx('--kata-gap-sm', node);\n const gapDown = tokenPx('--kata-gap-lg', node);\n // Fix the position before measuring; the width is bounded by max-width, so the height does not\n // depend on where it is measured\n node.style.position = 'fixed';\n node.style.left = '0px';\n node.style.top = '0px';\n const t = node.getBoundingClientRect();\n const bx = Math.max(0, bounds?.left ?? 0);\n const by = Math.max(0, bounds?.top ?? 0);\n const vw = Math.min(window.innerWidth, bounds?.right ?? Number.POSITIVE_INFINITY);\n const vh = Math.min(window.innerHeight, bounds?.bottom ?? Number.POSITIVE_INFINITY);\n const cx = anchor.left + anchor.width / 2 - t.width / 2;\n const cy = anchor.top + anchor.height / 2 - t.height / 2;\n const candidates = [\n {\n side: 'top',\n left: cx,\n top: anchor.top - t.height - gap,\n fits: anchor.top - t.height - gap >= by + gap,\n },\n {\n side: 'bottom',\n left: cx,\n top: anchor.bottom + gapDown,\n fits: anchor.bottom + gapDown + t.height <= vh - gap,\n },\n {\n side: 'right',\n left: anchor.right + gap,\n top: cy,\n fits: anchor.right + gap + t.width <= vw - gap,\n },\n {\n side: 'left',\n left: anchor.left - t.width - gap,\n top: cy,\n fits: anchor.left - t.width - gap >= bx + gap,\n },\n ];\n // Nothing fits only when the window is narrower than the tooltip: take the side with more room\n const fallback = anchor.top > vh - anchor.bottom ? candidates[0] : candidates[1];\n const pick = candidates.find((c) => c.fits) ?? fallback;\n node.style.left = `${clamp(pick.left, bx + gap, Math.max(bx + gap, vw - gap - t.width))}px`;\n node.style.top = `${clamp(pick.top, by + gap, Math.max(by + gap, vh - gap - t.height))}px`;\n return pick.side;\n}\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { type Snippet, untrack } from 'svelte';\n import type { Action } from 'svelte/action';\n import { hitRect, placeTip, tipBounds, tipHost } from '../lib/tipPlace.js';\n\n // Tooltip: a short word that explains the control it wraps, with an optional key hint. It is the\n // inverse of the page (the text color as the surface), in the caption role, as high as a small\n // button with pad-sm at the sides. The name belongs to the control inside (its aria-label), so\n // the tooltip is aria-hidden and is not read twice. The application passes the words; the component\n // has none of its own.\n //\n // It shows on hover after a short wait, so a pointer that only passes by does not show it, and\n // at once on keyboard focus. It hides at once: on leaving, on a press, on a scroll and on a\n // resize. It goes above its control, or below, right or left, whichever fits first, and never\n // covers the control. It is moved to the body (or to the open modal dialog it is in, or to the\n // nearest data-kata-root when kata is embedded in a page it does not own), so that no container\n // clips it or moves its reference.\n //\n // The wrapper only holds its content, so it shows the layout the content's role: box for a\n // control with a line, icon-button for a borderless icon button (whose area of the pointer is\n // larger than its icon). inline draws the tooltip beside its control, always shown, for\n // documentation.\n //\n // <Tooltip text=\"Share\" shortcut=\"⇧S\"><Button …>…</Button></Tooltip>\n let {\n text,\n shortcut,\n role = 'block',\n keep = false,\n inline = false,\n children,\n }: {\n /** The word; without it nothing shows */\n text?: string;\n /** A key hint, already written for the platform (⌘Z) */\n shortcut?: string;\n /** The role shown to the layout: box for a control, icon-button for an icon button */\n role?: 'block' | 'box' | 'icon-button';\n /** Copies data-keep to the wrapper, for a container that shows its content only on hover */\n keep?: boolean;\n /** Always shown beside its control, in the flow of the page, for documentation */\n inline?: boolean;\n children: Snippet;\n } = $props();\n\n // The wait before it shows on hover, in ms\n const DELAY = 400;\n\n // Read only in event handlers and actions, never in the template, so it is not state (as state,\n // clearing bind:this while the template tears down would be a write during rendering)\n // svelte-ignore non_reactive_update\n let wrap: HTMLElement | undefined;\n let anchor = $state<DOMRect | null>(null);\n let gone = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n function clearTimer() {\n if (timer === undefined) return;\n clearTimeout(timer);\n timer = undefined;\n }\n\n const hasText = $derived(!!text?.trim());\n function show() {\n clearTimer();\n if (gone || !wrap || !hasText) return;\n anchor = hitRect(wrap, role);\n }\n\n // Also called while the wrapper is being removed (its content leaves the page and fires\n // pointerleave or focusout), so the write is untracked\n function hide() {\n clearTimer();\n if (gone || anchor === null) return;\n untrack(() => {\n anchor = null;\n });\n }\n\n // Keyboard focus only (:focus-visible): a press also focuses, and the tooltip should not stay\n // after it\n const watch: Action<HTMLElement> = (node) => {\n const onEnter = () => {\n clearTimer();\n timer = setTimeout(show, DELAY);\n };\n const onFocusIn = (e: FocusEvent) => {\n if ((e.target as HTMLElement | null)?.matches?.(':focus-visible')) show();\n };\n node.addEventListener('pointerenter', onEnter);\n node.addEventListener('pointerleave', hide);\n node.addEventListener('pointerdown', hide);\n node.addEventListener('focusin', onFocusIn);\n node.addEventListener('focusout', hide);\n return {\n destroy() {\n gone = true;\n clearTimer();\n node.removeEventListener('pointerenter', onEnter);\n node.removeEventListener('pointerleave', hide);\n node.removeEventListener('pointerdown', hide);\n node.removeEventListener('focusin', onFocusIn);\n node.removeEventListener('focusout', hide);\n },\n };\n };\n\n // Moves the tooltip to its host and places it; a scroll or a resize hides it\n const tip: Action<HTMLElement, DOMRect> = (node, rect) => {\n tipHost(wrap).appendChild(node);\n placeTip(node, rect, wrap ? tipBounds(wrap) : undefined);\n const close = () => hide();\n document.addEventListener('scroll', close, true);\n window.addEventListener('resize', close);\n return {\n update(next: DOMRect) {\n placeTip(node, next, wrap ? tipBounds(wrap) : undefined);\n },\n destroy() {\n document.removeEventListener('scroll', close, true);\n window.removeEventListener('resize', close);\n node.remove();\n },\n };\n };\n</script>\n\n{#snippet face()}\n <span class=\"t\">{text}</span>{#if shortcut}<span class=\"kbd\"><span class=\"t\">{shortcut}</span></span>{/if}\n{/snippet}\n\n{#if inline}\n <span class=\"pair\">\n <span class=\"seat\" data-role={role}>{@render children()}</span>\n {#if hasText}<span class=\"tip inline\" data-h=\"button-sm\" aria-hidden=\"true\">{@render face()}</span>{/if}\n </span>\n{:else}\n <span class=\"seat\" data-role={role} data-keep={keep ? '' : undefined} bind:this={wrap} use:watch>\n {@render children()}\n {#if anchor && hasText}\n <span class=\"tip\" data-h=\"button-sm\" aria-hidden=\"true\" use:tip={anchor}>{@render face()}</span>\n {/if}\n </span>\n{/if}\n\n<style>.seat {\n display: inline-flex;\n align-items: center;\n min-width: 0;\n}\n\n.tip {\n position: fixed;\n z-index: var(--kata-z-menu);\n pointer-events: none;\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n width: max-content;\n flex: none;\n height: var(--kata-height-button-sm);\n padding: 0 var(--kata-pad-sm);\n background: var(--kata-color-text);\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n color: var(--kata-color-ground);\n white-space: nowrap;\n}\n\n.pair {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n max-width: 100%;\n}\n\n.tip.inline {\n position: static;\n}\n\n.t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.kbd {\n display: inline-flex;\n align-items: center;\n height: var(--kata-height-badge);\n padding: 0 var(--kata-pad-2xs);\n border: var(--kata-border-width) solid color-mix(in srgb, var(--kata-color-ground) 40%, transparent);\n color: inherit;\n font-family: var(--kata-font-mono);\n white-space: nowrap;\n}\n.kbd > .t {\n font-family: inherit;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import type { IconSource } from '../icons.js';\n import Counter from './Counter.svelte';\n import Icon from './Icon.svelte';\n import Tooltip from './Tooltip.svelte';\n\n // Button: a control that is pressed. Its height is the ink of its text, pad-md above and below\n // and a line on each side. Inside a list item, a toolbar or a bar of bulk actions the container\n // declares the small button (pad-sm above and below); the author never writes a size.\n //\n // variant: outline (the default), primary (one per screen), ghost (no line; the surface shows on\n // hover; for icon buttons only, since a text button without a line does not look pressable),\n // danger (a red line) and danger-fill (the primary action of a confirmation). An icon button has\n // no text: icon and an aria-label, and it is a square small button. block is for the primary\n // action of a one-column form. The area that is pressed, the hover surface, the line and the\n // focus ring are all this control's own.\n //\n // <Button variant=\"primary\" onclick={save}>Save</Button>\n // <Button leading=\"plus\">New document</Button> an icon before the text\n // <Button trailing=\"chevron-down\">Sort</Button> the trigger of a menu\n // <Button icon aria-label=\"Close\"><Icon name=\"x\" /></Button>\n // <Button kbd=\"⌘⏎\">Send</Button> a key hint after the text\n // <Button trailing=\"chevron-down\">{#snippet mark()}<Swatch color={c} />{/snippet}#FF0077</Button>\n // <Button icon badge={3} aria-label=\"Notifications\"><Icon name={Bell} /></Button>\n // <Button icon aria-label=\"Undo\" shortcut=\"⌘Z\"><Icon name={Undo} /></Button>\n // <Button tip=\"Export as a file\">Export</Button> a tooltip on a text button\n //\n // The children of a text button are text only; icons go in leading and trailing. An icon button\n // shows its aria-label in a Tooltip, with shortcut as the key hint inside it; tip gives a text\n // button a tooltip, or turns the tooltip of an icon button off (false).\n let {\n variant = 'outline',\n icon = false,\n block = false,\n busy = false,\n disabled = false,\n on = false,\n tone,\n leading,\n trailing,\n kbd,\n mark,\n clamp = false,\n mono = false,\n type = 'button',\n href,\n target,\n onclick,\n shortcut,\n tip,\n badge,\n 'aria-label': ariaLabel,\n children,\n ...rest\n }: Omit<HTMLAttributes<HTMLElement>, 'class' | 'style' | 'onclick'> & {\n variant?: 'outline' | 'primary' | 'ghost' | 'danger' | 'danger-fill';\n /** A square button with an icon and no text; it needs an aria-label */\n icon?: boolean;\n /** The full width of its container */\n block?: boolean;\n /** An action in progress: dimmed and not pressable */\n busy?: boolean;\n disabled?: boolean;\n /** Selected (a tool in a toolbar) */\n on?: boolean;\n /** A ghost button that removes something: its text turns red on hover */\n tone?: 'danger';\n /** An icon before the text */\n leading?: IconSource;\n /** An icon after the text (the chevron of a menu trigger) */\n trailing?: IconSource;\n /** A kbd hint after the text */\n kbd?: string;\n /** A mark of the value before the text (a color swatch), for the trigger of a value */\n mark?: Snippet;\n /** The trigger of a value: the text is one line with an ellipsis */\n clamp?: boolean;\n /** The text in the monospace font (a code, an identifier) */\n mono?: boolean;\n type?: 'button' | 'submit';\n /** Renders a link with the same look */\n href?: string;\n /** Opens the link in another tab; the component adds rel */\n target?: '_blank';\n /** The key hint inside the tooltip */\n shortcut?: string;\n /** The text of the tooltip (an icon button's aria-label by default); false shows none */\n tip?: string | false;\n /** A count over the top right of an icon button; 100 and more shows 99+ */\n badge?: number;\n 'aria-label'?: string;\n onclick?: (e: MouseEvent) => void;\n children: Snippet;\n } = $props();\n const badged = $derived(badge !== undefined && badge > 0);\n const tipText = $derived(tip === false ? undefined : (tip ?? (icon ? ariaLabel : undefined)));\n // A container that shows an icon button only on hover reads data-keep on the wrapper too\n const keep = $derived(rest['data-keep' as keyof typeof rest] !== undefined);\n // A full-width button with a trailing icon is a chooser: the text on the left, the icon at the\n // right end\n const spread = $derived(block && !!trailing);\n</script>\n\n{#snippet inner()}\n {#if icon}{@render children()}{:else}{#if leading}<Icon name={leading} />{:else if mark}{@render mark()}{/if}<span\n class=\"t\"\n class:clamp\n class:mono>{@render children()}</span\n >{#if kbd}<span class=\"kbd t\">{kbd}</span>{/if}{#if trailing}<Icon name={trailing} />{/if}{/if}\n{/snippet}\n\n{#snippet unread()}\n {#if badged}<span class=\"unread\" aria-hidden=\"true\"\n ><Counter>{(badge ?? 0) > 99 ? '99+' : badge}</Counter></span\n >{/if}\n{/snippet}\n\n{#snippet control()}\n {#if href}\n <a\n class=\"btn {variant}\"\n class:icon\n class:block\n class:spread\n class:busy\n class:on\n class:badged\n data-tone={tone}\n data-role=\"box\"\n data-h={icon ? 'icon-button' : 'button'}\n {href}\n {onclick}\n aria-label={ariaLabel}\n {target}\n rel={target ? 'noopener' : undefined}\n {...rest}\n >\n {@render inner()}{@render unread()}\n </a>\n {:else}\n <button\n class=\"btn {variant}\"\n class:icon\n class:block\n class:spread\n class:busy\n class:on\n class:badged\n data-tone={tone}\n data-role=\"box\"\n data-h={icon ? 'icon-button' : 'button'}\n {type}\n disabled={disabled || busy}\n {onclick}\n aria-label={ariaLabel}\n {...rest}\n >\n {@render inner()}{@render unread()}\n </button>\n {/if}\n{/snippet}\n\n{#if tipText}\n <Tooltip text={tipText} {shortcut} role=\"box\" {keep}>{@render control()}</Tooltip>\n{:else}\n {@render control()}\n{/if}\n\n<style>.btn {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding-block: 0;\n padding-inline: var(--kata-pad-md);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n background: transparent;\n color: var(--kata-color-text);\n white-space: nowrap;\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;\n position: relative;\n color: var(--kata-color-text);\n cursor: pointer;\n text-decoration: none;\n flex: 0 1 auto;\n max-width: 100%;\n}\n.btn:hover {\n background: var(--kata-color-raise);\n text-decoration: none;\n}\n.btn:active {\n background: var(--kata-color-raise-2);\n transition: none;\n}\n.btn:disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.btn > :global(svg) {\n flex: none;\n}\n.btn .t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n.btn .t.mono {\n font-family: var(--kata-font-mono);\n}\n.btn .kbd {\n font-family: var(--kata-font-mono);\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n color: var(--kata-color-muted);\n flex: none;\n}\n\n.unread {\n position: absolute;\n left: calc(50% + var(--kata-pad-2xs));\n bottom: calc(50% + var(--kata-pad-2xs));\n pointer-events: none;\n line-height: 0;\n}\n\n.primary {\n background: var(--kata-color-solid);\n border-color: var(--kata-color-solid);\n color: var(--kata-color-on-solid);\n}\n.primary:hover {\n background: var(--kata-color-solid-hover);\n border-color: var(--kata-color-solid-hover);\n}\n.primary:active {\n background: var(--kata-color-solid-active);\n border-color: var(--kata-color-solid-active);\n}\n\n.btn.primary .kbd {\n color: var(--kata-color-on-solid);\n}\n\n.ghost {\n border-color: transparent;\n background: transparent;\n}\n\n.danger {\n color: var(--kata-color-red-ink);\n border-color: var(--kata-color-red-ink);\n}\n.danger:hover {\n background: var(--kata-color-red-wash);\n}\n\n.danger-fill {\n background: var(--kata-color-red-fill);\n border-color: var(--kata-color-red-fill);\n color: var(--kata-color-on-red);\n}\n.danger-fill:hover {\n background: var(--kata-color-red-fill-hover);\n border-color: var(--kata-color-red-fill-hover);\n}\n.danger-fill:active {\n background: var(--kata-color-red-fill-active);\n border-color: var(--kata-color-red-fill-active);\n}\n\n.icon {\n width: var(--kata-height-icon-button);\n height: var(--kata-height-icon-button);\n padding: 0;\n justify-content: center;\n}\n\n.block {\n width: 100%;\n justify-content: center;\n}\n\n.spread {\n justify-content: space-between;\n}\n.spread .t {\n flex: 1 1 auto;\n text-align: start;\n}\n\n.busy {\n opacity: var(--kata-opacity-dim);\n cursor: progress;\n}\n\n.on {\n background: var(--kata-color-raise-2);\n}\n\n.on.icon > :global(svg) {\n color: var(--kata-color-blue-ink);\n}\n\n.ghost[data-tone=danger]:hover:not(:disabled) {\n color: var(--kata-color-red-ink);\n}\n\n.btn[aria-expanded=true][aria-haspopup] {\n background: var(--kata-color-raise);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { tick, untrack } from 'svelte';\n\n // Dropdown: a place that opens below a trigger, for a menu or a small picker. It is a popover, so\n // it shows in the top layer, above everything, also when it opens from inside a modal or a panel.\n //\n // With menu, the content is a list of MenuItem: the place wears the surface of a Menu, has\n // role=\"menu\", focuses the first item when it opens, and the arrow keys, Home and End move the\n // focus between the items. With bare, the content brings its own container (a picker, a list).\n //\n // It is placed from the trigger's rectangle: below it, or above when there is no room below, and\n // pushed inside the window at the sides. A press outside, Escape or Tab closes it; Escape and Tab\n // return the focus to the trigger of a menu.\n //\n // <Dropdown menu>\n // {#snippet trigger(toggle, open)}\n // <Button trailing=\"chevron-down\" aria-haspopup=\"menu\" aria-expanded={open} onclick={toggle}>\n // Sort\n // </Button>\n // {/snippet}\n // {#snippet panel(close)}<MenuItem onclick={close}>Name</MenuItem>{/snippet}\n // </Dropdown>\n let {\n trigger,\n panel,\n align = 'end',\n openInitially = false,\n menuMaxWidth,\n menu = false,\n bare = false,\n block = false,\n role = 'anchor',\n onOpenChange,\n }: {\n /** The trigger; it receives the toggle function and whether the place is open */\n trigger: Snippet<[() => void, boolean]>;\n /** The content; it receives the close function */\n panel: Snippet<[() => void]>;\n /** The edge of the trigger the place lines up with (it moves back inside the window) */\n align?: 'start' | 'end';\n /** Open from the start */\n openInitially?: boolean;\n /** The widest the place gets (a CSS length); long names end with an ellipsis */\n menuMaxWidth?: string;\n /** The content is a list of MenuItem */\n menu?: boolean;\n /** The content has its own container; the place has no surface */\n bare?: boolean;\n /** The trigger is as wide as its container (a list item) */\n block?: boolean;\n /** The role the trigger's wrapper shows to the layout: box for a control, icon-button for an icon button */\n role?: 'anchor' | 'box' | 'icon-button';\n /** Called whenever the place opens or closes, also by a press outside or Escape */\n onOpenChange?: (open: boolean) => void;\n } = $props();\n\n let open = $state(untrack(() => openInitially));\n\n $effect(() => {\n onOpenChange?.(open);\n });\n\n let anchor = $state<HTMLElement>();\n let panelEl = $state<HTMLElement>();\n let placed = $state(false);\n let pos = $state({ top: 0, left: 0, maxHeight: 0 });\n // Focus the first item once the place shows (menus only)\n let focusFirst = false;\n // Where the focus returns when Escape or Tab closes a menu\n let returnFocusEl: HTMLElement | null = null;\n\n // The distance from the trigger, the least distance from the window's edge, and the least height\n // below which the place opens on the other side\n const GAP = 4;\n const EDGE = 8;\n const MIN_HEIGHT = 120;\n\n function place() {\n if (!anchor || !panelEl) return;\n const r = anchor.getBoundingClientRect();\n const vw = window.innerWidth;\n const vh = window.innerHeight;\n const width = panelEl.offsetWidth;\n // The natural height is measured without the limit, or the direction would change each time\n const keep = panelEl.style.maxHeight;\n panelEl.style.maxHeight = '';\n const natural = panelEl.scrollHeight;\n panelEl.style.maxHeight = keep;\n const below = vh - r.bottom - GAP - EDGE;\n const above = r.top - GAP - EDGE;\n const up = below < Math.min(natural, MIN_HEIGHT) && above > below;\n const maxHeight = Math.max(MIN_HEIGHT, up ? above : below);\n const shown = Math.min(natural, maxHeight);\n const top = up ? r.top - GAP - shown : r.bottom + GAP;\n let left = align === 'end' ? r.right - width : r.left;\n left = Math.max(EDGE, Math.min(left, vw - width - EDGE));\n pos = { top: Math.round(top), left: Math.round(left), maxHeight: Math.round(maxHeight) };\n }\n\n function toggle() {\n open = !open;\n if (open) {\n returnFocusEl = menu ? (document.activeElement as HTMLElement | null) : null;\n focusFirst = menu;\n placed = false;\n }\n }\n\n function close() {\n open = false;\n }\n\n // Without the popover API (a test environment) the place is a plain fixed element; the attribute\n // is left out, since [popover] without showPopover() is never shown\n const canPopover =\n typeof HTMLElement !== 'undefined' && typeof HTMLElement.prototype.showPopover === 'function';\n\n function isShown(el: HTMLElement): boolean {\n try {\n return el.matches(':popover-open');\n } catch {\n return false;\n }\n }\n\n // The place is measured once it is open (until then it has no size), and the focus moves once it\n // is visible\n $effect(() => {\n if (!open || !panelEl) return;\n const el = panelEl;\n if (canPopover && !isShown(el)) {\n try {\n el.showPopover();\n } catch {\n // Already open\n }\n }\n void (async () => {\n await tick();\n place();\n placed = true;\n if (!focusFirst) return;\n focusFirst = false;\n await tick();\n focusItemAt(0);\n })();\n });\n\n function menuItems(): HTMLElement[] {\n if (!panelEl) return [];\n return [...panelEl.querySelectorAll<HTMLElement>('[role=\"menuitem\"]')];\n }\n function focusItemAt(index: number) {\n const items = menuItems();\n if (items.length === 0) return;\n items[((index % items.length) + items.length) % items.length]?.focus();\n }\n function closeAndReturnFocus() {\n open = false;\n returnFocusEl?.focus?.();\n }\n\n function onMenuKeyDown(e: KeyboardEvent) {\n if (!menu) return;\n const items = menuItems();\n if (items.length === 0) return;\n const at = items.indexOf(document.activeElement as HTMLElement);\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n focusItemAt(at < 0 ? 0 : at + 1);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n focusItemAt(at < 0 ? items.length - 1 : at - 1);\n } else if (e.key === 'Home') {\n e.preventDefault();\n focusItemAt(0);\n } else if (e.key === 'End') {\n e.preventDefault();\n focusItemAt(items.length - 1);\n } else if (e.key === 'Tab') {\n closeAndReturnFocus();\n }\n }\n\n // A press outside the trigger and the place closes it; read in the capture phase, so that a\n // container that stops propagation does not keep it open\n function onPointerDown(e: PointerEvent) {\n if (!open) return;\n const target = e.target as Node;\n if (anchor?.contains(target) || panelEl?.contains(target)) return;\n open = false;\n }\n\n // Escape closes the place while it is open and goes no further (a modal around it stays open)\n function onKeyDown(e: KeyboardEvent) {\n if (e.key !== 'Escape' || !open) return;\n e.stopPropagation();\n if (menu) closeAndReturnFocus();\n else open = false;\n }\n</script>\n\n<svelte:window\n onkeydowncapture={onKeyDown}\n onpointerdowncapture={onPointerDown}\n onresize={() => open && place()}\n onscroll={() => open && place()}\n/>\n\n<span class=\"anchor\" class:block bind:this={anchor} data-role={role}>\n {@render trigger(toggle, open)}\n</span>\n{#if open}\n <div\n class=\"seat\"\n class:menu={!bare}\n class:placed\n popover={canPopover ? 'manual' : undefined}\n bind:this={panelEl}\n role={menu ? 'menu' : undefined}\n aria-orientation={menu ? 'vertical' : undefined}\n onkeydown={menu ? onMenuKeyDown : undefined}\n style:top={`${pos.top}px`}\n style:left={`${pos.left}px`}\n style:max-height={`${pos.maxHeight}px`}\n style:max-width={menuMaxWidth}\n >\n {@render panel(close)}\n </div>\n{/if}\n\n<style>.anchor {\n display: inline-flex;\n max-width: 100%;\n min-width: 0;\n}\n\n.anchor:not(.block) {\n flex: none;\n}\n\n.anchor.block {\n display: flex;\n width: 100%;\n}\n.anchor.block > :global(*) {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.seat {\n position: fixed;\n inset: auto;\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n overflow: auto;\n visibility: hidden;\n}\n.seat:popover-open {\n display: flex;\n flex-direction: column;\n}\n\n.seat.placed {\n visibility: visible;\n}\n\n.menu {\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n min-width: min(12rem, 100vw - var(--kata-gap-md) * 2);\n max-width: calc(100vw - var(--kata-gap-md) * 2);\n}</style>\n","/** Whether an entry of a menu is an item */\nexport function isMenuItem(entry) {\n return 'id' in entry;\n}\n","// The widths of the layout, measured in script. The CSS side measures the size container `app`\n// against 24, 48 and 64rem: the Shell's root inside a Shell, else the body (base.css). This\n// measures the same thing in the same way, in rem, so that a larger text size makes the same width\n// count as narrower: inside a Shell the Shell's element, elsewhere the window.\nimport { getContext, setContext } from 'svelte';\n/** The widths the CSS measures against, in rem: tiny, narrow and mid */\nexport const WIDTHS = { tiny: 24, narrow: 48, mid: 64 };\nfunction rootFontSize() {\n const px = Number.parseFloat(getComputedStyle(document.documentElement).fontSize);\n return Number.isFinite(px) && px > 0 ? px : 16;\n}\n/**\n * The width in px that the layouts measure: the element's, or the window's when there is no\n * element or the element has no box yet (not in the page, or hidden).\n */\nfunction widthOf(el) {\n const w = el?.getBoundingClientRect().width ?? 0;\n return w > 0 ? w : window.innerWidth;\n}\n/**\n * Whether the window, or an element when one is given, is narrower than a width in rem. Without a\n * window (on a server) it is not.\n */\nexport function isNarrowerThan(remLimit, el) {\n if (typeof window === 'undefined')\n return false;\n return widthOf(el) / rootFontSize() < remLimit;\n}\n// ---- The container of the application ----\n// A Shell is the size container `app` of everything inside it. It hands its element down through\n// a context, so that a component inside it measures the Shell, as its container queries do.\nconst APP = Symbol('kata-app');\n/** Called by the Shell: the components inside measure this element instead of the window */\nexport function setAppContainer(container) {\n setContext(APP, container);\n}\nfunction appContainer() {\n try {\n return getContext(APP);\n }\n catch {\n // Called outside the initialisation of a component: there is no Shell around it\n return undefined;\n }\n}\n// One ResizeObserver for every element that is measured, however many flags watch it\nlet observer;\nconst watchers = new Map();\nfunction watchSize(el, run) {\n observer ??= new ResizeObserver((entries) => {\n for (const entry of entries)\n for (const fn of watchers.get(entry.target) ?? [])\n fn();\n });\n let set = watchers.get(el);\n if (!set) {\n set = new Set();\n watchers.set(el, set);\n observer.observe(el);\n }\n set.add(run);\n return () => {\n set.delete(run);\n if (set.size > 0)\n return;\n watchers.delete(el);\n observer?.unobserve(el);\n };\n}\n/**\n * A reactive flag: whether the window is narrower than a width in rem. Call start() in an $effect\n * and return what it returns. It measures again when the window is resized and when the text size\n * setting (data-font-scale on the root element) changes.\n *\n * Inside a Shell it measures the Shell's element instead, as the container queries do. start(el)\n * measures the element it is given. An element is followed with a ResizeObserver; where there is\n * none, the window is measured.\n */\nexport function createNarrow(remLimit) {\n let narrow = $state(false);\n const app = appContainer();\n return {\n get current() {\n return narrow;\n },\n start(el) {\n if (typeof window === 'undefined')\n return () => { };\n // Read in the effect that calls start(), so that it starts again once the Shell has its element\n const own = el instanceof Element ? el : undefined;\n const target = typeof ResizeObserver === 'undefined' ? undefined : (own ?? app?.el ?? undefined);\n const measure = () => {\n narrow = isNarrowerThan(remLimit, target);\n };\n measure();\n const unwatch = target ? watchSize(target, measure) : undefined;\n window.addEventListener('resize', measure);\n const mo = new MutationObserver(measure);\n mo.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['data-font-scale'],\n });\n return () => {\n unwatch?.();\n window.removeEventListener('resize', measure);\n mo.disconnect();\n };\n },\n };\n}\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Menu: the surface of a menu: the panel color, a strong line and a least width of 12rem, never\n // wider than the window. It has no padding, so the hover surface of each MenuItem reaches the\n // edges and the dividers. Dropdown with menu wears this surface itself; Menu is for a menu placed\n // by the application, such as a submenu that opens to the right. The roles and the keys belong to the\n // content.\n //\n // An item is as high as its content plus pad-md above and below. rows raises the least height of\n // every item, for a menu whose items hold different content and should line up.\n //\n // <Menu><div role=\"menu\">…MenuItem…</div></Menu>\n let {\n rows,\n children,\n }: {\n /** The least height of the items: mark, box, thumb or two lines */\n rows?: 'mark' | 'box' | 'thumb' | 'two';\n children: Snippet;\n } = $props();\n</script>\n\n<div class=\"menu\" data-role=\"menu\" data-rows={rows}>{@render children()}</div>\n\n<style>.menu {\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n min-width: min(12rem, 100vw - var(--kata-gap-md) * 2);\n max-width: calc(100vw - var(--kata-gap-md) * 2);\n display: flex;\n flex-direction: column;\n}\n.menu[data-rows=mark] {\n --kata-list-item-height: var(--kata-height-list-item-mark);\n}\n.menu[data-rows=box] {\n --kata-list-item-height: var(--kata-height-list-item-lg);\n}\n.menu[data-rows=thumb] {\n --kata-list-item-height: var(--kata-height-thumbnail-row);\n}\n.menu[data-rows=two] {\n --kata-list-item-height: var(--kata-height-list-item-two);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // MenuDivider: the line between groups of items in a menu. It has no space above or below, so the\n // hover surface of the items meets the line; the padding of the items is the distance. A\n // destructive item goes after it.\n //\n // <MenuDivider />\n</script>\n\n<div class=\"sep\" data-role=\"rule\" role=\"separator\"></div>\n\n<style>.sep {\n height: var(--kata-border-width);\n background: var(--kata-color-line);\n flex: none;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // MenuHead: the name of a group of items in a menu. It is an item that cannot be pressed: as high\n // as a MenuItem, pad-md at the sides, the name in the label role, trimmed to its ink and centred,\n // so it keeps the same distance to a divider or an edge as an item. What is not a name (a name\n // and an address, a list of people) goes in a Block.\n //\n // <MenuHead>Text size</MenuHead>\n let { children }: { children: Snippet } = $props();\n</script>\n\n<div class=\"head\" data-role=\"list-item\" data-h=\"list-item\">\n <span class=\"label\">{@render children()}</span>\n</div>\n\n<style>.head {\n display: flex;\n align-items: center;\n min-height: var(--kata-height-list-item);\n padding-inline: var(--kata-pad-md);\n min-width: 0;\n flex: none;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n --kata-box: var(--kata-height-button-sm);\n}\n\n.label {\n flex: 1;\n min-width: 0;\n font-size: var(--kata-text-size-label);\n line-height: var(--kata-text-leading-label);\n letter-spacing: var(--kata-text-tracking-label);\n font-weight: 600;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import type { IconSource } from '../icons.js';\n import Icon from './Icon.svelte';\n\n // MenuItem: one item of a menu. It is as high as a list item, with pad-md at the sides and gap-sm\n // between its columns: an icon or a check mark on the left, the name in the rest, and a key hint\n // (plain monospace) or a chevron for a submenu at the right end. danger turns the text red; a\n // destructive item goes last, after a MenuDivider.\n //\n // It is a <button> (an <a> with href), always with role=\"menuitem\" and tabindex=\"-1\": the menu\n // moves the focus with the arrow keys. Other attributes (data-*, aria-*, onmouseenter) go to the\n // element. An item grows with its content: a Stack with a second line of description makes it\n // two lines high.\n //\n // <MenuItem icon=\"copy\" kbd=\"⌘D\" onclick={duplicate}>Duplicate</MenuItem>\n // <MenuItem checked={sort === 'name'} onclick={() => (sort = 'name')}>Name</MenuItem>\n // <MenuItem sub on={openSub === i} onmouseenter={open}>Arrange</MenuItem>\n let {\n icon,\n kbd,\n danger = false,\n disabled = false,\n checked,\n sub = false,\n on = false,\n href,\n onclick,\n children,\n ...rest\n }: Omit<HTMLAttributes<HTMLElement>, 'class' | 'style' | 'onclick'> & {\n /** An icon on the left (a name or a component) */\n icon?: IconSource;\n /** A key hint at the right end (⌘Z) */\n kbd?: string;\n /** A destructive action: red text */\n danger?: boolean;\n /** Shown but not chosen: dimmed, with no hover */\n disabled?: boolean;\n /** The column of check marks on the left; without it the column is not drawn */\n checked?: boolean;\n /** The item opens a submenu: a chevron at the right end */\n sub?: boolean;\n /** The submenu of this item is open: it keeps the hover surface */\n on?: boolean;\n /** Renders a link */\n href?: string;\n onclick?: (e: MouseEvent) => void;\n children: Snippet;\n } = $props();\n\n function fire(e: MouseEvent) {\n e.stopPropagation();\n if (disabled) return;\n onclick?.(e);\n }\n</script>\n\n{#snippet inner()}\n {#if icon}\n <Icon name={icon} />\n {:else if checked !== undefined}\n <span class=\"chk\">{#if checked}<Icon name=\"check\" />{/if}</span>\n {/if}\n <span class=\"grow t\">{@render children()}</span>\n {#if kbd}<span class=\"kbd t\">{kbd}</span>{/if}\n {#if sub}<span class=\"sub\"><Icon name=\"chevron-right\" /></span>{/if}\n{/snippet}\n\n{#if href && !disabled}\n <a\n class=\"item\"\n class:danger\n class:on\n data-role=\"list-item\"\n data-h=\"list-item\"\n {href}\n role=\"menuitem\"\n tabindex=\"-1\"\n onclick={fire}\n {...rest}\n >\n {@render inner()}\n </a>\n{:else}\n <button\n type=\"button\"\n class=\"item\"\n class:danger\n class:disabled\n class:on\n data-role=\"list-item\"\n data-h=\"list-item\"\n role=\"menuitem\"\n tabindex=\"-1\"\n aria-disabled={disabled ? 'true' : undefined}\n onclick={fire}\n {...rest}\n >\n {@render inner()}\n </button>\n{/if}\n\n<style>.item {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n width: 100%;\n min-height: var(--kata-list-item-height, var(--kata-height-list-item));\n padding-inline: var(--kata-pad-md);\n border: 0;\n background: none;\n color: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n text-align: start;\n text-decoration: none;\n cursor: pointer;\n flex: none;\n}\n.item:hover {\n background: var(--kata-color-raise);\n text-decoration: none;\n}\n.item:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}\n.item > :global(svg) {\n flex: none;\n}\n.item :global([data-role='mark'][data-h]:not([data-h='icon'])),\n.item :global([data-role='mark'][data-kata-tall]),\n.item :global([data-role='box'][data-h]:not(.ghost)),\n.item :global(input:not([type='checkbox']):not([type='radio'])),\n.item :global(select),\n.item :global(textarea) {\n margin-block: var(--kata-text-size-body);\n}\n.item :global([data-role='stack']) {\n padding-block: var(--kata-text-size-body);\n}\n.item :global([data-role='stack'] [data-role='stack']) {\n padding-block: 0;\n}\n.item :global([data-role='stack'] [data-role='mark'][data-h]:not([data-h='icon'])),\n.item :global([data-role='stack'] [data-role='mark'][data-kata-tall]),\n.item :global([data-role='stack'] [data-role='box'][data-h]:not(.ghost)),\n.item :global([data-role='stack'] input:not([type='checkbox']):not([type='radio'])),\n.item :global([data-role='stack'] select),\n.item :global([data-role='stack'] textarea),\n.item :global([data-role='box'] input:not([type='checkbox']):not([type='radio'])),\n.item :global([data-role='box'] select),\n.item :global([data-role='box'] textarea) {\n margin-block: 0;\n}\n\n.t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.on {\n background: var(--kata-color-raise);\n}\n\n.danger {\n color: var(--kata-color-red-ink);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.disabled:hover {\n background: transparent;\n}\n\n.grow {\n flex: 1;\n min-width: 0;\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.chk {\n display: flex;\n width: var(--kata-height-icon);\n flex: none;\n}\n\n.kbd,\n.sub {\n margin-left: auto;\n color: var(--kata-color-muted);\n flex: none;\n}\n\n.kbd {\n font-family: var(--kata-font-mono);\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n white-space: nowrap;\n}\n\n.sub {\n display: flex;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { tick } from 'svelte';\n import { isMenuItem, type MenuModel, type MenuModelItem } from '../lib/menuModel.js';\n import { createNarrow, WIDTHS } from '../lib/viewport.svelte.js';\n import Menu from './Menu.svelte';\n import MenuDivider from './MenuDivider.svelte';\n import MenuHead from './MenuHead.svelte';\n import MenuItem from './MenuItem.svelte';\n import MenuList from './MenuList.svelte';\n\n // MenuList: the items of a menu drawn from its model (MenuModel[]): MenuItem for an item,\n // MenuDivider for a divider and MenuHead for a heading. It goes in a Dropdown with menu, or in a\n // Menu inside an element with role=\"menu\"; AppMenu, MenuSheet, Kebab, Topbar and LayerTree use it.\n //\n // An item with items opens a submenu: on hover or a press, next to its row, in a Menu of its own\n // that moves back inside the window. On a narrow screen, and with inline, the submenu takes the\n // place of the list instead, under a row that goes back. When one item of a level has checked, the\n // items of that level keep the column of check marks.\n //\n // Keys: the up and down arrows, Home and End move between the items of the level shown (and wrap),\n // the right arrow opens a submenu and moves into it, the left arrow goes back to its parent row.\n //\n // <Dropdown menu>\n // {#snippet trigger(toggle, open)}…{/snippet}\n // {#snippet panel(close)}<MenuList items={menu} onselect={run} onclose={close} />{/snippet}\n // </Dropdown>\n let {\n items,\n onselect,\n onclose,\n inline = false,\n level = 'root',\n backLabel,\n onexit,\n }: {\n /** The model of the menu */\n items: MenuModel[];\n /** Called with the id of the item that was chosen (not for a link) */\n onselect?: (id: string) => void;\n /** Called after an item was chosen, to close the menu */\n onclose?: () => void;\n /** Submenus take the place of the list at every width (a sheet) */\n inline?: boolean;\n /** Used by the submenus: the root, a submenu next to its row, or one in place */\n level?: 'root' | 'floating' | 'in-place';\n /** Used by the submenus in place: the name of the row that goes back */\n backLabel?: string;\n /** Used by the submenus: goes back to the parent row */\n onexit?: () => void;\n } = $props();\n\n const narrow = createNarrow(WIDTHS.narrow);\n $effect(narrow.start);\n const inPlace = $derived(inline || narrow.current);\n\n // The items of this level keep the column of check marks when one of them has a mark\n const hasCheck = $derived(items.some((e) => isMenuItem(e) && e.checked !== undefined));\n\n // The submenu open next to its row, and the one open in place of the list\n let openSub = $state<number | null>(null);\n let inPlaceSub = $state<number | null>(null);\n let subPos = $state({ top: 0, left: 0 });\n let listEl = $state<HTMLElement>();\n let subEl = $state<HTMLElement>();\n\n // The least distance from the window's edge, as a Dropdown keeps\n const EDGE = 8;\n\n // Next to the row, on its right; on its left when there is no room; inside the window below\n function place(row: HTMLElement) {\n const r = row.getBoundingClientRect();\n subPos = { top: r.top, left: r.right };\n void tick().then(() => {\n if (!subEl) return;\n const w = subEl.offsetWidth;\n const h = subEl.offsetHeight;\n let left = r.right;\n if (left + w > window.innerWidth - EDGE) left = Math.max(EDGE, r.left - w);\n let top = r.top;\n if (top + h > window.innerHeight - EDGE) top = Math.max(EDGE, window.innerHeight - EDGE - h);\n subPos = { top, left };\n });\n }\n\n function openAt(index: number, row: HTMLElement, focus = false) {\n if (inPlace) inPlaceSub = index;\n else {\n openSub = index;\n place(row);\n }\n if (!focus) return;\n void tick().then(() => {\n const box = inPlace ? listEl : subEl;\n box?.querySelector<HTMLElement>('[role=\"menuitem\"]')?.focus();\n });\n }\n\n function toggleAt(index: number, row: HTMLElement) {\n if (inPlace) inPlaceSub = inPlaceSub === index ? null : index;\n else if (openSub === index) openSub = null;\n else openAt(index, row);\n }\n\n // The rows of this level, in order\n function rows(): HTMLElement[] {\n if (!listEl) return [];\n return [...listEl.querySelectorAll<HTMLElement>(':scope > [role=\"menuitem\"]')];\n }\n\n // Closes the submenu and returns the focus to its row\n function exitSub() {\n const index = openSub ?? inPlaceSub;\n openSub = null;\n inPlaceSub = null;\n if (index !== null) focusRow(index);\n }\n\n function focusRow(index: number) {\n void tick().then(() => {\n rows()\n .find((el) => el.getAttribute('data-index') === String(index))\n ?.focus();\n });\n }\n\n function onkeydown(e: KeyboardEvent) {\n const list = rows();\n const at = list.indexOf(e.target as HTMLElement);\n if (at === -1) return;\n const el = list[at];\n const go = (i: number) => {\n e.preventDefault();\n e.stopPropagation();\n list[((i % list.length) + list.length) % list.length]?.focus();\n };\n if (e.key === 'ArrowDown') go(at + 1);\n else if (e.key === 'ArrowUp') go(at - 1);\n else if (e.key === 'Home') go(0);\n else if (e.key === 'End') go(list.length - 1);\n else if (e.key === 'ArrowRight' && el.getAttribute('aria-haspopup') === 'menu') {\n e.preventDefault();\n e.stopPropagation();\n openAt(Number(el.getAttribute('data-index')), el, true);\n } else if (e.key === 'ArrowLeft' && onexit) {\n e.preventDefault();\n e.stopPropagation();\n onexit();\n }\n }\n\n function choose(item: MenuModelItem) {\n if (item.disabled) return;\n if (!item.href) onselect?.(item.id);\n onclose?.();\n }\n\n const floating = $derived(openSub === null ? null : items[openSub]);\n const replaced = $derived(inPlaceSub === null ? null : items[inPlaceSub]);\n</script>\n\n{#snippet entries()}\n {#if level === 'in-place' && onexit}\n <MenuItem icon=\"arrow-left\" onclick={() => onexit?.()}>{backLabel}</MenuItem>\n <MenuDivider />\n {/if}\n {#each items as entry, i (i)}\n {#if 'divider' in entry}\n <MenuDivider />\n {:else if 'heading' in entry}\n <MenuHead>{entry.heading}</MenuHead>\n {:else if entry.items}\n <MenuItem\n sub\n icon={entry.icon}\n disabled={entry.disabled}\n on={openSub === i}\n checked={hasCheck ? (entry.checked ?? false) : undefined}\n data-index={i}\n aria-haspopup=\"menu\"\n aria-expanded={openSub === i || inPlaceSub === i}\n onmouseenter={(e: MouseEvent) => {\n if (!inPlace && !entry.disabled) openAt(i, e.currentTarget as HTMLElement);\n }}\n onclick={(e: MouseEvent) => {\n if (!entry.disabled) toggleAt(i, e.currentTarget as HTMLElement);\n }}>{entry.label}</MenuItem\n >\n {:else}\n <MenuItem\n icon={entry.icon}\n kbd={entry.kbd}\n danger={entry.danger}\n disabled={entry.disabled}\n href={entry.href}\n checked={hasCheck ? (entry.checked ?? false) : undefined}\n data-index={i}\n onmouseenter={() => {\n if (!inPlace) openSub = null;\n }}\n onclick={() => choose(entry)}>{entry.label}</MenuItem\n >\n {/if}\n {/each}\n{/snippet}\n\n<div\n class=\"level\"\n role={level === 'floating' ? 'menu' : 'group'}\n aria-label={level === 'in-place' ? backLabel : undefined}\n bind:this={listEl}\n {onkeydown}\n>\n {#if replaced && !('divider' in replaced) && !('heading' in replaced)}\n <MenuList\n items={replaced.items ?? []}\n level=\"in-place\"\n backLabel={replaced.label}\n {onselect}\n {onclose}\n {inline}\n onexit={exitSub}\n />\n {:else}\n {@render entries()}\n {/if}\n</div>\n\n{#if floating && !('divider' in floating) && !('heading' in floating)}\n <div class=\"sub\" bind:this={subEl} style:top={`${subPos.top}px`} style:left={`${subPos.left}px`}>\n <Menu>\n <MenuList\n items={floating.items ?? []}\n level=\"floating\"\n {onselect}\n {onclose}\n onexit={exitSub}\n />\n </Menu>\n </div>\n{/if}\n\n<style>.level {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.sub {\n position: fixed;\n z-index: var(--kata-z-menu);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Block: a wrapper with padding (md on all sides). Inside a container without padding (a panel,\n // a menu), it holds what does not reach the edges: text, fields, name and value pairs. Lists,\n // trees, tables and section headers reach the edges and do not go in a Block. Its content is a\n // Stack.\n //\n // <Block><Stack gap=\"sm\">…</Stack></Block>\n let { children }: { children: Snippet } = $props();\n</script>\n\n<div class=\"block\" data-inset data-role=\"block\">{@render children()}</div>\n\n<style>.block {\n padding: var(--kata-pad-md);\n --kata-inset: 0px;\n --kata-at-start: 1;\n --kata-at-end: 1;\n min-width: 0;\n flex: none;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { tick, untrack } from 'svelte';\n import Icon from './Icon.svelte';\n\n // InlineEdit: text that is changed where it stands. Read, it is a control without a line (the\n // height its container declares, no padding at the sides, so its edge lines up with the text\n // around it), with a surface and a pencil on hover. Edited, it becomes a control with a blue line\n // and pad-sm at the sides. Enter commits and Escape restores. When the text is emptied, the\n // application decides the name that takes its place.\n //\n // Three states:\n // empty and editable a text action, \"+ placeholder\"\n // a value and editable the text and a pencil; pressing it edits\n // not editable the text alone (nothing when empty)\n // Without a pencil or an action, the text cannot be changed.\n //\n // <InlineEdit bind:value={name} placeholder=\"Add a description\" onCommit={save} />\n let {\n value = $bindable(''),\n placeholder,\n editable = true,\n title = false,\n multiline = false,\n editing = $bindable(false),\n onCommit,\n label,\n }: {\n value?: string;\n /** The action shown when empty (for example Add a description); the component adds the + */\n placeholder: string;\n /** false shows the text only */\n editable?: boolean;\n /** A title, at the size and weight of h2 */\n title?: boolean;\n /** Several lines: Enter adds a line; blur or ⌘/Ctrl+Enter commits */\n multiline?: boolean;\n /** Called when the value has changed, with the text trimmed at both ends */\n onCommit: (v: string) => void;\n /** The accessible name of the input and of the text (the placeholder by default) */\n label?: string;\n /** Whether it is being edited, for an application that holds back updates meanwhile */\n editing?: boolean;\n } = $props();\n\n let draft = $state('');\n let inputEl = $state<HTMLInputElement | HTMLTextAreaElement | undefined>();\n // blur also fires after Escape; this says whether the edit may still be committed. It is a plain\n // variable, so that it does not depend on the order in which the input is removed.\n let armed = false;\n\n const a11yLabel = $derived(label ?? placeholder);\n\n function start() {\n if (!editable || editing) return;\n begin();\n }\n\n function begin() {\n draft = value;\n editing = true;\n armed = true;\n tick().then(() => {\n inputEl?.focus();\n inputEl?.select();\n });\n }\n\n // editing set to true by the application (a key such as F2) starts an edit as a press does\n $effect(() => {\n if (editing && !armed && editable) untrack(begin);\n });\n\n function commit() {\n if (!armed) return;\n armed = false;\n editing = false;\n const next = draft.trim();\n if (next === value) return;\n value = next;\n onCommit(next);\n }\n\n function cancel() {\n armed = false;\n editing = false;\n }\n\n function onkeydown(e: KeyboardEvent) {\n // The Enter that ends a composition (an input method) does not commit\n if (e.isComposing || e.keyCode === 229) return;\n if (e.key === 'Escape') {\n e.preventDefault();\n // Escape ends the edit here and does not reach a panel or a modal around it\n e.stopPropagation();\n cancel();\n return;\n }\n if (e.key === 'Enter' && (!multiline || e.metaKey || e.ctrlKey)) {\n e.preventDefault();\n commit();\n }\n }\n</script>\n\n{#if editing}\n <span\n class=\"ie editing\"\n class:title\n class:multi={multiline}\n data-role=\"box\"\n data-h={multiline ? undefined : 'button'}\n >\n {#if multiline}\n <textarea\n rows={1}\n bind:this={inputEl}\n bind:value={draft}\n aria-label={a11yLabel}\n onblur={commit}\n {onkeydown}\n ></textarea>\n {:else}\n <input\n type=\"text\"\n bind:this={inputEl}\n bind:value={draft}\n aria-label={a11yLabel}\n onblur={commit}\n {onkeydown}\n />\n {/if}\n </span>\n{:else if !editable}\n {#if value !== ''}\n <span\n class=\"ie read\"\n class:title\n class:multi={multiline}\n data-role=\"box\"\n data-h={multiline ? undefined : 'button'}><span class=\"t clamp\">{value}</span></span\n >\n {/if}\n{:else if value !== ''}\n <button\n class=\"ie\"\n class:title\n class:multi={multiline}\n type=\"button\"\n aria-label={a11yLabel}\n onclick={start}\n data-role=\"box\"\n data-h={multiline ? undefined : 'button'}\n >\n <span class=\"t clamp\">{value}</span>\n <span class=\"pen\"><Icon name=\"pencil\" /></span>\n </button>\n{:else}\n <button class=\"add\" type=\"button\" aria-label={a11yLabel} onclick={start} data-role=\"box\" data-h=\"button\">\n <Icon name=\"plus\" /><span class=\"t\">{placeholder}</span>\n </button>\n{/if}\n\n<style>.ie {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n max-width: 100%;\n padding: 0;\n border: var(--kata-border-width) solid transparent;\n background: none;\n color: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n text-align: start;\n cursor: text;\n min-width: 0;\n}\n\n.title {\n font-size: var(--kata-text-size-h2);\n line-height: var(--kata-text-leading-h2);\n letter-spacing: var(--kata-text-tracking-h2);\n font-weight: 600;\n}\n\n.t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.clamp {\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\nbutton.ie {\n cursor: pointer;\n}\nbutton.ie:hover {\n background: var(--kata-color-raise);\n}\nbutton.ie:hover .pen {\n color: var(--kata-color-muted);\n}\n\n.pen {\n display: flex;\n flex: none;\n color: var(--kata-color-faint);\n}\n\n.read {\n cursor: default;\n}\n\n.editing {\n border-color: var(--kata-color-blue-ink);\n padding-inline: var(--kata-pad-sm);\n}\n\n.ie input,\n.ie textarea {\n border: 0;\n background: transparent;\n padding: 0;\n margin: 0;\n min-width: 0;\n outline: none;\n color: inherit;\n font: inherit;\n appearance: none;\n}\n.ie input:focus-visible,\n.ie textarea:focus-visible {\n outline: none;\n}\n.ie input,\n.ie textarea {\n flex: 1;\n width: 100%;\n align-self: stretch;\n}\n\n.multi {\n --kata-inline-edit-pad: calc((var(--kata-box, var(--kata-height-button)) - var(--kata-border-width) * 2 - var(--kata-text-size-body) * var(--kata-text-leading-body)) / 2);\n height: auto;\n min-height: var(--kata-box, var(--kata-height-button));\n align-items: flex-start;\n white-space: normal;\n}\n\n.multi .clamp {\n text-box: none;\n padding-top: 0;\n padding-bottom: 0;\n white-space: pre-wrap;\n overflow: visible;\n text-overflow: clip;\n padding-block: var(--kata-inline-edit-pad);\n}\n\n.multi:not(.editing) {\n display: block;\n}\n.multi:not(.editing) .clamp {\n display: inline;\n}\n.multi:not(.editing) .pen {\n display: inline-flex;\n vertical-align: middle;\n margin-left: var(--kata-pad-sm);\n}\n\n.ie textarea {\n resize: none;\n field-sizing: content;\n line-height: var(--kata-text-leading-body);\n padding-block: var(--kata-inline-edit-pad);\n}\n\n.add {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding: 0;\n border: 0;\n background: none;\n color: var(--kata-color-blue-ink);\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n cursor: pointer;\n}\n.add:hover {\n text-decoration: underline;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { createNarrow } from '../lib/viewport.svelte.js';\n\n // Pair: a name and a value side by side. The name column is 7.5rem wide and muted; gap-sm lies\n // between the name and the value. It has three forms.\n //\n // edit (the default) the value is a control; the height is a button's\n // read the value is text to read (a summary, the attributes of a thing); the\n // height follows the content and the pair is not a control\n // top the value has several lines (a Textarea); aligned at the top\n //\n // The name is trimmed to its ink and level with the first line of the value (with a control,\n // with the text inside it). Edit and read pairs are not mixed in one column. Pairs are gap-sm\n // apart in a Stack; a column of read pairs is a Kv. The pair owns the padding at its sides: the\n // inset its container declares (none inside a container with padding).\n //\n // <Pair label=\"Line width\"><NumberInput bind:value unit=\"px\" /></Pair>\n // <Pair read label=\"Length\">13.1 km</Pair>\n // <Pair read label=\"ID\" mono clamp>ab12…</Pair>\n let {\n label,\n for: htmlFor,\n href,\n read = false,\n top = false,\n note,\n tight = false,\n indent = 0,\n muted = false,\n mono = false,\n clamp = false,\n children,\n }: {\n label: string;\n /** The id of the control the name labels */\n for?: string;\n /** Makes the name a link (a read pair opened by its name, as in a table of contents) */\n href?: string;\n /** A value to read, not a control */\n read?: boolean;\n /** A value of several lines: aligned at the top, the height follows the content */\n top?: boolean;\n /** A caption under the value, gap-xs from it */\n note?: string;\n /** The name column takes the width of its content (a narrow container) */\n tight?: boolean;\n /** The depth of a read name in a tree of values: md × depth */\n indent?: number;\n /** A weaker read value (empty or inherited) */\n muted?: boolean;\n /** The monospace font (identifiers) */\n mono?: boolean;\n /** The value on one line with an ellipsis */\n clamp?: boolean;\n children: Snippet;\n } = $props();\n // Below 24rem the name sits above the value, and the pair no longer has a control's height\n const tiny = createNarrow(24);\n $effect(tiny.start);\n // A read pair has no line and no surface: it is not a control, so it declares no height\n const h = $derived(top || tiny.current || read ? undefined : 'button');\n</script>\n\n<div\n class=\"pair\"\n class:read\n class:top\n class:tight\n class:noted={!!note}\n data-role=\"pair\"\n data-h={note ? undefined : h}\n>\n {#if htmlFor}\n <label class=\"k\" for={htmlFor} style:--kata-pair-depth={indent}>{label}</label>\n {:else if href}\n <a class=\"k link\" {href} style:--kata-pair-depth={indent}>{label}</a>\n {:else}\n <span class=\"k\" style:--kata-pair-depth={indent}>{label}</span>\n {/if}\n {#if read}\n <span class=\"v\" class:muted class:mono class:clamp>{@render children()}</span>\n {:else}\n <div class=\"row\">{@render children()}</div>\n {/if}\n {#if note}<span class=\"note\">{note}</span>{/if}\n</div>\n\n<style>.pair {\n --kata-pair-name: 7.5rem;\n display: grid;\n grid-template-columns: var(--kata-pair-cols, var(--kata-pair-name) minmax(0, 1fr));\n grid-column: 1/-1;\n align-items: center;\n column-gap: var(--kata-gap-sm);\n min-width: 0;\n flex: none;\n height: var(--kata-box, var(--kata-height-button));\n padding-inline: var(--kata-inset, 0px);\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n}\n\n.read {\n height: auto;\n align-items: baseline;\n}\n\n.tight {\n grid-template-columns: var(--kata-pair-cols, max-content minmax(0, 1fr));\n}\n\n.k {\n display: block;\n color: var(--kata-color-muted);\n padding-inline-start: calc(var(--kata-pair-depth, 0) * var(--kata-pad-md));\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.k.link {\n color: var(--kata-color-blue-ink);\n text-decoration: none;\n}\n.k.link:hover {\n text-decoration: underline;\n}\n\n.row {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n.row > :global(*) {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.v {\n display: block;\n min-width: 0;\n font-variant-numeric: tabular-nums;\n overflow-wrap: anywhere;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.v.muted {\n color: var(--kata-color-muted);\n}\n\n.mono {\n font-family: var(--kata-font-mono);\n}\n\n.v.clamp {\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n overflow-wrap: normal;\n}\n\n.note {\n grid-column: 2;\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n}\n\n.top {\n align-items: start;\n height: auto;\n}\n.top .k {\n padding-top: calc((var(--kata-box, var(--kata-height-button)) - 1em * var(--kata-ink)) / 2 + var(--kata-ink-over) * 1em);\n}\n\n.noted {\n height: auto;\n row-gap: var(--kata-gap-xs);\n}\n\n@container app (width < 24rem) {\n .pair {\n grid-template-columns: minmax(0, 1fr);\n align-items: start;\n row-gap: var(--kata-gap-xs);\n height: auto;\n }\n .note {\n grid-column: 1;\n }\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import Pair from './Pair.svelte';\n\n // Kv: a column of read pairs. The pairs sit on one grid, so their names line up in one column:\n // 7.5rem wide, or the width of the longest name with tight (a narrow container such as a tile).\n // Pairs are gap-sm apart. Below 24rem each name sits above its value.\n //\n // <Kv items={[{ k: 'Length', v: '13.1 km' }, { k: 'ID', v: 'ab12', mono: true }]} />\n // <Kv tight items={…} />\n let {\n items,\n tight = false,\n }: {\n items: {\n /** The name */\n k: string;\n /** The value */\n v: string;\n mono?: boolean;\n /** The depth in a tree of values */\n indent?: number;\n muted?: boolean;\n clamp?: boolean;\n /** Makes the name a link */\n href?: string;\n /** A caption under the value */\n note?: string;\n }[];\n /** The name column takes the width of the longest name */\n tight?: boolean;\n } = $props();\n</script>\n\n<div class=\"kv\" class:tight data-role=\"list\">\n {#each items as item, i (i)}\n <Pair\n read\n label={item.k}\n href={item.href}\n note={item.note}\n {tight}\n indent={item.indent ?? 0}\n muted={item.muted}\n mono={item.mono}\n clamp={item.clamp}>{item.v}</Pair\n >\n {/each}\n</div>\n\n<style>.kv {\n --kata-pair-name: 7.5rem;\n --kata-pair-cols: subgrid;\n display: grid;\n grid-template-columns: var(--kata-pair-name) minmax(0, 1fr);\n row-gap: var(--kata-gap-sm);\n column-gap: var(--kata-gap-sm);\n min-width: 0;\n}\n\n.tight {\n grid-template-columns: max-content minmax(0, 1fr);\n}\n\n@container app (width < 24rem) {\n .kv,\n .tight {\n grid-template-columns: minmax(0, 1fr);\n }\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { IconSource } from '../icons.js';\n import Icon from './Icon.svelte';\n\n // LinkAction: an action that is text only, for an action that does not call for a control with a\n // line (\"Add a description\", \"Show all\"). In a layout its height is the line box of its text, so\n // it is measured like the text around it; the area that is pressed reaches the square of an icon\n // button above and below it. No padding at the sides, so its edge lines up with the text around\n // it. The color is blue-ink, underlined on hover. An action that opens a modal or changes the\n // screen is a Button.\n //\n // <LinkAction icon=\"plus\" onclick={add}>Add a description</LinkAction>\n // <LinkAction href={url} external>Terms of use</LinkAction> opens in a new tab\n let {\n icon,\n href,\n onclick,\n disabled = false,\n external = false,\n children,\n }: {\n /** An icon before the text */\n icon?: IconSource;\n /** Renders a link */\n href?: string;\n onclick?: (e: MouseEvent) => void;\n /** Keeps its place but cannot be pressed (not with href) */\n disabled?: boolean;\n /** A destination outside the application: a new tab and an arrow after the text (with href) */\n external?: boolean;\n children: Snippet;\n } = $props();\n</script>\n\n{#snippet inner()}\n {#if icon}<Icon name={icon} />{/if}<span class=\"t\">{@render children()}</span>{#if external}<Icon\n name=\"arrow-up-right\"\n />{/if}\n{/snippet}\n\n{#if href}\n <a\n class=\"link\"\n data-role=\"box\"\n {href}\n target={external ? '_blank' : undefined}\n rel={external ? 'noreferrer' : undefined}\n {onclick}>{@render inner()}</a\n >\n{:else}\n <button type=\"button\" class=\"link\" data-role=\"box\" {disabled} {onclick}>{@render inner()}</button>\n{/if}\n\n<style>.link {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n position: relative;\n padding: 0;\n border: 0;\n background: none;\n color: var(--kata-color-blue-ink);\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n text-align: start;\n text-decoration: none;\n cursor: pointer;\n flex: none;\n}\n.link:hover {\n text-decoration: underline;\n}\n.link::after {\n content: \"\";\n position: absolute;\n inset-inline: 0;\n top: 50%;\n height: var(--kata-height-icon-button);\n translate: 0 -50%;\n}\n.link:disabled {\n color: var(--kata-color-text);\n opacity: var(--kata-opacity-dim);\n cursor: default;\n text-decoration: none;\n}\n.link > :global(svg) {\n flex: none;\n}\n\n.t {\n display: block;\n min-width: 0;\n}\n\n:global([data-h]) .t {\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}</style>\n","import { placeTip, tipBounds, tipHost } from './tipPlace.js';\nconst LOOK = [\n 'background: var(--kata-color-text)',\n 'color: var(--kata-color-ground)',\n 'padding: var(--kata-gap-2xs) var(--kata-gap-sm)',\n 'font-size: var(--kata-text-size-caption)',\n 'line-height: var(--kata-height-badge)',\n 'min-height: var(--kata-height-button-sm)',\n 'display: inline-flex',\n 'align-items: center',\n];\n// The widest line; the gap to the edge of the window is the same as in the placement\nconst MAX_WIDTH = 'min(var(--kata-width-panel), calc(100vw - 2 * var(--kata-gap-sm)))';\nfunction clipped(node) {\n return node.scrollWidth > node.clientWidth;\n}\nfunction makeTip(node) {\n const text = node.textContent?.trim();\n if (!text)\n return null;\n const tip = document.createElement('span');\n tip.setAttribute('aria-hidden', 'true');\n tip.style.cssText = [\n ...LOOK,\n 'position: fixed',\n 'z-index: var(--kata-z-menu)',\n `max-width: ${MAX_WIDTH}`,\n 'white-space: normal',\n 'overflow-wrap: anywhere',\n 'pointer-events: none',\n ].join(';');\n tip.textContent = text;\n tipHost(node).appendChild(tip);\n placeTip(tip, node.getBoundingClientRect(), tipBounds(node));\n return tip;\n}\nexport const clampTip = (node) => {\n let tip = null;\n function hide() {\n tip?.remove();\n tip = null;\n }\n function onEnter() {\n if (tip || !clipped(node))\n return;\n tip = makeTip(node);\n }\n function onFocusIn(e) {\n // Keyboard focus only, so that the tooltip does not stay after a click\n if (!e.target?.matches?.(':focus-visible'))\n return;\n onEnter();\n }\n node.addEventListener('pointerenter', onEnter);\n node.addEventListener('pointerleave', hide);\n node.addEventListener('focusin', onFocusIn);\n node.addEventListener('focusout', hide);\n // A press or a scroll moves things; hide at once\n node.addEventListener('pointerdown', hide);\n document.addEventListener('scroll', hide, true);\n return {\n destroy() {\n hide();\n node.removeEventListener('pointerenter', onEnter);\n node.removeEventListener('pointerleave', hide);\n node.removeEventListener('focusin', onFocusIn);\n node.removeEventListener('focusout', hide);\n node.removeEventListener('pointerdown', hide);\n document.removeEventListener('scroll', hide, true);\n },\n };\n};\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { Action } from 'svelte/action';\n import { clampTip } from '../lib/clampTip.js';\n\n // Text: text in one of the nine type roles, each with its size, leading, tracking, weight and\n // element. Text outside a control keeps its line box (it is not trimmed); the distance to its\n // neighbours is the gap of a Stack or a Row. Inside a component that declares its height\n // (a list item, a toolbar) it is trimmed to its ink and clipped to one line.\n //\n // <Text role=\"h1\">The title of a screen</Text> an h1\n // <Text role=\"caption\">A note</Text> a span shown as a block\n // <Text role=\"prose\">A paragraph to read</Text> a p\n // <Text role=\"caption\" mono clamp>name@example.com</Text>\n // <Text as=\"a\" href=\"/files/1\" clamp>A name</Text> a link that keeps the color around it\n type Role = 'num' | 'title' | 'h1' | 'h2' | 'prose' | 'body' | 'caption' | 'label' | 'glyph';\n let {\n role = 'body',\n as,\n clamp = false,\n lines,\n wrap = false,\n muted = false,\n mono = false,\n tabular = false,\n id,\n for: htmlFor,\n href,\n children,\n }: {\n /** The type role (default body) */\n role?: Role;\n /** Another element than the role's own: h1 (title, h1), h2 (h2), p (body, prose) or span */\n as?: 'span' | 'p' | 'div' | 'h1' | 'h2' | 'h3' | 'label' | 'dt' | 'dd' | 'a';\n /** One line with an ellipsis; the full text shows on hover when it is clipped */\n clamp?: boolean;\n /** Two lines with an ellipsis */\n lines?: 2;\n /** Keep line breaks and wrap long words (text that people wrote) */\n wrap?: boolean;\n /** The muted text color */\n muted?: boolean;\n /** The monospace font, at the role's size */\n mono?: boolean;\n /** Figures of equal width, for columns of numbers and times */\n tabular?: boolean;\n id?: string;\n /** The labelled control, with as=\"label\" */\n for?: string;\n /** The target, with as=\"a\" */\n href?: string;\n children: Snippet;\n } = $props();\n const tag = $derived(\n as ??\n (role === 'h1' || role === 'title'\n ? 'h1'\n : role === 'h2'\n ? 'h2'\n : role === 'prose' || role === 'body'\n ? 'p'\n : 'span'),\n );\n const dataRole = $derived(role === 'body' || role === 'prose' ? 'p' : role);\n // The full text of a clipped line shows as a tooltip (clampTip), only while clamp is on\n const clampTipIf: Action<HTMLElement, boolean> = (node, on) => {\n let inner: ReturnType<typeof clampTip> | undefined = on ? clampTip(node) : undefined;\n return {\n update(next: boolean) {\n if (next && !inner) inner = clampTip(node);\n else if (!next && inner) {\n inner?.destroy?.();\n inner = undefined;\n }\n },\n destroy() {\n inner?.destroy?.();\n },\n };\n };\n</script>\n\n<svelte:element\n this={tag}\n class=\"kata-text {role}\"\n class:clamp\n class:clamp2={lines === 2}\n class:wrap\n class:muted\n class:mono\n class:tabular\n data-role={dataRole}\n {id}\n for={tag === 'label' ? htmlFor : undefined}\n href={tag === 'a' ? href : undefined}\n use:clampTipIf={clamp}\n>\n {@render children()}\n</svelte:element>\n\n<style>.kata-text {\n display: block;\n margin: 0;\n min-width: 0;\n}\n\n@container style(--kata-in-control: 1) {\n .kata-text {\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n }\n .kata-text:not(.clamp2):not(.wrap) {\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n }\n}\n:global(td) .kata-text,\n:global(th) .kata-text {\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.num {\n font-size: var(--kata-text-size-num);\n line-height: var(--kata-text-leading-num);\n letter-spacing: var(--kata-text-tracking-num);\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n}\n\n.title {\n font-size: var(--kata-text-size-title);\n line-height: var(--kata-text-leading-title);\n letter-spacing: var(--kata-text-tracking-title);\n font-weight: 600;\n}\n\n.h1 {\n font-size: var(--kata-text-size-h1);\n line-height: var(--kata-text-leading-h1);\n letter-spacing: var(--kata-text-tracking-h1);\n font-weight: 600;\n}\n\n.h2 {\n font-size: var(--kata-text-size-h2);\n line-height: var(--kata-text-leading-h2);\n letter-spacing: var(--kata-text-tracking-h2);\n font-weight: 600;\n}\n\n.body {\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n}\n\n.prose {\n font-size: var(--kata-text-size-prose);\n line-height: var(--kata-text-leading-prose);\n letter-spacing: var(--kata-text-tracking-prose);\n}\n\n.caption {\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n}\n\n.label {\n font-size: var(--kata-text-size-label);\n line-height: var(--kata-text-leading-label);\n letter-spacing: var(--kata-text-tracking-label);\n font-weight: 600;\n}\n\n.glyph {\n font-size: var(--kata-text-size-glyph);\n line-height: var(--kata-text-leading-glyph);\n letter-spacing: var(--kata-text-tracking-glyph);\n font-weight: 600;\n}\n\n.kata-text.mono {\n font-family: var(--kata-font-mono);\n font-variant-numeric: tabular-nums;\n}\n\na.kata-text {\n color: inherit;\n text-decoration: none;\n}\na.kata-text:hover {\n text-decoration: underline;\n}\n\n.tabular {\n font-variant-numeric: tabular-nums;\n}\n\n.muted {\n color: var(--kata-color-muted);\n}\n\n.clamp {\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.wrap {\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n}\n\n.kata-text.clamp2 {\n text-box: none;\n padding-top: 0;\n padding-bottom: 0;\n}\n\n.clamp2 {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n overflow: hidden;\n white-space: pre-wrap;\n word-break: break-word;\n overflow-wrap: anywhere;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { HTMLInputAttributes } from 'svelte/elements';\n\n // TextInput: a one-line input. The control (a <label>) draws the line, holds the height and the\n // padding at the sides; the bare input inside has no line and no ring. Focus shows once, as the\n // control's line turns blue-ink; an error turns it red-ink; the placeholder is faint. The height is\n // the one the container declares (a button's, or a small button's in a list item or a cell), so\n // the author writes no size. The whole control is a <label>, so a press anywhere on it focuses the\n // input; the name of the field is Field's own <label for>. The width is the application's.\n //\n // <Field label=\"Name\" for=\"n\"><TextInput id=\"n\" bind:value={name} /></Field>\n let {\n value = $bindable(''),\n type = 'text',\n placeholder,\n id,\n name,\n autocomplete,\n disabled = false,\n error = false,\n title = false,\n mono = false,\n unit,\n suggestions,\n readonly = false,\n oninput,\n onchange,\n onkeydown,\n onblur,\n ...rest\n }: Omit<\n HTMLInputAttributes,\n | 'class'\n | 'style'\n | 'value'\n | 'type'\n | 'title'\n | 'placeholder'\n | 'name'\n | 'autocomplete'\n | 'disabled'\n | 'readonly'\n | 'oninput'\n | 'onchange'\n | 'onkeydown'\n | 'onblur'\n | 'list'\n > & {\n value?: string;\n type?: 'text' | 'email' | 'password' | 'url';\n placeholder?: string;\n id?: string;\n name?: string;\n autocomplete?: HTMLInputAttributes['autocomplete'];\n disabled?: boolean;\n /** The line turns red-ink */\n error?: boolean;\n /** The input of a name, at the size and weight of h2 */\n title?: boolean;\n /** A code or an identifier: the monospace font with figures of equal width */\n mono?: boolean;\n /** A unit, muted, on the right inside the control */\n unit?: string;\n /** Suggestions: the value may be typed or picked, and need not be one of them */\n suggestions?: string[];\n readonly?: boolean;\n oninput?: (e: Event & { currentTarget: HTMLInputElement }) => void;\n onchange?: (e: Event & { currentTarget: HTMLInputElement }) => void;\n onkeydown?: (e: KeyboardEvent) => void;\n onblur?: (e: FocusEvent) => void;\n } = $props();\n\n // One list of suggestions per control, named by the component\n const listId = $props.id();\n const hasList = $derived((suggestions?.length ?? 0) > 0);\n\n // type is dynamic, which bind:value does not allow, so the value is copied by hand\n function relay(e: Event & { currentTarget: HTMLInputElement }) {\n value = e.currentTarget.value;\n oninput?.(e);\n }\n</script>\n\n<label class=\"input\" class:err={error} class:disabled={disabled} class:title data-role=\"box\" data-h=\"button\">\n <input\n class:mono\n {type}\n {value}\n {placeholder}\n {id}\n {name}\n {autocomplete}\n {disabled}\n {readonly}\n aria-invalid={error || undefined}\n list={hasList ? listId : undefined}\n oninput={relay}\n {onchange}\n {onkeydown}\n {onblur}\n {...rest}\n />\n {#if hasList}\n <datalist id={listId}>\n {#each suggestions ?? [] as s (s)}<option value={s}></option>{/each}\n </datalist>\n {/if}\n {#if unit}<span class=\"unit\">{unit}</span>{/if}\n</label>\n\n<style>.input {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding-block: 0;\n padding-inline: var(--kata-pad-md);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n background: transparent;\n color: var(--kata-color-text);\n white-space: nowrap;\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;\n width: 100%;\n min-width: 0;\n justify-content: flex-start;\n cursor: text;\n}\n.input:focus-within {\n border-color: var(--kata-color-blue-ink);\n}\n\n.input input {\n border: 0;\n background: transparent;\n padding: 0;\n margin: 0;\n min-width: 0;\n outline: none;\n color: inherit;\n font: inherit;\n appearance: none;\n}\n.input input:focus-visible {\n outline: none;\n}\n.input input {\n flex: 1;\n align-self: stretch;\n}\n.input input::placeholder {\n color: var(--kata-color-faint);\n}\n\n.unit {\n color: var(--kata-color-muted);\n flex: none;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.title {\n font-size: var(--kata-text-size-h2);\n line-height: var(--kata-text-leading-h2);\n letter-spacing: var(--kata-text-tracking-h2);\n font-weight: 600;\n}\n\n.input input.mono {\n font-family: var(--kata-font-mono);\n font-variant-numeric: tabular-nums;\n}\n\n.err {\n border-color: var(--kata-color-red-ink);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.disabled .unit {\n color: inherit;\n}</style>\n","<script lang=\"ts\" module>\n /** One attribute of an AttributeList */\n export interface AttributeItem {\n key: string;\n value: string;\n }\n</script>\n\n<script lang=\"ts\">\n import '../styles/components.css';\n import { tick } from 'svelte';\n import { getMessages } from '../messages.js';\n import Block from './Block.svelte';\n import Button from './Button.svelte';\n import Icon from './Icon.svelte';\n import InlineEdit from './InlineEdit.svelte';\n import Kv from './Kv.svelte';\n import LinkAction from './LinkAction.svelte';\n import Text from './Text.svelte';\n import TextInput from './TextInput.svelte';\n\n // AttributeList: the attributes of a thing, names and values that the user writes. It reaches the\n // edges of its container, as a list does (a flush section, a panel's content). Read only, it is\n // a Kv in a Block. Editable, each row is the name and the value, each changed where it stands\n // (InlineEdit), and a remove button; the rows are a button tall and touch, as list items do. A\n // locked name is shown with a lock and cannot be changed or removed. The add action opens a row of two inputs at the end: Enter or leaving the row adds\n // the attribute, Escape drops it, and a row without a name is dropped.\n //\n // The list shows items; the changes are reported by index into items, and the application\n // updates items (at once), or the row goes back to what items holds. hide leaves out the names\n // the application keeps to itself.\n //\n // <AttributeList {items} locked={['id']} onchange={(i, item) => …} onadd={(item) => …}\n // onremove={(i) => …} />\n let {\n items,\n onchange,\n onadd,\n onremove,\n readonly = false,\n locked = [],\n hide,\n }: {\n /** The attributes, in order */\n items: AttributeItem[];\n /** Called with the index and the new name and value of an attribute changed */\n onchange?: (index: number, item: AttributeItem) => void;\n /** Called with an attribute to add; shows the add action */\n onadd?: (item: AttributeItem) => void;\n /** Called with the index of an attribute to remove; shows the remove buttons */\n onremove?: (index: number) => void;\n /** Only read: the list is a Kv */\n readonly?: boolean;\n /** The names shown but not changed or removed */\n locked?: string[];\n /** Leaves out the attributes whose name it returns true for */\n hide?: (key: string) => boolean;\n } = $props();\n\n // The attributes shown, with their index in items\n const shown = $derived(\n items.map((item, index) => ({ ...item, index })).filter((a) => !hide?.(a.key)),\n );\n // Raised to draw the rows again from items, after a change the application did not take\n let rev = $state(0);\n // The row being added, or null\n let draft = $state<AttributeItem | null>(null);\n let draftRow = $state<HTMLElement>();\n\n function change(index: number, next: AttributeItem) {\n if (next.key !== '') onchange?.(index, next);\n const now = items[index];\n if (!now || now.key !== next.key || now.value !== next.value) rev += 1;\n }\n\n async function open() {\n draft = { key: '', value: '' };\n await tick();\n draftRow?.querySelector('input')?.focus();\n }\n function add() {\n if (!draft) return;\n const key = draft.key.trim();\n const value = draft.value.trim();\n draft = null;\n if (key) onadd?.({ key, value });\n }\n function draftKey(e: KeyboardEvent) {\n if (e.isComposing || e.keyCode === 229) return;\n if (e.key === 'Enter') {\n e.preventDefault();\n add();\n } else if (e.key === 'Escape') {\n e.preventDefault();\n // Escape drops the row here and does not reach a panel or a modal around it\n e.stopPropagation();\n draft = null;\n }\n }\n // Leaving the row adds the attribute; moving between its inputs does not\n function draftOut(e: FocusEvent) {\n const next = e.relatedTarget as Node | null;\n if (next && draftRow?.contains(next)) return;\n add();\n }\n</script>\n\n<div class=\"attributes\">\n {#if readonly || shown.length === 0}\n {#if shown.length === 0 && !draft}\n <Block><Text muted>{getMessages().noAttributes}</Text></Block>\n {:else if readonly}\n <Block><Kv items={shown.map((a) => ({ k: a.key, v: a.value }))} /></Block>\n {/if}\n {/if}\n {#if !readonly}\n {#each shown as a (`${a.index}:${rev}`)}\n {@const fixed = locked.includes(a.key)}\n {@const editable = !fixed && !!onchange}\n <div class=\"row\">\n <span class=\"k\">\n <InlineEdit\n value={a.key}\n {editable}\n placeholder={getMessages().attributeName}\n label={getMessages().attributeName}\n onCommit={(key) => change(a.index, { key, value: a.value })}\n />\n </span>\n <span class=\"v\">\n <InlineEdit\n value={a.value}\n {editable}\n placeholder={getMessages().addValue}\n label={a.key}\n onCommit={(value) => change(a.index, { key: a.key, value })}\n />\n </span>\n <span class=\"end\">\n {#if fixed}\n <span class=\"lock\" role=\"img\" aria-label={getMessages().locked}>\n <Icon name=\"lock\" tone=\"muted\" />\n </span>\n {:else if onremove}\n <Button\n variant=\"ghost\"\n icon\n aria-label={getMessages().removeAttribute({ key: a.key })}\n onclick={() => onremove?.(a.index)}\n >\n <Icon name=\"x\" />\n </Button>\n {/if}\n </span>\n </div>\n {/each}\n {#if draft}\n <div class=\"row draft\" bind:this={draftRow} onfocusout={draftOut}>\n <span class=\"k\">\n <TextInput\n bind:value={draft.key}\n placeholder={getMessages().attributeName}\n aria-label={getMessages().attributeName}\n onkeydown={draftKey}\n />\n </span>\n <span class=\"v\">\n <TextInput\n bind:value={draft.value}\n placeholder={getMessages().attributeValue}\n aria-label={getMessages().attributeValue}\n onkeydown={draftKey}\n />\n </span>\n <span class=\"end\">\n <!-- Pressing it keeps the focus in the row, so that leaving the row does not add it first -->\n <Button\n variant=\"ghost\"\n icon\n aria-label={getMessages().cancel}\n onmousedown={(e: MouseEvent) => e.preventDefault()}\n onclick={() => (draft = null)}\n >\n <Icon name=\"x\" />\n </Button>\n </span>\n </div>\n {:else if onadd}\n <Block>\n <LinkAction icon=\"plus\" onclick={open}>{getMessages().addAttribute}</LinkAction>\n </Block>\n {/if}\n {/if}\n</div>\n\n<style>.attributes {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.row {\n display: grid;\n grid-template-columns: 7.5rem minmax(0, 1fr) auto;\n align-items: center;\n column-gap: var(--kata-gap-sm);\n min-width: 0;\n flex: none;\n height: var(--kata-box, var(--kata-height-button));\n padding-inline: var(--kata-inset, 0px);\n}\n\n.k,\n.v,\n.end {\n display: flex;\n align-items: center;\n min-width: 0;\n}\n\n.k > :global(*),\n.v > :global(*) {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.draft {\n height: var(--kata-height-button);\n --kata-box: var(--kata-height-button-sm);\n}\n\n.lock {\n display: flex;\n}\n\n@container app (width < 24rem) {\n .row {\n grid-template-columns: minmax(0, 1fr) auto;\n grid-template-areas: \"k end\" \"v v\";\n height: auto;\n }\n .k {\n grid-area: k;\n }\n .v {\n grid-area: v;\n }\n .end {\n grid-area: end;\n }\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { IconName } from '../icons.js';\n import Icon from './Icon.svelte';\n\n // Banner: a notice in the flow of a page or a panel. Its line takes the color of its tone (info\n // blue, warn yellow, error red, ok green) and so does its icon; the padding is pad-md. The icon\n // is centred on the first line of the text, which is not trimmed. An action (act) sits at the\n // right end; when it does not fit beside the text, it moves below it. A notice of several lines\n // puts them in a Stack. floating gives it the panel surface, for a notice over the stage; the\n // application places it.\n //\n // <Banner tone=\"warn\">The trial ends in 3 days{#snippet act()}<Button>Renew</Button>{/snippet}</Banner>\n let {\n tone,\n floating = false,\n label,\n children,\n act,\n }: {\n tone: 'info' | 'warn' | 'error' | 'ok';\n /** The panel surface, for a notice over the stage */\n floating?: boolean;\n /** The accessible name of the notice, when it is referred to by name */\n label?: string;\n children: Snippet;\n /** An action at the right end */\n act?: Snippet;\n } = $props();\n\n const MARK: Record<string, IconName> = {\n info: 'info',\n warn: 'triangle-alert',\n error: 'circle-alert',\n ok: 'circle-check',\n };\n</script>\n\n<div\n class=\"banner {tone}\"\n class:floating\n data-inset\n data-role=\"banner\"\n role={tone === 'error' ? 'alert' : 'status'}\n aria-label={label}\n>\n <div class=\"line\">\n <span class=\"mark\"><Icon name={MARK[tone]} /></span>\n <!-- A div, since the text can be a Stack of several lines -->\n <div class=\"text\">{@render children()}</div>\n </div>\n {#if act}<div class=\"act\">{@render act()}</div>{/if}\n</div>\n\n<style>.banner {\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n padding: var(--kata-pad-md);\n --kata-inset: 0px;\n --kata-at-start: 1;\n --kata-at-end: 1;\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n gap: var(--kata-gap-sm);\n color: var(--kata-color-text);\n min-width: 0;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n --kata-box: var(--kata-height-button);\n}\n\n.floating {\n background: var(--kata-color-panel);\n}\n\n.line {\n display: flex;\n align-items: flex-start;\n gap: var(--kata-gap-sm);\n flex: 1 1 12em;\n min-width: 0;\n}\n\n.mark {\n display: flex;\n align-items: center;\n flex: none;\n height: calc(var(--kata-text-size-body) * var(--kata-text-leading-body));\n}\n\n.text {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.act {\n margin-left: auto;\n flex: 0 1 auto;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--kata-gap-sm);\n min-width: 0;\n max-width: 100%;\n}\n.act > :global(*) {\n flex: 0 1 auto;\n min-width: 0;\n max-width: 100%;\n}\n\n.info {\n border-color: var(--kata-color-blue-ink);\n}\n.info .mark {\n color: var(--kata-color-blue-ink);\n}\n\n.warn {\n border-color: var(--kata-color-yellow-ink);\n}\n.warn .mark {\n color: var(--kata-color-yellow-ink);\n}\n\n.error {\n border-color: var(--kata-color-red-ink);\n}\n.error .mark {\n color: var(--kata-color-red-ink);\n}\n\n.ok {\n border-color: var(--kata-color-green-ink);\n}\n.ok .mark {\n color: var(--kata-color-green-ink);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Stack: the vertical layout, and the only one that holds the distance between its children. The\n // author writes the distance as a gap step (the root times a power of φ); nothing is inferred. A\n // page uses 0, sm, md, lg and xl; 2xs and xs are for the inside of components. The distance runs\n // between the untrimmed line boxes of the children.\n //\n // <Stack gap=\"lg\">…</Stack>\n // <Stack gap=\"sm\" align=\"start\">…</Stack> children keep their own width (marks, badges)\n type Gap = 0 | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n let {\n gap,\n align = 'stretch',\n children,\n }: {\n /** The distance between children */\n gap: Gap;\n /** start keeps each child at its own width instead of the full width */\n align?: 'stretch' | 'start';\n children: Snippet;\n } = $props();\n</script>\n\n<div class=\"stack\" data-gap={gap} data-align={align} data-role=\"stack\">\n {@render children()}\n</div>\n\n<style>.stack {\n display: flex;\n flex-direction: column;\n min-width: 0;\n gap: 0;\n}\n\n.stack[data-align=start] {\n align-items: flex-start;\n}\n\n.stack[data-gap=\"2xs\"] {\n gap: var(--kata-gap-2xs);\n}\n\n.stack[data-gap=xs] {\n gap: var(--kata-gap-xs);\n}\n\n.stack[data-gap=sm] {\n gap: var(--kata-gap-sm);\n}\n\n.stack[data-gap=md] {\n gap: var(--kata-gap-md);\n}\n\n.stack[data-gap=lg] {\n gap: var(--kata-gap-lg);\n}\n\n.stack[data-gap=xl] {\n gap: var(--kata-gap-xl);\n}\n\n.stack[data-gap=\"2xl\"] {\n gap: var(--kata-gap-2xl);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // ColorGrid: a grid of preset colors. The colors stand in columns (9 by default) gap-2xs\n // apart, and each color is itself the cell that is pressed; nothing is placed inside a cell. The\n // chosen cell shows one ring inside, two lines wide, with no surface or shadow added. A color\n // cannot be described by its look, so each cell is named by the color's name, and the group by\n // label.\n //\n // <ColorGrid colors={swatches} value={hex} label=\"Color\" onselect={pick} />\n let {\n colors,\n value,\n onselect,\n label,\n columns = 9,\n }: {\n colors: { hex: string; name: string }[];\n /** The chosen color (compared without regard to case) */\n value?: string;\n onselect: (hex: string) => void;\n /** The name of the group */\n label: string;\n /** The number of columns (9 by default) */\n columns?: number;\n } = $props();\n\n function on(hex: string): boolean {\n return value !== undefined && hex.toLowerCase() === value.toLowerCase();\n }\n</script>\n\n<div class=\"grid\" data-role=\"grid\" role=\"radiogroup\" aria-label={label} style:--kata-color-grid-columns={columns}>\n {#each colors as c (c.hex)}\n <button\n type=\"button\"\n class=\"cell\"\n class:on={on(c.hex)}\n role=\"radio\"\n aria-checked={on(c.hex)}\n aria-label={c.name}\n style:--kata-color-grid-color={c.hex}\n onclick={() => onselect(c.hex)}\n ></button>\n {/each}\n</div>\n\n<style>.grid {\n display: grid;\n grid-template-columns: repeat(var(--kata-color-grid-columns), minmax(0, 1fr));\n gap: var(--kata-gap-2xs);\n min-width: 0;\n}\n\n.cell {\n aspect-ratio: 1;\n width: 100%;\n border: 0;\n padding: 0;\n background: var(--kata-color-grid-color);\n box-shadow: inset 0 0 0 var(--kata-border-width) var(--kata-color-line);\n cursor: pointer;\n}\n\n.cell.on {\n box-shadow: inset 0 0 0 calc(var(--kata-border-width) * 2) var(--kata-color-focus), inset 0 0 0 calc(var(--kata-border-width) * 3) var(--kata-color-panel);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // NumberInput: the input of a number. It is the same control as TextInput, with the value\n // aligned to the end and the unit, muted, on the right inside the control. The height is the one\n // the container declares. Only short values such as numbers and dates take a fixed width, and\n // only one of three: 6, 8 or 12rem.\n //\n // <Field label=\"Line width\" for=\"w\"><NumberInput id=\"w\" bind:value unit=\"px\" width=\"6rem\" /></Field>\n let {\n value = $bindable(null),\n unit,\n min,\n max,\n step,\n placeholder,\n id,\n ariaLabel,\n disabled = false,\n readonly = false,\n error = false,\n width,\n oninput,\n onchange,\n }: {\n /** The number, or null when the input is empty */\n value?: number | null;\n /** A unit (px, %, °) */\n unit?: string;\n min?: number;\n max?: number;\n /** The step; 'any' for an input that takes decimals */\n step?: number | 'any';\n /** A word shown when empty, where empty has a meaning (for example Auto) */\n placeholder?: string;\n id?: string;\n /** The accessible name where no <label for> names it */\n ariaLabel?: string;\n disabled?: boolean;\n /** Can be focused and selected, not changed */\n readonly?: boolean;\n error?: boolean;\n /** The width of the control; without it, it fills its container */\n width?: '6rem' | '8rem' | '12rem';\n /** Every key stroke (the raw value is e.currentTarget.value) */\n oninput?: (e: Event & { currentTarget: HTMLInputElement }) => void;\n /** The value is committed */\n onchange?: (e: Event & { currentTarget: HTMLInputElement }) => void;\n } = $props();\n</script>\n\n<label class=\"input\" class:err={error} class:disabled={disabled} data-role=\"box\" data-h=\"button\" style:width>\n <input\n type=\"number\"\n bind:value\n {min}\n {max}\n {step}\n {placeholder}\n {id}\n {disabled}\n {readonly}\n aria-label={ariaLabel}\n aria-invalid={error || undefined}\n {oninput}\n {onchange}\n />\n {#if unit}<span class=\"unit\">{unit}</span>{/if}\n</label>\n\n<style>.input {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding-block: 0;\n padding-inline: var(--kata-pad-md);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n background: transparent;\n color: var(--kata-color-text);\n white-space: nowrap;\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;\n width: 100%;\n min-width: 0;\n justify-content: flex-start;\n cursor: text;\n}\n.input:focus-within {\n border-color: var(--kata-color-blue-ink);\n}\n\n.input input {\n border: 0;\n background: transparent;\n padding: 0;\n margin: 0;\n min-width: 0;\n outline: none;\n color: inherit;\n font: inherit;\n appearance: none;\n}\n.input input:focus-visible {\n outline: none;\n}\n.input input {\n flex: 1;\n align-self: stretch;\n text-align: end;\n font-variant-numeric: tabular-nums;\n}\n.input input::placeholder {\n color: var(--kata-color-faint);\n}\n\n.unit {\n color: var(--kata-color-muted);\n flex: none;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.err {\n border-color: var(--kata-color-red-ink);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.disabled .unit {\n color: inherit;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Row: the horizontal layout. The distance between neighbours is a gap step: 2xs between an icon\n // and its text, sm between controls, lg between groups, 0 between borderless icon buttons (their\n // hit area is the space). Text shrinks and wraps inside its own width while icons, marks and\n // controls keep theirs. A row of controls that may not fit takes wrap and moves whole items to\n // the next line.\n //\n // <Row gap=\"sm\" between wrap>…</Row>\n type Gap = '0' | '2xs' | 'sm' | 'md' | 'lg';\n let {\n gap = 'sm',\n between = false,\n wrap = false,\n align = 'center',\n justify = 'start',\n children,\n }: {\n /** The distance between items (default sm) */\n gap?: Gap;\n /** Push the first and the last item to the two ends */\n between?: boolean;\n /** Move items that do not fit to the next line */\n wrap?: boolean;\n /** Vertical alignment; stretch fills the height of the row (columns of a frame) */\n align?: 'center' | 'start' | 'end' | 'stretch';\n /** end moves the whole run to the right end */\n justify?: 'start' | 'end';\n children: Snippet;\n } = $props();\n</script>\n\n<div\n class=\"row\"\n data-gap={gap}\n data-align={align}\n data-justify={justify}\n class:between\n class:wrap\n data-role=\"row-inline\"\n data-edge-pass\n>\n {@render children()}\n</div>\n\n<style>.row {\n display: flex;\n align-items: center;\n min-width: 0;\n gap: var(--kata-gap-sm);\n}\n\n.row[data-gap=\"0\"] {\n gap: 0;\n}\n\n.row[data-gap=\"2xs\"] {\n gap: var(--kata-gap-2xs);\n}\n\n.row[data-gap=md] {\n gap: var(--kata-gap-md);\n}\n\n.row[data-gap=lg] {\n gap: var(--kata-gap-lg);\n}\n\n.row[data-align=start] {\n align-items: flex-start;\n}\n\n.row[data-align=end] {\n align-items: flex-end;\n}\n\n.row[data-align=stretch] {\n align-items: stretch;\n min-height: 0;\n}\n\n.row[data-justify=end] {\n justify-content: flex-end;\n}\n\n.between {\n justify-content: space-between;\n}\n\n.row > :global([data-role='mark']) {\n flex: none;\n}\n\n.wrap {\n flex-wrap: wrap;\n}\n.wrap > :global(*) {\n flex-shrink: 0;\n max-width: 100%;\n}\n\n.row:not(.between) > :global([data-role='caption']:last-child),\n.row:not(.between) > :global([data-role='p']:last-child) {\n flex: 1 1 auto;\n min-width: 0;\n}</style>\n","<script lang=\"ts\" generics=\"T extends string\">\n import '../styles/components.css';\n import { tick } from 'svelte';\n import Icon from './Icon.svelte';\n\n // Select: a select with a list of its own. The trigger is the control of a button with a chevron\n // on the right; the list opens below it, at least as wide as the trigger, with a check mark on\n // the left of the chosen option. Use it for five options or more, or options with a description\n // (Segmented for two to four, NativeSelect for long lists and phones). The height is the one the\n // container declares.\n //\n // The list is a popover, so it shows above everything, also inside a modal or a panel. It opens\n // upward when there is no room below and stays inside the window. The arrow keys move between\n // the options, Enter or Space chooses one, and a press outside, Escape or Tab closes the list;\n // Escape returns the focus to the trigger.\n //\n // <Select {options} bind:value onchange={apply} />\n let {\n options,\n value = $bindable(),\n placeholder = '',\n id,\n ariaLabel,\n disabled = false,\n error = false,\n onchange,\n }: {\n options: { value: T; label: string; description?: string }[];\n value?: T;\n /** The text on the trigger while nothing is chosen, faint */\n placeholder?: string;\n id?: string;\n /** The accessible name where no <label for> names it */\n ariaLabel?: string;\n disabled?: boolean;\n error?: boolean;\n onchange?: (value: T) => void;\n } = $props();\n\n const listId = $props.id();\n const current = $derived(options.find((o) => o.value === value));\n\n let open = $state(false);\n let placed = $state(false);\n let triggerEl = $state<HTMLButtonElement>();\n let listEl = $state<HTMLDivElement>();\n let pos = $state({ top: 0, left: 0, width: 0, maxHeight: 0 });\n\n // The distance from the trigger, the least distance from the window's edge, and the least height\n // below which the list opens on the other side\n const GAP = 4;\n const EDGE = 8;\n const MIN_HEIGHT = 120;\n\n // Without the popover API (a test environment) the list is a plain fixed element\n const canPopover =\n typeof HTMLElement !== 'undefined' && typeof HTMLElement.prototype.showPopover === 'function';\n\n function place() {\n if (!triggerEl || !listEl) return;\n const r = triggerEl.getBoundingClientRect();\n const keep = listEl.style.maxHeight;\n listEl.style.maxHeight = '';\n const natural = listEl.scrollHeight;\n listEl.style.maxHeight = keep;\n const below = window.innerHeight - r.bottom - GAP - EDGE;\n const above = r.top - GAP - EDGE;\n const up = below < Math.min(natural, MIN_HEIGHT) && above > below;\n const maxHeight = Math.max(MIN_HEIGHT, up ? above : below);\n const shown = Math.min(natural, maxHeight);\n const width = listEl.offsetWidth;\n const left = Math.max(\n EDGE,\n Math.min(r.left, window.innerWidth - Math.max(width, r.width) - EDGE),\n );\n pos = {\n top: Math.round(up ? r.top - GAP - shown : r.bottom + GAP),\n left: Math.round(left),\n width: Math.round(r.width),\n maxHeight: Math.round(maxHeight),\n };\n }\n\n function items(): HTMLElement[] {\n return listEl ? [...listEl.querySelectorAll<HTMLElement>('[role=\"option\"]')] : [];\n }\n function focusAt(index: number) {\n const all = items();\n if (all.length === 0) return;\n all[((index % all.length) + all.length) % all.length]?.focus();\n }\n\n function show() {\n if (disabled || open) return;\n placed = false;\n open = true;\n }\n function close(returnFocus: boolean) {\n open = false;\n if (returnFocus) triggerEl?.focus();\n }\n function choose(next: T) {\n value = next;\n onchange?.(next);\n close(true);\n }\n\n $effect(() => {\n if (!open || !listEl) return;\n const el = listEl;\n if (canPopover && !el.matches(':popover-open')) el.showPopover();\n void (async () => {\n await tick();\n place();\n placed = true;\n await tick();\n const i = options.findIndex((o) => o.value === value);\n focusAt(Math.max(0, i));\n })();\n });\n\n function onTriggerKey(e: KeyboardEvent) {\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n show();\n }\n }\n function onListKey(e: KeyboardEvent) {\n const all = items();\n const at = all.indexOf(document.activeElement as HTMLElement);\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n focusAt(at < 0 ? 0 : at + 1);\n } else if (e.key === 'ArrowUp') {\n e.preventDefault();\n focusAt(at < 0 ? all.length - 1 : at - 1);\n } else if (e.key === 'Home') {\n e.preventDefault();\n focusAt(0);\n } else if (e.key === 'End') {\n e.preventDefault();\n focusAt(all.length - 1);\n } else if (e.key === 'Escape') {\n // Escape closes the list and goes no further (a modal around it stays open)\n e.preventDefault();\n e.stopPropagation();\n close(true);\n } else if (e.key === 'Tab') {\n close(true);\n }\n }\n // A press outside the trigger and the list closes it; read in the capture phase, so that a\n // container that stops propagation does not keep it open\n function onPointerDown(e: PointerEvent) {\n if (!open) return;\n const target = e.target as Node;\n if (triggerEl?.contains(target) || listEl?.contains(target)) return;\n close(false);\n }\n</script>\n\n<svelte:window\n onpointerdowncapture={onPointerDown}\n onresize={() => open && place()}\n onscroll={() => open && place()}\n/>\n\n<button\n bind:this={triggerEl}\n type=\"button\"\n class=\"trigger\"\n class:err={error}\n class:disabled={disabled}\n data-role=\"box\"\n data-h=\"button\"\n {id}\n {disabled}\n aria-label={ariaLabel}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? listId : undefined}\n onclick={() => (open ? close(false) : show())}\n onkeydown={onTriggerKey}\n>\n {#if current}<span class=\"v\">{current.label}</span>{:else}<span class=\"v ph\" data-kata-placeholder\n >{placeholder}</span\n >{/if}\n <Icon name=\"chevron-down\" />\n</button>\n{#if open}\n <div\n bind:this={listEl}\n id={listId}\n class=\"list\"\n class:placed\n role=\"listbox\"\n tabindex=\"-1\"\n aria-label={ariaLabel}\n popover={canPopover ? 'manual' : undefined}\n onkeydown={onListKey}\n style:top={`${pos.top}px`}\n style:left={`${pos.left}px`}\n style:min-width={pos.width ? `${pos.width}px` : undefined}\n style:max-height={pos.maxHeight ? `${pos.maxHeight}px` : undefined}\n >\n {#each options as opt (opt.value)}\n <button\n type=\"button\"\n class=\"option\"\n class:two={!!opt.description}\n role=\"option\"\n aria-selected={opt.value === value}\n tabindex=\"-1\"\n data-role=\"list-item\"\n data-h=\"list-item\"\n onclick={() => choose(opt.value)}\n >\n <span class=\"chk\">{#if opt.value === value}<Icon name=\"check\" />{/if}</span>\n {#if opt.description}\n <span class=\"text\">\n <span class=\"t\">{opt.label}</span>\n <span class=\"t desc\">{opt.description}</span>\n </span>\n {:else}\n <span class=\"t label\">{opt.label}</span>\n {/if}\n </button>\n {/each}\n </div>\n{/if}\n\n<style>.trigger {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding-block: 0;\n padding-inline: var(--kata-pad-md);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n background: transparent;\n color: var(--kata-color-text);\n white-space: nowrap;\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;\n width: 100%;\n min-width: 0;\n justify-content: space-between;\n cursor: pointer;\n}\n.trigger[aria-expanded=true] {\n border-color: var(--kata-color-blue-ink);\n}\n\n.v {\n display: block;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.ph {\n color: var(--kata-color-faint);\n}\n\n.trigger :global(svg) {\n flex: none;\n}\n\n.err {\n border-color: var(--kata-color-red-ink);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n\n.list {\n position: fixed;\n inset: auto;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n overflow: auto;\n background: var(--kata-color-panel);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n color: var(--kata-color-text);\n min-width: min(12rem, 100vw - var(--kata-gap-md) * 2);\n max-width: calc(100vw - var(--kata-gap-md) * 2);\n visibility: hidden;\n}\n\n.list.placed {\n visibility: visible;\n}\n\n.option {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n width: 100%;\n min-height: var(--kata-height-list-item);\n padding-inline: var(--kata-pad-md);\n border: 0;\n background: none;\n color: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n text-align: start;\n cursor: pointer;\n flex: none;\n}\n.option:hover {\n background: var(--kata-color-raise);\n}\n.option:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}\n\n.option.two {\n padding-block: var(--kata-pad-md);\n}\n\n.chk {\n display: flex;\n width: var(--kata-height-icon);\n flex: none;\n}\n\n.text {\n display: flex;\n flex-direction: column;\n gap: var(--kata-gap-xs);\n min-width: 0;\n}\n\n.t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.label {\n flex: 1;\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.desc {\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { untrack } from 'svelte';\n import { getMessages } from '../messages.js';\n import Button from './Button.svelte';\n import ColorGrid from './ColorGrid.svelte';\n import Icon from './Icon.svelte';\n import NumberInput from './NumberInput.svelte';\n import Row from './Row.svelte';\n import Select from './Select.svelte';\n import Stack from './Stack.svelte';\n import Text from './Text.svelte';\n import TextInput from './TextInput.svelte';\n\n // ColorPicker: a board to pick one color. It stacks, gap-sm apart, the title and a close button,\n // a grid of preset colors (ColorGrid), the plane of saturation and value, the strip of hues with\n // an eyedropper, and the fields of the value (hex, or the components) with a Select of the\n // format. Opened in the content, the board draws its own surface and line; floating in a slot that\n // draws them (bare), it keeps only its padding, so that no line is drawn twice.\n //\n // The plane and the strip are pictures of the color space, so their colors are values, not roles\n // of the design; only their size is layout, and the edges of the knobs take color roles. The\n // eyedropper works where the browser has the EyeDropper API.\n //\n // <ColorPicker bind:value onpick={apply} onclose={() => (open = false)} />\n let {\n value = $bindable('#E5484D'),\n swatches = defaultSwatches(),\n format = 'hex',\n bare = false,\n title = getMessages().color,\n onpick,\n onclose,\n }: {\n /** The chosen color (#RRGGBB) */\n value?: string;\n /** The preset colors and their names, which screen readers say */\n swatches?: { name: string; hex: string }[];\n /** The format the fields start in */\n format?: Fmt;\n /** The slot around it draws the surface and the line; the board keeps its padding only */\n bare?: boolean;\n /** The title (Color by default) */\n title?: string;\n /** Called with the color picked and its name (the hex when it has none) */\n onpick?: (hex: string, name: string) => void;\n /** Called by the close button */\n onclose?: () => void;\n } = $props();\n\n type Fmt = 'hex' | 'rgb' | 'hsl';\n /** Nine preset colors, named from the messages */\n function defaultSwatches(): { name: string; hex: string }[] {\n const m = getMessages();\n return [\n { name: m.colorRed, hex: '#E5484D' },\n { name: m.colorOrange, hex: '#D9730D' },\n { name: m.colorGold, hex: '#C29210' },\n { name: m.colorGreen, hex: '#2E9E5B' },\n { name: m.colorBlue, hex: '#2D7FF9' },\n { name: m.colorPurple, hex: '#8A5CF6' },\n { name: m.colorBlack, hex: '#1B1B1B' },\n { name: m.colorBrown, hex: '#9A6B43' },\n { name: m.colorWhite, hex: '#FFFFFF' },\n ];\n }\n const formats: { value: Fmt; label: string }[] = [\n { value: 'hex', label: 'Hex' },\n { value: 'rgb', label: 'RGB' },\n { value: 'hsl', label: 'HSL' },\n ];\n\n // ── Color conversion (hex ↔ HSV) ───────────────────────────\n function clamp01(n: number): number {\n return Math.min(1, Math.max(0, n));\n }\n function hexToRgb(input: string): [number, number, number] | null {\n let v = input.trim().replace(/^#/, '');\n if (v.length === 3)\n v = v\n .split('')\n .map((c) => c + c)\n .join('');\n if (!/^[0-9a-fA-F]{6}$/.test(v)) return null;\n return [parseInt(v.slice(0, 2), 16), parseInt(v.slice(2, 4), 16), parseInt(v.slice(4, 6), 16)];\n }\n function rgbToHsv(r: number, g: number, b: number): { h: number; s: number; v: number } {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n let h = 0;\n if (d) {\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n return { h, s: max === 0 ? 0 : d / max, v: max };\n }\n function hsvToHex(h: number, s: number, v: number): string {\n const c = v * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m0 = v - c;\n let r = 0;\n let g = 0;\n let b = 0;\n if (h < 60) [r, g] = [c, x];\n else if (h < 120) [r, g] = [x, c];\n else if (h < 180) [g, b] = [c, x];\n else if (h < 240) [g, b] = [x, c];\n else if (h < 300) [r, b] = [x, c];\n else [r, b] = [c, x];\n const to2 = (n: number) =>\n Math.round((n + m0) * 255)\n .toString(16)\n .padStart(2, '0');\n return `#${to2(r)}${to2(g)}${to2(b)}`.toUpperCase();\n }\n function rgbToHex(r: number, g: number, b: number): string {\n const to2 = (n: number) => Math.round(n).toString(16).padStart(2, '0');\n return `#${to2(r)}${to2(g)}${to2(b)}`.toUpperCase();\n }\n function rgbToHsl(r: number, g: number, b: number): { h: number; s: number; l: number } {\n r /= 255;\n g /= 255;\n b /= 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const d = max - min;\n const l = (max + min) / 2;\n let h = 0;\n let sl = 0;\n if (d) {\n sl = d / (1 - Math.abs(2 * l - 1));\n if (max === r) h = ((g - b) / d) % 6;\n else if (max === g) h = (b - r) / d + 2;\n else h = (r - g) / d + 4;\n h *= 60;\n if (h < 0) h += 360;\n }\n return { h: Math.round(h), s: Math.round(sl * 100), l: Math.round(l * 100) };\n }\n function hslToRgb(h: number, s: number, l: number): [number, number, number] {\n s /= 100;\n l /= 100;\n const c = (1 - Math.abs(2 * l - 1)) * s;\n const x = c * (1 - Math.abs(((h / 60) % 2) - 1));\n const m0 = l - c / 2;\n let r = 0;\n let g = 0;\n let b = 0;\n if (h < 60) [r, g] = [c, x];\n else if (h < 120) [r, g] = [x, c];\n else if (h < 180) [g, b] = [c, x];\n else if (h < 240) [g, b] = [x, c];\n else if (h < 300) [r, b] = [x, c];\n else [r, b] = [c, x];\n return [Math.round((r + m0) * 255), Math.round((g + m0) * 255), Math.round((b + m0) * 255)];\n }\n\n // hex (the normalized internal value) and HSV (for SV/Hue interaction). HSV is the primary state for\n // interaction and the two stay in sync.\n let hex = $state(untrack(() => value));\n let fmt = $state<Fmt>(untrack(() => format));\n let h = $state(0);\n let s = $state(0);\n let v = $state(0);\n untrack(() => {\n const c = hexToRgb(value);\n if (c) ({ h, s, v } = rgbToHsv(...c));\n });\n\n // Pure hue used as the base of the SV plane (saturation/value 100%).\n const hueColor = $derived(hsvToHex(h, 1, 1));\n\n // Split the current color into components for the fields (hex is the source of truth). fmt decides\n // whether the Hex, RGB or HSL fields are shown.\n const rgb = $derived(hexToRgb(hex) ?? ([0, 0, 0] as [number, number, number]));\n const hsl = $derived(rgbToHsl(...rgb));\n\n let svEl = $state<HTMLDivElement>();\n let hueEl = $state<HTMLDivElement>();\n let svDragging = $state(false);\n let hueDragging = $state(false);\n\n function clampInt(raw: string | number, lo: number, hi: number): number {\n const n = Math.round(Number(raw));\n if (Number.isNaN(n)) return lo;\n return Math.min(hi, Math.max(lo, n));\n }\n // Commit HSV → hex and notify (also while dragging SV/Hue). The fields follow through the rgb/hsl derivations.\n function emitHsv() {\n hex = hsvToHex(h, s, v);\n value = hex;\n onpick?.(hex, hex);\n }\n // hex → HSV. Makes SV/Hue follow when a preset or a field changes the color.\n function syncHsvFromHex() {\n const c = hexToRgb(hex);\n if (c) ({ h, s, v } = rgbToHsv(...c));\n }\n // Commit hex, make SV/Hue follow and notify (shared by the fields, presets and eyedropper).\n function applyHex(next: string) {\n hex = next;\n value = next;\n syncHsvFromHex();\n onpick?.(hex, hex);\n }\n\n function pick(sw: { name: string; hex: string }) {\n hex = sw.hex;\n value = sw.hex;\n syncHsvFromHex();\n onpick?.(sw.hex, sw.name);\n }\n // Commit the Hex field. Accepts only #RRGGBB / #RGB; invalid input reverts to the current value.\n function commitHex(e: Event) {\n const el = e.currentTarget as HTMLInputElement;\n const c = hexToRgb(el.value.trim());\n if (c) applyHex(rgbToHex(...c));\n else el.value = hex;\n }\n // Commit one RGB component (the others come from the current color). Clamped to 0..255.\n function commitRgb(i: number, raw: string) {\n const next: [number, number, number] = [...rgb];\n next[i] = clampInt(raw, 0, 255);\n applyHex(rgbToHex(...next));\n }\n // Commit one HSL component. H is clamped to 0..359, S/L to 0..100 (%).\n function commitHsl(part: 'h' | 's' | 'l', raw: string) {\n let { h: H, s: S, l: L } = hsl;\n if (part === 'h') H = clampInt(raw, 0, 360) % 360;\n else if (part === 's') S = clampInt(raw, 0, 100);\n else L = clampInt(raw, 0, 100);\n applyHex(rgbToHex(...hslToRgb(H, S, L)));\n }\n\n // ── SV (saturation = x, value = y) ─────────────────────────\n function svAt(clientX: number, clientY: number) {\n const el = svEl;\n if (!el) return;\n const r = el.getBoundingClientRect();\n s = clamp01((clientX - r.left) / r.width);\n v = 1 - clamp01((clientY - r.top) / r.height);\n emitHsv();\n }\n function svDown(e: PointerEvent) {\n svDragging = true;\n svEl?.setPointerCapture(e.pointerId);\n svAt(e.clientX, e.clientY);\n }\n function svMove(e: PointerEvent) {\n if (svDragging) svAt(e.clientX, e.clientY);\n }\n function svUp(e: PointerEvent) {\n svDragging = false;\n svEl?.releasePointerCapture(e.pointerId);\n }\n function svKey(e: KeyboardEvent) {\n const step = 0.02;\n if (e.key === 'ArrowLeft') s = clamp01(s - step);\n else if (e.key === 'ArrowRight') s = clamp01(s + step);\n else if (e.key === 'ArrowUp') v = clamp01(v + step);\n else if (e.key === 'ArrowDown') v = clamp01(v - step);\n else return;\n e.preventDefault();\n emitHsv();\n }\n\n // ── Hue (0..360) ────────────────────────────────────────────\n function hueAt(clientX: number) {\n const el = hueEl;\n if (!el) return;\n const r = el.getBoundingClientRect();\n h = clamp01((clientX - r.left) / r.width) * 360;\n emitHsv();\n }\n function hueDown(e: PointerEvent) {\n hueDragging = true;\n hueEl?.setPointerCapture(e.pointerId);\n hueAt(e.clientX);\n }\n function hueMove(e: PointerEvent) {\n if (hueDragging) hueAt(e.clientX);\n }\n function hueUp(e: PointerEvent) {\n hueDragging = false;\n hueEl?.releasePointerCapture(e.pointerId);\n }\n function hueKey(e: KeyboardEvent) {\n const step = 2;\n if (e.key === 'ArrowLeft') h = (h - step + 360) % 360;\n else if (e.key === 'ArrowRight') h = (h + step) % 360;\n else return;\n e.preventDefault();\n emitHsv();\n }\n\n // Eyedropper (Chrome's EyeDropper API; does nothing where unsupported).\n async function useEyedropper() {\n const w = window as unknown as {\n EyeDropper?: new () => { open: () => Promise<{ sRGBHex: string }> };\n };\n if (!w.EyeDropper) return;\n try {\n const res = await new w.EyeDropper().open();\n applyHex(res.sRGBHex.toUpperCase());\n } catch {\n // Ignore a canceled pick.\n }\n }\n</script>\n\n{#snippet board()}\n <Stack gap=\"sm\">\n <Row between>\n <Text role=\"h2\">{title}</Text>\n <Button variant=\"ghost\" icon aria-label={getMessages().close} onclick={onclose}>\n <Icon name=\"x\" />\n </Button>\n </Row>\n\n <ColorGrid\n colors={swatches}\n value={hex}\n label={title}\n onselect={(picked) => {\n const sw = swatches.find((c) => c.hex === picked);\n if (sw) pick(sw);\n }}\n />\n\n <!-- The plane takes the pure hue as its ground -->\n <div\n class=\"sv\"\n bind:this={svEl}\n style:--kata-color-picker-hue={hueColor}\n role=\"slider\"\n aria-label={getMessages().saturationValue}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={Math.round(s * 100)}\n aria-valuetext={getMessages().saturationValueText({\n s: Math.round(s * 100),\n v: Math.round(v * 100),\n })}\n tabindex=\"0\"\n onpointerdown={svDown}\n onpointermove={svMove}\n onpointerup={svUp}\n onkeydown={svKey}\n >\n <span class=\"knob\" style:left=\"{s * 100}%\" style:top=\"{(1 - v) * 100}%\"></span>\n </div>\n\n <Row gap=\"sm\">\n <div\n class=\"hue\"\n bind:this={hueEl}\n role=\"slider\"\n aria-label={getMessages().hue}\n aria-valuemin={0}\n aria-valuemax={360}\n aria-valuenow={Math.round(h)}\n tabindex=\"0\"\n onpointerdown={hueDown}\n onpointermove={hueMove}\n onpointerup={hueUp}\n onkeydown={hueKey}\n >\n <span class=\"knob\" style:left=\"{(h / 360) * 100}%\" style:top=\"50%\"></span>\n </div>\n <Button variant=\"ghost\" icon aria-label={getMessages().eyedropper} onclick={useEyedropper}>\n <Icon name=\"pipette\" />\n </Button>\n </Row>\n\n <!-- A row of controls, which wraps when it does not fit -->\n <Row gap=\"sm\" wrap>\n {#if fmt === 'rgb'}\n {#each ['R', 'G', 'B'] as label, i (label)}\n <NumberInput\n value={rgb[i]}\n unit={label}\n min={0}\n max={255}\n ariaLabel={label}\n onchange={(e) => commitRgb(i, e.currentTarget.value)}\n />\n {/each}\n {:else if fmt === 'hsl'}\n <NumberInput\n value={hsl.h}\n unit=\"H\"\n min={0}\n max={360}\n ariaLabel={getMessages().hue}\n onchange={(e) => commitHsl('h', e.currentTarget.value)}\n />\n <NumberInput\n value={hsl.s}\n unit=\"S\"\n min={0}\n max={100}\n ariaLabel={getMessages().saturation}\n onchange={(e) => commitHsl('s', e.currentTarget.value)}\n />\n <NumberInput\n value={hsl.l}\n unit=\"L\"\n min={0}\n max={100}\n ariaLabel={getMessages().lightness}\n onchange={(e) => commitHsl('l', e.currentTarget.value)}\n />\n {:else}\n <TextInput mono value={hex} onchange={commitHex} aria-label={getMessages().colorCode} />\n {/if}\n <div class=\"fmt\">\n <Select options={formats} bind:value={fmt} />\n </div>\n </Row>\n </Stack>\n{/snippet}\n\n<div class=\"cp\" class:bare data-inset data-role={bare ? 'block' : 'card'}>{@render board()}</div>\n\n<style>.cp {\n width: 15rem;\n max-width: 100%;\n flex: 0 0 auto;\n pointer-events: auto;\n background: var(--kata-color-panel);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n padding: var(--kata-pad-md);\n --kata-inset: 0px;\n --kata-at-start: 1;\n --kata-at-end: 1;\n min-width: 0;\n --kata-box: var(--kata-height-button);\n}\n\n.cp.bare {\n background: none;\n border: 0;\n}\n\n.sv {\n position: relative;\n height: 7.5rem;\n background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, var(--kata-color-picker-hue, #0033ff));\n}\n\n.hue {\n position: relative;\n flex: 1 1 auto;\n min-width: 0;\n height: 0.5rem;\n background-image: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);\n}\n\n.knob {\n position: absolute;\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n border: calc(var(--kata-border-width) * 2) solid var(--kata-color-panel);\n box-shadow: 0 0 0 var(--kata-border-width) var(--kata-color-text);\n transform: translate(-50%, -50%);\n}\n\n.fmt {\n flex: 0 0 auto;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // Spinner: a short wait. Three dots that pulse; nothing turns or blinks. It has no color or\n // size of its own: it follows the text around it. The dots are an icon ÷ φ² square, gap-2xs\n // apart, gap-sm from the label; the label is text that is not trimmed. With reduced motion the\n // dots rest at three strengths.\n //\n // <Spinner /> <Spinner label=\"Saving\" />\n let {\n label,\n }: {\n /** The words after the dots */\n label?: string;\n } = $props();\n</script>\n\n<span class=\"seat\" data-role=\"spinner\" data-edge-pass role=\"status\"\n ><span class=\"dots\" aria-hidden=\"true\"><i></i><i></i><i></i></span\n >{#if label}<span class=\"t\">{label}</span>{/if}</span\n>\n\n<style>.seat {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n min-width: 0;\n}\n\n.dots {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-2xs);\n}\n\n.dots i {\n display: inline-block;\n width: var(--kata-size-xs-rem);\n height: var(--kata-size-xs-rem);\n background: var(--kata-color-muted);\n animation: pulse 1.2s ease-in-out infinite;\n}\n\n.dots i:nth-child(2) {\n opacity: 0.6;\n animation-delay: 0.15s;\n}\n\n.dots i:nth-child(3) {\n opacity: 0.3;\n animation-delay: 0.3s;\n}\n\n@keyframes pulse {\n 0%, 100% {\n opacity: 0.25;\n }\n 50% {\n opacity: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .dots i {\n animation: none;\n }\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import Actions from './Actions.svelte';\n import Spinner from './Spinner.svelte';\n import Stack from './Stack.svelte';\n\n // State: what a place shows when it is empty, loading or has failed: one sentence and at most\n // one note, at the start, and one action at the end (as in Actions); no picture and no heading.\n // No padding: the padding of the container it sits in applies. The sentence and the note are\n // not trimmed; sentence, note and action are gap-sm apart. A failure is a red sentence.\n //\n // <State text=\"Nothing is here yet.\" note=\"Drop a file, or…\">\n // {#snippet actions()}<Button>Add a file</Button>{/snippet}\n // </State>\n // <State loading text=\"Loading\" /> <State tone=\"error\" text=\"It could not be loaded.\" />\n let {\n text,\n note,\n tone,\n loading = false,\n actions,\n }: {\n /** The sentence */\n text: string;\n /** One sentence under it, as a caption */\n note?: string;\n /** error: a failure */\n tone?: 'error';\n /** Loading: a Spinner with the sentence as its label */\n loading?: boolean;\n /** One action */\n actions?: Snippet;\n } = $props();\n</script>\n\n<div class=\"state\" data-role=\"state\" data-pass>\n <Stack gap=\"sm\">\n {#if loading}\n <Spinner label={text} />\n {:else}\n <p class=\"t\" class:error={tone === 'error'} data-role=\"p\">{text}</p>\n {/if}\n {#if note}<span class=\"note\" data-role=\"caption\">{note}</span>{/if}\n {#if actions}<Actions primary={actions} />{/if}\n </Stack>\n</div>\n\n<style>.state {\n color: var(--kata-color-muted);\n min-width: 0;\n --kata-box: var(--kata-height-button);\n}\n\n.t {\n display: block;\n margin: 0;\n color: var(--kata-color-text);\n min-width: 0;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n}\n\n.t.error {\n color: var(--kata-color-red-ink);\n}\n\n.note {\n display: block;\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n color: var(--kata-color-muted);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Footer: the actions at the bottom of a modal or a panel, in a fixed order: lead on the left,\n // then secondary, cancel and primary on the right. A destructive action does not go here (it is\n // the primary action of a confirmation). The height is a button plus pad-md above and below; the\n // sides are pad-md and a line runs along the top. When the actions do not fit beside the lead, the\n // whole group moves below it; below 48rem everything stacks at full width, primary first.\n //\n // <Footer>\n // {#snippet cancel()}…{/snippet}\n // {#snippet primary()}…{/snippet}\n // </Footer>\n let {\n lead,\n secondary,\n cancel,\n primary,\n }: {\n /** A status or an action on the left */\n lead?: Snippet;\n secondary?: Snippet;\n cancel?: Snippet;\n primary?: Snippet;\n } = $props();\n</script>\n\n<div class=\"footer\" data-role=\"footer\" data-h=\"footer\">\n {#if lead}<div class=\"lead\">{@render lead()}</div>{/if}\n <div class=\"actions\">\n {@render secondary?.()}\n {@render cancel?.()}\n {@render primary?.()}\n </div>\n</div>\n\n<style>.footer {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n align-items: center;\n gap: var(--kata-gap-sm);\n min-height: var(--kata-height-footer);\n padding: var(--kata-pad-md);\n border-top: var(--kata-border-width) solid var(--kata-color-line);\n flex: none;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n --kata-box: var(--kata-height-button);\n}\n\n.lead {\n margin-right: auto;\n display: flex;\n align-items: center;\n min-width: 0;\n flex: 1 1 auto;\n}\n\n.actions {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: var(--kata-gap-sm);\n margin-left: auto;\n flex: none;\n max-width: 100%;\n}\n\n@container app (width < 48rem) {\n .footer {\n flex-direction: column;\n align-items: stretch;\n }\n .actions {\n flex-direction: column-reverse;\n align-items: stretch;\n margin-left: 0;\n }\n .lead {\n order: 1;\n margin-right: 0;\n }\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Toolbar: the head of a container (a Panel, a modal, a sheet). Its height is fixed: a small\n // button with pad-md above and below, which is what it holds; pad-md at the sides. The title is\n // h2 on one line with an ellipsis, the actions sit at the right end. When the last action is an\n // icon button, tail makes the padding on the right pad-sm, so the icon's strokes line up with the\n // edge of the content below. two lets a title with a second line grow, with pad-md above and\n // below. Without a title the children are free. Tabs inside a Toolbar take its height and meet\n // its line on their own.\n //\n // <Toolbar title=\"Contents\" rule tail>\n // {#snippet end()}<Button variant=\"ghost\" icon aria-label=\"Add\"><Icon name=\"plus\" /></Button>{/snippet}\n // </Toolbar>\n let {\n title,\n titleId,\n rule = false,\n tail = false,\n two = false,\n start,\n end,\n children,\n }: {\n /** The title, h2 on one line */\n title?: string;\n /** The id of the title, for aria-labelledby */\n titleId?: string;\n /** A line along the bottom */\n rule?: boolean;\n /** The last action is an icon button */\n tail?: boolean;\n /** A title with a second line: the height grows with its content */\n two?: boolean;\n /** Before the title (back, close) */\n start?: Snippet;\n /** After the title, at the right end (the actions) */\n end?: Snippet;\n /** Free content, after the title */\n children?: Snippet;\n } = $props();\n</script>\n\n<div\n class=\"bar\"\n class:rule\n class:tail\n class:two\n data-role=\"toolbar\"\n data-h={two ? undefined : 'toolbar'}\n>\n {@render start?.()}\n {#if title}<h2 class=\"title\" id={titleId}>{title}</h2>{/if}\n {@render children?.()}\n {#if end}<div class=\"end\">{@render end()}</div>{/if}\n</div>\n\n<style>.bar {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-height-toolbar);\n padding-inline: var(--kata-pad-md);\n flex: none;\n min-width: 0;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n --kata-box: var(--kata-height-button-sm);\n}\n.bar > :global(*) {\n white-space: nowrap;\n}\n\n.tail {\n padding-inline-end: var(--kata-pad-sm);\n}\n\n.two {\n height: auto;\n min-height: var(--kata-height-toolbar);\n padding-block: var(--kata-pad-md);\n align-items: flex-start;\n}\n\n.two .title {\n white-space: normal;\n}\n\n.rule {\n border-bottom: var(--kata-border-width) solid var(--kata-color-line);\n}\n\n.title {\n flex: 1;\n font-size: var(--kata-text-size-h2);\n line-height: var(--kata-text-leading-h2);\n letter-spacing: var(--kata-text-tracking-h2);\n font-weight: 600;\n margin: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.end {\n display: flex;\n align-items: center;\n gap: 0;\n margin-left: auto;\n flex: none;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { tick } from 'svelte';\n import { createNarrow } from '../lib/viewport.svelte.js';\n import { getMessages } from '../messages.js';\n import Actions from './Actions.svelte';\n import Button from './Button.svelte';\n import Footer from './Footer.svelte';\n import Icon from './Icon.svelte';\n import Stack from './Stack.svelte';\n import Text from './Text.svelte';\n import Toolbar from './Toolbar.svelte';\n\n // Modal: a container laid over the screen. From top to bottom: the head (a Toolbar with the title\n // and the close button, and a line below), an optional band for steps (sub), the body and the Footer. Only the\n // body shrinks and scrolls. The body has pad-md inside and stacks its children gap-md apart; flush\n // drops the padding, for content that reaches the edges and holds its own. The Footer fixes the\n // order of the actions, so the application only fills its slots.\n //\n // Below 48rem it fills the screen and the Footer's actions move into the head: the close button\n // (or back, with onback) at the start and the primary action (or the status) at the end; the\n // secondary action and the status move to Actions at the end of the body. A confirmation stays a\n // small dialog in the centre.\n //\n // Opening and closing, Escape, the scrim, the first focus and the ARIA attributes are fixed. It is\n // a <dialog> opened with showModal(): the focus stays inside and the page behind is inert.\n //\n // inline draws the same surface in the flow of a page, without a scrim, a <dialog> or a change of\n // size, for documentation.\n //\n // <Modal bind:open title=\"New document\">\n // <Field …>…</Field>\n // {#snippet cancel()}<Button onclick={() => (open = false)}>Cancel</Button>{/snippet}\n // {#snippet primary()}<Button variant=\"primary\" onclick={create}>Create</Button>{/snippet}\n // </Modal>\n let {\n open = $bindable(false),\n title,\n size = 'md',\n confirm = false,\n persistent = false,\n flush = false,\n inline = false,\n onclose,\n onback,\n children,\n sub,\n lead,\n secondary,\n cancel,\n primary,\n status,\n }: {\n open?: boolean;\n title: string;\n /** The width: sm 25rem, md 35rem, lg 45rem or xl 60rem. A confirmation is sm */\n size?: 'sm' | 'md' | 'lg' | 'xl';\n /** A confirmation: the scrim does not close it and it never fills the screen */\n confirm?: boolean;\n /** Cannot be closed: no close button, and neither Escape nor the scrim closes it */\n persistent?: boolean;\n /** The body reaches the edges; the content holds its own padding */\n flush?: boolean;\n /** The same surface in the flow of a page, for documentation (open is ignored) */\n inline?: boolean;\n /** Called once when the modal closes, however it closes */\n onclose?: () => void;\n /** On a full screen, the start of the head is back instead of close and calls this */\n onback?: () => void;\n children: Snippet;\n /** A band under the head, for steps; it does not scroll with the body */\n sub?: Snippet;\n /** The left end of the Footer: a status or a third outcome */\n lead?: Snippet;\n secondary?: Snippet;\n cancel?: Snippet;\n primary?: Snippet;\n /** The status of a modal that saves as it goes, at the left end of the Footer */\n status?: string;\n } = $props();\n\n let dialog = $state<HTMLDialogElement>();\n const titleId = $props.id();\n\n const narrow = createNarrow(48);\n $effect(narrow.start);\n const full = $derived(narrow.current && !confirm && !inline);\n\n const hasFoot = $derived(!!(lead || status || secondary || cancel || primary));\n // On a full screen with back, the secondary action is back itself; it does not show again\n const bodySecondary = $derived(full && onback ? undefined : secondary);\n // On a full screen the primary action takes the end of the head, so the status moves to the body\n const hasBodyActions = $derived(!!(lead || (status && primary) || bodySecondary));\n\n $effect(() => {\n const d = dialog;\n if (!d) return;\n if (open && !d.open) d.showModal();\n else if (!open && d.open) d.close();\n });\n\n // The first focus: cancel in a confirmation; otherwise the first input of the body, else the\n // primary action. showModal() would focus the close button of the head, so the focus is moved\n // after opening.\n $effect(() => {\n if (!open) return;\n const d = dialog;\n if (!d) return;\n tick().then(() => {\n const seats = [\n ...d.querySelectorAll<HTMLElement>(\n '[data-role=\"footer\"] button, [data-role=\"footer\"] a[href]',\n ),\n ];\n const target = confirm\n ? seats[0]\n : (d.querySelector<HTMLElement>(\n '.body input:not([type=\"hidden\"]), .body textarea, .body select',\n ) ??\n seats[seats.length - 1] ??\n d.querySelector<HTMLElement>(':scope > [data-role=\"toolbar\"] .end button'));\n target?.focus();\n });\n });\n\n // The close button and the scrim only ask to close. The modal closes on the dialog's close event,\n // the one place that calls onclose; Escape and open = false take the same path.\n function requestClose() {\n open = false;\n }\n\n function onDialogClose() {\n open = false;\n onclose?.();\n }\n</script>\n\n{#snippet statusLead()}<Text role=\"caption\">{status}</Text>{/snippet}\n\n{#snippet closeButton()}\n <Button variant=\"ghost\" icon aria-label={getMessages().close} onclick={requestClose}>\n <Icon name=\"x\" />\n </Button>\n{/snippet}\n\n{#snippet backButton()}\n <Button variant=\"ghost\" icon aria-label={getMessages().back} onclick={() => onback?.()}>\n <Icon name=\"arrow-left\" />\n </Button>\n{/snippet}\n\n{#snippet fullStart()}\n {#if onback}{@render backButton()}{:else if !persistent}{@render closeButton()}{/if}\n{/snippet}\n{#snippet fullEnd()}\n {#if primary}{@render primary()}{:else if status}{@render statusLead()}{/if}\n{/snippet}\n\n{#snippet surface()}\n {#if full}\n <Toolbar\n {title}\n {titleId}\n rule\n tail={!primary}\n start={fullStart}\n end={primary || status ? fullEnd : undefined}\n />\n {:else if persistent}\n <Toolbar {title} {titleId} rule />\n {:else}\n <Toolbar {title} {titleId} rule tail end={closeButton} />\n {/if}\n {#if sub}\n <div class=\"sub\">{@render sub()}</div>\n {/if}\n <div class=\"body\" data-inset={flush ? undefined : true} class:flush>\n {#if flush}\n {@render children()}\n {:else}\n <Stack gap=\"md\">\n {@render children()}\n {#if full && hasBodyActions}\n <Actions\n lead={lead ?? (status && primary ? statusLead : undefined)}\n secondary={bodySecondary}\n />\n {/if}\n </Stack>\n {/if}\n </div>\n {#if !full && hasFoot}\n <Footer lead={lead ?? (status ? statusLead : undefined)} {secondary} {cancel} {primary} />\n {/if}\n{/snippet}\n\n{#if inline}\n <div\n class=\"modal {size}\"\n class:confirm\n data-role=\"modal\"\n data-inline\n aria-labelledby={titleId}\n role={confirm ? 'alertdialog' : 'dialog'}\n >\n {@render surface()}\n </div>\n{:else}\n <dialog\n bind:this={dialog}\n class=\"modal {size}\"\n class:confirm\n class:full\n data-role=\"modal\"\n aria-labelledby={titleId}\n aria-modal=\"true\"\n role={confirm ? 'alertdialog' : 'dialog'}\n onclose={onDialogClose}\n oncancel={(e) => persistent && e.preventDefault()}\n onclick={(e) => e.target === dialog && !confirm && !persistent && requestClose()}\n >\n {@render surface()}\n </dialog>\n{/if}\n\n<style>.modal {\n margin: auto;\n padding: 0;\n max-width: none;\n max-height: calc(100% - var(--kata-gap-lg) * 2);\n color: var(--kata-color-text);\n background: var(--kata-color-panel);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n display: flex;\n flex-direction: column;\n width: min(var(--kata-modal-width), 100% - var(--kata-gap-lg) * 2);\n --kata-box: var(--kata-height-button);\n}\n.modal:not([open]):not([data-inline]) {\n display: none;\n}\n.modal::backdrop {\n background: var(--kata-color-scrim);\n}\n\n.sm {\n --kata-modal-width: var(--kata-width-modal-sm);\n}\n\n.md {\n --kata-modal-width: var(--kata-width-modal-md);\n}\n\n.lg {\n --kata-modal-width: var(--kata-width-modal-lg);\n}\n\n.xl {\n --kata-modal-width: var(--kata-width-modal-xl);\n}\n\n.modal.confirm {\n width: min(var(--kata-width-modal-sm), 100% - var(--kata-gap-md) * 2);\n}\n\n.modal.full {\n width: 100%;\n max-width: 100%;\n height: 100%;\n max-height: 100%;\n border: 0;\n}\n\n.modal[data-inline] {\n margin: 0;\n max-height: none;\n width: min(var(--kata-modal-width), 100%);\n}\n\n.sub {\n padding: var(--kata-pad-sm) var(--kata-pad-md);\n border-bottom: var(--kata-border-width) solid var(--kata-color-line);\n flex: none;\n}\n\n.body {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n display: flex;\n flex-direction: column;\n}\n.body > :global(*) {\n flex: none;\n}\n\n.body:not(.flush) {\n padding: var(--kata-pad-md);\n --kata-inset: 0px;\n --kata-at-start: 1;\n --kata-at-end: 1;\n}\n\n.body.flush {\n padding: 0;\n --kata-inset: var(--kata-pad-md);\n --kata-at-start: 0;\n --kata-at-end: 0;\n}</style>\n","// Which items of a bar of equal buttons fit in a width. The items are in groups: the buttons of a\n// group are itemGap apart and the groups groupGap apart. When the items do not all fit, a button\n// for the rest (\"More\") takes a group of its own at the end, the item at `keep` always shows, and\n// the others show from the start as long as they fit.\n/** The width of a bar that shows the given items, with or without the button for the rest */\nexport function barWidth(groups, shown, m, more) {\n const counts = new Map();\n for (const i of shown)\n counts.set(groups[i], (counts.get(groups[i]) ?? 0) + 1);\n let width = m.chrome;\n let n = 0;\n for (const count of counts.values()) {\n width += count * m.button + (count - 1) * m.itemGap;\n n += 1;\n }\n if (more) {\n width += m.button;\n n += 1;\n }\n return width + Math.max(0, n - 1) * m.groupGap;\n}\n/**\n * The indexes of the items that show, in order, or null when all of them fit.\n * @param groups the group of each item, in order\n * @param keep the index of the item that always shows, or -1\n */\nexport function fitBar(groups, keep, m) {\n const all = groups.map((_, i) => i);\n // Half a pixel of room for rounding\n const room = m.available + 0.5;\n if (barWidth(groups, all, m, false) <= room)\n return null;\n const chosen = new Set();\n if (keep >= 0 && keep < groups.length)\n chosen.add(keep);\n for (const i of all) {\n if (chosen.has(i))\n continue;\n if (barWidth(groups, [...chosen, i], m, true) > room)\n break;\n chosen.add(i);\n }\n return [...chosen].sort((a, b) => a - b);\n}\n","<script lang=\"ts\" module>\n import type { IconSource } from '../icons.js';\n\n /** One tool of a Drawbar */\n export interface DrawbarTool {\n id: string;\n /** The name of the tool, read by assistive technology */\n label: string;\n icon: IconSource;\n /** The key that picks the tool, shown in its tooltip */\n kbd?: string;\n /** Tools with the same group sit together; groups are gap-md apart */\n group?: string;\n /** A tool that removes something: red on hover */\n tone?: 'danger';\n disabled?: boolean;\n }\n\n /** One switch of a Drawbar: an aid that is on or off (snapping, a grid), after the tools */\n export interface DrawbarToggle {\n id: string;\n /** The name of the switch, read by assistive technology and shown in its tooltip */\n label: string;\n icon: IconSource;\n on: boolean;\n /** Called with the state the switch asks for */\n onchange: (on: boolean) => void;\n /** The key that switches it, shown in its tooltip */\n kbd?: string;\n disabled?: boolean;\n }\n</script>\n\n<script lang=\"ts\">\n import '../styles/components.css';\n import { untrack } from 'svelte';\n import { fitBar } from '../lib/fitBar.js';\n import { getMessages } from '../messages.js';\n import Button from './Button.svelte';\n import Dropdown from './Dropdown.svelte';\n import Icon from './Icon.svelte';\n import MenuDivider from './MenuDivider.svelte';\n import MenuItem from './MenuItem.svelte';\n\n // Drawbar: the toolbar of drawing tools that floats at the bottom centre of the stage.\n // Each tool is a ghost icon button; the current tool is on. Tools with the same group sit side by\n // side and the groups are gap-md apart, with pad-sm inside and one line around the whole bar (no\n // lines between tools). A tool with tone=\"danger\" turns red on hover. The switches (toggles), such\n // as snapping, form one more group after the tools; a switch that is on is pressed.\n //\n // It is placed absolutely in its positioned container, centred; bottom is its distance from the\n // container's bottom edge, a step of the gap scale. When the bar does not fit the container, the\n // tools and switches that do not fit fold into a \"More\" menu at the right end: the current tool\n // always shows, then the others from the start as long as they fit. Pressing a tool calls\n // onselect with its id; the application decides what is current. Pressing a switch calls its\n // onchange with the state it asks for. Each button shows its name and its key in a Tooltip.\n //\n // <Drawbar label=\"Tools\" {tools} {toggles} current={tool} onselect={(id) => (tool = id)} />\n type Step = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n let {\n tools,\n toggles = [],\n current,\n onselect,\n label,\n bottom = 'md',\n }: {\n /** The tools, in order */\n tools: DrawbarTool[];\n /** The switches after the tools, in order */\n toggles?: DrawbarToggle[];\n /** The id of the current tool */\n current?: string;\n /** Called with the id of the tool that is pressed */\n onselect?: (id: string) => void;\n /** The name of the bar */\n label?: string;\n /** The distance from the bottom edge of the container: 0 or a gap step */\n bottom?: 0 | Step;\n } = $props();\n\n type Item = { kind: 'tool'; tool: DrawbarTool } | { kind: 'toggle'; toggle: DrawbarToggle };\n\n // The items in order, and the group of each: consecutive tools of the same group form one group,\n // and the switches one more\n const items = $derived<Item[]>([\n ...tools.map((tool): Item => ({ kind: 'tool', tool })),\n ...toggles.map((toggle): Item => ({ kind: 'toggle', toggle })),\n ]);\n const groupOf = $derived.by(() => {\n const out: number[] = [];\n let g = -1;\n let last: string | undefined;\n for (const [i, t] of tools.entries()) {\n if (i === 0 || t.group !== last) g += 1;\n out.push(g);\n last = t.group;\n }\n return [...out, ...toggles.map(() => g + 1)];\n });\n const keep = $derived(tools.findIndex((t) => t.id === current));\n\n let bar = $state<HTMLElement>();\n // The indexes of the items that show, or null when all fit\n let shownIdx = $state<number[] | null>(null);\n $effect(() => {\n const el = bar;\n const container = el?.parentElement;\n if (!el || !container) return;\n const groups = groupOf;\n const k = keep;\n const px = (v: string) => Number.parseFloat(v) || 0;\n const read = () => {\n const cs = getComputedStyle(el);\n const group = el.querySelector<HTMLElement>('.group');\n const button = el.querySelector<HTMLElement>('[data-h=\"icon-button\"]');\n const next = fitBar(groups, k, {\n button: button?.getBoundingClientRect().width ?? 0,\n itemGap: group ? px(getComputedStyle(group).columnGap) : 0,\n groupGap: px(cs.columnGap),\n chrome:\n px(cs.paddingLeft) +\n px(cs.paddingRight) +\n px(cs.borderLeftWidth) +\n px(cs.borderRightWidth),\n // The bar keeps gap-md from each side of its container, the same as its gap\n available: container.clientWidth - 2 * px(cs.columnGap),\n });\n if (String(next) !== String(untrack(() => shownIdx))) shownIdx = next;\n };\n read();\n if (typeof ResizeObserver === 'undefined') return;\n // The container's width, and the bar's own size, which follows the text size\n const ro = new ResizeObserver(read);\n ro.observe(container);\n ro.observe(el);\n return () => ro.disconnect();\n });\n\n const shown = $derived.by(() => {\n const set = shownIdx ? new Set(shownIdx) : null;\n const out: Item[][] = [];\n let last = -1;\n for (const [i, item] of items.entries()) {\n if (set && !set.has(i)) continue;\n if (groupOf[i] !== last) out.push([]);\n out[out.length - 1].push(item);\n last = groupOf[i];\n }\n return out;\n });\n const hidden = $derived(shownIdx ? items.filter((_, i) => !shownIdx?.includes(i)) : []);\n const hiddenTools = $derived(hidden.flatMap((h) => (h.kind === 'tool' ? [h.tool] : [])));\n const hiddenToggles = $derived(hidden.flatMap((h) => (h.kind === 'toggle' ? [h.toggle] : [])));\n const key = (item: Item) => `${item.kind}:${item.kind === 'tool' ? item.tool.id : item.toggle.id}`;\n</script>\n\n<div\n class=\"drawbar\"\n data-role=\"drawbar\"\n role=\"toolbar\"\n aria-label={label}\n style:bottom={bottom === 0 ? '0' : `var(--kata-gap-${bottom})`}\n bind:this={bar}\n>\n {#each shown as group, g (g)}\n <div class=\"group\">\n {#each group as item (key(item))}\n {#if item.kind === 'tool'}\n {@const t = item.tool}\n <Button\n variant=\"ghost\"\n icon\n on={t.id === current}\n tone={t.tone}\n disabled={t.disabled}\n aria-label={t.label}\n aria-keyshortcuts={t.kbd}\n shortcut={t.kbd}\n aria-pressed={t.id === current}\n onclick={() => onselect?.(t.id)}><Icon name={t.icon} /></Button\n >\n {:else}\n {@const s = item.toggle}\n <Button\n variant=\"ghost\"\n icon\n on={s.on}\n disabled={s.disabled}\n aria-label={s.label}\n aria-keyshortcuts={s.kbd}\n shortcut={s.kbd}\n aria-pressed={s.on}\n onclick={() => s.onchange(!s.on)}><Icon name={s.icon} /></Button\n >\n {/if}\n {/each}\n </div>\n {/each}\n {#if hidden.length}\n <div class=\"group\">\n <Dropdown align=\"end\" menu role=\"icon-button\">\n {#snippet trigger(toggle, open)}\n <Button\n variant=\"ghost\"\n icon\n aria-label={getMessages().more}\n aria-haspopup=\"menu\"\n aria-expanded={open}\n onclick={toggle}><Icon name=\"ellipsis\" /></Button\n >\n {/snippet}\n {#snippet panel(close)}\n {#each hiddenTools as t (t.id)}\n <MenuItem\n icon={t.icon}\n kbd={t.kbd}\n danger={t.tone === 'danger'}\n disabled={t.disabled}\n onclick={() => {\n onselect?.(t.id);\n close();\n }}>{t.label}</MenuItem\n >\n {/each}\n {#if hiddenTools.length && hiddenToggles.length}<MenuDivider />{/if}\n {#each hiddenToggles as s (s.id)}\n <MenuItem\n checked={s.on}\n kbd={s.kbd}\n disabled={s.disabled}\n onclick={() => {\n s.onchange(!s.on);\n close();\n }}>{s.label}</MenuItem\n >\n {/each}\n {/snippet}\n </Dropdown>\n </div>\n {/if}\n</div>\n\n<style>.drawbar {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n z-index: var(--kata-z-floating);\n display: flex;\n align-items: center;\n gap: var(--kata-gap-md);\n padding: var(--kata-pad-sm);\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n max-width: calc(100% - var(--kata-gap-md) * 2);\n overflow-x: auto;\n --kata-box: var(--kata-height-button);\n}\n.drawbar > :global(*) {\n flex: none;\n}\n\n.group {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-2xs);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import Pair from './Pair.svelte';\n\n // InspectorRow: one setting of an inspector, a Pair of a name and a value. The name column is the\n // Pair's (7.5rem, muted); the value is a control, or a value read (ReadValue). With align=\"start\"\n // (the default) the control fills the value column; with align=\"end\" it keeps its own width at\n // the right end (a switch, a count). small is for a control of a small button's height (a Slider,\n // a Toggle): the row takes that height, so that the name and the control stay level and the row\n // is as tall as what it shows. hint is a caption under the value.\n //\n // <InspectorRow label=\"Width\"><NumberInput value={2} unit=\"px\" ariaLabel=\"Width\" /></InspectorRow>\n // <InspectorRow label=\"Visible\" align=\"end\" small><Toggle ariaLabel=\"Visible\" /></InspectorRow>\n let {\n label,\n for: htmlFor,\n hint,\n align = 'start',\n small = false,\n children,\n }: {\n /** The name */\n label: string;\n /** The id of the control that the name labels */\n for?: string;\n /** A caption under the value */\n hint?: string;\n /** start fills the value column; end keeps the value's width at the right end */\n align?: 'start' | 'end';\n /** The value is a control of a small button's height */\n small?: boolean;\n /** The control or the value */\n children: Snippet;\n } = $props();\n</script>\n\n<div class=\"inspector-row\" class:small>\n <Pair {label} for={htmlFor} note={hint}>\n {#if align === 'end'}\n <span class=\"end\">{@render children()}</span>\n {:else}\n {@render children()}\n {/if}\n </Pair>\n</div>\n\n<style>.inspector-row {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: none;\n}\n\n.small {\n --kata-box: var(--kata-height-button-sm);\n}\n\n.end {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n min-width: 0;\n}</style>\n","<script lang=\"ts\" generics=\"T extends string\">\n import '../styles/components.css';\n import Icon from './Icon.svelte';\n\n // NativeSelect: a select that looks like a trigger and opens the browser's own list. Use it on\n // phones and for long lists (languages, time zones); a Select, with its own list, is for five\n // options or more that carry a description. The control (a <label>) draws the line, holds the\n // height, the padding at the sides and the chevron on the right; the bare select inside is\n // transparent. The height is the one the container declares.\n //\n // <Field label=\"Language\" for=\"lang\"><NativeSelect id=\"lang\" {options} bind:value /></Field>\n let {\n options = [],\n groups,\n value = $bindable(),\n placeholder,\n id,\n ariaLabel,\n disabled = false,\n error = false,\n onchange,\n }: {\n /** An option that is disabled shows that it cannot be chosen now, without hiding it */\n options?: { value: T; label: string; disabled?: boolean }[];\n /** Options under headings, shown before options */\n groups?: { label: string; options: { value: T; label: string }[] }[];\n value?: T;\n /** The first line while nothing is chosen, shown faint; it goes once a value is chosen */\n placeholder?: string;\n id?: string;\n /** The accessible name where no <label for> names it */\n ariaLabel?: string;\n disabled?: boolean;\n error?: boolean;\n onchange?: (value: T) => void;\n } = $props();\n</script>\n\n<label class=\"trigger\" class:err={error} class:disabled={disabled} data-role=\"box\" data-h=\"button\">\n <select\n {id}\n {disabled}\n required={placeholder !== undefined}\n aria-label={ariaLabel}\n aria-invalid={error || undefined}\n bind:value\n onchange={(e) => onchange?.(e.currentTarget.value as T)}\n >\n {#if placeholder !== undefined}\n <option value=\"\" disabled data-kata-placeholder>{placeholder}</option>\n {/if}\n {#each groups ?? [] as group (group.label)}\n <optgroup label={group.label}>\n {#each group.options as opt (opt.value)}\n <option value={opt.value}>{opt.label}</option>\n {/each}\n </optgroup>\n {/each}\n {#each options as opt (opt.value)}\n <option value={opt.value} disabled={opt.disabled}>{opt.label}</option>\n {/each}\n </select>\n <Icon name=\"chevron-down\" />\n</label>\n\n<style>.trigger {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding-block: 0;\n padding-inline: var(--kata-pad-md);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n background: transparent;\n color: var(--kata-color-text);\n white-space: nowrap;\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;\n width: 100%;\n min-width: 0;\n justify-content: space-between;\n cursor: pointer;\n}\n.trigger:focus-within {\n border-color: var(--kata-color-blue-ink);\n}\n\n.trigger select {\n border: 0;\n background: transparent;\n padding: 0;\n margin: 0;\n min-width: 0;\n outline: none;\n color: inherit;\n font: inherit;\n appearance: none;\n}\n.trigger select:focus-visible {\n outline: none;\n}\n.trigger select {\n flex: 1;\n align-self: stretch;\n cursor: pointer;\n}\n.trigger select:invalid {\n color: var(--kata-color-faint);\n}\n\n.trigger select option {\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n}\n\n.trigger :global(svg) {\n flex: none;\n}\n\n.err {\n border-color: var(--kata-color-red-ink);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.disabled select {\n cursor: default;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { clampTip } from '../lib/clampTip.js';\n\n // ReadValue: a value that is read, not edited. It has no outline: it is text in the place of the\n // control of a Field or a Pair, which hold the distances. It stands in for an input on a screen\n // that is only viewed, or for a value that cannot be changed. Identifiers use mono.\n //\n // It trims its text the way Text does: inside a control (a pair or a list item) to its ink,\n // elsewhere not, and at the edge of a container on the side that touches the edge.\n //\n // <Field label=\"Handle\"><ReadValue value=\"studio\" mono /></Field>\n // <Field label=\"Email\"><Row between><ReadValue value={email} clamp /><Button>Change…</Button></Row></Field>\n let {\n value,\n mono = false,\n muted = false,\n clamp = false,\n }: {\n value: string;\n /** The monospace font, with figures of equal width */\n mono?: boolean;\n /** Not set, or left at the default (a sentence rather than a value) */\n muted?: boolean;\n /** One line with an ellipsis; the full text shows on hover when it is clipped */\n clamp?: boolean;\n } = $props();\n</script>\n\n{#if clamp}\n <span class=\"v clamp\" class:mono class:muted data-role=\"value\" use:clampTip>{value}</span>\n{:else}\n <span class=\"v\" class:mono class:muted data-role=\"value\">{value}</span>\n{/if}\n\n<style>.v {\n display: block;\n min-width: 0;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n}\n\n@container style(--kata-in-control: 1) {\n .v {\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n }\n}\n.mono {\n font-family: var(--kata-font-mono);\n font-variant-numeric: tabular-nums;\n}\n\n.muted {\n color: var(--kata-color-muted);\n}\n\n.clamp {\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}</style>\n","<script lang=\"ts\" generics=\"T extends string\">\n import '../styles/components.css';\n import type { IconSource } from '../icons.js';\n import Icon from './Icon.svelte';\n\n // Segmented: an exclusive switch between two to four options. Each option is a control of the\n // height its container declares (a button's, or a small button's), and neighbours share one\n // line. The chosen option takes the solid surface; the outer line stays line-strong. The text is\n // trimmed to its ink and centred. Five options or more are a Select. The group is one control, so\n // its root is a box too. It does not wrap and does not shrink its padding: when it does not fit,\n // it scrolls sideways without a scrollbar.\n //\n // <Segmented bind:value options={[{ value: 'grid', label: 'Grid' }, …]} ariaLabel=\"View\" />\n //\n // An option with an icon and no label is square. When the value is derived from elsewhere, pass\n // value and onchange instead of binding it.\n let {\n options,\n value = $bindable(),\n ariaLabel,\n onchange,\n }: {\n options: {\n value: T;\n label?: string;\n icon?: IconSource;\n /** The accessible name of an option with an icon only */\n ariaLabel?: string;\n disabled?: boolean;\n }[];\n value: T;\n /** The name of the group (for example View) */\n ariaLabel?: string;\n onchange?: (value: T) => void;\n } = $props();\n</script>\n\n<div class=\"seg\" data-role=\"box\" role=\"group\" aria-label={ariaLabel}>\n {#each options as opt (opt.value)}\n <button\n class=\"opt\"\n class:on={value === opt.value}\n class:icon={!!opt.icon && !opt.label}\n type=\"button\"\n data-role=\"box\"\n data-h=\"button\"\n disabled={opt.disabled}\n aria-label={opt.ariaLabel}\n aria-pressed={value === opt.value}\n onclick={() => {\n value = opt.value;\n onchange?.(opt.value);\n }}\n >\n {#if opt.icon}<Icon name={opt.icon} />{/if}{#if opt.label}<span class=\"t\">{opt.label}</span>{/if}\n </button>\n {/each}\n</div>\n\n<style>.seg {\n display: inline-flex;\n flex: none;\n max-width: 100%;\n overflow-x: auto;\n scrollbar-width: none;\n}\n.seg::-webkit-scrollbar {\n display: none;\n}\n\n.opt {\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-box, var(--kata-height-button));\n padding-block: 0;\n padding-inline: var(--kata-pad-md);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n background: transparent;\n color: var(--kata-color-text);\n white-space: nowrap;\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;\n cursor: pointer;\n flex: none;\n min-width: 0;\n}\n.opt:hover:not(.on):not(:disabled) {\n background: var(--kata-color-raise);\n}\n.opt:active:not(:disabled) {\n background: var(--kata-color-raise-2);\n transition: none;\n}\n.opt:disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.opt + .opt {\n border-left-width: 0;\n}\n.opt > :global(svg) {\n flex: none;\n}\n.opt .t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.on {\n background: var(--kata-color-solid);\n color: var(--kata-color-on-solid);\n}\n\n.icon {\n width: var(--kata-box, var(--kata-height-button));\n padding: 0;\n justify-content: center;\n}\n\n.opt:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // Slider: the input of a value on a range. It is a control of the height of a small button, and\n // the whole control can be dragged. The track is two lines thick (solid on the side that has\n // been passed), the thumb is the square of an icon, and the value sits on the right in a slot of\n // fixed width, aligned to its end, so that the width does not change with the digits. It is a\n // native range input: dragging, the arrow keys and screen readers work as the browser does.\n //\n // <Slider value={opacity} display=\"70%\" ariaLabel=\"Opacity\" onchange={apply} />\n let {\n value,\n min = 0,\n max = 100,\n step = 1,\n display,\n id,\n disabled = false,\n ariaLabel,\n oninput,\n onchange,\n }: {\n value: number;\n min?: number;\n max?: number;\n step?: number;\n /** The value as shown on the right, with its unit (the number itself by default) */\n display?: string;\n id?: string;\n disabled?: boolean;\n ariaLabel?: string;\n /** Every change while dragging */\n oninput?: (value: number) => void;\n /** The value when it is let go or changed with a key */\n onchange?: (value: number) => void;\n } = $props();\n\n const pct = $derived(max > min ? ((value - min) / (max - min)) * 100 : 0);\n</script>\n\n<div class=\"slider\" class:disabled={disabled} data-role=\"switch\" data-h=\"button-sm\">\n <input\n type=\"range\"\n {min}\n {max}\n {step}\n {value}\n {id}\n {disabled}\n aria-label={ariaLabel}\n style:--kata-slider-fill={`${pct}%`}\n oninput={(e) => oninput?.(Number(e.currentTarget.value))}\n onchange={(e) => onchange?.(Number(e.currentTarget.value))}\n />\n <span class=\"val\">{display ?? String(value)}</span>\n</div>\n\n<style>.slider {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-height-button-sm);\n min-width: 0;\n}\n\ninput {\n appearance: none;\n flex: 1;\n min-width: 0;\n height: var(--kata-height-button-sm);\n margin: 0;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n}\n\ninput::-webkit-slider-runnable-track {\n height: var(--kata-height-icon);\n background: linear-gradient(to right, var(--kata-color-solid) 0 var(--kata-slider-fill), var(--kata-color-line-strong) var(--kata-slider-fill) 100%) center/100% calc(var(--kata-border-width) * 2) no-repeat;\n}\n\ninput::-moz-range-track {\n height: var(--kata-height-icon);\n background: linear-gradient(to right, var(--kata-color-solid) 0 var(--kata-slider-fill), var(--kata-color-line-strong) var(--kata-slider-fill) 100%) center/100% calc(var(--kata-border-width) * 2) no-repeat;\n}\n\ninput::-webkit-slider-thumb {\n appearance: none;\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n border: 0;\n border-radius: 0;\n background: var(--kata-color-text);\n}\n\ninput::-moz-range-thumb {\n appearance: none;\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n border: 0;\n border-radius: 0;\n background: var(--kata-color-text);\n}\n\ninput:disabled {\n cursor: default;\n}\n\n.val {\n flex: none;\n width: 3.5rem;\n text-align: end;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n font-variant-numeric: tabular-nums;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { IconSource } from '../icons.js';\n import Icon from './Icon.svelte';\n\n // Swatch: a sample of a color, a mark of that color in the square of an icon. The color is a\n // value of the content (the color of a shape, a color scheme), not a role of the design, so it\n // is the one thing a component takes as a style (--kata-swatch-color). A line is drawn inside, so\n // that a pale color still shows its edge without growing the mark. In a list item it is centred\n // and does not change the item's height.\n //\n // The shape tells the kind of thing drawn: box (the default) a filled square, dot a point, line a\n // segment, area a small square with a line, ramp a continuous scheme (pass a gradient as the\n // color), and icon the tool's glyph in that color, over a halo of line-strong (the same glyph\n // drawn thicker) so that a light color still stands out. The sizes are fixed in rem.\n //\n // A swatch that is pressed goes inside an icon button.\n //\n // <Swatch color=\"#0033ff\" /> <Swatch shape=\"dot\" color={c} /> <Swatch shape=\"icon\" icon=\"polyline\" color={c} />\n let {\n color,\n shape = 'box',\n icon,\n fill = false,\n }: {\n /** A CSS color, or a background for ramp */\n color: string;\n /** The shape of the mark */\n shape?: 'box' | 'dot' | 'line' | 'area' | 'ramp' | 'icon';\n /** The glyph, with shape=\"icon\" */\n icon?: IconSource;\n /** Stretches to the width of its container */\n fill?: boolean;\n } = $props();\n</script>\n\n{#if shape === 'icon' && icon}\n <span data-role=\"mark\" class=\"swatch\" data-shape=\"icon\" style:--kata-swatch-color={color} aria-hidden=\"true\">\n <span class=\"halo\"><Icon name={icon} /></span>\n <span class=\"ink\" style:color><Icon name={icon} /></span>\n </span>\n{:else}\n <span\n data-role=\"mark\"\n class=\"swatch\"\n data-shape={shape}\n class:fill\n style:--kata-swatch-color={color}\n aria-hidden=\"true\"\n ></span>\n{/if}\n\n<style>.swatch {\n display: inline-block;\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n background: var(--kata-swatch-color);\n box-shadow: inset 0 0 0 var(--kata-border-width) var(--kata-color-line);\n flex: none;\n}\n\n.swatch[data-shape=dot] {\n width: 0.5rem;\n height: 0.5rem;\n border-radius: 50%;\n}\n\n.swatch[data-shape=line] {\n width: 0.875rem;\n height: calc(var(--kata-border-width) * 2);\n box-shadow: none;\n}\n\n.swatch[data-shape=area] {\n width: 0.625rem;\n height: 0.625rem;\n box-shadow: inset 0 0 0 var(--kata-border-width) var(--kata-color-line-strong);\n}\n\n.swatch[data-shape=icon] {\n position: relative;\n background: none;\n box-shadow: none;\n}\n\n.halo,\n.ink {\n position: absolute;\n inset: 0;\n display: flex;\n}\n\n.halo {\n color: var(--kata-color-line-strong);\n}\n.halo :global(svg.kata-icon) {\n stroke-width: 3.5;\n}\n\n.swatch[data-shape=ramp] {\n width: 3rem;\n height: 0.5rem;\n box-shadow: none;\n}\n\n.swatch.fill {\n width: 100%;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // Toggle: a switch for a setting that takes effect at once. It is a control of the height of a\n // small button, and the whole control is pressed. The switch is centred; its text on the right\n // (on the left with between) is trimmed to its ink and centred. It is a native checkbox with\n // role=\"switch\", so :checked holds the state, and the control is a <label>, so pressing the text\n // switches it too.\n //\n // <Toggle bind:checked={snap} label=\"Snap to grid\" />\n // <Toggle bind:checked={snap} label=\"Snap to grid\" between /> the switch at the right end\n let {\n checked = $bindable(false),\n label,\n ariaLabel,\n disabled = false,\n between = false,\n indent = false,\n id,\n onchange,\n }: {\n checked?: boolean;\n /** The text beside the switch, which is its name */\n label?: string;\n /** The text on the left and the switch at the right end (a row of settings) */\n between?: boolean;\n /** Under a parent switch: indented by pad-md */\n indent?: boolean;\n /** The accessible name when there is no text */\n ariaLabel?: string;\n disabled?: boolean;\n id?: string;\n onchange?: (checked: boolean) => void;\n } = $props();\n</script>\n\n<label class=\"ctl\" class:disabled={disabled} class:between class:indent data-role=\"switch\" data-control>\n {#if between && label}<span class=\"t grow\">{label}</span>{/if}\n <input\n type=\"checkbox\"\n role=\"switch\"\n class=\"toggle\"\n bind:checked\n {id}\n {disabled}\n aria-label={ariaLabel}\n onchange={() => onchange?.(checked)}\n />\n {#if label && !between}<span class=\"t\">{label}</span>{/if}\n</label>\n\n<style>.ctl {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n height: var(--kata-height-button-sm);\n padding-inline: var(--kata-inset, 0px);\n min-width: 0;\n cursor: pointer;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n}\n\n.between {\n justify-content: space-between;\n}\n\n.indent {\n padding-left: var(--kata-pad-md);\n}\n\n.t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.grow {\n flex: 1 1 auto;\n}\n\n.toggle {\n appearance: none;\n margin: 0;\n padding: 0;\n flex: none;\n width: var(--kata-height-button);\n height: var(--kata-height-badge);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n border-radius: 0;\n cursor: pointer;\n background-color: transparent;\n background-image: linear-gradient(var(--kata-color-muted) 0 0);\n background-repeat: no-repeat;\n background-size: calc(var(--kata-height-badge) - var(--kata-border-width) * 6) calc(var(--kata-height-badge) - var(--kata-border-width) * 6);\n background-position: left calc(var(--kata-border-width) * 2) center;\n transition: background-color 0.12s ease, border-color 0.12s ease;\n}\n\n.toggle:checked {\n background-color: var(--kata-color-solid);\n background-image: linear-gradient(var(--kata-color-on-solid) 0 0);\n background-position: right calc(var(--kata-border-width) * 2) center;\n border-color: var(--kata-color-solid);\n}\n\n.disabled {\n opacity: var(--kata-opacity-dim);\n cursor: default;\n}\n.disabled .toggle {\n cursor: default;\n}</style>\n","<script lang=\"ts\" module>\n /** The kinds of field a FieldList draws, each with its control */\n export type FieldKind =\n | 'text'\n | 'number'\n | 'select'\n | 'color'\n | 'toggle'\n | 'slider'\n | 'segmented'\n | 'custom';\n\n /** One field of a FieldList: what it edits, how, and its current value */\n export interface FieldSpec {\n /** The key the change is reported with */\n key: string;\n /** The control that edits it */\n kind: FieldKind;\n /** The name shown before the control */\n label: string;\n /** The current value, as the application holds it */\n value?: unknown;\n /** The things selected do not share one value; value is not shown */\n mixed?: boolean;\n /** The choices of select and segmented */\n options?: { value: string; label: string }[];\n min?: number;\n max?: number;\n step?: number;\n /** A unit shown after the value, as text only */\n unit?: string;\n /** A word shown while a text or a number is empty */\n placeholder?: string;\n disabled?: boolean;\n /** A caption under the control */\n hint?: string;\n }\n</script>\n\n<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { SvelteMap } from 'svelte/reactivity';\n import { getMessages } from '../messages.js';\n import Button from './Button.svelte';\n import ColorPicker from './ColorPicker.svelte';\n import Dropdown from './Dropdown.svelte';\n import InspectorRow from './InspectorRow.svelte';\n import NativeSelect from './NativeSelect.svelte';\n import NumberInput from './NumberInput.svelte';\n import ReadValue from './ReadValue.svelte';\n import Segmented from './Segmented.svelte';\n import Slider from './Slider.svelte';\n import Stack from './Stack.svelte';\n import Swatch from './Swatch.svelte';\n import TextInput from './TextInput.svelte';\n import Toggle from './Toggle.svelte';\n\n // FieldList: the rows of settings drawn from a list of field specs. Each spec names a key, a\n // kind, a label and the current value; the list draws one InspectorRow per spec with the control\n // of its kind and reports a committed change with onchange(key, value). The values are the\n // application's: the list does not convert them, and a unit is text after the value.\n //\n // text TextInput; a string, on change (Enter or leaving the input)\n // number NumberInput; a number, or null when emptied, on change\n // select NativeSelect of the options; the option's value\n // color a button with a Swatch and the value, which opens a ColorPicker; #RRGGBB, per pick\n // toggle Toggle at the end of the row; a boolean\n // slider Slider with the value and its unit; a number, when it is let go\n // segmented Segmented of the options; the option's value\n // custom the field snippet, which receives the spec\n //\n // A field with mixed (a selection whose things differ) shows no value: an empty input, no chosen\n // option, a button without a swatch, the thumb at the start; the hint says Mixed. Any change sets\n // the one value.\n //\n // <FieldList fields={[{ key: 'width', kind: 'number', label: 'Width', value: 2, unit: 'px' }]}\n // onchange={(key, value) => apply(key, value)} />\n let {\n fields,\n onchange,\n field,\n }: {\n /** The fields, in order */\n fields: FieldSpec[];\n /** Called with the key and the value of a committed change */\n onchange?: (key: string, value: unknown) => void;\n /** Draws the control of a custom field (a snippet that receives the spec) */\n field?: Snippet<[FieldSpec]>;\n } = $props();\n\n const uid = $props.id();\n // The value of a slider while it is dragged, by key; it is reported when the slider is let go\n const dragging = new SvelteMap<string, number>();\n\n const report = (key: string, value: unknown) => onchange?.(key, value);\n const text = (f: FieldSpec) => (f.mixed || f.value == null ? '' : String(f.value));\n const num = (f: FieldSpec) =>\n !f.mixed && typeof f.value === 'number' && Number.isFinite(f.value) ? f.value : null;\n\n function commitNumber(f: FieldSpec, raw: string) {\n if (raw.trim() === '') {\n report(f.key, null);\n return;\n }\n const n = Number(raw);\n if (!Number.isNaN(n)) report(f.key, n);\n }\n\n function slide(f: FieldSpec) {\n const v = dragging.get(f.key) ?? num(f);\n return { value: v ?? f.min ?? 0, display: v === null ? '' : `${v}${f.unit ?? ''}` };\n }\n</script>\n\n<Stack gap=\"sm\">\n {#each fields as f, i (f.key)}\n {@const id = `${uid}-${i}`}\n {@const hint = f.mixed ? getMessages().mixed : f.hint}\n <InspectorRow\n label={f.label}\n for={f.kind === 'color' || f.kind === 'segmented' || f.kind === 'custom' ? undefined : id}\n {hint}\n align={f.kind === 'toggle' ? 'end' : 'start'}\n small={f.kind === 'toggle' || f.kind === 'slider'}\n >\n {#if f.kind === 'text'}\n <TextInput\n {id}\n value={text(f)}\n aria-label={f.label}\n unit={f.unit}\n placeholder={f.mixed ? getMessages().mixed : f.placeholder}\n disabled={f.disabled}\n onchange={(e) => report(f.key, e.currentTarget.value)}\n />\n {:else if f.kind === 'number'}\n <NumberInput\n {id}\n value={num(f)}\n ariaLabel={f.label}\n unit={f.unit}\n min={f.min}\n max={f.max}\n step={f.step ?? 'any'}\n placeholder={f.mixed ? getMessages().mixed : f.placeholder}\n disabled={f.disabled}\n onchange={(e) => commitNumber(f, e.currentTarget.value)}\n />\n {:else if f.kind === 'select'}\n <NativeSelect\n {id}\n options={f.options ?? []}\n value={f.mixed ? undefined : text(f)}\n ariaLabel={f.label}\n placeholder={f.mixed ? getMessages().mixed : f.placeholder}\n disabled={f.disabled}\n onchange={(v) => report(f.key, v)}\n />\n {:else if f.kind === 'color'}\n <Dropdown bare align=\"start\" role=\"box\">\n {#snippet trigger(toggle, open)}\n <Button\n trailing=\"chevron-down\"\n clamp\n mono={!f.mixed}\n disabled={f.disabled}\n aria-label={f.label}\n aria-haspopup=\"dialog\"\n aria-expanded={open}\n onclick={toggle}\n mark={f.mixed ? undefined : swatch}\n >\n {f.mixed ? getMessages().mixed : text(f)}\n </Button>\n {#snippet swatch()}<Swatch color={text(f)} />{/snippet}\n {/snippet}\n {#snippet panel(close)}\n <ColorPicker\n value={f.mixed ? '#000000' : text(f)}\n title={f.label}\n onpick={(hex) => report(f.key, hex)}\n onclose={close}\n />\n {/snippet}\n </Dropdown>\n {:else if f.kind === 'toggle'}\n <Toggle\n {id}\n checked={!f.mixed && f.value === true}\n ariaLabel={f.label}\n disabled={f.disabled}\n onchange={(v) => report(f.key, v)}\n />\n {:else if f.kind === 'slider'}\n {@const s = slide(f)}\n <Slider\n {id}\n value={s.value}\n display={s.display}\n ariaLabel={f.label}\n min={f.min}\n max={f.max}\n step={f.step}\n disabled={f.disabled}\n oninput={(v) => dragging.set(f.key, v)}\n onchange={(v) => {\n dragging.delete(f.key);\n report(f.key, v);\n }}\n />\n {:else if f.kind === 'segmented'}\n <Segmented\n options={(f.options ?? []).map((o) => ({ ...o, disabled: f.disabled }))}\n value={f.mixed ? '' : text(f)}\n ariaLabel={f.label}\n onchange={(v) => report(f.key, v)}\n />\n {:else if field}\n {@render field(f)}\n {:else}\n <ReadValue value={text(f)} />\n {/if}\n </InspectorRow>\n {/each}\n</Stack>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Floating: a container that floats over the stage (a search, a navigation, a credit line), or a\n // small panel in a place that is already positioned. It has the panel color and one strong line,\n // no shadow, and floats on the floating layer. A panel placed inside needs no line of its own.\n //\n // Only its position comes from outside: the distance to each side it is pinned to. A step name\n // (2xs to xl) is that gap step; any other string is a CSS length, such as 50%. It is placed\n // absolutely in its frame, which must be a positioned element; with no side given it stands in\n // the flow and fills its place. It has no padding: list items hold their own and text goes in a\n // Block.\n //\n // <Floating left=\"md\" top=\"md\"><Block>…</Block></Floating>\n type Step = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n type Place = 0 | Step | (string & {});\n const STEPS = new Set(['2xs', 'xs', 'sm', 'md', 'lg', 'xl']);\n let {\n top,\n right,\n bottom,\n left,\n children,\n }: {\n top?: Place;\n right?: Place;\n bottom?: Place;\n left?: Place;\n children: Snippet;\n } = $props();\n\n /** A step name is a gap step; 0 is 0; anything else is used as it is */\n function at(v: Place | undefined): string | undefined {\n if (v === undefined) return undefined;\n if (v === 0) return '0';\n return STEPS.has(v) ? `var(--kata-gap-${v})` : v;\n }\n</script>\n\n<div\n class=\"floating\"\n class:flow={top === undefined && right === undefined && bottom === undefined && left === undefined}\n data-role=\"floating\"\n style:top={at(top)}\n style:right={at(right)}\n style:bottom={at(bottom)}\n style:left={at(left)}\n>\n {@render children()}\n</div>\n\n<style>.floating {\n position: absolute;\n z-index: var(--kata-z-floating);\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n min-width: 0;\n max-width: 100%;\n padding: 0;\n --kata-inset: var(--kata-pad-md);\n --kata-at-start: 0;\n --kata-at-end: 0;\n --kata-box: var(--kata-height-button);\n}\n\n.flow {\n position: static;\n display: flex;\n flex: 1 1 auto;\n min-height: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Panel: a container that stacks items reaching its edges (a side column, a left or right panel,\n // a dock). Its order is fixed: head (a Toolbar), content, foot (a Footer). The head and the foot\n // keep their size; only the content shrinks, and it scrolls when it overflows. The content has no\n // padding: lists, trees and section headers reach the edges and are stacked with Stack gap 0,\n // while text and fields go in a Block. The controls inside have a button's height.\n //\n // side: rail (the width of a side column), panel (the width of a panel) or fill (the rest of the\n // row: a dock). fit takes the height of the content only. A dock with resizable shows a grip along\n // its top edge; the grip has no look of its own, only the resize cursor. The panel reports the\n // height asked for with onresize; the application keeps it and applies its limits.\n //\n // <Panel side=\"panel\">\n // {#snippet head()}<Toolbar title=\"Contents\" rule tail>…</Toolbar>{/snippet}\n // <Stack gap={0}><SectionHeader …/><Block>…</Block></Stack>\n // {#snippet foot()}<Footer>…</Footer>{/snippet}\n // </Panel>\n let {\n side = 'panel',\n fit = false,\n resizable = false,\n onresize,\n resizeLabel,\n label,\n head,\n foot,\n children,\n }: {\n /** rail and panel are fixed widths; fill takes the rest of the row (a dock) */\n side?: 'rail' | 'panel' | 'fill';\n /** Takes the height of the content only, up to the height of its container */\n fit?: boolean;\n /** A grip along the top edge that changes the height (a dock) */\n resizable?: boolean;\n /** The height asked for by the grip, in px; the application applies its limits */\n onresize?: (height: number) => void;\n /** The name of the grip; required with resizable */\n resizeLabel?: string;\n /** The name of the panel as a region */\n label?: string;\n /** The head, a Toolbar */\n head?: Snippet;\n /** The foot, a Footer, for a panel with a main action */\n foot?: Snippet;\n /** The content; it scrolls when it overflows */\n children: Snippet;\n } = $props();\n\n // The grip. The panel measures its own height (the application sets it); onresize reports the\n // height asked for. The range it announces is the height of the element that holds the panel's\n // seat.\n let el = $state<HTMLElement>();\n let nowH = $state(0);\n let maxH = $state(0);\n let dragging = false;\n let startY = 0;\n let startH = 0;\n // One press of an arrow key, in px\n const STEP = 32;\n\n function stageHeight(): number {\n const seat = el?.parentElement;\n return seat?.parentElement?.clientHeight ?? seat?.clientHeight ?? 0;\n }\n $effect(() => {\n if (resizable) maxH = stageHeight();\n });\n function gripDown(e: PointerEvent) {\n maxH = stageHeight();\n startY = e.clientY;\n startH = nowH;\n dragging = true;\n (e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId);\n }\n function gripMove(e: PointerEvent) {\n if (!dragging) return;\n onresize?.(startH + (startY - e.clientY));\n }\n function gripUp() {\n dragging = false;\n }\n function gripKey(e: KeyboardEvent) {\n maxH = stageHeight();\n if (e.key === 'ArrowUp') onresize?.(nowH + STEP);\n else if (e.key === 'ArrowDown') onresize?.(nowH - STEP);\n else return;\n e.preventDefault();\n }\n</script>\n\n<section\n class=\"panel\"\n data-side={side}\n class:fit\n class:grip={resizable}\n data-role=\"panel\"\n aria-label={label}\n bind:this={el}\n bind:clientHeight={nowH}\n>\n {#if resizable}\n <div\n class=\"handle\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label={resizeLabel}\n aria-orientation=\"vertical\"\n aria-valuenow={nowH}\n aria-valuemin={0}\n aria-valuemax={maxH}\n onpointerdown={gripDown}\n onpointermove={gripMove}\n onpointerup={gripUp}\n onpointercancel={gripUp}\n onkeydown={gripKey}\n ></div>\n {/if}\n {@render head?.()}\n <div class=\"scroll\">{@render children()}</div>\n {@render foot?.()}\n</section>\n\n<style>.panel {\n display: flex;\n flex-direction: column;\n min-height: 0;\n min-width: 0;\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n flex: none;\n --kata-box: var(--kata-height-button);\n}\n.panel > :global(*) {\n flex: none;\n}\n.panel > .scroll {\n flex: 1 1 auto;\n}\n\n.grip {\n position: relative;\n}\n\n.handle {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: var(--kata-pad-sm);\n z-index: 1;\n cursor: ns-resize;\n touch-action: none;\n}\n.handle:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}\n\n.fit {\n height: auto;\n max-height: 100%;\n align-self: flex-start;\n}\n\n.panel[data-side=rail] {\n width: var(--kata-width-rail);\n max-width: 100%;\n}\n\n.panel[data-side=panel] {\n width: var(--kata-width-panel);\n max-width: 100%;\n}\n\n.panel[data-side=fill] {\n flex: 1 1 auto;\n width: 100%;\n}\n\n.scroll {\n padding: 0;\n --kata-inset: var(--kata-pad-md);\n --kata-at-start: 0;\n --kata-at-end: 0;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { getMessages } from '../messages.js';\n import Dropdown from './Dropdown.svelte';\n import Icon from './Icon.svelte';\n import MenuItem from './MenuItem.svelte';\n\n // Tabs: switches between views. A tab has the height of a list item with pad-md at the sides; the\n // current tab is underlined with a double line drawn inside it, so its height does not change.\n // Inside a Toolbar the tabs find the toolbar on their own: they take its height, and the\n // underline meets the toolbar's line (the tabs have no line of their own there).\n //\n // A tab with href is a link (it moves to another page, as the tabs of a settings page do); a tab\n // without is a button (it switches a view on the same page). Either way the current tab has\n // aria-current=\"page\". Only the current tab is in the tab order; the left and right arrow keys,\n // Home and End move the focus between the tabs, and Enter or Space opens the focused one.\n //\n // When the tabs do not fit, as many as fit show and the rest fold into a \"More\" menu at the right\n // end; nothing scrolls. The current tab always shows: its width is taken first, then the others\n // from the start as long as they fit. The widths are measured on a hidden copy of the tabs and\n // followed with a ResizeObserver.\n //\n // <Tabs {tabs} current=\"general\" onselect={(id) => (view = id)} label=\"Views\" />\n type Tab = { id: string; label: string; href?: string };\n let {\n tabs,\n current,\n label,\n onselect,\n }: {\n tabs: Tab[];\n /** The id of the current tab */\n current: string;\n /** The name of the set of tabs */\n label?: string;\n /** Called with the id of the tab that is opened */\n onselect?: (id: string) => void;\n } = $props();\n\n let root = $state<HTMLElement>();\n let measure = $state<HTMLElement>();\n // Inside a Toolbar the tabs follow its height and its line\n const bar = $derived(!!root?.parentElement?.closest('[data-role=\"toolbar\"]'));\n // The tab that is in the tab order: the current one, or the first when none is current\n const focusable = $derived(tabs.some((t) => t.id === current) ? current : tabs[0]?.id);\n\n // The indexes of the tabs that show, or null when all fit\n let shownIdx = $state<number[] | null>(null);\n $effect(() => {\n const r = root;\n const m = measure;\n if (!r || !m) return;\n void tabs;\n void current;\n const read = () => {\n const avail = r.clientWidth + 0.5;\n const widths = [...m.querySelectorAll<HTMLElement>('.tab:not(.more)')].map(\n (el) => el.getBoundingClientRect().width,\n );\n if (widths.reduce((a, b) => a + b, 0) <= avail) {\n shownIdx = null;\n return;\n }\n const ci = tabs.findIndex((t) => t.id === current);\n const chosen = new Set<number>();\n let sum = m.querySelector<HTMLElement>('.more')?.getBoundingClientRect().width ?? 0;\n if (ci >= 0) {\n chosen.add(ci);\n sum += widths[ci];\n }\n for (let i = 0; i < widths.length; i += 1) {\n if (chosen.has(i)) continue;\n if (sum + widths[i] > avail) break;\n chosen.add(i);\n sum += widths[i];\n }\n shownIdx = [...chosen].sort((a, b) => a - b);\n };\n read();\n if (typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(read);\n ro.observe(r);\n return () => ro.disconnect();\n });\n const split = $derived.by(() => {\n if (!shownIdx) return { shown: tabs, hidden: [] as Tab[] };\n const set = new Set(shownIdx);\n return { shown: tabs.filter((_, i) => set.has(i)), hidden: tabs.filter((_, i) => !set.has(i)) };\n });\n\n function onkeydown(e: KeyboardEvent) {\n const all = root ? [...root.querySelectorAll<HTMLElement>('a.tab, button.tab')] : [];\n const at = all.indexOf(e.currentTarget as HTMLElement);\n if (at < 0) return;\n let next = -1;\n if (e.key === 'ArrowRight') next = (at + 1) % all.length;\n else if (e.key === 'ArrowLeft') next = (at - 1 + all.length) % all.length;\n else if (e.key === 'Home') next = 0;\n else if (e.key === 'End') next = all.length - 1;\n else return;\n e.preventDefault();\n all[next]?.focus();\n }\n</script>\n\n{#snippet tab(t: Tab)}\n {#if t.href}\n <a\n class=\"tab\"\n class:on={t.id === current}\n data-h={bar ? 'toolbar' : 'list-item'}\n href={t.href}\n tabindex={t.id === focusable ? 0 : -1}\n aria-current={t.id === current ? 'page' : undefined}\n {onkeydown}\n onclick={() => onselect?.(t.id)}><span class=\"t\">{t.label}</span></a\n >\n {:else}\n <button\n type=\"button\"\n class=\"tab\"\n class:on={t.id === current}\n data-h={bar ? 'toolbar' : 'list-item'}\n tabindex={t.id === focusable ? 0 : -1}\n aria-current={t.id === current ? 'page' : undefined}\n {onkeydown}\n onclick={() => onselect?.(t.id)}><span class=\"t\">{t.label}</span></button\n >\n {/if}\n{/snippet}\n\n<nav class=\"tabs\" class:bar aria-label={label} data-role=\"tabs\" bind:this={root}>\n {#each split.shown as t (t.id)}\n {@render tab(t)}\n {/each}\n {#if split.hidden.length}\n <Dropdown align=\"end\" menu>\n {#snippet trigger(toggle, open)}\n <button\n type=\"button\"\n class=\"tab more\"\n data-h={bar ? 'toolbar' : 'list-item'}\n tabindex=\"-1\"\n aria-haspopup=\"menu\"\n aria-expanded={open}\n {onkeydown}\n onclick={toggle}><span class=\"t\">{getMessages().more}</span><Icon name=\"chevron-down\" /></button\n >\n {/snippet}\n {#snippet panel(close)}\n {#each split.hidden as t (t.id)}\n <MenuItem\n href={t.href}\n onclick={() => {\n onselect?.(t.id);\n close();\n }}>{t.label}</MenuItem\n >\n {/each}\n {/snippet}\n </Dropdown>\n {/if}\n <!-- A hidden copy of every tab and of \"More\", to measure their widths -->\n <span class=\"measure\" aria-hidden=\"true\" data-kata-skip bind:this={measure}>\n {#each tabs as t (t.id)}\n <span class=\"tab\"><span class=\"t\">{t.label}</span></span>\n {/each}\n <span class=\"tab more\"><span class=\"t\">{getMessages().more}</span><Icon name=\"chevron-down\" /></span>\n </span>\n</nav>\n\n<style>.tabs {\n position: relative;\n display: flex;\n min-width: 0;\n flex: none;\n border-bottom: var(--kata-border-width) solid var(--kata-color-line);\n overflow: clip;\n}\n\n.tabs.bar {\n border-bottom: 0;\n flex: 1 1 auto;\n}\n.tabs.bar .tab {\n height: var(--kata-height-toolbar);\n}\n\n.tab {\n flex: none;\n display: inline-flex;\n align-items: center;\n gap: var(--kata-gap-2xs);\n height: var(--kata-height-list-item);\n padding-inline: var(--kata-pad-md);\n border: 0;\n background: none;\n color: var(--kata-color-muted);\n font: inherit;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n white-space: nowrap;\n text-decoration: none;\n cursor: pointer;\n transition: color 0.12s ease;\n}\n.tab:hover {\n color: var(--kata-color-text);\n background: var(--kata-color-raise);\n text-decoration: none;\n}\n.tab:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}\n\n.t {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.on {\n color: var(--kata-color-text);\n box-shadow: inset 0 calc(var(--kata-border-width) * -2) 0 var(--kata-color-blue-ink);\n}\n\n.measure {\n position: absolute;\n inset-inline-start: 0;\n top: 0;\n display: flex;\n visibility: hidden;\n pointer-events: none;\n white-space: nowrap;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { IconSource } from '../icons.js';\n import { getMessages } from '../messages.js';\n import Button from './Button.svelte';\n import Icon from './Icon.svelte';\n import InlineEdit from './InlineEdit.svelte';\n import Panel from './Panel.svelte';\n import Stack from './Stack.svelte';\n import Tabs from './Tabs.svelte';\n import Text from './Text.svelte';\n import Toolbar from './Toolbar.svelte';\n\n // InspectorFrame: the panel that shows the thing selected and lets it be changed. The head is a\n // Toolbar with an optional icon, the name (changed where it stands with InlineEdit, or a title\n // when it cannot be changed), an optional second line, the application's controls (head) and a\n // close button. The tabs, when there are several views, are a second Toolbar under it; the\n // content is the sections of the current tab, stacked with gap 0; end is the foot (a Footer).\n //\n // The frame shows the name it is given. When the name is committed, ontitle receives it trimmed;\n // the application updates title (at once), or the name goes back to title, so a name the\n // application does not take (an empty one, say) is not left on screen.\n //\n // <InspectorFrame title={name} ontitle={rename} {tabs} bind:current onclose={close}>\n // {#if current === 'style'}<InspectorSection title=\"Fill\">…</InspectorSection>{/if}\n // </InspectorFrame>\n let {\n title,\n ontitle,\n titleEditable = true,\n placeholder,\n subtitle,\n icon,\n tabs = [],\n current = $bindable(tabs[0]?.id ?? ''),\n onselect,\n head,\n end,\n onclose,\n side = 'panel',\n children,\n }: {\n /** The name of the thing shown */\n title: string;\n /** Called with the name committed, trimmed; the name can be changed only with it */\n ontitle?: (name: string) => void;\n /** false shows the name as a title that cannot be changed */\n titleEditable?: boolean;\n /** The action shown while the name is empty (the addName message by default) */\n placeholder?: string;\n /** A second line under the name (the kind of the thing, a count) */\n subtitle?: string;\n /** An icon before the name */\n icon?: IconSource;\n /** The views of the thing; with none, the head has no tabs */\n tabs?: { id: string; label: string }[];\n /** The id of the current tab */\n current?: string;\n /** Called with the id of the tab that is opened */\n onselect?: (id: string) => void;\n /** More controls in the head, icon buttons before the close button (a snippet) */\n head?: Snippet;\n /** The foot of the panel, a Footer with the actions (a snippet) */\n end?: Snippet;\n /** Shows a close button in the head and is called when it is pressed */\n onclose?: () => void;\n /** The width of the panel, as Panel's side */\n side?: 'rail' | 'panel' | 'fill';\n /** The sections of the current tab */\n children: Snippet;\n } = $props();\n\n const editable = $derived(titleEditable && !!ontitle);\n const action = $derived(placeholder ?? getMessages().addName);\n // The name on screen. It follows title, and goes back to it after a commit the application did\n // not take.\n let name = $derived(title);\n\n function commit(next: string) {\n ontitle?.(next);\n if (title !== next) name = title;\n }\n\n function select(id: string) {\n current = id;\n onselect?.(id);\n }\n</script>\n\n{#snippet headEnd()}\n {@render head?.()}\n {#if onclose}\n <Button variant=\"ghost\" icon aria-label={getMessages().close} onclick={() => onclose?.()}>\n <Icon name=\"x\" />\n </Button>\n {/if}\n{/snippet}\n\n{#snippet lead()}{#if icon}<Icon name={icon} />{/if}{/snippet}\n\n{#snippet nameOf()}\n {#if editable}\n <span class=\"name\">\n <InlineEdit\n bind:value={name}\n title\n placeholder={action}\n label={name ? getMessages().rename : action}\n onCommit={commit}\n />\n </span>\n {:else}\n <Text role=\"h2\" as=\"h2\" clamp>{title}</Text>\n {/if}\n{/snippet}\n\n<Panel {side} foot={end} label={title || action}>\n {#snippet head()}\n <Toolbar\n title={!editable && !subtitle ? title : undefined}\n rule={tabs.length === 0}\n tail={!!(onclose || head)}\n two={!!subtitle}\n start={icon ? lead : undefined}\n end={onclose || head ? headEnd : undefined}\n >\n {#if subtitle}\n <span class=\"name\">\n <Stack gap=\"2xs\">\n {@render nameOf()}\n <Text role=\"caption\" muted>{subtitle}</Text>\n </Stack>\n </span>\n {:else if editable}\n {@render nameOf()}\n {/if}\n </Toolbar>\n {#if tabs.length > 0}\n <Toolbar rule><Tabs {tabs} {current} onselect={select} /></Toolbar>\n {/if}\n {/snippet}\n <Stack gap={0}>{@render children()}</Stack>\n</Panel>\n\n<style>.name {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-width: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import Stack from './Stack.svelte';\n\n // SectionHeader: a titled group inside a panel. The head is the name (label role, trimmed to its\n // ink) with pad-md at the sides and, on the right, an optional action (a small button: an icon\n // button, or a bordered text button). The head has the height of its ink; the action overlaps it\n // without taking height.\n //\n // The head is closer to its own content than to what comes before: the break above is the lower\n // half of the previous group plus pad-sm (about pad-lg from the previous ink; pad-lg after a\n // line), and the head is pad-md from the content. The content has pad-md on its sides and bottom,\n // so text, fields and pairs go in directly, without a Block. Content that reaches the edges\n // (List, Tree, Table, Disclosure) takes flush (no padding).\n //\n // Section headers are stacked with gap 0. rule draws a line above, with the same distance from the\n // ink on both sides.\n //\n // <SectionHeader label=\"Layers\" flush>\n // {#snippet actions()}…{/snippet}\n // <List>…</List>\n // </SectionHeader>\n let {\n label,\n actions,\n flush = false,\n rule = false,\n gap = 'sm',\n children,\n }: {\n /** The name of the group */\n label: string;\n /** The action on the right of the head */\n actions?: Snippet;\n /** The content reaches the edges (List, Tree, Table, Disclosure) */\n flush?: boolean;\n /** Draw a line above */\n rule?: boolean;\n /** The distance between the content's children (default sm; not used with flush) */\n gap?: 0 | 'sm' | 'md';\n children: Snippet;\n } = $props();\n</script>\n\n<div class=\"kata-section-header\" class:flush class:rule data-role=\"section-header\">\n <div class=\"head\" data-role=\"section-head\">\n <span class=\"label\">{label}</span>\n {#if actions}<div class=\"side\">{@render actions()}</div>{/if}\n </div>\n <div class=\"body\" data-inset={flush ? undefined : true}>\n {#if flush}{@render children()}{:else}<Stack {gap}>{@render children()}</Stack>{/if}\n </div>\n</div>\n\n<style>.kata-section-header {\n padding: 0;\n --kata-inset: var(--kata-pad-md);\n --kata-at-start: 0;\n --kata-at-end: 0;\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: none;\n padding-block-start: var(--kata-pad-sm);\n --kata-box: var(--kata-height-button);\n}\n\n.kata-section-header:first-child,\n:global([data-role='rule']) + .kata-section-header {\n padding-block-start: var(--kata-pad-lg);\n}\n\n.rule {\n border-top: var(--kata-border-width) solid var(--kata-color-line);\n padding-block-start: var(--kata-pad-lg);\n}\n\n:global(.kata-section-header:has(+ .kata-section-header.rule)) > .body {\n padding-bottom: var(--kata-pad-lg);\n}\n\n:global(.kata-section-header.flush:has(+ .kata-section-header.rule)) > .body {\n padding-bottom: var(--kata-pad-sm);\n}\n\n.body {\n padding: var(--kata-pad-md);\n min-width: 0;\n --kata-inset: 0px;\n}\n\n.kata-section-header:not(.flush) > .body {\n --kata-at-start: 1;\n --kata-at-end: 1;\n}\n\n.flush > .body {\n padding: 0;\n --kata-inset: var(--kata-pad-md);\n}\n\n.flush > .body > :global([data-role='list-item']:last-child) {\n padding-bottom: var(--kata-pad-md);\n}\n\n.head {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n padding-inline: var(--kata-pad-md);\n min-width: 0;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n --kata-box: var(--kata-height-button-sm);\n}\n\n.label {\n flex: 1;\n font-size: var(--kata-text-size-label);\n line-height: var(--kata-text-leading-label);\n letter-spacing: var(--kata-text-tracking-label);\n font-weight: 600;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n.side {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n margin-left: auto;\n height: 0;\n overflow: visible;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { getMessages } from '../messages.js';\n import Button from './Button.svelte';\n import Icon from './Icon.svelte';\n import SectionHeader from './SectionHeader.svelte';\n\n // InspectorSection: a titled group of an inspector, a SectionHeader that can fold. The head is\n // the title and, on the right, the application's actions (end) and, with collapsible, a small\n // ghost button with a chevron that opens and closes the group. Closed, only the head remains.\n // The rows (InspectorRow, a FieldList) go straight in; sections are stacked with gap 0.\n //\n // <InspectorSection title=\"Stroke\" collapsible bind:open>\n // <FieldList fields={stroke} onchange={apply} />\n // </InspectorSection>\n let {\n title,\n collapsible = false,\n open = $bindable(true),\n ontoggle,\n end,\n rule = false,\n flush = false,\n children,\n }: {\n /** The name of the group */\n title: string;\n /** The group can be closed and opened */\n collapsible?: boolean;\n /** Whether the content shows (open by default) */\n open?: boolean;\n /** Called with the new state when the chevron is pressed */\n ontoggle?: (open: boolean) => void;\n /** Actions on the right of the head, small buttons (a snippet) */\n end?: Snippet;\n /** Draws a line above the group */\n rule?: boolean;\n /** The content reaches the edges (a list, a tree) */\n flush?: boolean;\n /** The rows */\n children: Snippet;\n } = $props();\n\n const shown = $derived(!collapsible || open);\n\n function toggle() {\n open = !open;\n ontoggle?.(open);\n }\n</script>\n\n{#snippet actions()}\n {@render end?.()}\n {#if collapsible}\n <Button\n variant=\"ghost\"\n icon\n aria-label={open ? getMessages().collapse : getMessages().expand}\n aria-expanded={open}\n onclick={toggle}\n >\n <Icon name={open ? 'chevron-down' : 'chevron-right'} />\n </Button>\n {/if}\n{/snippet}\n\n<SectionHeader\n label={title}\n {rule}\n flush={flush || !shown}\n actions={end || collapsible ? actions : undefined}\n>\n {#if shown}{@render children()}{/if}\n</SectionHeader>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Kbd: a key or a shortcut. It has two forms. With an outline (monospace caption, a line, pad-xs\n // at the sides, the height of a badge) it sits among words, in a tooltip or a sentence. bare is\n // the monospace text alone, for a column at the right end of a menu or a list of shortcuts. The\n // text is trimmed to its ink in both. One shortcut is one Kbd (\"⌘K\"), not one per key.\n //\n // <Kbd>⌘K</Kbd> <Kbd bare>⌘K</Kbd>\n let {\n bare = false,\n children,\n }: {\n /** Without the outline, for a column of shortcuts */\n bare?: boolean;\n children: Snippet;\n } = $props();\n</script>\n\n<kbd data-role=\"mark\" data-h={bare ? undefined : 'badge'} class=\"kbd\" class:bare\n ><span class=\"key\">{@render children()}</span></kbd\n>\n\n<style>.kbd {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: var(--kata-height-badge);\n padding-inline: var(--kata-pad-xs);\n border: var(--kata-border-width) solid var(--kata-color-line-strong);\n font-family: var(--kata-font-mono);\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n white-space: nowrap;\n flex: none;\n}\n\n.key {\n display: block;\n min-width: 0;\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n}\n\n.bare {\n border: 0;\n padding: 0;\n height: auto;\n}</style>\n","/**!\n * Sortable 1.15.7\n * @author\tRubaXa <trash@rubaxa.org>\n * @author\towenm <owen23355@gmail.com>\n * @license MIT\n */\nfunction _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return _arrayLikeToArray(r);\n}\nfunction _defineProperty(e, r, t) {\n return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nfunction _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = _objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nfunction _toConsumableArray(r) {\n return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();\n}\nfunction _toPrimitive(t, r) {\n if (\"object\" != typeof t || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != typeof i) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction _toPropertyKey(t) {\n var i = _toPrimitive(t, \"string\");\n return \"symbol\" == typeof i ? i : i + \"\";\n}\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n }\n}\n\nvar version = \"1.15.7\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\nfunction matches( /**HTMLElement*/el, /**String*/selector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n return false;\n}\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType && el.host !== el ? el.host : el.parentNode;\n}\nfunction closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n return null;\n}\nvar R_SPACE = /\\s+/g;\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\nfunction css(el, prop, val) {\n var style = el && el.style;\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n } while (!selfOnly && (el = el.parentNode));\n }\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n return matrixFn && new matrixFn(appliedTransforms);\n}\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n return list;\n }\n return [];\n}\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n\n/**\r\n * Returns the \"bounding client rect\" of given element\r\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\r\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\r\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\r\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\r\n * @param {[HTMLElement]} container The parent the element will be placed in\r\n * @return {Object} The boundingClientRect of el, with specified adjustments\r\n */\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode;\n\n // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect();\n\n // Set relative to edges of padding box of container\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n } while (container = container.parentNode);\n }\n }\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n\n/**\r\n * Checks if a side of an element is scrolled past a side of its parents\r\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\r\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\r\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\r\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\r\n */\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n\n /* jshint boss:true */\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n return false;\n}\n\n/**\r\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\r\n * and non-draggable elements\r\n * @param {HTMLElement} el The parent element\r\n * @param {Number} childNum The index of the child\r\n * @param {Object} options Parent Sortable's options\r\n * @return {HTMLElement} The child at index childNum, or null if not found\r\n */\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n currentChild++;\n }\n i++;\n }\n return null;\n}\n\n/**\r\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\r\n * @param {HTMLElement} el Parent element\r\n * @param {selector} selector Any other elements that should be ignored\r\n * @return {HTMLElement} The last child, ignoring ghostEl\r\n */\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n return last || null;\n}\n\n/**\r\n * Returns the index of an element within its parent for a selected set of\r\n * elements\r\n * @param {HTMLElement} el\r\n * @param {selector} selector\r\n * @return {number}\r\n */\nfunction index(el, selector) {\n var index = 0;\n if (!el || !el.parentNode) {\n return -1;\n }\n\n /* jshint boss:true */\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n return index;\n}\n\n/**\r\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\r\n * The value is returned in real pixels.\r\n * @param {HTMLElement} el\r\n * @return {Array} Offsets in the format of [left, top]\r\n */\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n return [offsetLeft, offsetTop];\n}\n\n/**\r\n * Returns the index of the object within the given array\r\n * @param {Array} arr Array that may or may not hold the object\r\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\r\n * @return {Number} The index of the object in the array, or -1\r\n */\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n return -1;\n}\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n } while (elem = elem.parentNode);\n return getWindowScrollingElement();\n}\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n return dst;\n}\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\nvar _throttleTimeout;\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\nfunction getChildContainingRectFromElement(container, options, ghostEl) {\n var rect = {};\n Array.from(container.children).forEach(function (child) {\n var _rect$left, _rect$top, _rect$right, _rect$bottom;\n if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;\n var childRect = getRect(child);\n rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);\n rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);\n rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);\n rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);\n });\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);\n\n // If animating: compensate for current animation\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n target.toRect = toRect;\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&\n // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n }\n\n // if fromRect != toRect: animate\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n if (!time) {\n time = _this.options.animation;\n }\n _this.animate(target, animatingRect, toRect, time);\n }\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\nfunction repaint(target) {\n return target.offsetWidth;\n}\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n this.eventCanceled = false;\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return;\n // Fire global events if it exists in this sortable\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n\n // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized;\n\n // Add default options from plugin\n _extends(defaults, initialized.defaults);\n });\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return;\n\n // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\n ghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n\n _silent = false,\n savedInputChecked = [];\n\n/** @const */\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\n supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return;\n // false when <= IE11\n if (IE11OrLess) {\n return false;\n }\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n }(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n },\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n },\n /**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n },\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n var group = {};\n var originalGroup = options.group;\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n },\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n },\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n };\n\n// #1184 fix - Prevent click event on fallback if dragged but item not changed position\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n if (nearest) {\n // Create imitation event\n var event = {};\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n nearest[expando]._onDragOver(event);\n }\n }\n};\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n this.el = el; // root element\n this.options = options = _extends({}, options);\n\n // Export instance\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n // Disabled on Safari: #1571; Enabled on Safari IOS: #2244\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && (!Safari || IOS),\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults);\n\n // Set default options\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n _prepareGroup(options);\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n // Setup drag mode\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n }\n\n // Bind events\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n sortables.push(this.el);\n\n // Restore sorting\n options.store && options.store.get && this.sort(options.store.get(this) || []);\n\n // Add animation state manager\n _extends(this, AnimationStateManager());\n}\nSortable.prototype = /** @lends Sortable.prototype */{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {\n if (!evt.cancelable) return;\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n _saveInputCheckedState(el);\n\n // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n if (dragEl) {\n return;\n }\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n }\n\n // cancel dnd if original target is content editable\n if (originalTarget.isContentEditable) {\n return;\n }\n\n // Safari ignores further event handling after mousedown\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n target = closest(target, options.draggable, el, false);\n if (target && target.animated) {\n return;\n }\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n }\n\n // Get the index of the dragged element within its parent\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable);\n\n // Check filter\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n if (filter) {\n preventOnFilter && evt.preventDefault();\n return; // cancel dnd\n }\n }\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n }\n\n // Prepare `dragstart`\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n _this._onDrop();\n return;\n }\n // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n _this._disableDelayedDragEvents();\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n }\n\n // Bind the events: dragstart/dragend\n _this._triggerDragStart(evt, touch);\n\n // Drag start event\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n });\n\n // Chosen item\n toggleClass(dragEl, options.chosenClass, true);\n };\n\n // Disable \"draggable\"\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n if (options.supportPointer) {\n on(ownerDocument, 'pointerup', _this._onDrop);\n // Native D&D triggers pointercancel\n !this.nativeDraggable && on(ownerDocument, 'pointercancel', _this._onDrop);\n } else {\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop);\n }\n\n // Make dragEl draggable (must be before delay for FireFox)\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n pluginEvent('delayStart', this, {\n evt: evt\n });\n\n // Delay is impossible for native DnD in Edge or IE\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n if (options.supportPointer) {\n on(ownerDocument, 'pointerup', _this._disableDelayedDrag);\n on(ownerDocument, 'pointercancel', _this._disableDelayedDrag);\n } else {\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n }\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {\n var touch = e.touches ? e.touches[0] : e;\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'pointerup', this._disableDelayedDrag);\n off(ownerDocument, 'pointercancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n try {\n if (document.selection) {\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n awaitingDragStarted = false;\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n var options = this.options;\n\n // Apply effect\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost();\n\n // Drag start event\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n _hideGhostForTarget();\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n target = parent; // store last element\n }\n /* jshint boss:true */ while (parent = getParentOrHost(parent));\n }\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);\n\n // only set the status to dragging, when we are actually dragging\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n this._onDragStart(evt, true);\n }\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options;\n\n // Position absolutely\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl);\n\n // Set transform-origin\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {\n var _this = this;\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n if (Sortable.eventCanceled) {\n this._onDrop();\n return;\n }\n pluginEvent('setupClone', this);\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n this._hideClone();\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n }\n\n // #1143: IFrame support workaround\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n _this._hideClone();\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true);\n\n // Set proper drop events\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n on(document, 'drop', _this);\n\n // #1276 fix:\n css(dragEl, 'transform', 'translateZ(0)');\n }\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n window.getSelection().removeAllRanges();\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver( /**Event*/evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n if (_silent) return;\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n }\n\n // Capture animation state\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n _this.captureAnimationState();\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n }\n\n // Return invocation when dragEl is inserted (or completed)\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n }\n\n // Animation\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n }\n\n // Null lastTarget if it is not inside a previously swapped element\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n }\n\n // no bubbling and not fallback\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n\n // Do not detect for empty insert if already inserted\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n }\n\n // Call when dragEl has been inserted\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n ignoreNextClick = false;\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n if (revert) {\n parentEl = rootEl; // actualization\n capture();\n this._hideClone();\n dragOverEvent('revert');\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n return completed(true);\n }\n var elLastChild = lastChild(el, options.draggable);\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n }\n\n // if there is a last element, it is the target\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n if (target) {\n targetRect = getRect(target);\n }\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n if (firstChild === dragEl) {\n return completed(false);\n }\n target = firstChild;\n targetRect = getRect(target);\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n }\n // If dragEl is already beside target: Do not insert\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n }\n\n // Undo chrome's scroll adjustment (has no effect on other browsers)\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n parentEl = dragEl.parentNode; // actualization\n\n // must be done before animation\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n changed();\n return completed(true);\n }\n }\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'pointercancel', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop( /**Event*/evt) {\n var el = this.el,\n options = this.options;\n\n // Get the index of the dragged element within its parent\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode;\n\n // Get again after plugin event\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n if (Sortable.eventCanceled) {\n this._nulling();\n return;\n }\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n _cancelNextTick(this.cloneId);\n _cancelNextTick(this._dragStartId);\n\n // Unbind events\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n this._offMoveEvents();\n this._offUpEvents();\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n css(dragEl, 'transform', '');\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n _disableDraggable(dragEl);\n dragEl.style['will-change'] = '';\n\n // Remove classes\n // ghostClass is added in dragStarted\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n toggleClass(dragEl, this.options.chosenClass, false);\n\n // Drag stop event\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n // Remove event\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // drag from one list and drop into another\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n });\n\n // Save sorting\n this.save();\n }\n }\n }\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n var el = this.el;\n savedInputChecked.forEach(function (checkEl) {\n if (el.contains(checkEl)) {\n checkEl.checked = true;\n }\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent( /**Event*/evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n break;\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n _globalDragOver(evt);\n }\n break;\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n for (; i < n; i++) {\n el = children[i];\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n return order;\n },\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n }\n // Remove draggable attributes\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n this._onDrop();\n this._disableDelayedDragEvents();\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n return;\n }\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return;\n\n // show clone at dragEl or original position\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\nfunction _globalDragOver( /**Event*/evt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n evt.cancelable && evt.preventDefault();\n}\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal;\n // Support for new CustomEvent feature\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n return retVal;\n}\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\nfunction _unsilent() {\n _silent = false;\n}\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;\n}\nfunction _ghostIsLast(evt, vertical, sortable) {\n var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);\n var spacer = 10;\n return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;\n}\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n invert = invert || invertSwap;\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n return 0;\n}\n\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n while (i--) {\n sum += str.charCodeAt(i);\n }\n return sum.toString(36);\n}\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n}\n\n// Fixed #973:\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n}\n\n// Export utils\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild,\n expando: expando\n};\n\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\nSortable.get = function (element) {\n return element[expando];\n};\n\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n};\n\n// Export\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n };\n\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt;\n\n // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback);\n\n // Listener for pointer element change\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval();\n // Detect for pointer elem change, emulating native DnD behaviour\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn;\n\n // New scroll root, set scrollEl\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n var layersOut = 0;\n var currentParent = scrollEl;\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n }\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\nfunction Revert() {}\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n this.sortable.animateAll();\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\nfunction Remove() {}\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\n multiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\n folding = false,\n // Folding any other time\n dragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n dataTransfer.setData('Text', data);\n }\n };\n }\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n sortable._hideClone();\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n });\n\n // Sort multi-drag elements\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n\n sortable.captureAnimationState();\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n }\n\n // Remove all auxiliary multidrag items from el, if sorting enabled\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n initialFolding = false;\n // If leaving sort:false root, or already folding - Fold to new location\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute);\n\n // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n }\n\n // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n activeSortable._showClone(sortable);\n\n // Unfold animation for clones if showing from hidden\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children;\n\n // Multi-drag selection\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n\n // Modifier activated, select from last to dragEl\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n (function () {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n var filter = options.filter;\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n // Check if element is draggable\n if (!closest(children[i], options.draggable, parentEl, false)) continue;\n // Check if element is filtered\n var filtered = filter && (typeof filter === 'function' ? filter.call(sortable, evt, children[i], sortable) : filter.split(',').some(function (criteria) {\n return closest(children[i], criteria.trim(), parentEl, false);\n }));\n if (filtered) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n })();\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n }\n\n // Multi-drag drop\n if (dragStarted && this.isMultiDrag) {\n folding = false;\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect;\n\n // Prepare unfold animation\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n }\n\n // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n multiDragIndex++;\n });\n\n // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n if (update) {\n dispatchSortableEvent('update');\n dispatchSortableEvent('sort');\n }\n }\n }\n\n // Must be done after capturing individual rects (scroll bar)\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n multiDragSortable = toSortable;\n }\n\n // Remove clones if necessary\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return;\n\n // Only deselect if selection is in this sortable\n if (multiDragSortable !== this.sortable) return;\n\n // Only deselect if target is not item in this sortable\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;\n\n // Only deselect if left click\n if (evt && evt.button !== 0) return;\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n multiDragSortable = sortable;\n }\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n });\n\n // multiDragElements will already be sorted if folding\n var newIndex;\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n return key;\n }\n }\n });\n}\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","// sortable: a Svelte action that lets the user reorder items by dragging them, within a container\n// and between containers. SortableJS handles the input (mouse, touch, nested containers); the\n// action reports the result as a move from one container and index to another, and the\n// application applies it to its own data. The data stays the only source of the order: right after\n// a drop the action puts the element back where it was, so that a keyed {#each} is never out of\n// step with the DOM, and the list is drawn again from the data.\n//\n// Put the action on each container. Containers with the same group exchange items. Each item\n// carries data-sortable-item and data-id; data-kind names its kind when containers accept only\n// some kinds. With handle, an item is picked up by that part only (a grip for touch screens);\n// without it, by the whole item.\n//\n// <div use:sortable={{ group: 'rows', containerId: 'root', onDrop: move }}>\n// {#each rows as row (row.id)}\n// <TreeRow data-sortable-item data-id={row.id}>{row.name}</TreeRow>\n// {/each}\n// </div>\nimport Sortable from 'sortablejs';\nexport function sortable(node, params) {\n let cur = params;\n let instance = null;\n // Where the item was when the drag began, to put it back after the drop\n let origParent = null;\n let origNext = null;\n // The item under the pointer, read from the document during a drag: SortableJS reports moves\n // only over containers that accept the item\n let docMove = null;\n node.setAttribute('data-container', params.containerId);\n // The value of a data attribute of an element, or ''\n const data = (el, name) => el?.getAttribute(`data-${name}`) ?? '';\n function stopWatching() {\n if (docMove) {\n document.removeEventListener('pointermove', docMove, true);\n docMove = null;\n }\n }\n function make() {\n if (cur.enabled === false)\n return null;\n return Sortable.create(node, {\n group: {\n name: cur.group,\n pull: true,\n put: (_to, _from, el) => (cur.accept ? cur.accept(data(el, 'kind'), data(el, 'id')) : true),\n },\n handle: cur.handle ?? undefined,\n filter: cur.filter,\n // A press on a filtered part (a button) stays a click\n preventOnFilter: false,\n draggable: '[data-sortable-item]',\n animation: 150,\n // The fallback drag behaves the same with a mouse and with touch, and keeps clicks\n forceFallback: true,\n // A smaller movement is a click, not a drag\n fallbackTolerance: 10,\n fallbackClass: 'sortfallback',\n // The classes of the item picked up, of the place it would drop and of the dragged copy\n ghostClass: 'sortghost',\n chosenClass: 'sortchosen',\n dragClass: 'sortdrag',\n scroll: true,\n scrollSensitivity: 40,\n scrollSpeed: 12,\n touchStartThreshold: 4,\n onMove(evt) {\n const dragged = evt.dragged;\n const related = evt.related;\n const hold = cur.onOver?.({\n dragId: data(dragged, 'id'),\n dragKind: data(dragged, 'kind'),\n overId: data(related, 'id'),\n overKind: data(related, 'kind'),\n });\n return hold !== true;\n },\n onStart(evt) {\n origParent = evt.from;\n origNext = evt.item.nextSibling;\n const dragId = data(evt.item, 'id');\n const dragKind = data(evt.item, 'kind');\n docMove = (e) => {\n const el = document.elementFromPoint?.(e.clientX, e.clientY);\n const over = el?.closest('[data-sortable-item]');\n const overId = data(over, 'id');\n const self = overId === dragId;\n cur.onOver?.({\n dragId,\n dragKind,\n overId: self ? '' : overId,\n overKind: self ? '' : data(over, 'kind'),\n });\n };\n document.addEventListener('pointermove', docMove, true);\n },\n onEnd(evt) {\n stopWatching();\n const item = evt.item;\n const oldIndex = evt.oldIndex ?? 0;\n const newIndex = evt.newIndex ?? 0;\n // Put the element back; the application's data decides the order\n if (origParent)\n origParent.insertBefore(item, origNext);\n origParent = null;\n origNext = null;\n cur.onOver?.(null);\n const from = data(evt.from, 'container');\n const to = data(evt.to, 'container');\n const itemId = data(item, 'id');\n if (!itemId || !from || !to)\n return;\n if (from === to && oldIndex === newIndex)\n return;\n cur.onDrop({ itemId, from, to, oldIndex, newIndex });\n },\n });\n }\n instance = make();\n return {\n update(p) {\n const remake = p.group !== cur.group ||\n p.handle !== cur.handle ||\n p.enabled !== cur.enabled ||\n p.containerId !== cur.containerId;\n cur = p;\n node.setAttribute('data-container', p.containerId);\n if (remake) {\n instance?.destroy();\n instance = make();\n }\n },\n destroy() {\n stopWatching();\n instance?.destroy();\n instance = null;\n },\n };\n}\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Markbox: the place of an icon. A square of an icon's size that centres what it holds (an\n // icon, an emoji, a color mark, a Swatch), so that the first column of a list stays in place\n // when the marks differ in size. It has no surface and no line, and it does not change the\n // height of a list item.\n //\n // <Markbox><Icon name=\"image\" /></Markbox> <Markbox glyph>🏔️</Markbox>\n let {\n glyph = false,\n children,\n }: {\n /** The content is an emoji; its font is --kata-glyph-font, set by the container */\n glyph?: boolean;\n children: Snippet;\n } = $props();\n</script>\n\n<span class=\"markbox\" class:glyph data-role=\"markbox\" data-h=\"icon\">{@render children()}</span>\n\n<style>.markbox {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n flex: none;\n}\n\n.glyph {\n font-family: var(--kata-glyph-font, inherit);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { setContext } from 'svelte';\n import Stack from './Stack.svelte';\n\n // Tree: a list with depth. It stacks TreeRows and DropLines only; the rows touch, and the tree's\n // outline is the edges of its rows, so the distance to what is around it belongs to the Stack it\n // sits in. The depth of a row is its depth prop, so the elements inside a tree may be flat, or\n // nested in groups that a drag and drop reorders (see sortable); a group needs no distance of its\n // own.\n //\n // flat is for a tree where no row opens: the rows leave no room for the chevron, so their text\n // starts where the head of a SectionHeader does. A row takes its height from its content (the\n // content and pad-md above and below); rows raises the least height, so that rows with different\n // content in one tree are the same height: mark (a mark before the name), box (a control), thumb\n // (a thumbnail) or two (two lines).\n //\n // <Tree label=\"Contents\"><TreeRow …/><TreeRow depth={1} …/></Tree>\n let {\n label,\n flat = false,\n rows,\n children,\n }: {\n /** The name of the tree */\n label?: string;\n /** No row opens: no room for the chevron */\n flat?: boolean;\n /** The least height of every row */\n rows?: 'mark' | 'box' | 'thumb' | 'two';\n children: Snippet;\n } = $props();\n // The rows read whether the tree is flat\n setContext('kata-tree-flat', () => flat);\n</script>\n\n<div class=\"tree\" role=\"tree\" aria-label={label} data-role=\"list\" data-rows={rows}>\n <Stack gap={0}>{@render children()}</Stack>\n</div>\n\n<style>.tree {\n min-width: 0;\n flex: none;\n}\n.tree[data-rows=mark] {\n --kata-list-item-height: var(--kata-height-list-item-mark);\n}\n.tree[data-rows=box] {\n --kata-list-item-height: var(--kata-height-list-item-lg);\n}\n.tree[data-rows=thumb] {\n --kata-list-item-height: var(--kata-height-thumbnail-row);\n}\n.tree[data-rows=two] {\n --kata-list-item-height: var(--kata-height-list-item-two);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n\n // ListItem: one entry of a list, a roster or a list of notifications. Its height comes from its\n // content: every visible thing in it (a mark, a picture, a control with a line or a surface,\n // stacked content) keeps md above and below, and the item grows to fit. The least height is the\n // ink of its text and md above and below; a list raises it with rows so that items holding\n // different things line up. The author declares no kind.\n //\n // The columns are a grid (columns, as grid-template-columns), gap-sm apart. pad-md at the sides,\n // or the inset its container declares; tail narrows the right side to pad-sm when the item ends\n // with an icon button, so that the icon's strokes line up with the edge of the text. It declares\n // the small button for the controls inside. The hover and selection surfaces, the line and the\n // area that is pressed all belong to this item.\n //\n // Items touch (no gap). rule draws a line under an item, between items only. An item that is\n // pressed takes onclick or href; one that is not takes plain.\n //\n // <ListItem columns=\"auto minmax(0, 1fr)\" onclick={open}><Icon name=\"image\" /><span>Photos</span></ListItem>\n // <ListItem columns=\"minmax(0, 1fr) auto\" tail plain><span>Name</span><Button …/></ListItem>\n let {\n columns,\n tail = false,\n sel = false,\n rule = false,\n plain = false,\n href,\n onclick,\n onkeydown,\n children,\n ...rest\n }: Omit<HTMLAttributes<HTMLElement>, 'class' | 'style' | 'onclick' | 'onkeydown'> & {\n /** The columns of the item's grid (grid-template-columns) */\n columns: string;\n /** The item ends with an icon button: pad-sm at the right */\n tail?: boolean;\n /** Selected: the raise surface and a blue line of two at the left */\n sel?: boolean;\n /** A line under the item (not under the last one) */\n rule?: boolean;\n /** An item that is not pressed: no hover surface */\n plain?: boolean;\n /** Renders a link */\n href?: string;\n /** Makes the item pressable (Enter and Space press it too) */\n onclick?: (e: MouseEvent) => void;\n onkeydown?: (e: KeyboardEvent) => void;\n children: Snippet;\n } = $props();\n\n const clickable = $derived(!plain && !!(onclick || href));\n function onKeyDown(e: KeyboardEvent) {\n onkeydown?.(e);\n if (e.defaultPrevented) return;\n if (e.key !== 'Enter' && e.key !== ' ') return;\n // The keys typed into a field inside the item stay the field's\n if ((e.target as HTMLElement).closest('input, textarea, select, [contenteditable]')) return;\n e.preventDefault();\n (e.currentTarget as HTMLElement).click();\n }\n</script>\n\n{#if href}\n <a\n class=\"row\"\n class:sel\n class:rule\n class:plain\n class:tail\n data-role=\"list-item\"\n data-h=\"list-item\"\n data-rule={rule ? '' : undefined}\n style:grid-template-columns={columns}\n {href}\n {onclick}\n {onkeydown}\n {...rest}\n >\n {@render children()}\n </a>\n{:else}\n <div\n class=\"row\"\n class:sel\n class:rule\n class:plain\n class:tail\n data-role=\"list-item\"\n data-h=\"list-item\"\n data-rule={rule ? '' : undefined}\n style:grid-template-columns={columns}\n {...clickable ? { role: 'button', tabindex: 0 } : {}}\n {onclick}\n onkeydown={clickable ? onKeyDown : onkeydown}\n {...rest}\n >\n {@render children()}\n </div>\n{/if}\n\n<style>.row {\n display: grid;\n align-items: center;\n gap: var(--kata-gap-sm);\n min-height: var(--kata-list-item-height, var(--kata-height-list-item));\n position: relative;\n padding-inline: var(--kata-inset, var(--kata-pad-md));\n min-width: 0;\n width: 100%;\n color: inherit;\n text-decoration: none;\n flex: none;\n cursor: default;\n font-size: var(--kata-text-size-body);\n line-height: var(--kata-text-leading-body);\n letter-spacing: var(--kata-text-tracking-body);\n --kata-box: var(--kata-height-button-sm);\n}\n.row :global([data-role='mark'][data-h]:not([data-h='icon'])),\n.row :global([data-role='mark'][data-kata-tall]),\n.row :global([data-role='box'][data-h]:not(.ghost)),\n.row :global(input:not([type='checkbox']):not([type='radio'])),\n.row :global(select),\n.row :global(textarea) {\n margin-block: var(--kata-text-size-body);\n}\n.row :global([data-role='stack']) {\n padding-block: var(--kata-text-size-body);\n}\n.row :global([data-role='stack'] [data-role='stack']) {\n padding-block: 0;\n}\n.row :global([data-role='stack'] [data-role='mark'][data-h]:not([data-h='icon'])),\n.row :global([data-role='stack'] [data-role='mark'][data-kata-tall]),\n.row :global([data-role='stack'] [data-role='box'][data-h]:not(.ghost)),\n.row :global([data-role='stack'] input:not([type='checkbox']):not([type='radio'])),\n.row :global([data-role='stack'] select),\n.row :global([data-role='stack'] textarea),\n.row :global([data-role='box'] input:not([type='checkbox']):not([type='radio'])),\n.row :global([data-role='box'] select),\n.row :global([data-role='box'] textarea) {\n margin-block: 0;\n}\n.row > :global(*) {\n min-width: 0;\n}\n.row > :global(:where(span, a, p):not([data-role]):not([data-h])) {\n text-box: trim-both cap alphabetic;\n padding-top: calc(var(--kata-ink-over) * 1em);\n padding-bottom: calc(var(--kata-ink-under) * 1em);\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}\n.row:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}\n\n.tail {\n padding-inline-end: var(--kata-pad-sm);\n}\n\n.row[role=button],\na.row {\n cursor: pointer;\n}\n.row[role=button]:hover,\na.row:hover {\n background: var(--kata-color-raise);\n}\n\n.sel {\n background: var(--kata-color-raise);\n box-shadow: inset 2px 0 0 var(--kata-color-blue-ink);\n}\n\n.rule {\n border-bottom: var(--kata-border-width) solid var(--kata-color-line);\n}\n\n.rule:last-child {\n border-bottom: 0;\n}\n\n.plain,\n.plain:hover {\n cursor: default;\n background: transparent;\n}\n\n.sel.plain {\n background: var(--kata-color-raise);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { getContext } from 'svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import { getMessages } from '../messages.js';\n import Icon from './Icon.svelte';\n import ListItem from './ListItem.svelte';\n\n // TreeRow: one row of a Tree, a ListItem indented by its depth: pad-md plus depth × pad-md on\n // the left. Its columns are fixed: the chevron, the name, the actions. The chevron's place (the\n // square of an icon button) is kept even when the row does not open, so nothing moves when a row\n // gains children; a flat Tree removes it. The chevron is a button of that square.\n //\n // The grip shows on hover and on focus, just left of the first thing the row shows (the chevron,\n // or the name), over the padding, so it takes no place. The actions on the right keep no place:\n // an action in a state other than its default (a hidden eye, a closed lock: data-keep on it)\n // always shows, the others only while the row is hovered or focused (data-open on the row keeps\n // them while a menu of the row is open).\n //\n // States: sel (selected: a double blue line on the left and the raise surface), hidden (the row\n // hides its content: dimmed), dimmed (a parent is hidden), dragging (the row is being dragged).\n // Attributes other than the props (data-id, data-kind, data-sortable-item for sortable) go to\n // the row. The right and left arrow keys open and close a row that has the focus.\n //\n // <TreeRow depth={1} expandable bind:expanded sel onclick={pick}>\n // Background\n // {#snippet end()}<Button variant=\"ghost\" icon aria-label=\"Hide\"><Icon name={Eye} /></Button>{/snippet}\n // </TreeRow>\n let {\n depth = 0,\n expandable = false,\n expanded = $bindable(false),\n ontoggle,\n grip = true,\n gripShow = false,\n sel = false,\n hidden = false,\n dimmed = false,\n dragging = false,\n onclick,\n children,\n end,\n ...rest\n }: Omit<HTMLAttributes<HTMLElement>, 'class' | 'style' | 'onclick' | 'ontoggle' | 'hidden'> & {\n /** The depth, from 0 */\n depth?: number;\n /** The row has children and shows the chevron */\n expandable?: boolean;\n /** The children show */\n expanded?: boolean;\n /** Called with the new state when the chevron is pressed */\n ontoggle?: (expanded: boolean) => void;\n /** Shows the grip (false in a tree that is not reordered) */\n grip?: boolean;\n /** Always shows the grip (screens without hover) */\n gripShow?: boolean;\n /** Selected */\n sel?: boolean;\n /** The row hides its content */\n hidden?: boolean;\n /** A parent is hidden */\n dimmed?: boolean;\n /** The row is being dragged */\n dragging?: boolean;\n /** Called when the row is pressed */\n onclick?: (e: MouseEvent) => void;\n /** The name, and a mark before it */\n children: Snippet;\n /** The actions on the right */\n end?: Snippet;\n } = $props();\n const flatTree = getContext<(() => boolean) | undefined>('kata-tree-flat');\n const noSeat = $derived(!!flatTree?.() && !expandable);\n\n function toggle() {\n expanded = !expanded;\n ontoggle?.(expanded);\n }\n // The arrow keys open and close the row (Enter and Space press it, as ListItem does)\n function onkeydown(e: KeyboardEvent) {\n const t = e.target as HTMLElement;\n if (t !== e.currentTarget && !t.classList.contains('chev')) return;\n if (!expandable) return;\n if ((e.key === 'ArrowRight' && !expanded) || (e.key === 'ArrowLeft' && expanded)) {\n e.preventDefault();\n toggle();\n }\n }\n const columns = $derived(\n [noSeat ? '' : 'auto', 'minmax(0, 1fr)', end ? 'auto' : ''].filter(Boolean).join(' '),\n );\n</script>\n\n<div\n class=\"tree-row\"\n class:hidden\n class:dimmed\n class:dragging\n data-dim={hidden || dimmed || dragging ? '' : undefined}\n style:--kata-tree-depth={depth}\n role=\"treeitem\"\n aria-selected={sel}\n aria-expanded={expandable ? expanded : undefined}\n aria-level={depth + 1}\n {...rest}\n>\n <ListItem {columns} {sel} tail={!!end} {onclick} {onkeydown}>\n {#if grip}\n <span class=\"grip\" class:beside={expandable || noSeat} class:show={gripShow} data-grip aria-hidden=\"true\"\n ><Icon name=\"grip-vertical\" /></span\n >\n {/if}\n {#if expandable}\n <button\n class=\"chev\"\n type=\"button\"\n data-h=\"icon-button\"\n tabindex={onclick ? -1 : 0}\n aria-label={expanded ? getMessages().collapse : getMessages().expand}\n onclick={(e) => {\n e.stopPropagation();\n toggle();\n }}\n >\n <Icon name={expanded ? 'chevron-down' : 'chevron-right'} />\n </button>\n {:else if !noSeat}\n <span class=\"seat\" aria-hidden=\"true\"></span>\n {/if}\n <span class=\"main\">{@render children()}</span>\n {#if end}\n <span class=\"end\">{@render end()}</span>\n {/if}\n </ListItem>\n</div>\n\n<style>.tree-row {\n min-width: 0;\n flex: none;\n}\n\n.tree-row > :global([data-role='list-item']) {\n padding-left: calc(var(--kata-pad-md) + var(--kata-tree-depth, 0) * var(--kata-pad-md));\n}\n\n.seat {\n width: var(--kata-height-icon-button);\n flex: none;\n}\n\n.grip {\n position: absolute;\n top: 50%;\n left: calc(var(--kata-pad-md) + var(--kata-tree-depth, 0) * var(--kata-pad-md) + var(--kata-height-icon-button) + var(--kata-pad-sm));\n translate: calc(-1 * (var(--kata-height-icon) + var(--kata-pad-2xs))) -50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--kata-pad-md);\n height: var(--kata-height-icon-button);\n color: var(--kata-color-faint);\n cursor: grab;\n opacity: 0;\n transition: opacity 0.12s ease;\n}\n\n.grip.beside {\n left: calc(var(--kata-pad-md) + var(--kata-tree-depth, 0) * var(--kata-pad-md));\n}\n\n.tree-row:hover .grip,\n.tree-row:focus-within .grip,\n.grip.show {\n opacity: 1;\n}\n\n.chev {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--kata-height-icon-button);\n height: var(--kata-height-icon-button);\n flex: none;\n border: 0;\n padding: 0;\n background: transparent;\n color: var(--kata-color-muted);\n cursor: pointer;\n}\n.chev:hover {\n background: var(--kata-color-raise-2);\n color: var(--kata-color-text);\n}\n.chev:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}\n\n.main {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-sm);\n}\n\n.main > :global([data-role='stack']) {\n flex: 1 1 auto;\n min-width: 0;\n white-space: normal;\n}\n\n.end {\n display: flex;\n align-items: center;\n gap: 0;\n flex: none;\n}\n.end > :global(*:not([data-keep])) {\n opacity: 0;\n}\n\n.tree-row .end :global([data-role='mark'][data-h]) {\n margin-block: 0;\n}\n\n@container app (width < 24rem) {\n .end {\n position: absolute;\n right: var(--kata-pad-sm);\n top: 50%;\n transform: translateY(-50%);\n }\n}\n.tree-row:hover .end > :global(*),\n.tree-row:focus-within .end > :global(*),\n.tree-row[data-open] .end > :global(*) {\n opacity: 1;\n}\n\n.hidden,\n.dimmed,\n.dragging {\n opacity: var(--kata-opacity-dim);\n}\n\n:global(.sortghost) > .tree-row > :global([data-role='list-item']),\n.tree-row:global(.sortghost) > :global([data-role='list-item']) {\n background: var(--kata-color-raise-2);\n box-shadow: inset 0 0 0 calc(var(--kata-border-width) * 2) var(--kata-color-blue-ink);\n}\n\n:global(.sortchosen) > .tree-row > :global([data-role='list-item']),\n.tree-row:global(.sortchosen) > :global([data-role='list-item']) {\n background: var(--kata-color-raise-2);\n}</style>\n","<script lang=\"ts\" module>\n import type { IconSource } from '../icons.js';\n\n /** One node of a LayerTree. A node with children (an array, even empty) is a group. */\n export interface TreeNode {\n id: string;\n /** What the node is, in the application's words; the tree only passes it back */\n kind: string;\n name: string;\n /** The mark before the name */\n icon?: IconSource;\n /** The color of the mark (a CSS color) */\n iconColor?: string;\n visible: boolean;\n locked: boolean;\n children?: TreeNode[];\n /** The application's own fields */\n data?: unknown;\n }\n\n /** The keys held when a row was pressed: Shift (range) and ⌘ or Ctrl (toggle) */\n export interface TreeSelectModifiers {\n range: boolean;\n toggle: boolean;\n }\n\n /** A node dropped in a new place: its new parent (null for the root) and its index there */\n export interface TreeMove {\n id: string;\n parentId: string | null;\n index: number;\n }\n\n // Each tree drags within itself only\n let trees = 0;\n</script>\n\n<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { tick } from 'svelte';\n import type { MenuModel } from '../lib/menuModel.js';\n import { getMessages } from '../messages.js';\n import { type SortableParams, type SortMove, type SortOver, sortable } from '../sortable.js';\n import Button from './Button.svelte';\n import Dropdown from './Dropdown.svelte';\n import Icon from './Icon.svelte';\n import InlineEdit from './InlineEdit.svelte';\n import Markbox from './Markbox.svelte';\n import MenuList from './MenuList.svelte';\n import SectionHeader from './SectionHeader.svelte';\n import Swatch from './Swatch.svelte';\n import Text from './Text.svelte';\n import Tree from './Tree.svelte';\n import TreeRow from './TreeRow.svelte';\n\n // LayerTree: the layers of a drawing and what they hold, as a tree: a Tree of TreeRows with a\n // head (a SectionHeader with the add menu). The nodes are data of one general shape (TreeNode);\n // the tree knows nothing of what a kind is. The application keeps the nodes, the selection and\n // the open groups, and applies what the tree reports.\n //\n // A row shows the node's mark and name, and on the right its actions, the eye and the lock (each\n // when its callback is given). row(node, name) draws the part before the actions for a kind of\n // its own, and renders name(node) where the name goes; actions(node) adds actions before the\n // eye. A press selects (Shift adds the range, ⌘ or Ctrl toggles), F2 or a double click renames in\n // place, and with onmove the rows are reordered by dragging: a node goes into any open group, but\n // a group keeps its depth unless allowNesting, so a group never enters another group.\n //\n // <LayerTree label=\"Layers\" {nodes} bind:selected bind:expanded\n // onvisible={show} onlock={lock} onrename={rename} onmove={move}\n // addMenu={[{ id: 'layer', label: 'Layer' }]} onadd={add} />\n let {\n nodes,\n label,\n head = true,\n selected = $bindable([]),\n onselect,\n expanded = $bindable([]),\n onexpand,\n onvisible,\n onlock,\n onrename,\n onmove,\n allowNesting = false,\n canDrop,\n gripOnly = false,\n addMenu,\n onadd,\n addLabel,\n row,\n actions,\n }: {\n /** The nodes at the root, in the order they show */\n nodes: TreeNode[];\n /** The name of the tree, and the title of its head */\n label: string;\n /** Shows the head (the title and the add menu) */\n head?: boolean;\n /** The ids of the selected nodes */\n selected?: string[];\n /** Called with the new selection and the keys held */\n onselect?: (ids: string[], modifiers: TreeSelectModifiers) => void;\n /** The ids of the open groups */\n expanded?: string[];\n /** Called when a group opens or closes */\n onexpand?: (id: string, open: boolean) => void;\n /** Shows the eye; called with the node's new visibility */\n onvisible?: (id: string, visible: boolean) => void;\n /** Shows the lock; called with the node's new state */\n onlock?: (id: string, locked: boolean) => void;\n /** Lets a name be changed in place; called with the new name */\n onrename?: (id: string, name: string) => void;\n /** Lets the rows be reordered by dragging; called after a drop */\n onmove?: (move: TreeMove) => void;\n /** A group may go into another group */\n allowNesting?: boolean;\n /** A rule of the application: whether a node may go into a parent (null for the root) */\n canDrop?: (node: TreeNode, parent: TreeNode | null) => boolean;\n /** Rows are picked up by their grip only, which always shows (screens without hover) */\n gripOnly?: boolean;\n /** The menu of the add button in the head */\n addMenu?: MenuModel[];\n /** Called with the id of the item of the add menu that was chosen */\n onadd?: (id: string) => void;\n /** The text of the add button (\"Add\" by default) */\n addLabel?: string;\n /** Draws the part of a row before its actions: the mark, name(node) and anything after it */\n row?: Snippet<[TreeNode, Snippet<[TreeNode]>]>;\n /** Actions of a row before the eye and the lock */\n actions?: Snippet<[TreeNode]>;\n } = $props();\n\n const group = `kata-layer-tree-${++trees}`;\n const ROOT = 'root';\n const zoneId = (parent: TreeNode | null) => (parent ? `node:${parent.id}` : ROOT);\n\n // Where each node is: the node, its parent and its depth\n const index = $derived.by(() => {\n const map = new Map<string, { node: TreeNode; parent: TreeNode | null; depth: number }>();\n const walk = (list: TreeNode[], parent: TreeNode | null, depth: number) => {\n for (const node of list) {\n map.set(node.id, { node, parent, depth });\n if (node.children) walk(node.children, node, depth + 1);\n }\n };\n walk(nodes, null, 0);\n return map;\n });\n const openSet = $derived(new Set(expanded));\n const selSet = $derived(new Set(selected));\n // The ids of the rows that show, in order\n const shown = $derived.by(() => {\n const ids: string[] = [];\n const walk = (list: TreeNode[]) => {\n for (const node of list) {\n ids.push(node.id);\n if (node.children && openSet.has(node.id)) walk(node.children);\n }\n };\n walk(nodes);\n return ids;\n });\n const hasEnd = $derived(!!(onvisible || onlock || actions));\n\n let root = $state<HTMLElement>();\n\n function setOpen(id: string, open: boolean) {\n if (open === openSet.has(id)) return;\n expanded = open ? [...expanded, id] : expanded.filter((x) => x !== id);\n onexpand?.(id, open);\n }\n\n // ---- Selection ----\n // The node a range starts from: the last one pressed without Shift\n let anchor: string | null = null;\n\n function pick(node: TreeNode, e?: MouseEvent) {\n const modifiers = { range: !!e?.shiftKey, toggle: !!(e?.metaKey || e?.ctrlKey) };\n let ids: string[];\n const from = anchor ? shown.indexOf(anchor) : -1;\n const to = shown.indexOf(node.id);\n if (modifiers.range && from !== -1 && to !== -1) {\n ids = shown.slice(Math.min(from, to), Math.max(from, to) + 1);\n } else if (modifiers.toggle) {\n ids = selSet.has(node.id) ? selected.filter((x) => x !== node.id) : [...selected, node.id];\n anchor = node.id;\n } else {\n ids = [node.id];\n anchor = node.id;\n }\n selected = ids;\n onselect?.(ids, modifiers);\n }\n\n // ---- Renaming ----\n let renaming = $state<string | null>(null);\n\n function startRename(id: string) {\n if (onrename) renaming = id;\n }\n function endRename(id: string) {\n if (renaming !== id) return;\n renaming = null;\n // The focus returns to the row, unless it went somewhere else\n void tick().then(() => {\n if (document.activeElement && document.activeElement !== document.body) return;\n rowOf(id)?.focus();\n });\n }\n // ---- Keys ----\n function rows(): HTMLElement[] {\n if (!root) return [];\n return [...root.querySelectorAll<HTMLElement>('[role=\"treeitem\"] > [data-role=\"list-item\"]')];\n }\n function rowOf(id: string): HTMLElement | undefined {\n return root?.querySelector<HTMLElement>(\n `[role=\"treeitem\"][data-node=\"${CSS.escape(id)}\"] > [data-role=\"list-item\"]`,\n ) ?? undefined;\n }\n\n // The up and down arrows, Home and End move between the rows; the right arrow goes into an open\n // group and the left one out to the parent (a row that opens or closes handles them first); F2\n // renames. Enter and Space press the row (ListItem).\n function onkeydown(e: KeyboardEvent) {\n const target = e.target as HTMLElement;\n if (!target.matches('[role=\"treeitem\"] > [data-role=\"list-item\"]')) return;\n const id = target.parentElement?.getAttribute('data-node');\n const at = id ? index.get(id) : undefined;\n if (!at || e.defaultPrevented) return;\n const list = rows();\n const i = list.indexOf(target);\n const go = (el: HTMLElement | undefined) => {\n e.preventDefault();\n el?.focus();\n };\n if (e.key === 'ArrowDown') go(list[i + 1]);\n else if (e.key === 'ArrowUp') go(list[i - 1]);\n else if (e.key === 'Home') go(list[0]);\n else if (e.key === 'End') go(list[list.length - 1]);\n else if (e.key === 'ArrowRight' && at.node.children?.length && openSet.has(at.node.id))\n go(list[i + 1]);\n else if (e.key === 'ArrowLeft' && at.parent) go(rowOf(at.parent.id));\n else if (e.key === 'F2' && onrename) {\n e.preventDefault();\n startRename(at.node.id);\n }\n }\n function keys(node: HTMLElement) {\n node.addEventListener('keydown', onkeydown);\n return { destroy: () => node.removeEventListener('keydown', onkeydown) };\n }\n\n // ---- Dragging ----\n // Whether a node may go into a parent: never into itself or below it; a group keeps its depth\n // unless allowNesting; then the application's rule\n function allowed(id: string, parent: TreeNode | null): boolean {\n const at = index.get(id);\n if (!at) return false;\n for (let p = parent; p; p = index.get(p.id)?.parent ?? null) if (p.id === id) return false;\n if (!allowNesting && at.node.children) {\n const depth = parent ? (index.get(parent.id)?.depth ?? 0) + 1 : 0;\n if (depth !== at.depth) return false;\n }\n return canDrop ? canDrop(at.node, parent) : true;\n }\n\n function drop(m: SortMove) {\n const parentId = m.to === ROOT ? null : m.to.slice('node:'.length);\n const parent = parentId ? (index.get(parentId)?.node ?? null) : null;\n if (!allowed(m.itemId, parent)) return;\n onmove?.({ id: m.itemId, parentId, index: m.newIndex });\n }\n\n // A closed group that the dragged node may enter opens after a moment under the pointer\n let springId: string | null = null;\n let springTimer = 0;\n function clearSpring() {\n if (springTimer) clearTimeout(springTimer);\n springTimer = 0;\n springId = null;\n }\n function over(info: SortOver | null): boolean {\n const target = info ? index.get(info.overId)?.node : undefined;\n if (!info || !target?.children || openSet.has(target.id) || !allowed(info.dragId, target)) {\n clearSpring();\n return false;\n }\n if (springId !== target.id) {\n clearSpring();\n springId = target.id;\n springTimer = window.setTimeout(() => {\n if (springId) setOpen(springId, true);\n clearSpring();\n }, 550);\n }\n return true;\n }\n\n function zone(parent: TreeNode | null): SortableParams {\n return {\n group,\n containerId: zoneId(parent),\n handle: gripOnly ? '[data-grip]' : null,\n filter: 'button, input, textarea',\n accept: (_kind, id) => allowed(id, parent),\n enabled: !!onmove,\n onDrop: drop,\n onOver: over,\n };\n }\n\n function rowProps(node: TreeNode, depth: number, parentHidden: boolean) {\n return {\n depth,\n expandable: !!node.children,\n expanded: openSet.has(node.id),\n ontoggle: (open: boolean) => setOpen(node.id, open),\n grip: !!onmove,\n gripShow: gripOnly && !!onmove,\n hidden: !node.visible,\n dimmed: parentHidden,\n sel: selSet.has(node.id),\n onclick: (e: MouseEvent) => pick(node, e),\n ondblclick: (e: MouseEvent) => {\n if (!(e.target as HTMLElement).closest('button')) startRename(node.id);\n },\n 'data-node': node.id,\n };\n }\n</script>\n\n{#snippet name(node: TreeNode)}\n {#if renaming === node.id}\n <span class=\"rename\">\n <InlineEdit\n value={node.name}\n placeholder={getMessages().rename}\n bind:editing={() => true, (v) => !v && endRename(node.id)}\n onCommit={(v) => onrename?.(node.id, v)}\n />\n </span>\n {:else}\n <Text clamp>{node.name}</Text>\n {/if}\n{/snippet}\n\n{#snippet mark(node: TreeNode)}\n {#if node.icon}\n <Markbox>\n {#if node.iconColor}\n <Swatch shape=\"icon\" icon={node.icon} color={node.iconColor} />\n {:else}\n <Icon name={node.icon} />\n {/if}\n </Markbox>\n {/if}\n{/snippet}\n\n{#snippet body(node: TreeNode)}\n {#if row}\n {@render row(node, name)}\n {:else}\n {@render mark(node)}\n {@render name(node)}\n {/if}\n{/snippet}\n\n{#snippet tools(node: TreeNode)}\n {@render actions?.(node)}\n {#if onvisible}\n <Button\n variant=\"ghost\"\n icon\n aria-label={node.visible ? getMessages().hide : getMessages().show}\n data-keep={node.visible ? undefined : ''}\n onclick={(e: MouseEvent) => {\n e.stopPropagation();\n onvisible?.(node.id, !node.visible);\n }}><Icon name={node.visible ? 'eye' : 'eye-off'} /></Button\n >\n {/if}\n {#if onlock}\n <Button\n variant=\"ghost\"\n icon\n aria-label={node.locked ? getMessages().unlock : getMessages().lock}\n data-keep={node.locked ? '' : undefined}\n onclick={(e: MouseEvent) => {\n e.stopPropagation();\n onlock?.(node.id, !node.locked);\n }}><Icon name={node.locked ? 'lock' : 'lock-open'} /></Button\n >\n {/if}\n{/snippet}\n\n{#snippet item(node: TreeNode, depth: number, parentHidden: boolean)}\n <div class=\"item\" role=\"none\" data-sortable-item data-id={node.id} data-kind={node.kind}>\n {#if hasEnd}\n <TreeRow {...rowProps(node, depth, parentHidden)}>\n {@render body(node)}\n {#snippet end()}{@render tools(node)}{/snippet}\n </TreeRow>\n {:else}\n <TreeRow {...rowProps(node, depth, parentHidden)}>{@render body(node)}</TreeRow>\n {/if}\n {#if node.children && openSet.has(node.id)}\n <div class=\"zone\" role=\"group\" aria-label={node.name} use:sortable={zone(node)}>\n {#each node.children as child (child.id)}\n {@render item(child, depth + 1, parentHidden || !node.visible)}\n {/each}\n </div>\n {/if}\n </div>\n{/snippet}\n\n{#snippet add()}\n <Dropdown menu align=\"end\" role=\"box\">\n {#snippet trigger(toggle, open)}\n <Button leading=\"plus\" aria-haspopup=\"menu\" aria-expanded={open} onclick={toggle}\n >{addLabel ?? getMessages().add}</Button\n >\n {/snippet}\n {#snippet panel(close)}\n <MenuList items={addMenu ?? []} onselect={onadd} onclose={close} />\n {/snippet}\n </Dropdown>\n{/snippet}\n\n{#snippet tree()}\n <Tree {label}>\n <div class=\"zone\" role=\"none\" use:sortable={zone(null)}>\n {#each nodes as node (node.id)}\n {@render item(node, 0, false)}\n {/each}\n </div>\n </Tree>\n{/snippet}\n\n<div class=\"layer-tree\" bind:this={root} use:keys>\n {#if head}\n <SectionHeader {label} flush actions={addMenu ? add : undefined}>{@render tree()}</SectionHeader>\n {:else}\n {@render tree()}\n {/if}\n</div>\n\n<style>.layer-tree,\n.item,\n.zone {\n display: flex;\n flex-direction: column;\n min-width: 0;\n flex: none;\n}\n\n.rename {\n display: flex;\n flex: 1 1 auto;\n min-width: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import Stack from './Stack.svelte';\n\n // List: a column of list items and nothing else. The items touch; the list's outline runs from\n // the top of the first item to the bottom of the last, and the distance to what is outside is\n // the gap of the layout around it. A switch, a checkbox or a radio is not a list item and goes\n // in a Stack.\n //\n // An item's height comes from its content. When a list mixes items that hold different things\n // and they must line up, rows raises the least height: mark (a mark), box (a control with an\n // outline), thumb (a thumbnail) or two (a title and a caption).\n //\n // <List label=\"Documents\">{#each docs as d (d.id)}<ListItem …>…</ListItem>{/each}</List>\n let {\n label,\n role = 'list',\n rows,\n children,\n }: {\n /** The name of the list */\n label?: string;\n /** The role when the list has a name: group when its items are choices (icons, suggestions) */\n role?: 'list' | 'group';\n /** The least height of the items, named after what they hold */\n rows?: 'mark' | 'box' | 'thumb' | 'two';\n children: Snippet;\n } = $props();\n</script>\n\n<div\n class=\"list\"\n role={label ? role : undefined}\n aria-label={label}\n data-role=\"list\"\n data-rows={rows}\n>\n <Stack gap={0}>{@render children()}</Stack>\n</div>\n\n<style>.list {\n min-width: 0;\n}\n.list[data-rows=mark] {\n --kata-list-item-height: var(--kata-height-list-item-mark);\n}\n.list[data-rows=box] {\n --kata-list-item-height: var(--kata-height-list-item-lg);\n}\n.list[data-rows=thumb] {\n --kata-list-item-height: var(--kata-height-thumbnail-row);\n}\n.list[data-rows=two] {\n --kata-list-item-height: var(--kata-height-list-item-two);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { getMessages } from '../messages.js';\n\n // Sheet: a panel that comes up from the bottom of a narrow screen, with a strong line along its\n // top. It has three heights: peek (the handle and the head), half and full. A press on the handle\n // steps up through them (from the highest it returns to the lowest), the arrow keys step up and\n // down, and a drag snaps to the nearest height on release. stages offers fewer heights.\n //\n // The order inside is fixed: the handle, the head, the content and the foot. Only the content\n // shrinks and scrolls. It has no padding. When the content is a panel with a head of its own,\n // pane gives it the full height and the panel's head becomes the sheet's head.\n //\n // It is placed absolutely at the bottom of its frame, which must be a positioned element. inline\n // draws it in the flow instead, for documentation.\n //\n // <Sheet bind:stage label=\"Details\">\n // {#snippet head()}…{/snippet}\n // <Stack gap=\"md\">…</Stack>\n // </Sheet>\n type Stage = 'peek' | 'half' | 'full';\n let {\n stage = $bindable('half'),\n stages = ['peek', 'half', 'full'],\n onstage,\n name,\n z,\n closable = false,\n onclose,\n pane = false,\n inline = false,\n label,\n head,\n foot,\n children,\n }: {\n /** The height: peek (the head only), half or full */\n stage?: Stage;\n /** The heights offered, lowest first */\n stages?: Stage[];\n /** Called when the height changes */\n onstage?: (stage: Stage) => void;\n /** Tells several sheets apart (data-sheet) */\n name?: string;\n /** The stacking order; the sheet layer by default */\n z?: number;\n /** A drag below the lowest height, or ArrowDown there, closes it */\n closable?: boolean;\n onclose?: () => void;\n /** The content is a panel with its own head and scrolling */\n pane?: boolean;\n /** In the flow of a page, for documentation */\n inline?: boolean;\n /** The accessible name of the sheet */\n label?: string;\n /** The head; it does not shrink */\n head?: Snippet;\n /** The foot, for a primary action */\n foot?: Snippet;\n /** The content; it scrolls */\n children: Snippet;\n } = $props();\n\n // The share of the frame's height of each stage. peek takes the height of its content; its value\n // only guides where a drag snaps.\n const FRAC: Record<Stage, number> = { peek: 0.14, half: 0.5, full: 1 };\n // The least height while dragging, in px\n const MIN_DRAG = 48;\n\n let el = $state<HTMLElement>();\n // The height in px while dragging; back to a stage on release\n let dragH = $state<number | null>(null);\n let dragging = $state(false);\n let startY = 0;\n let startH = 0;\n let parentH = 0;\n\n const index = $derived(Math.max(0, stages.indexOf(stage)));\n\n function go(next: Stage) {\n if (next === stage) return;\n stage = next;\n onstage?.(next);\n }\n\n function cycle() {\n if (dragging) return;\n go(stages[index >= stages.length - 1 ? 0 : index + 1]);\n }\n\n function down(e: PointerEvent) {\n if (!el) return;\n parentH = el.parentElement?.clientHeight ?? window.innerHeight;\n startY = e.clientY;\n // Start from the height at the moment of the grab; peek is not a share of the frame\n startH = el.getBoundingClientRect().height;\n dragH = startH;\n dragging = true;\n (e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId);\n }\n function move(e: PointerEvent) {\n if (!dragging) return;\n const h = startH + (startY - e.clientY);\n dragH = Math.max(MIN_DRAG, Math.min(parentH * 0.94, h));\n }\n function up() {\n if (!dragging) return;\n dragging = false;\n const frac = (dragH ?? 0) / (parentH || 1);\n dragH = null;\n if (closable && frac < FRAC[stages[0]] * 0.55) {\n onclose?.();\n return;\n }\n let best = stages[0];\n let bestD = Number.POSITIVE_INFINITY;\n for (const s of stages) {\n const d = Math.abs(FRAC[s] - frac);\n if (d < bestD) {\n bestD = d;\n best = s;\n }\n }\n go(best);\n }\n function onkeydown(e: KeyboardEvent) {\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n go(stages[Math.min(stages.length - 1, index + 1)]);\n } else if (e.key === 'ArrowDown') {\n e.preventDefault();\n if (index === 0 && closable) onclose?.();\n else go(stages[Math.max(0, index - 1)]);\n }\n }\n</script>\n\n<aside\n class=\"sheet\"\n class:dragging\n data-stage={stage}\n data-inline={inline ? '' : undefined}\n data-sheet={name}\n aria-label={label}\n data-role=\"panel\"\n bind:this={el}\n style:z-index={z}\n style:height={dragH !== null ? `${dragH}px` : undefined}\n>\n <!-- The handle: a short bar that steps through the heights and can be dragged -->\n <button\n class=\"handle\"\n type=\"button\"\n aria-label={getMessages().sheetHeight}\n onclick={cycle}\n onpointerdown={down}\n onpointermove={move}\n onpointerup={up}\n onpointercancel={up}\n {onkeydown}\n ></button>\n {@render head?.()}\n <div class=\"scroll\" class:pane>{@render children()}</div>\n {@render foot?.()}\n</aside>\n\n<style>.sheet {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n min-width: 0;\n max-height: 100%;\n background: var(--kata-color-panel);\n color: var(--kata-color-text);\n border-top: var(--kata-border-width) solid var(--kata-color-line-strong);\n z-index: var(--kata-z-sheet);\n transition: height 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);\n --kata-box: var(--kata-height-button);\n}\n.sheet > :global(*) {\n flex: none;\n}\n.sheet > .scroll {\n flex: 1 1 auto;\n}\n\naside.sheet[data-inline] {\n position: static;\n flex: none;\n}\n\n.sheet.dragging {\n transition: none;\n}\n\n.sheet[data-stage=peek] > .scroll:not(.pane) {\n display: none;\n}\n\n.sheet[data-stage=peek] > .scroll.pane :global(.scroll) {\n display: none;\n}\n\n.sheet[data-stage=half] {\n height: 50%;\n}\n\n.sheet[data-stage=full] {\n height: 100%;\n}\n\n.scroll {\n padding: 0;\n --kata-inset: var(--kata-pad-md);\n --kata-at-start: 0;\n --kata-at-end: 0;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n}\n\n.scroll.pane {\n overflow: hidden;\n display: flex;\n}\n.scroll.pane > :global(*) {\n flex: 1 1 auto;\n width: 100%;\n max-width: none;\n min-height: 0;\n}\n\n.handle {\n height: var(--kata-gap-md);\n display: flex;\n align-items: center;\n justify-content: center;\n flex: none;\n border: 0;\n padding: 0;\n background: transparent;\n cursor: grab;\n touch-action: none;\n}\n.handle:active {\n cursor: grabbing;\n}\n.handle::before {\n content: \"\";\n width: calc(var(--kata-gap-md) * 2);\n height: calc(var(--kata-border-width) * 2);\n background: var(--kata-color-line-strong);\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n\n // Progress: the progress of a task, a bar gap-2xs high. With a value the fill grows from the\n // left; without one (indeterminate) a block runs across. A sentence such as \"Importing 3 of 8\n // files\" goes above it, in a Stack. How much of a limit is used is a Meter.\n //\n // <Progress value={38} /> <Progress label=\"Uploading\" />\n let {\n value,\n max = 100,\n label,\n }: {\n /** The amount done; without it the bar is indeterminate */\n value?: number;\n max?: number;\n /** The accessible name of the bar */\n label?: string;\n } = $props();\n\n const indet = $derived(value === undefined);\n const pct = $derived(\n indet || max <= 0 ? 0 : Math.max(0, Math.min(100, ((value ?? 0) / max) * 100)),\n );\n</script>\n\n<div\n class=\"progress\"\n data-role=\"progress\"\n class:indet\n role=\"progressbar\"\n aria-label={label}\n aria-valuemin={0}\n aria-valuemax={max}\n aria-valuenow={value}\n>\n <div class=\"fill\" style:width={indet ? undefined : `${pct}%`}></div>\n</div>\n\n<style>.progress {\n position: relative;\n height: var(--kata-gap-2xs);\n background: var(--kata-color-line);\n overflow: hidden;\n min-width: 0;\n flex: none;\n}\n\n.fill {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n background: var(--kata-color-solid);\n}\n\n.indet .fill {\n width: 30%;\n left: 35%;\n animation: flow 1.6s ease-in-out infinite;\n}\n\n@keyframes flow {\n 0% {\n transform: translateX(-135%);\n }\n 100% {\n transform: translateX(135%);\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .indet .fill {\n animation: none;\n }\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { getMessages } from '../messages.js';\n import Banner from './Banner.svelte';\n import Button from './Button.svelte';\n import Modal from './Modal.svelte';\n import Progress from './Progress.svelte';\n import Spinner from './Spinner.svelte';\n import Stack from './Stack.svelte';\n import Text from './Text.svelte';\n\n // ProcessDialog: the frame of a dialog that runs a process on what the application passes in (a\n // conversion, an export, an operation on a selection). It is a Modal whose body reads in a fixed\n // order: the error, the description, then the fields (children), gap-lg apart. The Footer holds\n // cancel and the run action, the primary one.\n //\n // While running, the body shows what is happening instead: a Spinner with the running text and a\n // Progress (with progress, how far it is; without, a block that runs across). The run action is\n // busy. Cancel, the close button and Escape call oncancel whenever they close the dialog, also\n // while running; when the application closes it (open = false after the run) oncancel is not\n // called.\n //\n // <ProcessDialog bind:open title=\"Simplify\" description=\"Removes points that change little.\"\n // runLabel=\"Simplify\" {running} onrun={simplify} oncancel={abort}>\n // <Field label=\"Tolerance\" for=\"tol\">…</Field>\n // </ProcessDialog>\n let {\n open = $bindable(false),\n title,\n description,\n error,\n runLabel,\n runningText,\n running = false,\n progress,\n disabled = false,\n onrun,\n oncancel,\n size = 'md',\n inline = false,\n children,\n }: {\n open?: boolean;\n title: string;\n /** What the process does, in a sentence or two, above the fields */\n description?: string;\n /** Why the last run failed, in a red notice at the top */\n error?: string;\n /** The run action; the run message by default */\n runLabel?: string;\n /** What shows while running; the running message by default */\n runningText?: string;\n /** The process runs: the body shows the progress and the run action is busy */\n running?: boolean;\n /** How far the process is, 0 to 100; without it the progress is indeterminate */\n progress?: number;\n /** The run action cannot be pressed (a field is missing) */\n disabled?: boolean;\n /** Called when the run action is pressed */\n onrun?: () => void;\n /** Called when the user closes the dialog without running it, or stops a run */\n oncancel?: () => void;\n /** The width, as Modal's size */\n size?: 'sm' | 'md' | 'lg' | 'xl';\n /** The same surface in the flow of a page, for documentation */\n inline?: boolean;\n /** The fields of the process */\n children?: Snippet;\n } = $props();\n\n const words = $derived(getMessages());\n\n function cancel() {\n open = false;\n oncancel?.();\n }\n // Every way of closing ends here; it is a cancel unless the application closed the dialog\n function onclose() {\n if (open) cancel();\n }\n</script>\n\n{#snippet cancelAction()}<Button onclick={cancel}>{words.cancel}</Button>{/snippet}\n{#snippet runAction()}\n <Button variant=\"primary\" busy={running} {disabled} onclick={() => onrun?.()}>\n {runLabel ?? words.run}\n </Button>\n{/snippet}\n\n<Modal {open} {title} {size} {inline} {onclose} cancel={cancelAction} primary={runAction}>\n {#if running}\n <Stack gap=\"sm\">\n <div aria-live=\"polite\"><Spinner label={runningText ?? words.running} /></div>\n <Progress value={progress} label={runningText ?? words.running} />\n </Stack>\n {:else}\n {#if error}<Banner tone=\"error\">{error}</Banner>{/if}\n {#if description}<Text>{description}</Text>{/if}\n {#if children}<Stack gap=\"lg\">{@render children()}</Stack>{/if}\n {/if}\n</Modal>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import Stack from './Stack.svelte';\n\n // Section: a titled part of a page (settings, forms). The head is the title (h2) with an optional\n // status on the right (saving, saved), gap-xs, then an optional note that applies to the whole\n // section. gap-lg separates the head from the content; it is never smaller than the gaps inside\n // the content. The content's children are gap apart (lg between fields, md for text and lists).\n //\n // The status is the only thing on the right of the title. Actions that create something go in a\n // Row at the start of the content, and a count goes in a caption at its end.\n //\n // Sections own the breaks between them, so they are stacked with gap 0: each has gap-lg below\n // (0 for the last one), and each one after the first draws a line above with pad-lg under it.\n // A section whose content ends with a List or a Tree is flush: the last item's lower padding is\n // part of the distance, so the section keeps only the rest (gap-sm).\n //\n // <Stack gap={0}>\n // <Section title=\"General\" status=\"Saved\">…</Section>\n // <Section title=\"Members\" gap=\"md\" flush>…</Section>\n // </Stack>\n type Gap = 0 | 'sm' | 'md' | 'lg';\n let {\n title,\n note,\n status,\n gap = 'lg',\n flush = false,\n children,\n }: {\n title: string;\n /** One sentence that applies to the whole section, under the title */\n note?: string;\n /** A short status on the right of the title */\n status?: string;\n /** The content ends with a List or a Tree */\n flush?: boolean;\n /** The distance between the content's children (default lg) */\n gap?: Gap;\n children: Snippet;\n } = $props();\n</script>\n\n<section class=\"kata-section\" class:flush data-role=\"section\">\n <Stack gap=\"lg\">\n <Stack gap=\"xs\">\n <div class=\"head\" data-role=\"row-inline\">\n <h2 class=\"title\">{title}</h2>\n {#if status}<span class=\"status\">{status}</span>{/if}\n </div>\n {#if note}<p class=\"note\" data-role=\"caption\">{note}</p>{/if}\n </Stack>\n <div class=\"body\" data-pass>\n <Stack {gap}>{@render children()}</Stack>\n </div>\n </Stack>\n</section>\n\n<style>.kata-section {\n display: flex;\n flex-direction: column;\n min-width: 0;\n padding-bottom: var(--kata-gap-lg); /* kata-allow-gap-padding */\n --kata-box: var(--kata-height-button);\n}\n\n.kata-section.flush {\n padding-bottom: var(--kata-gap-sm); /* kata-allow-gap-padding */\n}\n\n.kata-section:last-child {\n padding-bottom: 0;\n}\n\n.kata-section:not(:first-child) {\n padding-top: var(--kata-pad-lg);\n}\n\n.kata-section + :global(.kata-section) {\n border-top: var(--kata-border-width) solid var(--kata-color-line);\n}\n\n.title {\n font-size: var(--kata-text-size-h2);\n line-height: var(--kata-text-leading-h2);\n letter-spacing: var(--kata-text-tracking-h2);\n font-weight: 600;\n text-box: trim-start cap alphabetic;\n padding-top: var(--kata-edge-top);\n margin: 0;\n min-width: 0;\n}\n\n.body {\n min-width: 0;\n --kata-inset: 0px;\n --kata-at-start: 1;\n --kata-at-end: 1;\n}\n\n.head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-wrap: wrap;\n gap: var(--kata-gap-sm);\n min-width: 0;\n}\n\n.status {\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n color: var(--kata-color-muted);\n}\n\n.note {\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n color: var(--kata-color-muted);\n margin: 0;\n min-width: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { IconSource } from '../icons.js';\n import Icon from './Icon.svelte';\n\n // Stat: a figure (num) with its name (caption) below it. Neither text is trimmed, so the two sit\n // with no gap: the line heights are the distance. Figures have equal widths. Stats sets several\n // side by side.\n //\n // <Stat label=\"Documents\" value=\"128\" />\n let {\n label,\n value,\n icon,\n }: {\n /** The name */\n label: string;\n /** The figure, with its unit written by the application */\n value: string;\n /** An icon before the name, when an icon says what kind of figure it is */\n icon?: IconSource;\n } = $props();\n</script>\n\n<div class=\"stat\" data-role=\"stat\">\n <span class=\"v\">{value}</span>\n <span class=\"k\">{#if icon}<Icon name={icon} />{/if}<span class=\"t\">{label}</span></span>\n</div>\n\n<style>.stat {\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n\n.v {\n font-size: var(--kata-text-size-num);\n line-height: var(--kata-text-leading-num);\n letter-spacing: var(--kata-text-tracking-num);\n font-weight: 600;\n font-variant-numeric: tabular-nums;\n font-variant-numeric: tabular-nums;\n}\n\n.k {\n display: flex;\n align-items: center;\n gap: var(--kata-gap-2xs);\n min-width: 0;\n font-size: var(--kata-text-size-caption);\n line-height: var(--kata-text-leading-caption);\n letter-spacing: var(--kata-text-tracking-caption);\n color: var(--kata-color-muted);\n}\n\n.k > :global(svg) {\n flex: none;\n}\n\n.t {\n display: block;\n min-width: 0;\n white-space: nowrap;\n overflow: clip;\n overflow-clip-margin: 0.382em;\n text-overflow: ellipsis;\n min-width: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Stats: Stat side by side, gap-lg apart. When they do not fit (a narrow width, a large text\n // size) they wrap, gap-sm between the lines. It holds Stat only.\n //\n // <Stats><Stat label=\"Documents\" value=\"128\" /><Stat label=\"Storage\" value=\"1.2 GB\" /></Stats>\n let { children }: { children: Snippet } = $props();\n</script>\n\n<div class=\"stats\" data-role=\"stat\">{@render children()}</div>\n\n<style>.stats {\n display: flex;\n flex-wrap: wrap;\n gap: var(--kata-gap-sm) var(--kata-gap-lg);\n min-width: 0;\n}</style>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { getMessages } from '../messages.js';\n import Block from './Block.svelte';\n import Button from './Button.svelte';\n import Icon from './Icon.svelte';\n import Panel from './Panel.svelte';\n import Stack from './Stack.svelte';\n import Stat from './Stat.svelte';\n import Stats from './Stats.svelte';\n import Toolbar from './Toolbar.svelte';\n\n // SelectionSummary: the panel of a selection of several things. The head is a Toolbar with the\n // number selected (the messages API writes it, or title), the actions of end and a close button\n // with onclose. The content is, in order: the count of each kind as Stats in a Block, the fields\n // that edit what the things share (a snippet, usually SectionHeader groups), and the actions on\n // the whole selection in a Block. The panel knows nothing of the kinds; the application counts\n // them and names them.\n //\n // <SelectionSummary count={5} kinds={[{ label: 'Shapes', count: 3 }, { label: 'Notes', count: 2 }]}>\n // {#snippet fields()}<SectionHeader label=\"Color\">…</SectionHeader>{/snippet}\n // {#snippet actions()}<Row wrap><Button>Group</Button></Row>{/snippet}\n // </SelectionSummary>\n let {\n count,\n kinds = [],\n title,\n fields,\n actions,\n end,\n onclose,\n side = 'panel',\n }: {\n /** The number of things selected */\n count: number;\n /** The number of each kind, in order */\n kinds?: { label: string; count: number }[];\n /** The title in the head; by default the number selected */\n title?: string;\n /** The editors of what the things share (a snippet) */\n fields?: Snippet;\n /** The actions on the whole selection (a snippet) */\n actions?: Snippet;\n /** Icon buttons at the end of the head, before the close button (a snippet) */\n end?: Snippet;\n /** Shows a close button in the head and is called when it is pressed */\n onclose?: () => void;\n /** The width of the panel, as Panel's side */\n side?: 'rail' | 'panel' | 'fill';\n } = $props();\n\n const name = $derived(title ?? getMessages().selected({ count }));\n</script>\n\n{#snippet headEnd()}\n {@render end?.()}\n {#if onclose}\n <Button variant=\"ghost\" icon aria-label={getMessages().close} onclick={() => onclose?.()}>\n <Icon name=\"x\" />\n </Button>\n {/if}\n{/snippet}\n\n<Panel {side} label={name}>\n {#snippet head()}\n <Toolbar title={name} rule tail={!!(onclose || end)} end={onclose || end ? headEnd : undefined} />\n {/snippet}\n <Stack gap={0}>\n {#if kinds.length}\n <Block>\n <Stats>\n {#each kinds as kind, i (i)}\n <Stat label={kind.label} value={String(kind.count)} />\n {/each}\n </Stats>\n </Block>\n {/if}\n {@render fields?.()}\n {#if actions}<Block>{@render actions()}</Block>{/if}\n </Stack>\n</Panel>\n","// Keyboard shortcuts: how a key is written, shown and matched. A key is written without regard to\n// the platform: modifiers joined with +, then one key, for example \"mod+z\", \"shift+mod+z\", \"alt+l\"\n// or \"?\". mod is ⌘ on a Mac and Ctrl elsewhere. The key is one character or a name: escape, enter,\n// tab, space, backspace, delete, plus, minus, the arrows (up, down, left, right), home, end,\n// pageup, pagedown and f1 to f12.\nconst NAMES = {\n escape: 'Esc',\n enter: 'Enter',\n tab: 'Tab',\n space: 'Space',\n backspace: 'Backspace',\n delete: 'Del',\n plus: '+',\n minus: '-',\n up: '↑',\n down: '↓',\n left: '←',\n right: '→',\n home: 'Home',\n end: 'End',\n pageup: 'PgUp',\n pagedown: 'PgDn',\n};\nconst MAC_NAMES = { backspace: '⌫', delete: '⌦', enter: '↩' };\n// The names of e.key for the named keys\nconst KEY_OF = {\n escape: ['Escape'],\n enter: ['Enter'],\n tab: ['Tab'],\n space: [' ', 'Spacebar'],\n backspace: ['Backspace'],\n delete: ['Delete'],\n plus: ['+', '='],\n minus: ['-', '_'],\n up: ['ArrowUp'],\n down: ['ArrowDown'],\n left: ['ArrowLeft'],\n right: ['ArrowRight'],\n home: ['Home'],\n end: ['End'],\n pageup: ['PageUp'],\n pagedown: ['PageDown'],\n};\nfunction parse(spec) {\n const combo = { mod: false, ctrl: false, shift: false, alt: false, key: '' };\n // A trailing + is the key itself (\"mod++\"); the other parts are modifiers\n const parts = spec.endsWith('++') ? [...spec.slice(0, -2).split('+'), '+'] : spec.split('+');\n for (const raw of parts) {\n const part = raw.trim().toLowerCase();\n if (part === 'mod' || part === 'cmd' || part === 'meta')\n combo.mod = true;\n else if (part === 'ctrl' || part === 'control')\n combo.ctrl = true;\n else if (part === 'shift')\n combo.shift = true;\n else if (part === 'alt' || part === 'option')\n combo.alt = true;\n else if (part)\n combo.key = part;\n }\n return combo;\n}\n/** Whether the platform is a Mac (or another Apple system), where mod is ⌘ */\nexport function isMacPlatform() {\n if (typeof navigator === 'undefined')\n return false;\n const data = navigator.userAgentData;\n return /mac|iphone|ipad|ipod/i.test(data?.platform ?? navigator.platform ?? '');\n}\nfunction keyText(key, mac) {\n if (mac && MAC_NAMES[key])\n return MAC_NAMES[key];\n if (NAMES[key])\n return NAMES[key];\n if (/^f\\d{1,2}$/.test(key))\n return key.toUpperCase();\n return key.length === 1 ? key.toUpperCase() : key;\n}\n/**\n * The key as the platform writes it: symbols on a Mac (⌃⌥⇧⌘ in that order, then the key), words\n * elsewhere (Ctrl+Alt+Shift+Z).\n *\n * formatShortcut('shift+mod+z') // \"⇧⌘Z\" on a Mac, \"Ctrl+Shift+Z\" elsewhere\n */\nexport function formatShortcut(key, mac = isMacPlatform()) {\n const c = parse(key);\n const k = keyText(c.key, mac);\n if (mac) {\n return `${c.ctrl ? '⌃' : ''}${c.alt ? '⌥' : ''}${c.shift ? '⇧' : ''}${c.mod ? '⌘' : ''}${k}`;\n }\n const mods = [];\n if (c.mod || c.ctrl)\n mods.push('Ctrl');\n if (c.alt)\n mods.push('Alt');\n if (c.shift)\n mods.push('Shift');\n return [...mods, k].join('+');\n}\n/** A character that needs Shift on some keyboards and not on others: Shift is not compared */\nconst symbol = (key) => key.length === 1 && !/[a-z0-9]/.test(key);\nfunction sameKey(key, e) {\n const named = KEY_OF[key];\n if (named)\n return named.includes(e.key);\n if (/^f\\d{1,2}$/.test(key))\n return e.key.toLowerCase() === key;\n if (key.length !== 1)\n return false;\n if (e.key.toLowerCase() === key)\n return true;\n // Alt on a Mac turns a letter into another character: the physical key still counts\n if (key >= 'a' && key <= 'z')\n return e.code === `Key${key.toUpperCase()}`;\n if (key >= '0' && key <= '9')\n return e.code === `Digit${key}`;\n return false;\n}\n/** Whether a key event is the given shortcut */\nexport function matchesShortcut(key, e, mac = isMacPlatform()) {\n const c = parse(key);\n if (!c.key)\n return false;\n if (e.metaKey !== (mac ? c.mod : false))\n return false;\n if (e.ctrlKey !== (mac ? c.ctrl : c.mod || c.ctrl))\n return false;\n if (e.altKey !== c.alt)\n return false;\n const named = c.key === 'plus' || c.key === 'minus';\n if (!symbol(c.key) && !named && e.shiftKey !== c.shift)\n return false;\n return sameKey(c.key, e);\n}\n/** Whether the element takes typed text, so that keys belong to it */\nexport function isEditable(el) {\n if (!(el instanceof Element))\n return false;\n if (el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement)\n return true;\n if (el instanceof HTMLInputElement) {\n return !['checkbox', 'radio', 'button', 'submit', 'reset', 'range', 'color', 'file'].includes(el.type.toLowerCase());\n }\n return el instanceof HTMLElement && el.isContentEditable;\n}\n/** The help key: ?, or the Help key of the keyboard, or F1 */\nexport function isHelpKey(e) {\n if (e.metaKey || e.ctrlKey || e.altKey)\n return false;\n return e.key === '?' || e.key === 'Help' || e.key === 'F1';\n}\n","<script lang=\"ts\">\n import '../styles/components.css';\n import { formatShortcut, isMacPlatform, type Shortcut } from '../lib/shortcuts.js';\n import { getMessages } from '../messages.js';\n import Kbd from './Kbd.svelte';\n import List from './List.svelte';\n import ListItem from './ListItem.svelte';\n import Modal from './Modal.svelte';\n import Section from './Section.svelte';\n import Stack from './Stack.svelte';\n import Text from './Text.svelte';\n\n // ShortcutsModal: the list of keyboard shortcuts, in a Modal. One row for each shortcut: what it\n // does on the left, the key on the right, written as the platform writes it (formatShortcut).\n // Shortcuts without a group come first, without a heading; then one Section for each group, in\n // the order the groups first appear. Only the label and the key are read; run and when are not.\n // A Shell opens it with the help key; an application can also open it from a menu.\n //\n // <ShortcutsModal bind:open {shortcuts} />\n let {\n open = $bindable(false),\n shortcuts,\n title,\n mac,\n inline = false,\n onclose,\n }: {\n open?: boolean;\n /** The shortcuts to list; only key, label and group are read */\n shortcuts: Pick<Shortcut, 'key' | 'label' | 'group'>[];\n /** The title; the keyboardShortcuts string by default */\n title?: string;\n /** Writes the keys as a Mac does; by default, as the platform does */\n mac?: boolean;\n /** The same surface in the flow of a page, for documentation */\n inline?: boolean;\n onclose?: () => void;\n } = $props();\n\n const onMac = $derived(mac ?? isMacPlatform());\n const loose = $derived(shortcuts.filter((s) => !s.group));\n const groups = $derived.by(() => {\n const out = new Map<string, typeof shortcuts>();\n for (const s of shortcuts) {\n if (!s.group) continue;\n out.set(s.group, [...(out.get(s.group) ?? []), s]);\n }\n return [...out];\n });\n</script>\n\n{#snippet rows(list: typeof shortcuts)}\n <List>\n {#each list as s, i (`${i}:${s.key}`)}\n <ListItem columns=\"minmax(0, 1fr) auto\" plain rule>\n <Text clamp>{s.label}</Text>\n <Kbd bare>{formatShortcut(s.key, onMac)}</Kbd>\n </ListItem>\n {/each}\n </List>\n{/snippet}\n\n<Modal bind:open title={title ?? getMessages().keyboardShortcuts} {inline} {onclose}>\n <Stack gap={0}>\n {#if loose.length > 0}{@render rows(loose)}{/if}\n {#each groups as [group, list] (group)}\n <Section title={group} flush>{@render rows(list)}</Section>\n {/each}\n </Stack>\n</Modal>\n","<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n\n // Veil: a surface that covers its parent with the ground color and centres its content (a\n // loading state). It lies over a stage that must not show yet. It has a surface and a layer\n // only, no text and no spacing of its own. The parent must be a positioned element.\n //\n // <Veil busy><Text role=\"caption\">Loading</Text></Veil>\n let {\n busy = false,\n children,\n }: {\n /** Tells assistive technology that the content is loading (aria-busy) */\n busy?: boolean;\n children: Snippet;\n } = $props();\n</script>\n\n<div class=\"veil\" data-role=\"veil\" aria-busy={busy || undefined}>\n {@render children()}\n</div>\n\n<style>.veil {\n position: absolute;\n inset: 0;\n display: grid;\n place-items: center;\n z-index: var(--kata-z-modal);\n background: var(--kata-color-ground);\n}</style>\n","<script lang=\"ts\" module>\n /** The band of the window's width: wide (64rem and more), mid (48 to 64rem) or narrow */\n export type ShellWidth = 'wide' | 'mid' | 'narrow';\n /** Where a side region is: beside the stage, floating over it, or a sheet from the bottom */\n export type ShellMode = 'beside' | 'floating' | 'sheet';\n /** Where the side regions are above the narrow width: floating over the stage, or beside it */\n export type ShellSide = 'floating' | 'beside';\n /** What onlayout reports */\n export interface ShellLayout {\n width: ShellWidth;\n leftMode: ShellMode;\n rightMode: ShellMode;\n }\n</script>\n\n<script lang=\"ts\">\n import '../styles/components.css';\n import type { Snippet } from 'svelte';\n import { tick, untrack } from 'svelte';\n import type { Attachment } from 'svelte/attachments';\n import {\n isEditable,\n isHelpKey,\n isMacPlatform,\n matchesShortcut,\n type Shortcut,\n } from '../lib/shortcuts.js';\n import { createNarrow, setAppContainer, WIDTHS } from '../lib/viewport.svelte.js';\n import { getMessages } from '../messages.js';\n import Floating from './Floating.svelte';\n import Sheet from './Sheet.svelte';\n import ShortcutsModal from './ShortcutsModal.svelte';\n import Veil from './Veil.svelte';\n\n // Shell: the frame of a drawing application. The bar at the top, a region on the left and one on\n // the right, the stage (the drawing surface) in the middle, the toolbar over the bottom of the\n // stage, and a dock under it. Every region is a snippet and any may be absent; the shell knows\n // nothing of what they hold.\n //\n // The side regions follow the three widths of the shell's own element, which is the size container\n // `app` of everything inside it (so the container queries of the components in it, and the\n // components that measure in script, read the shell, not the window). From 48rem they float over\n // the stage (Floating, gap-md from its top and its side, a panel wide), both may be open at once,\n // each as tall as its content up to the stage's height less gap-md above and below, and the\n // stage takes the pointer wherever a pane is not. With side=\"beside\" they stand beside the stage\n // from 64rem instead, with a strong line between, and float from 48 to 64rem. Below 48rem they\n // are Sheets from the bottom of the stage and the toolbar rises to stay above them. leftOpen and\n // rightOpen open and close them; onlayout reports the width and where each region is.\n //\n // shortcuts are attached to the document while the shell is mounted, and the help key (?, Help or\n // F1) opens a ShortcutsModal that lists them. Escape closes the sheet opened last; when none is\n // open (and always while the regions float or stand beside the stage) it goes to onescape. Keys\n // typed into a field, and keys pressed while a modal dialog or a popover is open, belong to them.\n //\n // overlay lays the shell over a drawing surface that belongs to the page: the shell's root lets\n // the pointer through, and only the regions it draws take it.\n //\n // <Shell bind:leftOpen shortcuts={keys} onescape={clearSelection}>\n // {#snippet top()}<Topbar …/>{/snippet}\n // {#snippet left()}<Panel label=\"Contents\">…</Panel>{/snippet}\n // {#snippet stage()}<canvas …></canvas>{/snippet}\n // {#snippet bottom()}<Drawbar …/>{/snippet}\n // </Shell>\n type Side = 'left' | 'right';\n let {\n side: sides = 'floating',\n leftOpen = $bindable(true),\n rightOpen = $bindable(false),\n dockHeight = $bindable(),\n shortcutsOpen = $bindable(false),\n shortcuts = [],\n overlay = false,\n leftLabel,\n rightLabel,\n onlayout,\n onescape,\n top,\n left,\n right,\n bottom,\n dock,\n stage,\n veil,\n }: {\n /** Where the side regions are from 64rem: floating over the stage, or beside it */\n side?: ShellSide;\n /** Whether the left region shows */\n leftOpen?: boolean;\n /** Whether the right region shows */\n rightOpen?: boolean;\n /** The height of the dock in px; without it, 38.2% of the height under the bar */\n dockHeight?: number;\n /** Whether the list of shortcuts is open */\n shortcutsOpen?: boolean;\n /** The keyboard shortcuts, attached while the shell is mounted */\n shortcuts?: Shortcut[];\n /** Over a surface of the page: the root lets the pointer through, the regions take it */\n overlay?: boolean;\n /** The names of the sheets that hold the side regions on a narrow screen */\n leftLabel?: string;\n rightLabel?: string;\n /** Called with the width and the place of each side region, and again when they change */\n onlayout?: (layout: ShellLayout) => void;\n /** Escape when no sheet is left to close; returning false leaves the key to the browser */\n onescape?: (e: KeyboardEvent) => unknown;\n /** The bar at the top: a Topbar */\n top?: Snippet;\n /** The left region: a Panel */\n left?: Snippet;\n /** The right region: a Panel */\n right?: Snippet;\n /** The toolbar over the bottom of the stage: a Drawbar */\n bottom?: Snippet;\n /** The dock under the stage: a Panel with side fill */\n dock?: Snippet;\n /** The drawing surface; it fills the rest */\n stage?: Snippet;\n /** While given, a Veil covers the stage and shows it (a loading state) */\n veil?: Snippet;\n } = $props();\n\n // The shell measures its own element, and the components inside measure it too\n let root = $state<HTMLElement>();\n setAppContainer({\n get el() {\n return root;\n },\n });\n const narrow = createNarrow(WIDTHS.narrow);\n const mid = createNarrow(WIDTHS.mid);\n $effect(() => narrow.start(root));\n $effect(() => mid.start(root));\n\n const width: ShellWidth = $derived(narrow.current ? 'narrow' : mid.current ? 'mid' : 'wide');\n const mode: ShellMode = $derived(\n width === 'narrow' ? 'sheet' : width === 'wide' && sides === 'beside' ? 'beside' : 'floating',\n );\n\n $effect(() => {\n const layout: ShellLayout = { width, leftMode: mode, rightMode: mode };\n untrack(() => onlayout?.(layout));\n });\n\n // The side regions that are open, in the order they were opened: the last sheet is on top, and\n // Escape closes it first\n let order = $state<Side[]>([]);\n // What had the focus when a sheet opened, to return to when it closes\n const before: Partial<Record<Side, Element | null>> = {};\n function track(side: Side, open: boolean) {\n const rest = order.filter((s) => s !== side);\n if (open && !order.includes(side)) {\n before[side] = typeof document === 'undefined' ? null : document.activeElement;\n order = [...rest, side];\n } else if (!open && order.includes(side)) {\n order = rest;\n }\n }\n $effect(() => {\n const open = leftOpen && !!left;\n untrack(() => track('left', open));\n });\n $effect(() => {\n const open = rightOpen && !!right;\n untrack(() => track('right', open));\n });\n\n const region = (side: Side) => (side === 'left' ? left : right);\n const shown = (side: Side) => order.includes(side);\n // The floating panes, the left one first whatever the order they were opened in\n const floating = $derived((['left', 'right'] as const).filter(shown));\n\n /** Closes a side region, and returns the focus to where it was when the region opened */\n function close(side: Side) {\n if (side === 'left') leftOpen = false;\n else rightOpen = false;\n const back = before[side];\n before[side] = null;\n if (back instanceof HTMLElement && back.isConnected) tick().then(() => back.focus());\n }\n\n // The height of the sheets, which the toolbar rises above\n const sheetH = $state<Record<Side, number>>({ left: 0, right: 0 });\n const lift = $derived(\n mode === 'sheet' ? Math.max(0, ...order.map((side) => sheetH[side])) : 0,\n );\n function measure(side: Side): Attachment<HTMLElement> {\n return (seat) => {\n const sheet = seat.firstElementChild;\n if (!sheet || typeof ResizeObserver === 'undefined') return;\n const ro = new ResizeObserver(() => {\n sheetH[side] = sheet.getBoundingClientRect().height;\n });\n ro.observe(sheet);\n return () => {\n ro.disconnect();\n sheetH[side] = 0;\n };\n };\n }\n let sheetStage = $state<Record<Side, 'peek' | 'half' | 'full'>>({ left: 'half', right: 'half' });\n\n // ---- The dock's grip ----\n let dockEl = $state<HTMLElement>();\n let mainH = $state(0);\n let dockNow = $state(0);\n let dragging = false;\n let startY = 0;\n let startH = 0;\n // One press of an arrow key, in px (the same as a Panel's grip)\n const STEP = 32;\n /** Keeps the bound height to what the dock shows, after its limits */\n async function settle() {\n await tick();\n if (dockEl) dockHeight = Math.round(dockEl.getBoundingClientRect().height);\n }\n function gripDown(e: PointerEvent) {\n if (!dockEl) return;\n startY = e.clientY;\n startH = dockEl.getBoundingClientRect().height;\n dragging = true;\n (e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId);\n }\n function gripMove(e: PointerEvent) {\n if (!dragging) return;\n dockHeight = Math.round(startH + (startY - e.clientY));\n }\n function gripUp() {\n if (!dragging) return;\n dragging = false;\n settle();\n }\n function gripKey(e: KeyboardEvent) {\n const now = dockEl?.getBoundingClientRect().height ?? 0;\n if (e.key === 'ArrowUp') dockHeight = Math.round(now + STEP);\n else if (e.key === 'ArrowDown') dockHeight = Math.round(now - STEP);\n else return;\n e.preventDefault();\n settle();\n }\n\n // ---- The keys ----\n function modalOpen(): boolean {\n if (document.querySelector('dialog[open]')) return true;\n try {\n return !!document.querySelector(':popover-open');\n } catch {\n return false;\n }\n }\n function onkeydown(e: KeyboardEvent) {\n if (e.defaultPrevented || e.isComposing || shortcutsOpen || modalOpen()) return;\n if (isEditable(e.target) || isEditable(document.activeElement)) return;\n if (e.key === 'Escape' && !e.metaKey && !e.ctrlKey && !e.altKey) {\n // Only a sheet closes on Escape; the floating panes stay open, as the panels beside the stage\n const topmost = mode === 'sheet' ? order.at(-1) : undefined;\n if (topmost) {\n e.preventDefault();\n close(topmost);\n } else if (onescape && onescape(e) !== false) {\n e.preventDefault();\n }\n return;\n }\n const mac = isMacPlatform();\n for (const s of shortcuts) {\n if (s.when && !s.when()) continue;\n if (!matchesShortcut(s.key, e, mac)) continue;\n if (s.run(e) === false) continue;\n e.preventDefault();\n return;\n }\n if (shortcuts.length > 0 && isHelpKey(e)) {\n e.preventDefault();\n shortcutsOpen = true;\n }\n }\n</script>\n\n<svelte:document {onkeydown} />\n\n{#snippet seat(side: Side)}\n {@render region(side)?.()}\n{/snippet}\n\n<div\n bind:this={root}\n class=\"shell\"\n class:overlay\n data-role=\"shell\"\n data-width={width}\n style:--kata-shell-lift=\"{lift}px\"\n style:--kata-shell-dock={dockHeight === undefined ? undefined : `${dockHeight}px`}\n>\n {#if top}<div class=\"top\">{@render top()}</div>{/if}\n <div class=\"body\">\n {#if mode === 'beside' && shown('left')}\n <div class=\"side left\" data-region=\"left\">{@render seat('left')}</div>\n {/if}\n <div class=\"main\" bind:clientHeight={mainH}>\n <div class=\"stage\" data-region=\"stage\">\n {#if stage}<div class=\"surface\">{@render stage()}</div>{/if}\n {#if bottom}<div class=\"bottom\" data-region=\"bottom\">{@render bottom()}</div>{/if}\n {#if mode === 'floating'}\n {#each floating as side (side)}\n <Floating\n top=\"md\"\n left={side === 'left' ? 'md' : undefined}\n right={side === 'right' ? 'md' : undefined}\n >\n <div class=\"pane\" data-region={side}>{@render seat(side)}</div>\n </Floating>\n {/each}\n {:else if mode === 'sheet'}\n {#each order as side (side)}\n <div class=\"sheet-seat\" data-region={side} {@attach measure(side)}>\n <Sheet\n pane\n closable\n name={side}\n label={side === 'left' ? leftLabel : rightLabel}\n bind:stage={sheetStage[side]}\n onclose={() => close(side)}\n >\n {@render seat(side)}\n </Sheet>\n </div>\n {/each}\n {/if}\n {#if veil}<Veil busy>{@render veil()}</Veil>{/if}\n </div>\n {#if dock}\n <div class=\"dock\" data-region=\"dock\" bind:this={dockEl} bind:clientHeight={dockNow}>\n <div\n class=\"grip\"\n role=\"slider\"\n tabindex=\"0\"\n aria-label={getMessages().dockHeight}\n aria-orientation=\"vertical\"\n aria-valuenow={Math.round(dockNow)}\n aria-valuemin={0}\n aria-valuemax={Math.round(mainH)}\n onpointerdown={gripDown}\n onpointermove={gripMove}\n onpointerup={gripUp}\n onpointercancel={gripUp}\n onkeydown={gripKey}\n ></div>\n {@render dock()}\n </div>\n {/if}\n </div>\n {#if mode === 'beside' && shown('right')}\n <div class=\"side right\" data-region=\"right\">{@render seat('right')}</div>\n {/if}\n </div>\n <!-- Inside the root, so that it measures the shell as the components in the regions do -->\n <ShortcutsModal bind:open={shortcutsOpen} {shortcuts} />\n</div>\n\n<style>.shell {\n container: app/inline-size;\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n color: var(--kata-color-text);\n}\n.shell > .top {\n flex: none;\n min-width: 0;\n}\n\n.body {\n flex: 1 1 auto;\n display: flex;\n min-height: 0;\n min-width: 0;\n}\n\n.side {\n flex: none;\n display: flex;\n min-height: 0;\n max-width: 50%;\n}\n.side > :global(*) {\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.side.left {\n border-right: var(--kata-border-width) solid var(--kata-color-line-strong);\n}\n\n.side.right {\n border-left: var(--kata-border-width) solid var(--kata-color-line-strong);\n}\n\n.main {\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n min-width: 0;\n min-height: 0;\n}\n\n.stage {\n position: relative;\n flex: 1 1 auto;\n min-height: 0;\n overflow: hidden;\n}\n\n.surface {\n position: absolute;\n inset: 0;\n}\n\n.bottom {\n position: absolute;\n left: 0;\n right: 0;\n bottom: var(--kata-shell-lift, 0px);\n height: 0;\n}\n\n.stage > :global([data-role='floating']) {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n width: var(--kata-width-panel);\n max-width: calc(100% - var(--kata-gap-md) * 2);\n max-height: calc(100% - var(--kata-gap-md) * 2);\n}\n\n.stage .pane {\n display: flex;\n flex-direction: column;\n flex: 0 1 auto;\n min-height: 0;\n}\n.stage .pane > :global(*) {\n flex: 0 1 auto;\n min-height: 0;\n}\n\n.sheet-seat {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.sheet-seat > :global(*) {\n pointer-events: auto;\n}\n\n.dock {\n position: relative;\n flex: none;\n display: flex;\n min-height: 0;\n height: clamp(var(--kata-height-toolbar), var(--kata-shell-dock, 38.2%), 100% - var(--kata-height-toolbar));\n border-top: var(--kata-border-width) solid var(--kata-color-line-strong);\n}\n.dock > :global(*) {\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.shell.overlay {\n pointer-events: none;\n}\n.shell.overlay > .top,\n.shell.overlay > .body > .side,\n.shell.overlay > .body > .main > .dock,\n.shell.overlay > .body > .main > .stage > .bottom,\n.shell.overlay > .body > .main > .stage > :global([data-role='floating']),\n.shell.overlay > .body > .main > .stage > :global([data-role='veil']),\n.shell.overlay > :global(dialog) {\n pointer-events: auto;\n}\n\n.grip {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: var(--kata-pad-sm);\n z-index: 1;\n flex: none;\n cursor: ns-resize;\n touch-action: none;\n}\n.grip:focus-visible {\n outline: 2px solid var(--kata-color-focus);\n outline-offset: -2px;\n}</style>\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"circle\", \"size\": 24, \"node\": [[\"circle\", { \"cx\": \"12\", \"cy\": \"12\", \"r\": \"10\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/circle\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"magnet\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"m12 15 4 4\" }], [\"path\", { \"d\": \"M2.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.029-6.029a1 1 0 1 1 3 3l-6.029 6.029a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l6.365-6.367A1 1 0 0 0 8.716 4.282z\" }], [\"path\", { \"d\": \"m5 8 4 4\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/magnet\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"mouse-pointer-2\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/mouse-pointer-2\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n // MarkupIcon: an icon given as SVG markup by the application (the icon of a tool it adds),\n // drawn at the size of kata's icons. The markup is the application's own and is inserted as it\n // is.\n let { svg, class: className }: { svg: string; class?: string } = $props();\n</script>\n\n<span class={['markup', className]} aria-hidden=\"true\">{@html svg}</span>\n\n<style>\n .markup {\n display: block;\n flex: none;\n width: var(--kata-height-icon);\n height: var(--kata-height-icon);\n }\n .markup > :global(svg) {\n display: block;\n width: 100%;\n height: 100%;\n }\n</style>\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The tools of the toolbar: the seven built-in tools, one for each built-in mode of core, and\n// the tools an application adds. A tool only calls `draw.setMode` with its mode; the mode itself\n// belongs to core (a mode an application adds is registered with `draw.extensions.modes.add`\n// before its tool is added).\n\nimport Circle from '@lucide/svelte/icons/circle';\nimport Magnet from '@lucide/svelte/icons/magnet';\nimport MousePointer2 from '@lucide/svelte/icons/mouse-pointer-2';\nimport {\n type DrawbarTool,\n formatShortcut,\n type IconComponent,\n type IconSource,\n} from '@sakuzu/kata/svelte';\nimport type { Mode } from '@sakuzu/maplibre-gl-draw';\nimport MarkupIcon from './components/MarkupIcon.svelte';\nimport type { Messages } from './messages.js';\nimport type { ToolEntry, ToolId, ToolSpec } from './types.js';\n\n/** The built-in tools, in the order of the toolbar */\nexport const TOOL_IDS: readonly ToolId[] = Object.freeze([\n 'select',\n 'point',\n 'line',\n 'polygon',\n 'circle',\n 'freehand',\n 'image',\n]);\n\n/** The mode, the key and the group of each built-in tool */\nexport const BUILTIN_TOOLS: Readonly<\n Record<ToolId, { mode: Mode; shortcut: string; group: string }>\n> = Object.freeze({\n select: { mode: 'select', shortcut: 'V', group: 'select' },\n point: { mode: 'draw_point', shortcut: 'P', group: 'draw' },\n line: { mode: 'draw_line', shortcut: 'L', group: 'draw' },\n polygon: { mode: 'draw_polygon', shortcut: 'A', group: 'draw' },\n circle: { mode: 'draw_circle', shortcut: 'C', group: 'draw' },\n freehand: { mode: 'draw_freehand', shortcut: 'F', group: 'draw' },\n image: { mode: 'draw_image', shortcut: 'I', group: 'draw' },\n});\n\n/** The IDs that the toolbar keeps for its own buttons */\nexport const DELETE_ID = 'delete';\nexport const SNAPPING_ID = 'snapping';\n\n/** The built-in icons, by name: kata's icons where it has them, Lucide's for the rest */\nexport const BUILTIN_ICONS: Readonly<Record<string, IconSource>> = Object.freeze({\n select: MousePointer2 as unknown as IconComponent,\n point: 'point',\n line: 'polyline',\n polygon: 'polygon',\n circle: Circle as unknown as IconComponent,\n freehand: 'pencil',\n image: 'image',\n [DELETE_ID]: 'trash-2',\n [SNAPPING_ID]: Magnet as unknown as IconComponent,\n});\n\n/** Whether a name is the ID of a built-in tool */\nexport function isToolId(value: unknown): value is ToolId {\n return typeof value === 'string' && (TOOL_IDS as readonly string[]).includes(value);\n}\n\n/** Whether an icon is SVG markup rather than the name of a built-in icon */\nfunction isMarkup(icon: string): boolean {\n return icon.trimStart().startsWith('<');\n}\n\n/**\n * Checks a tool of the application\n *\n * @throws Error when a field is missing or has the wrong type, or the icon is neither markup\n * nor the name of a built-in icon\n */\nexport function checkSpec(spec: ToolSpec): void {\n for (const key of ['id', 'mode', 'label', 'icon'] as const) {\n if (typeof spec?.[key] !== 'string' || spec[key] === '') {\n throw new Error(`A tool needs a ${key} (a string that is not empty)`);\n }\n }\n if (spec.id === DELETE_ID || spec.id === SNAPPING_ID) {\n throw new Error(`The tool ID \"${spec.id}\" is kept for the toolbar's own button`);\n }\n if (!isMarkup(spec.icon) && !(spec.icon in BUILTIN_ICONS)) {\n throw new Error(`The icon of the tool \"${spec.id}\" is neither SVG markup nor a built-in icon`);\n }\n}\n\n/**\n * The tools of the options, checked\n *\n * @throws Error when a name is not a built-in tool, a tool is not valid, or two tools share an ID\n */\nexport function normalizeTools(tools: readonly ToolEntry[] = TOOL_IDS): ToolEntry[] {\n const out: ToolEntry[] = [];\n const ids = new Set<string>();\n for (const entry of tools) {\n if (typeof entry === 'string') {\n if (!isToolId(entry)) throw new Error(`There is no built-in tool \"${entry}\"`);\n } else {\n checkSpec(entry);\n }\n const id = entryId(entry);\n if (ids.has(id)) throw new Error(`Two tools have the ID \"${id}\"`);\n ids.add(id);\n out.push(typeof entry === 'string' ? entry : { ...entry });\n }\n return out;\n}\n\n/** The ID of a tool */\nexport function entryId(entry: ToolEntry): string {\n return typeof entry === 'string' ? entry : entry.id;\n}\n\n/** The group of a tool; a tool without one is in a group named after its ID */\nfunction entryGroup(entry: ToolEntry): string {\n if (typeof entry === 'string') return BUILTIN_TOOLS[entry].group;\n return entry.group ?? `tool:${entry.id}`;\n}\n\n/**\n * The tools with one more: after the last tool of its group, or at the end when no tool is in\n * its group\n */\nexport function insertTool(entries: readonly ToolEntry[], spec: ToolSpec): ToolEntry[] {\n const group = entryGroup(spec);\n let at = entries.length;\n for (let i = entries.length - 1; i >= 0; i--) {\n if (entryGroup(entries[i]) === group) {\n at = i + 1;\n break;\n }\n }\n return [...entries.slice(0, at), { ...spec }, ...entries.slice(at)];\n}\n\n/** A tool as `tools.list()` returns it: a built-in tool with its words and the name of its icon */\nexport function toSpec(entry: ToolEntry, messages: Messages): ToolSpec {\n if (typeof entry !== 'string') return { ...entry };\n const { mode, shortcut, group } = BUILTIN_TOOLS[entry];\n return { id: entry, mode, label: messages[entry], icon: entry, shortcut, group };\n}\n\nconst markupIcons = new Map<string, IconComponent>();\n\n/**\n * An icon component that draws SVG markup, made once for each markup. It receives the class of\n * kata's icons and passes it on, so the markup is sized like the built-in icons\n */\nexport function markupIcon(svg: string): IconComponent {\n let icon = markupIcons.get(svg);\n if (!icon) {\n icon = ((internals, props) =>\n MarkupIcon(internals, {\n svg,\n get class() {\n return props.class;\n },\n })) as IconComponent;\n markupIcons.set(svg, icon);\n }\n return icon;\n}\n\n/** The icon of a tool */\nexport function specIcon(spec: ToolSpec): IconSource {\n return isMarkup(spec.icon) ? markupIcon(spec.icon) : (BUILTIN_ICONS[spec.icon] ?? 'circle-alert');\n}\n\n/** The key of a shortcut as kata writes it: modifiers and keys in lowercase */\nexport function shortcutKey(shortcut: string): string {\n return shortcut.toLowerCase();\n}\n\n/**\n * The tools of the Drawbar of kata\n *\n * @param keys Whether the keys are shown in the tooltips (only when the shortcuts are on)\n */\nexport function drawbarTools(specs: readonly ToolSpec[], keys: boolean): DrawbarTool[] {\n return specs.map((spec) => ({\n id: spec.id,\n label: spec.label,\n icon: specIcon(spec),\n kbd: keys && spec.shortcut ? formatShortcut(shortcutKey(spec.shortcut)) : undefined,\n group: spec.group ?? `tool:${spec.id}`,\n }));\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The keyboard shortcuts of the interface: the key of each tool and Delete and Backspace for the\n// selection. kata's Shell listens for them on the document.\n//\n// Core listens for its own keys on the map's canvas (Delete, Backspace and Escape among them),\n// and those events go on to the document. A shortcut that core also has declines an event from\n// the canvas, so that the key does not act twice.\n\nimport type { Shortcut } from '@sakuzu/kata/svelte';\nimport type { Messages } from './messages.js';\nimport { shortcutKey } from './tools.js';\nimport type { DrawUIDraw, ToolSpec } from './types.js';\n\n/** Whether a key event comes from the map's canvas, where core has handled it already */\nexport function fromMapCanvas(draw: Pick<DrawUIDraw, 'getMap'>, e: KeyboardEvent): boolean {\n return e.target === draw.getMap().getCanvas();\n}\n\n/** The shortcuts of the tools and of the delete button */\nexport function toolbarShortcuts(\n draw: DrawUIDraw,\n specs: readonly ToolSpec[],\n messages: Messages,\n deletable: boolean,\n): Shortcut[] {\n const out: Shortcut[] = [];\n for (const spec of specs) {\n if (!spec.shortcut) continue;\n out.push({\n key: shortcutKey(spec.shortcut),\n label: spec.label,\n group: messages.toolsGroup,\n // setMode returns false when the mode cannot be entered now: the key goes on\n run: () => draw.setMode(spec.mode),\n });\n }\n if (deletable) {\n for (const key of ['delete', 'backspace']) {\n out.push({\n key,\n label: messages.deleteSelection,\n group: messages.editGroup,\n when: () => draw.selection.get().ids.length > 0,\n run: (e) => !fromMapCanvas(draw, e) && draw.selection.delete(),\n });\n }\n }\n return out;\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The two ways the components follow a value that lives outside them.\n//\n// - follow(): a value of the draw instance, read again whenever one of its events fires. The\n// draw instance stays the only source of truth; nothing is copied\n// - Box: a setting of the interface itself (the tools shown, the words), which the functions of\n// the API change and the components read\n\nimport type { Draw, DrawEvents } from '@sakuzu/maplibre-gl-draw';\nimport { createSubscriber } from 'svelte/reactivity';\n\n/** The members of a draw instance that subscribing needs */\nexport type DrawEventSource = Pick<Draw, 'on'>;\n\n/**\n * A value of the draw instance that the components follow. Read inside a component (or an\n * effect), it is read again after each of the events; elsewhere it is a plain read.\n *\n * `refresh` reads it again without an event, for a value that core changes without one.\n */\nexport function follow<T>(\n draw: DrawEventSource,\n events: readonly (keyof DrawEvents)[],\n read: () => T,\n): { get(): T; refresh(): void } {\n const updates = new Set<() => void>();\n const subscribe = createSubscriber((update) => {\n updates.add(update);\n const offs = events.map((event) => draw.on(event, update));\n return () => {\n updates.delete(update);\n for (const off of offs) off();\n };\n });\n return {\n get() {\n subscribe();\n return read();\n },\n refresh() {\n for (const update of updates) update();\n },\n };\n}\n\n/** A setting of the interface that the components follow */\nexport class Box<T> {\n #value: T;\n readonly #updates = new Set<() => void>();\n readonly #subscribe = createSubscriber((update) => {\n this.#updates.add(update);\n return () => {\n this.#updates.delete(update);\n };\n });\n\n constructor(value: T) {\n this.#value = value;\n }\n\n /** The value; inside a component it is followed */\n get(): T {\n this.#subscribe();\n return this.#value;\n }\n\n set(value: T): void {\n this.#value = value;\n for (const update of this.#updates) update();\n }\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The options of the inspector, and the sections an application adds to it.\n\nimport type { Feature } from '@sakuzu/maplibre-gl-draw';\nimport type { Box } from '../store.js';\nimport type {\n InspectorOptions,\n InspectorSectionSpec,\n InspectorSectionsHandle,\n InspectorSettings,\n InspectorTab,\n Units,\n} from './types.js';\n\nconst TABS: readonly InspectorTab[] = ['style', 'attributes'];\n\n/**\n * The options of the inspector with their defaults\n *\n * @param units - The units when the options name none (those of `createDrawUI`)\n * @throws Error when a tab is not `style` or `attributes`\n */\nexport function inspectorSettings(\n options: InspectorOptions = {},\n units: Units = 'metric',\n): InspectorSettings {\n const tabs = options.tabs ?? [...TABS];\n for (const tab of tabs) {\n if (!TABS.includes(tab)) throw new Error(`There is no inspector tab \"${tab}\"`);\n }\n return {\n tabs: [...new Set(tabs)],\n measurements: options.measurements !== false,\n operations: options.operations !== false,\n units: options.units ?? units,\n };\n}\n\n/**\n * Checks a section of the application\n *\n * @throws Error when the ID or the title is missing, or `appliesTo` is not a function\n */\nexport function checkSection(spec: InspectorSectionSpec): void {\n for (const key of ['id', 'title'] as const) {\n if (typeof spec?.[key] !== 'string' || spec[key] === '') {\n throw new Error(`An inspector section needs a ${key} (a string that is not empty)`);\n }\n }\n if (typeof spec.appliesTo !== 'function') {\n throw new Error(`The inspector section \"${spec.id}\" needs appliesTo (a function)`);\n }\n}\n\n/** The sections that apply to features; a section whose appliesTo throws does not */\nexport function applicableSections(\n sections: readonly InspectorSectionSpec[],\n features: readonly Feature[],\n): InspectorSectionSpec[] {\n return sections.filter((spec) => {\n try {\n return spec.appliesTo(features);\n } catch {\n return false;\n }\n });\n}\n\n/** The sections of an inspector, to add to and to remove from */\nexport function sectionsHandle(sections: Box<InspectorSectionSpec[]>): InspectorSectionsHandle {\n const remove = (id: string): boolean => {\n const now = sections.get();\n const next = now.filter((spec) => spec.id !== id);\n if (next.length === now.length) return false;\n sections.set(next);\n return true;\n };\n return {\n add(spec) {\n checkSection(spec);\n if (sections.get().some((s) => s.id === spec.id)) {\n throw new Error(`There is an inspector section with the ID \"${spec.id}\" already`);\n }\n const own = { ...spec };\n sections.set([...sections.get(), own]);\n let removed = false;\n return () => {\n if (removed) return;\n removed = true;\n const now = sections.get();\n if (now.includes(own)) sections.set(now.filter((s) => s !== own));\n };\n },\n remove,\n list() {\n return sections.get().map((spec) => ({ ...spec }));\n },\n };\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The name, the description and the attributes of a feature, and the patches their changes make.\n//\n// Core has no name for a feature. The interface keeps it, and the description, in two\n// attributes of `properties`: `name` (the title of the inspector) and `description` (a field of\n// its own). The Attributes tab lists every other key of `properties`, except the keys of the\n// library (isDrawProperty).\n//\n// A value is shown as a string (an object or an array as JSON). A value the user types is kept\n// as the string typed: \"12\" stays the string \"12\" and is not turned into a number, so that what\n// is typed is what is stored, whatever it looks like. An application that wants typed values\n// converts them itself (feature.updated tells it of each change).\n\nimport { type Feature, type FeaturePatch, isDrawProperty } from '@sakuzu/maplibre-gl-draw';\n\n/** The attribute that holds the name of a feature */\nexport const NAME_KEY = 'name';\n/** The attribute that holds the description of a feature */\nexport const DESCRIPTION_KEY = 'description';\n\n/** An attribute as the list shows it */\nexport interface AttributeRow {\n key: string;\n value: string;\n}\n\n/** Whether a key of `properties` is kept out of the list of attributes */\nexport function isReservedKey(key: string): boolean {\n return key === NAME_KEY || key === DESCRIPTION_KEY || isDrawProperty(key);\n}\n\n/** A value of `properties` as a string */\nexport function showValue(value: unknown): string {\n if (value === null || value === undefined) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint') {\n return String(value);\n }\n try {\n return JSON.stringify(value) ?? '';\n } catch {\n return String(value);\n }\n}\n\n/** The name of a feature, or an empty string */\nexport function featureName(feature: Pick<Feature, 'properties'>): string {\n const name = feature.properties?.[NAME_KEY];\n return typeof name === 'string' ? name : '';\n}\n\n/** The description of a feature, or an empty string */\nexport function featureDescription(feature: Pick<Feature, 'properties'>): string {\n const text = feature.properties?.[DESCRIPTION_KEY];\n return typeof text === 'string' ? text : '';\n}\n\n/** The attributes of a feature, in the order of `properties` */\nexport function attributeRows(feature: Pick<Feature, 'properties'>): AttributeRow[] {\n return Object.entries(feature.properties ?? {})\n .filter(([key]) => !isReservedKey(key))\n .map(([key, value]) => ({ key, value: showValue(value) }));\n}\n\n/** The patch that sets a text attribute, or removes it when the text is empty after trimming */\nfunction textPatch(key: string, text: string): FeaturePatch {\n const value = text.trim();\n return { properties: { [key]: value === '' ? undefined : value } };\n}\n\n/** The patch that names a feature; an empty name removes the attribute */\nexport function namePatch(name: string): FeaturePatch {\n return textPatch(NAME_KEY, name);\n}\n\n/** The patch that describes a feature; an empty description removes the attribute */\nexport function descriptionPatch(text: string): FeaturePatch {\n const value = text.trim() === '' ? undefined : text;\n return { properties: { [DESCRIPTION_KEY]: value } };\n}\n\n/** Whether a name can be given to an attribute of the feature, other than the one at `except` */\nfunction freeKey(feature: Pick<Feature, 'properties'>, key: string, except?: string): boolean {\n if (key === '' || isReservedKey(key)) return false;\n return key === except || !Object.hasOwn(feature.properties ?? {}, key);\n}\n\n/**\n * The patch of a change of the attribute at `index` of {@link attributeRows}: a new value, a\n * new name (the old key removed and the new one set), or both. When only the name changes, the\n * value keeps its type.\n *\n * @returns The patch, or null when nothing changes, there is no attribute at `index`, or the\n * new name is empty, is the name of another attribute, or is kept (`name`, `description`, a\n * key of the library)\n */\nexport function attributePatch(\n feature: Pick<Feature, 'properties'>,\n index: number,\n next: AttributeRow,\n): FeaturePatch | null {\n const row = attributeRows(feature)[index];\n if (!row) return null;\n const key = next.key.trim();\n if (key === row.key && next.value === row.value) return null;\n if (!freeKey(feature, key, row.key)) return null;\n const raw = feature.properties[row.key];\n const value = next.value === row.value ? raw : next.value;\n if (key === row.key) return { properties: { [key]: value } };\n return { properties: { [row.key]: undefined, [key]: value } };\n}\n\n/**\n * The patch that adds an attribute\n *\n * @returns The patch, or null when the name is empty, is taken, or is kept\n */\nexport function attributeAdd(\n feature: Pick<Feature, 'properties'>,\n item: AttributeRow,\n): FeaturePatch | null {\n const key = item.key.trim();\n if (!freeKey(feature, key)) return null;\n return { properties: { [key]: item.value } };\n}\n\n/**\n * The patch that removes the attribute at `index` of {@link attributeRows}\n *\n * @returns The patch, or null when there is no attribute at `index`\n */\nexport function attributeRemove(\n feature: Pick<Feature, 'properties'>,\n index: number,\n): FeaturePatch | null {\n const row = attributeRows(feature)[index];\n return row ? { properties: { [row.key]: undefined } } : null;\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The measurements of a feature, written in metric or imperial units.\n//\n// Lengths and areas come from core's geometry entry (meters and square meters on the sphere); a\n// circle, whose geometry is its center, is measured from its radius. A Multi geometry gives the\n// totals of its parts.\n//\n// Units: a length is in meters below 1 000 m and in kilometers from there; an area in square\n// meters below 1 ha (10 000 m²), in hectares below 1 km², and in square kilometers from there.\n// In imperial units a length is in feet below 1 mile (5 280 ft), an area in square feet below\n// 1 acre (43 560 ft²), in acres below 1 square mile (640 ac), and in square miles from there.\n// The small unit is written with at most one decimal, the large ones with two.\n\nimport type { Feature } from '@sakuzu/maplibre-gl-draw';\nimport { area, length, perimeter } from '@sakuzu/maplibre-gl-draw/geometry';\nimport type { Units } from './types.js';\n\n/** What a row of the measurements is */\nexport type MeasureKey =\n | 'longitude'\n | 'latitude'\n | 'length'\n | 'area'\n | 'perimeter'\n | 'radius'\n | 'points';\n\n/** A row of the measurements: what it is and the value, written out */\nexport interface MeasureRow {\n key: MeasureKey;\n value: string;\n}\n\nconst FOOT = 0.3048;\nconst FEET_PER_MILE = 5280;\nconst SQUARE_FOOT = FOOT * FOOT;\nconst SQUARE_FEET_PER_ACRE = 43_560;\nconst ACRES_PER_SQUARE_MILE = 640;\n\n/** The property of core that holds the radius of a circle, in meters */\nconst RADIUS_KEY = 'maplibre-gl-draw:radiusMeters';\n\nfunction number(value: number, locale: string, digits: { min: number; max: number }): string {\n return new Intl.NumberFormat(locale, {\n minimumFractionDigits: digits.min,\n maximumFractionDigits: digits.max,\n }).format(value);\n}\n\nconst SMALL = { min: 0, max: 1 };\nconst LARGE = { min: 2, max: 2 };\n\n/** A length in meters, written in the units */\nexport function formatLength(meters: number, units: Units, locale = 'en'): string {\n if (units === 'imperial') {\n const feet = meters / FOOT;\n if (feet < FEET_PER_MILE) return `${number(feet, locale, SMALL)} ft`;\n return `${number(feet / FEET_PER_MILE, locale, LARGE)} mi`;\n }\n if (meters < 1000) return `${number(meters, locale, SMALL)} m`;\n return `${number(meters / 1000, locale, LARGE)} km`;\n}\n\n/** An area in square meters, written in the units */\nexport function formatArea(squareMeters: number, units: Units, locale = 'en'): string {\n if (units === 'imperial') {\n const squareFeet = squareMeters / SQUARE_FOOT;\n if (squareFeet < SQUARE_FEET_PER_ACRE) return `${number(squareFeet, locale, SMALL)} ft²`;\n const acres = squareFeet / SQUARE_FEET_PER_ACRE;\n if (acres < ACRES_PER_SQUARE_MILE) return `${number(acres, locale, LARGE)} ac`;\n return `${number(acres / ACRES_PER_SQUARE_MILE, locale, LARGE)} mi²`;\n }\n if (squareMeters < 10_000) return `${number(squareMeters, locale, SMALL)} m²`;\n if (squareMeters < 1_000_000) return `${number(squareMeters / 10_000, locale, LARGE)} ha`;\n return `${number(squareMeters / 1_000_000, locale, LARGE)} km²`;\n}\n\n/** A longitude or a latitude in degrees, with six decimals */\nexport function formatDegrees(degrees: number, locale = 'en'): string {\n return `${number(degrees, locale, { min: 6, max: 6 })}°`;\n}\n\n/** The radius of a circle in meters, or undefined */\nfunction radiusOf(feature: Feature): number | undefined {\n const r = feature.properties?.[RADIUS_KEY];\n return typeof r === 'number' && Number.isFinite(r) && r > 0 ? r : undefined;\n}\n\n/** Runs a measurement of core, which throws on a geometry it does not take */\nfunction tryMeasure(run: () => number): number | undefined {\n try {\n const value = run();\n return Number.isFinite(value) ? value : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * The measurements of a feature: the coordinates of a point, the length of a line, the area and\n * the perimeter of an area (and the radius of a circle), the number of points of a MultiPoint.\n * An image and a custom type have none.\n *\n * @param feature - The feature\n * @param units - Metric or imperial\n * @param locale - The language tag the numbers are written in\n */\nexport function measure(feature: Feature, units: Units, locale = 'en'): MeasureRow[] {\n const { geometry } = feature;\n const len = (meters: number | undefined): MeasureRow[] =>\n meters === undefined ? [] : [{ key: 'length', value: formatLength(meters, units, locale) }];\n switch (feature.type) {\n case 'Point': {\n if (geometry.type !== 'Point') return [];\n const [lng, lat] = geometry.coordinates;\n return [\n { key: 'longitude', value: formatDegrees(lng, locale) },\n { key: 'latitude', value: formatDegrees(lat, locale) },\n ];\n }\n case 'MultiPoint': {\n if (geometry.type !== 'MultiPoint') return [];\n const count = new Intl.NumberFormat(locale).format(geometry.coordinates.length);\n return [{ key: 'points', value: count }];\n }\n case 'LineString':\n case 'MultiLineString':\n case 'Freehand':\n return len(tryMeasure(() => length(geometry as Parameters<typeof length>[0])));\n case 'Polygon':\n case 'MultiPolygon': {\n const a = tryMeasure(() => area(geometry as Parameters<typeof area>[0]));\n const p = tryMeasure(() => perimeter(geometry as Parameters<typeof perimeter>[0]));\n const rows: MeasureRow[] = [];\n if (a !== undefined) rows.push({ key: 'area', value: formatArea(a, units, locale) });\n if (p !== undefined) rows.push({ key: 'perimeter', value: formatLength(p, units, locale) });\n return rows;\n }\n case 'Circle': {\n const r = radiusOf(feature);\n if (r === undefined) return [];\n return [\n { key: 'area', value: formatArea(Math.PI * r * r, units, locale) },\n { key: 'perimeter', value: formatLength(2 * Math.PI * r, units, locale) },\n { key: 'radius', value: formatLength(r, units, locale) },\n ];\n }\n default:\n return [];\n }\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The operations on the features selected, and which of them apply.\n//\n// They are core's (draw.features.union and the rest), which check the features again and throw\n// on any they do not take; the interface only offers an operation for features it would take:\n//\n// - union and intersection: two areas or more (Polygon, MultiPolygon, or a Circle with a radius)\n// - difference: two areas or more, the first selected minus the others\n// - split: one area and one line (LineString, MultiLineString or Freehand) to cut it along\n// - buffer: one feature or more, each a point, a line or an area (not a freehand line, an image\n// or a custom type, which core does not buffer)\n//\n// The features an operation makes become the selection.\n\nimport type { Feature } from '@sakuzu/maplibre-gl-draw';\nimport type { InspectorDraw, Units } from './types.js';\n\n/** An operation on the features selected */\nexport type OperationId = 'union' | 'intersection' | 'difference' | 'split' | 'buffer';\n\n/** The operations, in the order they are offered */\nexport const OPERATION_IDS: readonly OperationId[] = Object.freeze([\n 'union',\n 'intersection',\n 'difference',\n 'split',\n 'buffer',\n]);\n\nconst RADIUS_KEY = 'maplibre-gl-draw:radiusMeters';\n\nfunction hasRadius(feature: Pick<Feature, 'properties'>): boolean {\n const r = feature.properties?.[RADIUS_KEY];\n return typeof r === 'number' && r > 0;\n}\n\n/** Whether a feature is an area that union, intersection, difference and split take */\nexport function isArea(feature: Pick<Feature, 'type' | 'properties'>): boolean {\n if (feature.type === 'Circle') return hasRadius(feature);\n return feature.type === 'Polygon' || feature.type === 'MultiPolygon';\n}\n\n/** Whether a feature is a line that a split cuts along */\nexport function isCuttingLine(feature: Pick<Feature, 'type'>): boolean {\n return (\n feature.type === 'LineString' ||\n feature.type === 'MultiLineString' ||\n feature.type === 'Freehand'\n );\n}\n\nconst BUFFERABLE = new Set(['Point', 'MultiPoint', 'LineString', 'MultiLineString']);\n\n/** Whether a feature is one that buffer takes */\nexport function isBufferable(feature: Pick<Feature, 'type' | 'properties'>): boolean {\n return isArea(feature) || BUFFERABLE.has(feature.type);\n}\n\n/** The area and the line of a split, or null when the features are not one of each */\nexport function splitPair<T extends Pick<Feature, 'type' | 'properties'>>(\n features: readonly T[],\n): { area: T; line: T } | null {\n if (features.length !== 2) return null;\n const [a, b] = features;\n if (isArea(a) && isCuttingLine(b)) return { area: a, line: b };\n if (isArea(b) && isCuttingLine(a)) return { area: b, line: a };\n return null;\n}\n\n/** The operations that apply to features, in order */\nexport function applicableOperations(\n features: readonly Pick<Feature, 'type' | 'properties'>[],\n): OperationId[] {\n const out: OperationId[] = [];\n const areas = features.length >= 2 && features.every(isArea);\n if (areas) out.push('union', 'intersection', 'difference');\n if (splitPair(features)) out.push('split');\n if (features.length >= 1 && features.every(isBufferable)) out.push('buffer');\n return out;\n}\n\n/** The units of the distance of a buffer */\nexport type DistanceUnit = 'm' | 'km' | 'ft' | 'mi';\n\n/** The units of the distance offered for a system of units, the first being the default */\nexport function distanceUnits(units: Units): DistanceUnit[] {\n return units === 'imperial' ? ['ft', 'mi'] : ['m', 'km'];\n}\n\nconst METERS: Record<DistanceUnit, number> = { m: 1, km: 1000, ft: 0.3048, mi: 1609.344 };\n\n/** A distance in meters */\nexport function toMeters(value: number, unit: DistanceUnit): number {\n return value * METERS[unit];\n}\n\n/** Selects the features an operation made, when it made any */\nfunction selectResults(draw: InspectorDraw, features: readonly Feature[] | null): string[] | null {\n if (!features) return null;\n const ids = features.map((f) => f.id);\n if (ids.length > 0) draw.selection.set('feature', ids);\n return ids;\n}\n\n/**\n * Runs union, intersection, difference or split on features, and selects what it made\n *\n * @param features - The features, in the order of the selection (difference subtracts the\n * others from the first)\n * @returns The IDs of the features made (empty when the line did not cut the area), or null when\n * core refused the operation (read-only, a lock) or its result is empty\n * @throws `DrawError` of core when the features do not suit the operation\n */\nexport function runOperation(\n draw: InspectorDraw,\n op: Exclude<OperationId, 'buffer'>,\n features: readonly Feature[],\n): string[] | null {\n const ids = features.map((f) => f.id);\n return draw.transact(() => {\n switch (op) {\n case 'union': {\n const made = draw.features.union(ids);\n return selectResults(draw, made ? [made] : null);\n }\n case 'intersection': {\n const made = draw.features.intersection(ids);\n return selectResults(draw, made ? [made] : null);\n }\n case 'difference': {\n const [first, ...rest] = ids;\n const made = draw.features.difference(first, rest);\n return selectResults(draw, made ? [made] : null);\n }\n case 'split': {\n const pair = splitPair(features);\n if (!pair) return null;\n return selectResults(draw, draw.features.split(pair.area.id, pair.line.id));\n }\n }\n });\n}\n\n/**\n * Makes the buffers of features and selects them\n *\n * @param distanceMeters - The distance of the outline from the features, in meters\n * @param segments - The segments of a full circle; core's default when left out\n * @returns The IDs of the features made, or null when core refused the operation\n * @throws `DrawError` of core when a feature cannot be buffered or the distance is not finite\n */\nexport function runBuffer(\n draw: InspectorDraw,\n features: readonly Feature[],\n distanceMeters: number,\n segments?: number,\n): string[] | null {\n const ids = features.map((f) => f.id);\n const options = segments === undefined ? { distanceMeters } : { distanceMeters, segments };\n return draw.transact(() => selectResults(draw, draw.features.buffer(ids, options)));\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The fields of the style of features, and the patches their changes make.\n//\n// Each type reads its own keys of the style (the table of FeatureStyle in core): a point its\n// marker, a line its stroke, an area its fill and its stroke, an image its opacity. A custom type\n// has no field here. The values shown are those the feature is drawn with\n// (draw.features.getAppliedStyle: the default, the layer rule and the style of the feature on top\n// of each other); a change writes the key into the style of the features.\n//\n// The opacities are fractions from 0 to 1 in core and percentages from 0 to 100 on screen.\n\nimport type {\n Feature,\n FeatureStyle,\n FeatureStyleResolved,\n FeatureType,\n LineStyle,\n PointShape,\n} from '@sakuzu/maplibre-gl-draw';\nimport type { Messages } from '../messages.js';\nimport type { InspectorDraw, InspectorField } from './types.js';\n\n/** A key of the style that the inspector edits */\nexport type StyleKey = keyof FeatureStyleResolved;\n\n/** The kind of style a type reads */\nexport type StyleKind = 'point' | 'line' | 'area' | 'image';\n\n/** The values of the line style, as core's LineStyle has them */\nexport const LINE_STYLES = ['solid', 'dashed', 'dotted'] as const satisfies readonly LineStyle[];\n\n/** The shapes of a point marker, as core's PointShape has them */\nexport const POINT_SHAPES = [\n 'circle',\n 'square',\n 'triangle',\n 'star',\n] as const satisfies readonly PointShape[];\n\nconst STROKE: readonly StyleKey[] = ['strokeColor', 'strokeWidth', 'strokeOpacity', 'lineStyle'];\n\n/** The keys of each kind, in the order of the fields */\nexport const STYLE_KEYS: Readonly<Record<StyleKind, readonly StyleKey[]>> = Object.freeze({\n point: [\n 'pointColor',\n 'pointRadius',\n 'pointShape',\n 'pointOpacity',\n 'pointStrokeColor',\n 'pointStrokeWidth',\n ],\n line: STROKE,\n area: ['fillColor', 'fillOpacity', ...STROKE],\n image: ['imageOpacity'],\n});\n\n/** The kind of style of a type, or null for a custom type */\nexport function styleKind(type: FeatureType): StyleKind | null {\n switch (type) {\n case 'Point':\n case 'MultiPoint':\n return 'point';\n case 'LineString':\n case 'MultiLineString':\n case 'Freehand':\n return 'line';\n case 'Polygon':\n case 'MultiPolygon':\n case 'Circle':\n return 'area';\n case 'Image':\n return 'image';\n default:\n return null;\n }\n}\n\n/** The keys a type reads, in order; none for a custom type */\nexport function styleKeys(type: FeatureType): readonly StyleKey[] {\n const kind = styleKind(type);\n return kind ? STYLE_KEYS[kind] : [];\n}\n\n/** The keys that are opacities: 0 to 1 in core, percentages on screen */\nconst PERCENT: ReadonlySet<StyleKey> = new Set([\n 'fillOpacity',\n 'strokeOpacity',\n 'pointOpacity',\n 'imageOpacity',\n]);\n\n/** Whether a key is an opacity, shown as a percentage */\nexport function isPercentKey(key: string): boolean {\n return PERCENT.has(key as StyleKey);\n}\n\n/** The control of each key, without its name and its value */\ntype FieldShape = Omit<InspectorField, 'key' | 'label' | 'value' | 'mixed'>;\n\nconst COLOR: FieldShape = { kind: 'color' };\nconst PERCENT_SLIDER: FieldShape = { kind: 'slider', min: 0, max: 100, step: 1, unit: '%' };\n\nfunction shapes(m: Messages): Record<StyleKey, FieldShape> {\n return {\n fillColor: COLOR,\n fillOpacity: PERCENT_SLIDER,\n strokeColor: COLOR,\n strokeWidth: { kind: 'slider', min: 0.5, max: 20, step: 0.5, unit: 'px' },\n strokeOpacity: PERCENT_SLIDER,\n lineStyle: {\n kind: 'select',\n options: [\n { value: 'solid', label: m.lineSolid },\n { value: 'dashed', label: m.lineDashed },\n { value: 'dotted', label: m.lineDotted },\n ] satisfies { value: (typeof LINE_STYLES)[number]; label: string }[],\n },\n pointColor: COLOR,\n pointRadius: { kind: 'slider', min: 1, max: 40, step: 1, unit: 'px' },\n pointShape: {\n kind: 'select',\n options: [\n { value: 'circle', label: m.shapeCircle },\n { value: 'square', label: m.shapeSquare },\n { value: 'triangle', label: m.shapeTriangle },\n { value: 'star', label: m.shapeStar },\n ] satisfies { value: (typeof POINT_SHAPES)[number]; label: string }[],\n },\n pointOpacity: PERCENT_SLIDER,\n pointStrokeColor: COLOR,\n pointStrokeWidth: { kind: 'slider', min: 0, max: 10, step: 1, unit: 'px' },\n imageOpacity: PERCENT_SLIDER,\n };\n}\n\n/** The name of each key */\nfunction labels(m: Messages): Record<StyleKey, string> {\n return {\n fillColor: m.styleFillColor,\n fillOpacity: m.styleFillOpacity,\n strokeColor: m.styleStrokeColor,\n strokeWidth: m.styleStrokeWidth,\n strokeOpacity: m.styleStrokeOpacity,\n lineStyle: m.styleLineStyle,\n pointColor: m.stylePointColor,\n pointRadius: m.stylePointRadius,\n pointShape: m.stylePointShape,\n pointOpacity: m.stylePointOpacity,\n pointStrokeColor: m.stylePointStrokeColor,\n pointStrokeWidth: m.stylePointStrokeWidth,\n imageOpacity: m.styleImageOpacity,\n };\n}\n\n/** A value of the style as the field shows it: an opacity as a whole percentage */\nexport function displayValue(key: StyleKey, value: unknown): unknown {\n if (isPercentKey(key) && typeof value === 'number') return Math.round(value * 100);\n if (typeof value === 'string' && key.endsWith('Color')) return value.toLowerCase();\n return value;\n}\n\n/**\n * The keys the features share, in the order of the first one's: the keys of every type of the\n * selection. Empty when one of them is of a custom type, or when there is no feature\n */\nexport function sharedStyleKeys(features: readonly Pick<Feature, 'type'>[]): StyleKey[] {\n if (features.length === 0) return [];\n const [first, ...rest] = features;\n return styleKeys(first.type).filter((key) => rest.every((f) => styleKeys(f.type).includes(key)));\n}\n\n/**\n * The fields of the style of features: the keys they share, each with the value they are drawn\n * with, or `mixed` when their values differ.\n *\n * @param features - The features selected\n * @param applied - The look of a feature as core resolves it (`draw.features.getAppliedStyle`);\n * a feature it gives nothing for shows the keys of its own style\n * @param messages - The words\n * @param disabled - Whether the fields cannot be changed (read-only, a lock)\n */\nexport function styleFields(\n features: readonly Feature[],\n applied: (id: string) => FeatureStyleResolved | undefined,\n messages: Messages,\n disabled = false,\n): InspectorField[] {\n const keys = sharedStyleKeys(features);\n if (keys.length === 0) return [];\n const looks = features.map((f) => applied(f.id) ?? (f.style as Partial<FeatureStyleResolved>));\n const shape = shapes(messages);\n const label = labels(messages);\n return keys.map((key) => {\n const values = looks.map((look) => displayValue(key, look[key]));\n const mixed = values.some((v) => v !== values[0]);\n const field: InspectorField = { key, label: label[key], ...shape[key] };\n if (mixed) field.mixed = true;\n else field.value = values[0];\n if (disabled) field.disabled = true;\n return field;\n });\n}\n\n/**\n * The style that a change of a field writes: an opacity from a percentage to a fraction (clamped\n * to 0..1), a number as it is, a color or a choice as a string. An empty value (a number\n * input emptied) removes the key, so the feature takes the layer rule or the default again.\n */\nexport function stylePatch(key: string, value: unknown): FeatureStyle {\n const k = key as StyleKey;\n if (value === null || value === undefined || value === '') return { [k]: undefined };\n if (isPercentKey(k)) {\n const n = Number(value);\n return { [k]: Number.isFinite(n) ? Math.min(1, Math.max(0, n / 100)) : undefined };\n }\n if (typeof value === 'number') return { [k]: value } as FeatureStyle;\n return { [k]: String(value) } as FeatureStyle;\n}\n\n/**\n * The keys of the inspector's fields that the features set in their own style, over the layer\n * rule and the defaults. Keys the features share no field for (keys of an extension) are left\n * out, so a reset does not touch them\n */\nexport function ownStyleKeys(features: readonly Pick<Feature, 'type' | 'style'>[]): StyleKey[] {\n const fields = new Set(sharedStyleKeys(features));\n const out = new Set<StyleKey>();\n for (const f of features) {\n for (const [key, value] of Object.entries(f.style ?? {})) {\n if (value !== undefined && fields.has(key as StyleKey)) out.add(key as StyleKey);\n }\n }\n return [...out];\n}\n\n/** The style that removes keys, so the features take the layer rule or the defaults again */\nexport function resetPatch(keys: readonly string[]): FeatureStyle {\n const out: Record<string, undefined> = {};\n for (const key of keys) out[key] = undefined;\n return out as FeatureStyle;\n}\n\n/**\n * Writes a style into features, in one transaction\n *\n * @returns The features after the change, or null when core refused it (read-only, a lock)\n */\nexport function applyStyle(\n draw: Pick<InspectorDraw, 'transact' | 'features'>,\n ids: readonly string[],\n style: FeatureStyle,\n): Feature[] | null {\n return draw.transact(() => draw.features.updateMany(ids.map((id) => ({ id, patch: { style } }))));\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// What the inspector shows, read from the draw instance: nothing, one feature, several, a layer,\n// a group, or several layers or groups. It is read again after each event the inspector follows,\n// so what it shows is always what the draw instance holds.\n//\n// The inspector of one feature is laid out from top to bottom as featureLayout gives it: the head\n// (the name and the subtitle), the rows under it with no tab (the measurements and the\n// description), then the tabs. The Style tab holds the fields of the style, the sections of the\n// application and the operations; the Attributes tab the list of the attributes.\n\nimport type {\n Feature,\n FeatureStyleResolved,\n FeatureType,\n Group,\n Layer,\n} from '@sakuzu/maplibre-gl-draw';\nimport type { Messages } from '../messages.js';\nimport { featureDescription } from './attributes.js';\nimport { type MeasureRow, measure } from './measure.js';\nimport { applicableOperations } from './operations.js';\nimport { sharedStyleKeys } from './style.js';\nimport type { InspectorDraw, InspectorSettings, InspectorTab } from './types.js';\n\n/** The events after which the inspector reads the draw instance again */\nexport const INSPECTOR_EVENTS = [\n 'selection.changed',\n 'document.changed',\n 'hidden.changed',\n 'readOnly.changed',\n] as const;\n\n/** One feature, with what its inspector needs */\nexport interface FeatureView {\n kind: 'feature';\n feature: Feature;\n /** The look it is drawn with */\n applied: FeatureStyleResolved | undefined;\n /** Its layer */\n layer: Layer | undefined;\n /** Whether it can be edited now (not read-only, no lock on it, its group or its layer) */\n editable: boolean;\n /** Whether the document is read-only */\n readOnly: boolean;\n /** Whether this client hides it */\n hidden: boolean;\n}\n\n/** What the inspector shows */\nexport type InspectorView =\n | { kind: 'empty' }\n | FeatureView\n | {\n kind: 'features';\n features: Feature[];\n applied: (FeatureStyleResolved | undefined)[];\n editable: boolean;\n readOnly: boolean;\n }\n | { kind: 'layer'; layer: Layer; onlyLayer: boolean; readOnly: boolean }\n | { kind: 'group'; group: Group; layer: Layer | undefined; readOnly: boolean }\n | { kind: 'items'; type: 'layer' | 'group'; count: number; readOnly: boolean };\n\n/** Reads what the inspector shows */\nexport function readView(draw: InspectorDraw): InspectorView {\n const { type, ids } = draw.selection.get();\n const readOnly = draw.isReadOnly();\n if (type === 'feature') {\n const features = draw.features.getMany(ids).filter((f): f is Feature => f !== undefined);\n if (features.length === 0) return { kind: 'empty' };\n const editable = features.every((f) => draw.features.isEditable(f.id));\n if (features.length === 1) {\n const [feature] = features;\n return {\n kind: 'feature',\n feature,\n applied: draw.features.getAppliedStyle(feature.id),\n layer: draw.layers.get(feature.layerId),\n editable,\n readOnly,\n hidden: draw.hidden.has(feature.id),\n };\n }\n const applied = features.map((f) => draw.features.getAppliedStyle(f.id));\n return { kind: 'features', features, applied, editable, readOnly };\n }\n if (type === 'layer') {\n const layers = ids.map((id) => draw.layers.get(id)).filter((l): l is Layer => !!l);\n if (layers.length === 0) return { kind: 'empty' };\n if (layers.length > 1) return { kind: 'items', type, count: layers.length, readOnly };\n return { kind: 'layer', layer: layers[0], onlyLayer: draw.layers.count() <= 1, readOnly };\n }\n if (type === 'group') {\n const groups = ids.map((id) => draw.groups.get(id)).filter((g): g is Group => !!g);\n if (groups.length === 0) return { kind: 'empty' };\n if (groups.length > 1) return { kind: 'items', type, count: groups.length, readOnly };\n const [group] = groups;\n return { kind: 'group', group, layer: draw.layers.get(group.layerId), readOnly };\n }\n return { kind: 'empty' };\n}\n\n/** What the inspector of one feature shows under its head and in its tabs */\nexport interface FeatureLayout {\n /** The measurements under the head, before the tabs; none when the options leave them out */\n measurements: MeasureRow[];\n /**\n * The description under the head, before the tabs: its text, and whether it can be changed\n * (an empty one then shows the action that adds it). Null when it is empty and cannot be\n * changed\n */\n description: { text: string; editable: boolean } | null;\n /** The tabs, in the order of the options; the Style tab only when it has something to show */\n tabs: InspectorTab[];\n /** Whether the Style tab has the fields of the style */\n style: boolean;\n /** Whether the Style tab has the buffer, at its end */\n buffer: boolean;\n}\n\n/**\n * Lays out the inspector of one feature\n *\n * @param view - The feature, as readView gives it\n * @param settings - The options of the inspector\n * @param sections - The number of the sections of the application that apply to the feature\n * @param locale - The language tag the numbers of the measurements are written in\n */\nexport function featureLayout(\n view: Pick<FeatureView, 'feature' | 'editable'>,\n settings: InspectorSettings,\n sections: number,\n locale = 'en',\n): FeatureLayout {\n const { feature, editable } = view;\n const text = featureDescription(feature);\n const style = sharedStyleKeys([feature]).length > 0;\n const buffer = settings.operations && applicableOperations([feature]).includes('buffer');\n const styleTab = style || sections > 0 || buffer;\n return {\n measurements: settings.measurements ? measure(feature, settings.units, locale) : [],\n description: editable || text !== '' ? { text, editable } : null,\n tabs: settings.tabs.filter((tab) => tab !== 'style' || styleTab),\n style,\n buffer,\n };\n}\n\n/** The name of a type: the words of the built-in types, and a custom type as it is named */\nexport function typeLabel(type: FeatureType, m: Messages): string {\n switch (type) {\n case 'Point':\n return m.point;\n case 'LineString':\n return m.line;\n case 'Polygon':\n return m.polygon;\n case 'Circle':\n return m.circle;\n case 'Freehand':\n return m.freehand;\n case 'Image':\n return m.image;\n case 'MultiPoint':\n return m.multiPoint;\n case 'MultiLineString':\n return m.multiLine;\n case 'MultiPolygon':\n return m.multiPolygon;\n default:\n return type;\n }\n}\n\n/** The number of features of each type, in the order the types first appear */\nexport function kindCounts(\n features: readonly Pick<Feature, 'type'>[],\n m: Messages,\n): { label: string; count: number }[] {\n const counts = new Map<string, number>();\n for (const f of features) counts.set(f.type, (counts.get(f.type) ?? 0) + 1);\n return [...counts].map(([type, count]) => ({ label: typeLabel(type, m), count }));\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\nimport type { Messages } from '../messages.js';\n\n/** The English words, the default */\nexport const en: Readonly<Messages> = Object.freeze({\n toolbar: 'Drawing tools',\n select: 'Select',\n point: 'Point',\n line: 'Line',\n polygon: 'Polygon',\n circle: 'Circle',\n freehand: 'Freehand',\n image: 'Image',\n delete: 'Delete',\n snapping: 'Snapping',\n toolsGroup: 'Tools',\n editGroup: 'Edit',\n deleteSelection: 'Delete the selection',\n more: 'More',\n keyboardShortcuts: 'Keyboard shortcuts',\n close: 'Close',\n back: 'Back',\n closePanes: 'Close the panels',\n dockHeight: 'Dock height',\n sheetHeight: 'Sheet height',\n layers: 'Layers',\n legend: 'Legend',\n newLayer: 'New layer',\n newGroup: 'New group from selection',\n activeLayer: 'Active layer',\n panelsGroup: 'Panels',\n toggleLayers: 'Show or hide the layers',\n multiPoint: 'Points',\n multiLine: 'Lines',\n multiPolygon: 'Polygons',\n legendAll: 'All',\n legendOther: 'Other',\n legendBelow: 'Below {upper}',\n legendAtLeast: '{lower} or more',\n legendRange: '{lower} to below {upper}',\n noLegend: 'No layer has a style rule.',\n hide: 'Hide',\n show: 'Show',\n lock: 'Lock',\n unlock: 'Unlock',\n rename: 'Name',\n add: 'Add',\n expand: 'Expand',\n collapse: 'Collapse',\n inspector: 'Inspector',\n nothingSelected: 'Nothing is selected',\n nothingSelectedNote: 'Select a feature, a group or a layer to see it here.',\n numberLocale: 'en',\n styleTab: 'Style',\n attributesTab: 'Attributes',\n addDescription: 'Add a description',\n description: 'Description',\n resetStyle: 'Reset the style',\n styleFillColor: 'Fill color',\n styleFillOpacity: 'Fill opacity',\n styleStrokeColor: 'Line color',\n styleStrokeWidth: 'Line width',\n styleStrokeOpacity: 'Line opacity',\n styleLineStyle: 'Line style',\n stylePointColor: 'Color',\n stylePointRadius: 'Radius',\n stylePointShape: 'Shape',\n stylePointOpacity: 'Opacity',\n stylePointStrokeColor: 'Outline color',\n stylePointStrokeWidth: 'Outline width',\n styleImageOpacity: 'Opacity',\n lineSolid: 'Solid',\n lineDashed: 'Dashed',\n lineDotted: 'Dotted',\n shapeCircle: 'Circle',\n shapeSquare: 'Square',\n shapeTriangle: 'Triangle',\n shapeStar: 'Star',\n measureLongitude: 'Longitude',\n measureLatitude: 'Latitude',\n measureLength: 'Length',\n measureArea: 'Area',\n measurePerimeter: 'Perimeter',\n measureRadius: 'Radius',\n measurePoints: 'Points',\n typeLayer: 'Layer',\n typeGroup: 'Group',\n hiddenState: 'Hidden',\n selectedCount: '{count} selected',\n groupAction: 'Group',\n ungroupAction: 'Ungroup',\n operations: 'Operations',\n opUnion: 'Union',\n opIntersection: 'Intersection',\n opDifference: 'Difference',\n opSplit: 'Split',\n opBuffer: 'Buffer',\n bufferDescription:\n 'Creates the area within a distance of the features. A negative distance shrinks an area.',\n bufferDistance: 'Distance',\n bufferUnit: 'Unit',\n bufferSegments: 'Segments',\n bufferSegmentsHint: 'The segments of a full circle; empty for the default',\n bufferRun: 'Create',\n bufferFailed: 'The buffer could not be made.',\n opacityField: 'Opacity',\n visibleField: 'Visible',\n lockedField: 'Locked',\n styleRule: 'Style rule',\n ruleKind: 'Rule',\n ruleProperty: 'Attribute',\n ruleNone: 'None',\n ruleSingle: 'One color',\n ruleCategorical: 'By category',\n ruleGraduated: 'By class',\n ruleContinuous: 'Gradient',\n ruleHint: 'In this version a rule is set with layers.update.',\n deleteLayer: 'Delete layer',\n addName: 'Add a name',\n mixed: 'Mixed',\n cancelLabel: 'Cancel',\n noAttributes: 'No attributes.',\n attributeName: 'Attribute name',\n attributeValue: 'Value',\n addValue: 'Add a value',\n addAttribute: 'Add an attribute',\n removeAttribute: 'Remove {key}',\n locked: 'Locked',\n color: 'Color',\n colorRed: 'Red',\n colorOrange: 'Orange',\n colorGold: 'Gold',\n colorGreen: 'Green',\n colorBlue: 'Blue',\n colorPurple: 'Purple',\n colorBlack: 'Black',\n colorBrown: 'Brown',\n colorWhite: 'White',\n colorCode: 'Color code',\n eyedropper: 'Eyedropper',\n hue: 'Hue',\n saturation: 'Saturation',\n lightness: 'Lightness',\n saturationValue: 'Saturation and value',\n saturationValueText: 'Saturation {s}%, value {v}%',\n running: 'Running',\n toLight: 'Switch to light',\n toDark: 'Switch to dark',\n});\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\nimport type { Messages } from '../messages.js';\n\n/** The Japanese words */\nexport const ja: Readonly<Messages> = Object.freeze({\n toolbar: '描画の道具',\n select: '選択',\n point: '点',\n line: '線',\n polygon: '面',\n circle: '円',\n freehand: 'フリーハンド',\n image: '画像',\n delete: '削除',\n snapping: '吸着',\n toolsGroup: '道具',\n editGroup: '編集',\n deleteSelection: '選んだものを削除',\n more: 'その他',\n keyboardShortcuts: 'キーボードショートカット',\n close: '閉じる',\n back: '戻る',\n closePanes: 'パネルを閉じる',\n dockHeight: 'ドックの高さ',\n sheetHeight: 'シートの高さ',\n layers: 'レイヤー',\n legend: '凡例',\n newLayer: '新しいレイヤー',\n newGroup: '選んだものからグループを作る',\n activeLayer: '描き込むレイヤー',\n panelsGroup: 'パネル',\n toggleLayers: 'レイヤーのパネルを開く、閉じる',\n multiPoint: '複数の点',\n multiLine: '複数の線',\n multiPolygon: '複数の面',\n legendAll: 'すべて',\n legendOther: 'その他',\n legendBelow: '{upper} 未満',\n legendAtLeast: '{lower} 以上',\n legendRange: '{lower} 以上 {upper} 未満',\n noLegend: 'スタイルの規則を持つレイヤーはありません。',\n hide: '隠す',\n show: '表示する',\n lock: 'ロックする',\n unlock: 'ロックを解除する',\n rename: '名前',\n add: '追加',\n expand: '開く',\n collapse: '閉じる',\n inspector: 'インスペクター',\n nothingSelected: '何も選んでいません',\n nothingSelectedNote: '地物、グループ、レイヤーを選ぶとここに出ます。',\n numberLocale: 'ja',\n styleTab: 'スタイル',\n attributesTab: '属性',\n addDescription: '説明を追加',\n description: '説明',\n resetStyle: 'スタイルを戻す',\n styleFillColor: '塗りの色',\n styleFillOpacity: '塗りの不透明度',\n styleStrokeColor: '線の色',\n styleStrokeWidth: '線の太さ',\n styleStrokeOpacity: '線の不透明度',\n styleLineStyle: '線種',\n stylePointColor: '色',\n stylePointRadius: '半径',\n stylePointShape: '形',\n stylePointOpacity: '不透明度',\n stylePointStrokeColor: '縁の色',\n stylePointStrokeWidth: '縁の太さ',\n styleImageOpacity: '不透明度',\n lineSolid: '実線',\n lineDashed: '破線',\n lineDotted: '点線',\n shapeCircle: '円',\n shapeSquare: '四角',\n shapeTriangle: '三角',\n shapeStar: '星',\n measureLongitude: '経度',\n measureLatitude: '緯度',\n measureLength: '長さ',\n measureArea: '面積',\n measurePerimeter: '周長',\n measureRadius: '半径',\n measurePoints: '点の数',\n typeLayer: 'レイヤー',\n typeGroup: 'グループ',\n hiddenState: '非表示',\n selectedCount: '{count} 件を選択中',\n groupAction: 'グループにする',\n ungroupAction: 'グループを解除',\n operations: '演算',\n opUnion: '結合',\n opIntersection: '交差',\n opDifference: '差',\n opSplit: '分割',\n opBuffer: 'バッファー',\n bufferDescription: '地物から一定の距離の範囲を作ります。負の距離は面を縮めます。',\n bufferDistance: '距離',\n bufferUnit: '単位',\n bufferSegments: '分割数',\n bufferSegmentsHint: '円 1 周の辺の数。空なら既定値',\n bufferRun: '作る',\n bufferFailed: 'バッファーを作れませんでした。',\n opacityField: '不透明度',\n visibleField: '表示',\n lockedField: 'ロック',\n styleRule: 'スタイルの規則',\n ruleKind: '規則',\n ruleProperty: '属性',\n ruleNone: 'なし',\n ruleSingle: '単色',\n ruleCategorical: 'カテゴリー別',\n ruleGraduated: '階級別',\n ruleContinuous: 'グラデーション',\n ruleHint: 'この版では規則を layers.update で設定します。',\n deleteLayer: 'レイヤーを削除',\n addName: '名前を付ける',\n mixed: '混在',\n cancelLabel: 'キャンセル',\n noAttributes: '属性はありません。',\n attributeName: '属性の名前',\n attributeValue: '値',\n addValue: '値を入れる',\n addAttribute: '属性を足す',\n removeAttribute: '{key} を削除',\n locked: 'ロック中',\n color: '色',\n colorRed: '赤',\n colorOrange: '橙',\n colorGold: '金',\n colorGreen: '緑',\n colorBlue: '青',\n colorPurple: '紫',\n colorBlack: '黒',\n colorBrown: '茶',\n colorWhite: '白',\n colorCode: 'カラーコード',\n eyedropper: 'スポイト',\n hue: '色相',\n saturation: '彩度',\n lightness: '明度',\n saturationValue: '彩度と明度',\n saturationValueText: '彩度 {s}%、明度 {v}%',\n running: '実行中',\n toLight: 'ライトに切り替える',\n toDark: 'ダークに切り替える',\n});\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The words of the interface. English and Japanese come with it; an application can replace any\n// of them by passing a partial set, which is laid over English.\n//\n// Some words are shown by the components of kata the interface is built from (the More menu of\n// the toolbar, the list of the keyboard shortcuts). They are part of this set too, and applying a\n// locale passes them on to kata. kata keeps them for the whole page: every interface on one page\n// shows the words of the locale that was applied last.\n\nimport { type Messages as KataMessages, setMessages as setKataMessages } from '@sakuzu/kata/svelte';\nimport { en } from './locales/en.js';\nimport { ja } from './locales/ja.js';\n\n/** The words of the interface */\nexport interface Messages {\n /** The name of the toolbar, read by assistive technology */\n toolbar: string;\n /** The names of the built-in tools */\n select: string;\n point: string;\n line: string;\n polygon: string;\n circle: string;\n freehand: string;\n image: string;\n /** The delete button of the toolbar */\n delete: string;\n /** The snapping switch of the toolbar */\n snapping: string;\n /** In the list of the keyboard shortcuts: the heading of the tools and of the editing keys */\n toolsGroup: string;\n editGroup: string;\n /** In the list of the keyboard shortcuts: what Delete and Backspace do */\n deleteSelection: string;\n /** The trigger of the menu that holds the tools that do not fit */\n more: string;\n /** The title of the list of the keyboard shortcuts */\n keyboardShortcuts: string;\n /** The close and back buttons of a dialog */\n close: string;\n back: string;\n /** The scrim that closes the panels floating over the map */\n closePanes: string;\n /** The handles that resize a dock and a sheet */\n dockHeight: string;\n sheetHeight: string;\n /** The tab of the layer panel, and the name of its tree */\n layers: string;\n /** The tab of the legend */\n legend: string;\n /** The items of the add menu of the layer panel */\n newLayer: string;\n newGroup: string;\n /** The mark of the layer that drawn features go into */\n activeLayer: string;\n /** In the list of the keyboard shortcuts: the heading of the panels, and the key of the left one */\n panelsGroup: string;\n toggleLayers: string;\n /** The names of the types that have no tool, for a feature without a name */\n multiPoint: string;\n multiLine: string;\n multiPolygon: string;\n /**\n * The labels of the legend that are not values of the data: every feature, the features the\n * rule does not resolve, and the classes of a graduated rule, with `{lower}` and `{upper}` for\n * their bounds\n */\n legendAll: string;\n legendOther: string;\n legendBelow: string;\n legendAtLeast: string;\n legendRange: string;\n /** What the legend shows when no layer has a style rule */\n noLegend: string;\n /** In the layer tree of kata: the eye, the lock, the name's input, the add button and the chevron */\n hide: string;\n show: string;\n lock: string;\n unlock: string;\n rename: string;\n add: string;\n expand: string;\n collapse: string;\n /** The inspector: its name, read by assistive technology, and what it says with nothing selected */\n inspector: string;\n nothingSelected: string;\n nothingSelectedNote: string;\n /** The language tag the numbers of the inspector are written in (Intl.NumberFormat) */\n numberLocale: string;\n /** The tabs of the inspector of a feature; the first is also the title of the style's section */\n styleTab: string;\n attributesTab: string;\n /** The row of the description of a feature, and its action while it is empty */\n description: string;\n addDescription: string;\n /** The button that removes the style of the features, back to the layer rule and the defaults */\n resetStyle: string;\n /** The names of the fields of the style */\n styleFillColor: string;\n styleFillOpacity: string;\n styleStrokeColor: string;\n styleStrokeWidth: string;\n styleStrokeOpacity: string;\n styleLineStyle: string;\n stylePointColor: string;\n stylePointRadius: string;\n stylePointShape: string;\n stylePointOpacity: string;\n stylePointStrokeColor: string;\n stylePointStrokeWidth: string;\n styleImageOpacity: string;\n /** The choices of the line style and of the shape of a point */\n lineSolid: string;\n lineDashed: string;\n lineDotted: string;\n shapeCircle: string;\n shapeSquare: string;\n shapeTriangle: string;\n shapeStar: string;\n /** The names of the measurements */\n measureLongitude: string;\n measureLatitude: string;\n measureLength: string;\n measureArea: string;\n measurePerimeter: string;\n measureRadius: string;\n measurePoints: string;\n /** The names of a layer and of a group */\n typeLayer: string;\n typeGroup: string;\n /** What the inspector says of a feature this client hides */\n hiddenState: string;\n /** The title of a selection of several things; {count} is their number */\n selectedCount: string;\n /** The actions on a selection */\n groupAction: string;\n ungroupAction: string;\n /** The operations on features, and the title of their section */\n operations: string;\n opUnion: string;\n opIntersection: string;\n opDifference: string;\n opSplit: string;\n opBuffer: string;\n /** The dialog of the buffer */\n bufferDescription: string;\n bufferDistance: string;\n bufferUnit: string;\n bufferSegments: string;\n bufferSegmentsHint: string;\n bufferRun: string;\n bufferFailed: string;\n /** The fields of a layer and of a group */\n opacityField: string;\n visibleField: string;\n lockedField: string;\n /** The section of the style rule of a layer, which is only read */\n styleRule: string;\n ruleKind: string;\n ruleProperty: string;\n ruleNone: string;\n ruleSingle: string;\n ruleCategorical: string;\n ruleGraduated: string;\n ruleContinuous: string;\n ruleHint: string;\n deleteLayer: string;\n /**\n * Words kata's components of the inspector show: the action of an empty name, a field whose\n * values differ, the list of attributes and the color picker. `removeAttribute` has {key} for\n * the name of the attribute, and `saturationValueText` {s} and {v} for the two percentages\n */\n addName: string;\n mixed: string;\n cancelLabel: string;\n noAttributes: string;\n attributeName: string;\n attributeValue: string;\n addValue: string;\n addAttribute: string;\n removeAttribute: string;\n locked: string;\n color: string;\n colorRed: string;\n colorOrange: string;\n colorGold: string;\n colorGreen: string;\n colorBlue: string;\n colorPurple: string;\n colorBlack: string;\n colorBrown: string;\n colorWhite: string;\n colorCode: string;\n eyedropper: string;\n hue: string;\n saturation: string;\n lightness: string;\n saturationValue: string;\n saturationValueText: string;\n running: string;\n /** The button that switches the theme: what pressing it does, to the light and to the dark */\n toLight: string;\n toDark: string;\n}\n\n/** A locale: one of the sets that come with the interface, or words laid over English */\nexport type Locale = 'en' | 'ja' | Partial<Messages>;\n\n/** The words of the components of kata, taken from the set */\nconst KATA_KEYS = [\n 'more',\n 'keyboardShortcuts',\n 'close',\n 'back',\n 'closePanes',\n 'dockHeight',\n 'sheetHeight',\n 'hide',\n 'show',\n 'lock',\n 'unlock',\n 'rename',\n 'add',\n 'expand',\n 'collapse',\n] as const satisfies readonly (keyof Messages)[];\n\n/** The full set of words for a locale */\nexport function resolveMessages(locale: Locale = 'en'): Messages {\n if (locale === 'en') return { ...en };\n if (locale === 'ja') return { ...ja };\n const out: Messages = { ...en };\n for (const [key, value] of Object.entries(locale) as [keyof Messages, unknown][]) {\n if (typeof value === 'string' && key in en) out[key] = value;\n }\n return out;\n}\n\n/** The language of a locale, for the lang attribute of the root element, when it is known */\nexport function localeLanguage(locale: Locale = 'en'): string | null {\n return typeof locale === 'string' ? locale : null;\n}\n\n/** The words of the set that kata shows */\nexport function kataMessages(messages: Messages): Pick<Messages, (typeof KATA_KEYS)[number]> {\n const out = {} as Pick<Messages, (typeof KATA_KEYS)[number]>;\n for (const key of KATA_KEYS) out[key] = messages[key];\n return out;\n}\n\n/** Passes the words that kata shows on to kata (for the whole page) */\nexport function applyKataMessages(messages: Messages): void {\n setKataMessages({\n ...kataMessages(messages),\n ...(inspectorKataMessages(messages) as Partial<KataMessages>),\n });\n}\n\n/**\n * The words of kata's components of the inspector, by kata's key: the key of the set that holds\n * each, where the two names differ (the words kata's layer tree shows too are in KATA_KEYS)\n */\nconst INSPECTOR_KATA_WORDS = {\n addName: 'addName',\n mixed: 'mixed',\n cancel: 'cancelLabel',\n noAttributes: 'noAttributes',\n attributeName: 'attributeName',\n attributeValue: 'attributeValue',\n addValue: 'addValue',\n addAttribute: 'addAttribute',\n locked: 'locked',\n color: 'color',\n colorRed: 'colorRed',\n colorOrange: 'colorOrange',\n colorGold: 'colorGold',\n colorGreen: 'colorGreen',\n colorBlue: 'colorBlue',\n colorPurple: 'colorPurple',\n colorBlack: 'colorBlack',\n colorBrown: 'colorBrown',\n colorWhite: 'colorWhite',\n colorCode: 'colorCode',\n eyedropper: 'eyedropper',\n hue: 'hue',\n saturation: 'saturation',\n lightness: 'lightness',\n saturationValue: 'saturationValue',\n running: 'running',\n} as const satisfies Partial<Record<keyof KataMessages, keyof Messages>>;\n\n/** Fills the {name} places of a word with values */\nexport function fillWord(word: string, values: Record<string, string | number>): string {\n return word.replace(/\\{(\\w+)\\}/g, (all, name: string) =>\n name in values ? String(values[name]) : all,\n );\n}\n\n/**\n * The words of the set that kata's components of the inspector show, by kata's keys, as kata\n * takes them (a word with values as a function of them)\n */\nexport function inspectorKataMessages(messages: Messages): Record<string, unknown> {\n const out: Partial<Record<keyof KataMessages, unknown>> = {};\n for (const [kata, own] of Object.entries(INSPECTOR_KATA_WORDS)) {\n out[kata as keyof KataMessages] = messages[own];\n }\n out.removeAttribute = ({ key }: { key: string }) => fillWord(messages.removeAttribute, { key });\n out.saturationValueText = ({ s, v }: { s: number; v: number }) =>\n fillWord(messages.saturationValueText, { s, v });\n return out;\n}\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { InspectorRow, NativeSelect, NumberInput, ProcessDialog } from '@sakuzu/kata/svelte';\n import type { Feature } from '@sakuzu/maplibre-gl-draw';\n import {\n type DistanceUnit,\n distanceUnits,\n runBuffer,\n toMeters,\n } from '../inspector/operations.js';\n import type { InspectorDraw, Units } from '../inspector/types.js';\n import type { Messages } from '../messages.js';\n\n // BufferDialog: kata's ProcessDialog that asks the distance of a buffer (a number and a unit of\n // the units of the inspector) and, optionally, the segments of a full circle, then makes the\n // buffers with draw.features.buffer and selects them. Core's error shows in the dialog.\n let {\n open = $bindable(false),\n draw,\n features,\n units,\n m,\n }: {\n open?: boolean;\n draw: InspectorDraw;\n /** The features to surround */\n features: Feature[];\n units: Units;\n m: Messages;\n } = $props();\n\n const uid = $props.id();\n const unitChoices = $derived(distanceUnits(units));\n let distance = $state<number | null>(null);\n let unit = $state<DistanceUnit | undefined>();\n let segments = $state<number | null>(null);\n let error = $state<string | undefined>();\n\n const currentUnit = $derived(unit && unitChoices.includes(unit) ? unit : unitChoices[0]);\n const ready = $derived(\n distance !== null &&\n Number.isFinite(distance) &&\n distance !== 0 &&\n (segments === null || segments > 0),\n );\n\n function run() {\n if (!ready || distance === null) return;\n try {\n const made = runBuffer(\n draw,\n features,\n toMeters(distance, currentUnit),\n segments === null ? undefined : segments,\n );\n if (made === null || made.length === 0) {\n error = m.bufferFailed;\n return;\n }\n error = undefined;\n open = false;\n } catch (e) {\n error = e instanceof Error ? e.message : m.bufferFailed;\n }\n }\n</script>\n\n<ProcessDialog\n bind:open\n title={m.opBuffer}\n description={m.bufferDescription}\n runLabel={m.bufferRun}\n {error}\n disabled={!ready}\n onrun={run}\n oncancel={() => (error = undefined)}\n size=\"sm\"\n>\n <InspectorRow label={m.bufferDistance} for=\"{uid}-distance\">\n <NumberInput id=\"{uid}-distance\" bind:value={distance} step=\"any\" />\n </InspectorRow>\n <InspectorRow label={m.bufferUnit} for=\"{uid}-unit\">\n <NativeSelect\n id=\"{uid}-unit\"\n options={unitChoices.map((u) => ({ value: u, label: u }))}\n value={currentUnit}\n onchange={(u) => (unit = u)}\n />\n </InspectorRow>\n <InspectorRow label={m.bufferSegments} for=\"{uid}-segments\" hint={m.bufferSegmentsHint}>\n <NumberInput id=\"{uid}-segments\" bind:value={segments} min={1} step={1} />\n </InspectorRow>\n</ProcessDialog>\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { FieldList, InspectorSection } from '@sakuzu/kata/svelte';\n import type { Feature } from '@sakuzu/maplibre-gl-draw';\n import type { Attachment } from 'svelte/attachments';\n import type { InspectorField, InspectorSectionSpec } from '../inspector/types.js';\n\n // CustomSection: a section the application added. Its fields are drawn by kata's FieldList\n // and their changes go to the section's onchange; what render draws goes under them. render\n // runs again with the features whenever they change, after the function it returned is called.\n let {\n spec,\n features,\n editable,\n }: {\n spec: InspectorSectionSpec;\n features: Feature[];\n /** Whether the features can be edited now; the fields are disabled when they cannot */\n editable: boolean;\n } = $props();\n\n const fields = $derived.by((): InspectorField[] => {\n let out: InspectorField[] = [];\n try {\n out = spec.fields?.(features) ?? [];\n } catch (error) {\n console.error(`The inspector section \"${spec.id}\" failed to give its fields`, error);\n }\n return editable ? out : out.map((f) => ({ ...f, disabled: true }));\n });\n\n function draw(spec: InspectorSectionSpec, features: Feature[]): Attachment<HTMLElement> {\n return (element) => spec.render?.(element, features);\n }\n</script>\n\n<InspectorSection title={spec.title}>\n {#if fields.length > 0}\n <FieldList {fields} onchange={(key, value) => spec.onchange?.(key, value, features)} />\n {/if}\n {#if spec.render}\n <div data-section={spec.id} {@attach draw(spec, features)}></div>\n {/if}\n</InspectorSection>\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { Button, FieldList, Icon, InspectorSection } from '@sakuzu/kata/svelte';\n import type { Feature, FeatureStyleResolved } from '@sakuzu/maplibre-gl-draw';\n import {\n applyStyle,\n ownStyleKeys,\n resetPatch,\n styleFields,\n stylePatch,\n } from '../inspector/style.js';\n import type { InspectorDraw, InspectorSectionSpec } from '../inspector/types.js';\n import type { Messages } from '../messages.js';\n import CustomSection from './CustomSection.svelte';\n\n // StyleFields: the section of the style of features, and the sections the application added\n // that apply to them. The fields are those the features share, with the values they are drawn\n // with; a change is written into the style of every feature in one transaction, and the reset\n // removes the keys the features set themselves.\n let {\n draw,\n features,\n applied,\n editable,\n m,\n sections = [],\n }: {\n draw: InspectorDraw;\n features: Feature[];\n /** The look of each feature, in the order of features */\n applied: (FeatureStyleResolved | undefined)[];\n /** Whether the features can be edited now */\n editable: boolean;\n m: Messages;\n /** The sections of the application that apply to the features */\n sections?: InspectorSectionSpec[];\n } = $props();\n\n const fields = $derived.by(() => {\n const looks = new Map(features.map((f, i) => [f.id, applied[i]]));\n return styleFields(features, (id) => looks.get(id), m, !editable);\n });\n const own = $derived(ownStyleKeys(features));\n const ids = $derived(features.map((f) => f.id));\n\n function onchange(key: string, value: unknown) {\n applyStyle(draw, ids, stylePatch(key, value));\n }\n\n function reset() {\n applyStyle(draw, ids, resetPatch(own));\n }\n</script>\n\n{#snippet resetButton()}\n <Button variant=\"ghost\" icon aria-label={m.resetStyle} onclick={reset}>\n <Icon name=\"undo-2\" />\n </Button>\n{/snippet}\n\n{#if fields.length > 0}\n <InspectorSection\n title={m.styleTab}\n end={editable && own.length > 0 ? resetButton : undefined}\n >\n <FieldList {fields} {onchange} />\n </InspectorSection>\n{/if}\n{#each sections as spec (spec.id)}\n <CustomSection {spec} {features} {editable} />\n{/each}\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import {\n AttributeList,\n Block,\n Button,\n Footer,\n InlineEdit,\n InspectorFrame,\n InspectorSection,\n Kv,\n Pair,\n Row,\n Stack,\n Tabs,\n } from '@sakuzu/kata/svelte';\n import type { FeaturePatch } from '@sakuzu/maplibre-gl-draw';\n import {\n attributeAdd,\n attributePatch,\n attributeRemove,\n attributeRows,\n descriptionPatch,\n featureName,\n namePatch,\n } from '../inspector/attributes.js';\n import type { MeasureKey } from '../inspector/measure.js';\n import type {\n InspectorDraw,\n InspectorSectionSpec,\n InspectorSettings,\n InspectorTab,\n } from '../inspector/types.js';\n import { type FeatureView, featureLayout, typeLabel } from '../inspector/view.js';\n import type { Messages } from '../messages.js';\n import BufferDialog from './BufferDialog.svelte';\n import StyleFields from './StyleFields.svelte';\n\n // FeatureInspector: the inspector of one feature in kata's InspectorFrame, laid out as\n // featureLayout gives it. The head is its name (properties.name), changed where it stands, and\n // a subtitle (its type, its layer and whether this client hides it). Under the head, with no\n // tab, are its measurements and its description (properties.description), changed where it\n // stands. Then the tabs: Style has the fields of its style, the sections of the application and\n // the buffer; Attributes the list of its other attributes. The foot deletes it, locks or\n // unlocks it, and hides or shows it in this client.\n let {\n draw,\n view,\n m,\n settings,\n sections = [],\n tab = $bindable('style'),\n onclose,\n }: {\n draw: InspectorDraw;\n view: FeatureView;\n m: Messages;\n settings: InspectorSettings;\n /** The sections of the application that apply to the feature */\n sections?: InspectorSectionSpec[];\n /** The tab chosen last, kept while the selection changes */\n tab?: InspectorTab;\n onclose?: () => void;\n } = $props();\n\n const feature = $derived(view.feature);\n const editable = $derived(view.editable);\n const layout = $derived(featureLayout(view, settings, sections.length, m.numberLocale));\n const tabs = $derived(\n layout.tabs.map((id) => ({ id, label: id === 'style' ? m.styleTab : m.attributesTab })),\n );\n const current = $derived(tabs.some((t) => t.id === tab) ? tab : tabs[0]?.id);\n const subtitle = $derived(\n [typeLabel(feature.type, m), view.layer?.name, view.hidden ? m.hiddenState : '']\n .filter(Boolean)\n .join(' · '),\n );\n const name = $derived(featureName(feature));\n const attributes = $derived(attributeRows(feature));\n const both = $derived(`${m.styleTab}, ${m.attributesTab}`);\n let bufferOpen = $state(false);\n\n const MEASURE_LABELS: Record<MeasureKey, keyof Messages> = {\n longitude: 'measureLongitude',\n latitude: 'measureLatitude',\n length: 'measureLength',\n area: 'measureArea',\n perimeter: 'measurePerimeter',\n radius: 'measureRadius',\n points: 'measurePoints',\n };\n const measurements = $derived(\n layout.measurements.map((row) => ({ k: m[MEASURE_LABELS[row.key]], v: row.value, mono: true })),\n );\n\n function update(patch: FeaturePatch | null) {\n if (patch) draw.features.update(feature.id, patch);\n }\n\n function toggleHidden() {\n if (view.hidden) draw.hidden.remove(feature.id);\n else draw.hidden.add(feature.id);\n }\n</script>\n\n{#snippet foot()}\n <Footer>\n {#snippet lead()}\n <Button variant=\"danger\" disabled={!editable} onclick={() => draw.selection.delete()}>\n {m.delete}\n </Button>\n {/snippet}\n {#snippet secondary()}\n <Button\n disabled={view.readOnly}\n onclick={() => draw.features.update(feature.id, { locked: !feature.locked })}\n >\n {feature.locked ? m.unlock : m.lock}\n </Button>\n <Button onclick={toggleHidden}>{view.hidden ? m.show : m.hide}</Button>\n {/snippet}\n </Footer>\n{/snippet}\n\n<InspectorFrame\n title={editable ? name : name || typeLabel(feature.type, m)}\n ontitle={editable ? (next) => update(namePatch(next)) : undefined}\n {subtitle}\n {onclose}\n end={foot}\n>\n {#if measurements.length > 0 || layout.description}\n <Block>\n <Stack gap=\"sm\">\n {#if measurements.length > 0}\n <Kv items={measurements} />\n {/if}\n {#if layout.description}\n <Pair label={m.description} top>\n <InlineEdit\n value={layout.description.text}\n placeholder={m.addDescription}\n label={layout.description.text ? m.description : m.addDescription}\n multiline\n editable={layout.description.editable}\n onCommit={(next) => update(descriptionPatch(next))}\n />\n </Pair>\n {/if}\n </Stack>\n </Block>\n {/if}\n {#if tabs.length > 1 && current}\n <Tabs {tabs} {current} label={both} onselect={(id) => (tab = id as InspectorTab)} />\n {/if}\n {#if current === 'style'}\n <StyleFields\n {draw}\n features={[feature]}\n applied={[view.applied]}\n {editable}\n {m}\n {sections}\n />\n {#if layout.buffer}\n <InspectorSection title={m.operations}>\n <Row wrap>\n <Button disabled={!editable} onclick={() => (bufferOpen = true)}>{m.opBuffer}</Button>\n </Row>\n </InspectorSection>\n {/if}\n {:else if current === 'attributes'}\n <AttributeList\n items={attributes}\n readonly={!editable}\n onchange={(index, item) => update(attributePatch(feature, index, item))}\n onadd={editable ? (item) => update(attributeAdd(feature, item)) : undefined}\n onremove={editable ? (index) => update(attributeRemove(feature, index)) : undefined}\n />\n {/if}\n</InspectorFrame>\n\n{#if layout.buffer}\n <BufferDialog bind:open={bufferOpen} {draw} features={[feature]} units={settings.units} {m} />\n{/if}\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import {\n Button,\n FieldList,\n type FieldSpec,\n Footer,\n InspectorFrame,\n InspectorSection,\n } from '@sakuzu/kata/svelte';\n import type { Group, Layer } from '@sakuzu/maplibre-gl-draw';\n import type { InspectorDraw } from '../inspector/types.js';\n import type { Messages } from '../messages.js';\n\n // GroupInspector: a group in kata's InspectorFrame: its name, changed where it stands, whether\n // it is visible and whether it is locked. The foot takes its features out of it (the group\n // goes) or deletes it with its features.\n let {\n draw,\n group,\n layer,\n readOnly,\n m,\n onclose,\n }: {\n draw: InspectorDraw;\n group: Group;\n /** The layer it is in */\n layer: Layer | undefined;\n readOnly: boolean;\n m: Messages;\n onclose?: () => void;\n } = $props();\n\n const lockedHere = $derived(group.locked || layer?.locked === true);\n const fields = $derived<FieldSpec[]>([\n {\n key: 'visible',\n kind: 'toggle',\n label: m.visibleField,\n value: group.visible,\n disabled: readOnly,\n },\n {\n key: 'locked',\n kind: 'toggle',\n label: m.lockedField,\n value: group.locked,\n disabled: readOnly,\n },\n ]);\n\n function onchange(key: string, value: unknown) {\n if (key === 'visible' || key === 'locked') {\n draw.groups.update(group.id, { [key]: value === true });\n }\n }\n\n function rename(name: string) {\n if (name !== '') draw.groups.update(group.id, { name });\n }\n</script>\n\n{#snippet foot()}\n <Footer>\n {#snippet lead()}\n <Button\n variant=\"danger\"\n disabled={readOnly || lockedHere}\n onclick={() => draw.selection.delete()}\n >\n {m.delete}\n </Button>\n {/snippet}\n {#snippet secondary()}\n <Button disabled={readOnly} onclick={() => draw.selection.ungroup()}>\n {m.ungroupAction}\n </Button>\n {/snippet}\n </Footer>\n{/snippet}\n\n<InspectorFrame\n title={group.name}\n ontitle={readOnly || lockedHere ? undefined : rename}\n subtitle={[m.typeGroup, layer?.name].filter(Boolean).join(' · ')}\n {onclose}\n end={foot}\n>\n <InspectorSection title={m.typeGroup}>\n <FieldList {fields} {onchange} />\n </InspectorSection>\n</InspectorFrame>\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import {\n Button,\n FieldList,\n type FieldSpec,\n Footer,\n InspectorFrame,\n InspectorRow,\n InspectorSection,\n ReadValue,\n } from '@sakuzu/kata/svelte';\n import type { Layer, StyleRule } from '@sakuzu/maplibre-gl-draw';\n import type { InspectorDraw } from '../inspector/types.js';\n import type { Messages } from '../messages.js';\n\n // LayerInspector: a layer in kata's InspectorFrame: its name, changed where it stands, its\n // opacity, whether it is visible and whether it is locked. Its style rule is shown and not\n // edited here (an application sets it with draw.layers.update). The foot deletes it, unless it\n // is the only layer.\n let {\n draw,\n layer,\n onlyLayer,\n readOnly,\n m,\n onclose,\n }: {\n draw: InspectorDraw;\n layer: Layer;\n /** Whether it is the only layer of the document, which is not deleted */\n onlyLayer: boolean;\n readOnly: boolean;\n m: Messages;\n onclose?: () => void;\n } = $props();\n\n const fields = $derived<FieldSpec[]>([\n {\n key: 'opacity',\n kind: 'slider',\n label: m.opacityField,\n value: Math.round(layer.opacity * 100),\n min: 0,\n max: 100,\n step: 1,\n unit: '%',\n disabled: readOnly || layer.locked,\n },\n {\n key: 'visible',\n kind: 'toggle',\n label: m.visibleField,\n value: layer.visible,\n disabled: readOnly,\n },\n {\n key: 'locked',\n kind: 'toggle',\n label: m.lockedField,\n value: layer.locked,\n disabled: readOnly,\n },\n ]);\n\n const RULES: Record<StyleRule['kind'], keyof Messages> = {\n single: 'ruleSingle',\n categorical: 'ruleCategorical',\n graduated: 'ruleGraduated',\n continuous: 'ruleContinuous',\n };\n const rule = $derived(layer.styleRule);\n\n function onchange(key: string, value: unknown) {\n if (key === 'opacity' && typeof value === 'number') {\n draw.layers.update(layer.id, { opacity: Math.min(1, Math.max(0, value / 100)) });\n } else if (key === 'visible' || key === 'locked') {\n draw.layers.update(layer.id, { [key]: value === true });\n }\n }\n\n function rename(name: string) {\n if (name !== '') draw.layers.update(layer.id, { name });\n }\n</script>\n\n{#snippet foot()}\n <Footer>\n {#snippet lead()}\n <Button\n variant=\"danger\"\n disabled={readOnly || onlyLayer || layer.locked}\n onclick={() => draw.selection.delete()}\n >\n {m.deleteLayer}\n </Button>\n {/snippet}\n </Footer>\n{/snippet}\n\n<InspectorFrame\n title={layer.name}\n ontitle={readOnly || layer.locked ? undefined : rename}\n subtitle={m.typeLayer}\n {onclose}\n end={foot}\n>\n <InspectorSection title={m.typeLayer}>\n <FieldList {fields} {onchange} />\n </InspectorSection>\n <InspectorSection title={m.styleRule}>\n <InspectorRow label={m.ruleKind} hint={m.ruleHint}>\n <ReadValue value={rule ? m[RULES[rule.kind]] : m.ruleNone} muted={!rule} />\n </InspectorRow>\n {#if rule && rule.kind !== 'single'}\n <InspectorRow label={m.ruleProperty}>\n <ReadValue value={rule.property} mono />\n </InspectorRow>\n {/if}\n </InspectorSection>\n</InspectorFrame>\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { Button, Row, SelectionSummary } from '@sakuzu/kata/svelte';\n import type { Feature, FeatureStyleResolved } from '@sakuzu/maplibre-gl-draw';\n import { applicableOperations, type OperationId, runOperation } from '../inspector/operations.js';\n import type {\n InspectorDraw,\n InspectorSectionSpec,\n InspectorSettings,\n } from '../inspector/types.js';\n import { kindCounts } from '../inspector/view.js';\n import { fillWord, type Messages } from '../messages.js';\n import BufferDialog from './BufferDialog.svelte';\n import StyleFields from './StyleFields.svelte';\n\n // SelectionInspector: several features in kata's SelectionSummary. It counts them by type,\n // shows the fields of the style they share (a field whose values differ is mixed) and the\n // sections of the application that apply to all of them, and offers the operations that apply,\n // grouping and deleting.\n let {\n draw,\n features,\n applied,\n editable,\n readOnly,\n m,\n settings,\n sections = [],\n onclose,\n }: {\n draw: InspectorDraw;\n features: Feature[];\n applied: (FeatureStyleResolved | undefined)[];\n editable: boolean;\n readOnly: boolean;\n m: Messages;\n settings: InspectorSettings;\n sections?: InspectorSectionSpec[];\n onclose?: () => void;\n } = $props();\n\n const operations = $derived(settings.operations ? applicableOperations(features) : []);\n const oneLayer = $derived(features.every((f) => f.layerId === features[0]?.layerId));\n let bufferOpen = $state(false);\n\n const LABELS: Record<OperationId, keyof Messages> = {\n union: 'opUnion',\n intersection: 'opIntersection',\n difference: 'opDifference',\n split: 'opSplit',\n buffer: 'opBuffer',\n };\n\n function run(op: OperationId) {\n if (op === 'buffer') {\n bufferOpen = true;\n return;\n }\n try {\n runOperation(draw, op, features);\n } catch (error) {\n console.error(error);\n }\n }\n</script>\n\n{#snippet fields()}\n <StyleFields {draw} {features} {applied} {editable} {m} {sections} />\n{/snippet}\n\n{#snippet actions()}\n <Row wrap>\n {#each operations as op (op)}\n <Button disabled={!editable} onclick={() => run(op)}>{m[LABELS[op]]}</Button>\n {/each}\n <Button disabled={readOnly || !oneLayer} onclick={() => draw.selection.group()}>\n {m.groupAction}\n </Button>\n <Button variant=\"danger\" disabled={readOnly} onclick={() => draw.selection.delete()}>\n {m.delete}\n </Button>\n </Row>\n{/snippet}\n\n<SelectionSummary\n count={features.length}\n kinds={kindCounts(features, m)}\n title={fillWord(m.selectedCount, { count: features.length })}\n {fields}\n {actions}\n {onclose}\n/>\n\n{#if operations.includes('buffer')}\n <BufferDialog bind:open={bufferOpen} {draw} {features} units={settings.units} {m} />\n{/if}\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { Button, Panel, Row, SelectionSummary, State } from '@sakuzu/kata/svelte';\n import type { Feature } from '@sakuzu/maplibre-gl-draw';\n import { applicableSections } from '../inspector/sections.js';\n import type {\n InspectorDraw,\n InspectorSectionSpec,\n InspectorSettings,\n InspectorTab,\n } from '../inspector/types.js';\n import { INSPECTOR_EVENTS, readView } from '../inspector/view.js';\n import { fillWord, type Messages } from '../messages.js';\n import { type Box, follow } from '../store.js';\n import FeatureInspector from './FeatureInspector.svelte';\n import GroupInspector from './GroupInspector.svelte';\n import LayerInspector from './LayerInspector.svelte';\n import SelectionInspector from './SelectionInspector.svelte';\n\n // Inspector: the panel of what is selected. It keeps nothing of the drawing: what it shows is\n // read from the draw instance (readView) again after each change of the selection, of the\n // document, of what this client hides and of read-only, so a change made anywhere shows at\n // once. Nothing selected shows an empty state; one feature its inspector, several features a\n // summary, a layer or a group theirs. Every change calls the public API of the draw instance.\n let {\n draw,\n messages,\n settings,\n sections,\n onclose,\n }: {\n draw: InspectorDraw;\n messages: Box<Messages>;\n settings: InspectorSettings;\n /** The sections the application added */\n sections: Box<InspectorSectionSpec[]>;\n /** Called by the close button; clears the selection when left out */\n onclose?: () => void;\n } = $props();\n\n const view = $derived(follow(draw, INSPECTOR_EVENTS, () => readView(draw)));\n const v = $derived(view.get());\n const m = $derived(messages.get());\n // The tab chosen last, kept from one feature to the next\n let tab = $state<InspectorTab>('style');\n\n const close = () => (onclose ? onclose() : draw.selection.clear());\n const applying = (features: Feature[]) => applicableSections(sections.get(), features);\n</script>\n\n<div class=\"inspector\" data-role=\"inspector\">\n {#if v.kind === 'feature'}\n <FeatureInspector\n {draw}\n view={v}\n {m}\n {settings}\n sections={applying([v.feature])}\n bind:tab\n onclose={close}\n />\n {:else if v.kind === 'features'}\n <SelectionInspector\n {draw}\n features={v.features}\n applied={v.applied}\n editable={v.editable}\n readOnly={v.readOnly}\n {m}\n {settings}\n sections={applying(v.features)}\n onclose={close}\n />\n {:else if v.kind === 'layer'}\n <LayerInspector\n {draw}\n layer={v.layer}\n onlyLayer={v.onlyLayer}\n readOnly={v.readOnly}\n {m}\n onclose={close}\n />\n {:else if v.kind === 'group'}\n <GroupInspector {draw} group={v.group} layer={v.layer} readOnly={v.readOnly} {m} onclose={close} />\n {:else if v.kind === 'items'}\n {@const label = v.type === 'layer' ? m.typeLayer : m.typeGroup}\n <SelectionSummary\n count={v.count}\n kinds={[{ label, count: v.count }]}\n title={fillWord(m.selectedCount, { count: v.count })}\n onclose={close}\n >\n {#snippet actions()}\n <Row wrap>\n <Button variant=\"danger\" disabled={v.readOnly} onclick={() => draw.selection.delete()}>\n {m.delete}\n </Button>\n </Row>\n {/snippet}\n </SelectionSummary>\n {:else}\n <Panel label={m.inspector}>\n <State text={m.nothingSelected} note={m.nothingSelectedNote} />\n </Panel>\n {/if}\n</div>\n\n<style>\n .inspector {\n display: flex;\n min-width: 0;\n min-height: 0;\n height: 100%;\n max-height: 100%;\n }\n</style>\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"pen-line\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M13 21h8\" }], [\"path\", { \"d\": \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\" }]], \"aliases\": [\"edit-3\"] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/pen-line\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"group\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M3 7V5c0-1.1.9-2 2-2h2\" }], [\"path\", { \"d\": \"M17 3h2c1.1 0 2 .9 2 2v2\" }], [\"path\", { \"d\": \"M21 17v2c0 1.1-.9 2-2 2h-2\" }], [\"path\", { \"d\": \"M7 21H5c-1.1 0-2-.9-2-2v-2\" }], [\"rect\", { \"width\": \"7\", \"height\": \"5\", \"x\": \"7\", \"y\": \"7\", \"rx\": \"1\" }], [\"rect\", { \"width\": \"7\", \"height\": \"5\", \"x\": \"10\", \"y\": \"12\", \"rx\": \"1\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/group\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","<!--\n@lucide/svelte v1.49.0 - ISC\n\nThis source code is licensed under the ISC license.\nSee the LICENSE file in the root directory of this source tree.\n-->\n\n\n<script lang=\"ts\">import Icon from '../Icon.svelte';\nlet props = $props();\nconst iconData = { \"name\": \"shapes\", \"size\": 24, \"node\": [[\"path\", { \"d\": \"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z\" }], [\"rect\", { \"x\": \"3\", \"y\": \"14\", \"width\": \"7\", \"height\": \"7\", \"rx\": \"1\" }], [\"circle\", { \"cx\": \"17.5\", \"cy\": \"17.5\", \"r\": \"3.5\" }]] };\n</script>\n\n<!--\n@component\n\nLucide SVG icon component, renders SVG Element with children.\n\n@preview  - https://lucide.dev/icons/shapes\n@see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n-->\n\n<Icon {...props} icon={iconData} />\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The nodes of the layer tree, built from the draw instance each time it changes.\n//\n// The tree reads like a stack: the front comes first. Core lists everything from the back (the\n// stacking order of the layers, the items of a layer, the features of a group), so every list is\n// reversed here, and a move in the tree is converted back (move.ts).\n//\n// A node is one of three kinds: a layer, a group or a feature. Its `data` is the entity of core as\n// it was read, so the handlers of the panel know what was pressed without reading it again.\n\nimport Circle from '@lucide/svelte/icons/circle';\nimport Group from '@lucide/svelte/icons/group';\nimport Layers from '@lucide/svelte/icons/layers';\nimport Shapes from '@lucide/svelte/icons/shapes';\nimport type { IconComponent, IconSource, TreeNode } from '@sakuzu/kata/svelte';\nimport {\n type Group as DrawGroup,\n type Feature,\n type FeatureStyleResolved,\n getStyleRuleChannel,\n type Layer,\n type Selection,\n type SelectionType,\n} from '@sakuzu/maplibre-gl-draw';\nimport type { Messages } from '../messages.js';\n\n/** The kinds of the nodes, which are the types of the selection of core */\nexport type NodeKind = SelectionType;\n\n/** A node of the tree, with the entity of core it was built from */\nexport type LayerTreeNode = TreeNode & { kind: NodeKind; data: Layer | DrawGroup | Feature };\n\n/** What building the nodes reads from the draw instance */\nexport interface TreeSource {\n readonly layers: {\n get(id: string): Layer | undefined;\n getOrder(): readonly string[];\n };\n readonly groups: { get(id: string): DrawGroup | undefined };\n readonly features: {\n get(id: string): Feature | undefined;\n getAppliedStyle(id: string): FeatureStyleResolved | undefined;\n };\n /** What this client hides; a node it hides shows as hidden */\n readonly hidden?: { has(id: string): boolean };\n}\n\n/** Whether a node shows as visible: visible in the document, and not hidden by this client */\nfunction shown(source: TreeSource, entity: { id: string; visible: boolean }): boolean {\n return entity.visible && !source.hidden?.has(entity.id);\n}\n\n/** What the tree shows */\nexport interface TreeOptions {\n /** Whether the features show under the layers and the groups */\n features: boolean;\n}\n\n/** The icons of the built-in feature types: kata's drawing glyphs where it has them */\nconst TYPE_ICONS: Readonly<Record<string, IconSource>> = Object.freeze({\n Point: 'point',\n MultiPoint: 'point',\n LineString: 'polyline',\n MultiLineString: 'polyline',\n Polygon: 'polygon',\n MultiPolygon: 'polygon',\n Circle: Circle as unknown as IconComponent,\n Freehand: 'pencil',\n Image: 'image',\n});\n\n/** The icon of a layer and of a group */\nexport const LAYER_ICON = Layers as unknown as IconComponent;\nexport const GROUP_ICON = Group as unknown as IconComponent;\n/** The icon of a feature of a custom type */\nconst CUSTOM_ICON = Shapes as unknown as IconComponent;\n\n/** The icon of a feature type */\nexport function typeIcon(type: string): IconSource {\n return TYPE_ICONS[type] ?? CUSTOM_ICON;\n}\n\n/** The words for each built-in feature type, from the set of the interface */\nexport function typeLabel(type: string, m: Messages): string {\n switch (type) {\n case 'Point':\n return m.point;\n case 'MultiPoint':\n return m.multiPoint;\n case 'LineString':\n return m.line;\n case 'MultiLineString':\n return m.multiLine;\n case 'Polygon':\n return m.polygon;\n case 'MultiPolygon':\n return m.multiPolygon;\n case 'Circle':\n return m.circle;\n case 'Freehand':\n return m.freehand;\n case 'Image':\n return m.image;\n default:\n // A custom type is named by the application\n return type;\n }\n}\n\n/**\n * The name of a feature: `properties.name` (the name the interface shows and edits, by the\n * convention of the interface; core has no name of its own for a feature), or the word of its\n * type when it has none\n */\nexport function featureName(feature: Feature, m: Messages): string {\n const name = feature.properties?.name;\n if (typeof name === 'string' && name.trim() !== '') return name;\n if (typeof name === 'number') return String(name);\n return typeLabel(feature.type, m);\n}\n\n/**\n * The color of the mark of a feature: the color it is drawn with, of the part a style rule colors\n * (the marker of a point, the line of a line, the fill of an area). An image has none\n */\nexport function featureColor(\n feature: Feature,\n style: FeatureStyleResolved | undefined,\n): string | undefined {\n if (!style || feature.type === 'Image') return undefined;\n const channel = getStyleRuleChannel(feature.type);\n if (channel === 'point') return style.pointColor;\n if (channel === 'stroke') return style.strokeColor;\n return style.fillColor;\n}\n\nfunction featureNode(source: TreeSource, feature: Feature, m: Messages): LayerTreeNode {\n return {\n id: feature.id,\n kind: 'feature',\n name: featureName(feature, m),\n icon: typeIcon(feature.type),\n iconColor: featureColor(feature, source.features.getAppliedStyle(feature.id)),\n visible: shown(source, feature),\n locked: feature.locked,\n data: feature,\n };\n}\n\n/**\n * The nodes of the tree: the layers from the front, each with its groups and features from the\n * front, and the features of each group from the front.\n *\n * An ID of the stacking order that is not a layer (a dataset placed among the layers) is left\n * out, and so is an item of a layer that is neither a group nor a feature. A feature shows once,\n * under its group when it is in one.\n */\nexport function buildNodes(\n source: TreeSource,\n m: Messages,\n options: TreeOptions = { features: true },\n): LayerTreeNode[] {\n const seen = new Set<string>();\n const nodes: LayerTreeNode[] = [];\n for (const layerId of [...source.layers.getOrder()].reverse()) {\n const layer = source.layers.get(layerId);\n if (!layer || seen.has(layer.id)) continue;\n seen.add(layer.id);\n const children: LayerTreeNode[] = [];\n for (const itemId of [...layer.items].reverse()) {\n if (seen.has(itemId)) continue;\n const group = source.groups.get(itemId);\n if (group) {\n seen.add(group.id);\n const node: LayerTreeNode = {\n id: group.id,\n kind: 'group',\n name: group.name,\n icon: GROUP_ICON,\n visible: shown(source, group),\n locked: group.locked,\n data: group,\n };\n if (options.features) {\n node.children = [];\n for (const featureId of [...group.featureIds].reverse()) {\n const feature = seen.has(featureId) ? undefined : source.features.get(featureId);\n if (!feature) continue;\n seen.add(feature.id);\n node.children.push(featureNode(source, feature, m));\n }\n }\n children.push(node);\n continue;\n }\n if (!options.features) continue;\n const feature = source.features.get(itemId);\n // A feature in a group shows under the group\n if (!feature || (feature.groupId !== undefined && source.groups.get(feature.groupId))) {\n continue;\n }\n seen.add(feature.id);\n children.push(featureNode(source, feature, m));\n }\n nodes.push({\n id: layer.id,\n kind: 'layer',\n name: layer.name,\n icon: LAYER_ICON,\n visible: shown(source, layer),\n locked: layer.locked,\n children,\n data: layer,\n });\n }\n return nodes;\n}\n\n/** Every node of the tree by its ID, with the ID of its parent */\nexport function indexNodes(\n nodes: readonly LayerTreeNode[],\n): Map<string, { node: LayerTreeNode; parentId: string | null }> {\n const index = new Map<string, { node: LayerTreeNode; parentId: string | null }>();\n const walk = (list: readonly TreeNode[], parentId: string | null) => {\n for (const node of list as LayerTreeNode[]) {\n index.set(node.id, { node, parentId });\n if (node.children) walk(node.children, node.id);\n }\n };\n walk(nodes, null);\n return index;\n}\n\n/** The rows the tree shows as selected: what draw has selected, of any of the three types */\nexport function selectedIds(selection: Selection): string[] {\n return selection.type ? [...selection.ids] : [];\n}\n\n/**\n * What a press in the tree selects in draw, which holds one type at a time: the IDs of the new\n * selection that are of the kind of the node pressed last. With no node pressed (a key, a range\n * without a pointer), the kind of the last ID.\n *\n * @returns The type and the IDs, or null to clear the selection\n */\nexport function selectionOf(\n ids: readonly string[],\n kindOf: (id: string) => NodeKind | undefined,\n pressed?: NodeKind,\n): { type: NodeKind; ids: string[] } | null {\n const known = ids.filter((id) => kindOf(id) !== undefined);\n if (known.length === 0) return null;\n const type = pressed ?? (kindOf(known[known.length - 1]) as NodeKind);\n const same = known.filter((id) => kindOf(id) === type);\n return same.length > 0 ? { type, ids: same } : null;\n}\n\n/**\n * Whether a node may be dropped into a parent (null for the root): a layer only at the root, a\n * group only into a layer, a feature into a layer or a group\n */\nexport function canDropInto(node: TreeNode, parent: TreeNode | null): boolean {\n if (node.kind === 'layer') return parent === null;\n if (node.kind === 'group') return parent?.kind === 'layer';\n if (node.kind === 'feature') return parent?.kind === 'layer' || parent?.kind === 'group';\n return false;\n}\n\n/**\n * Whether the selected features can make a new group: two or more, all in one layer\n */\nexport function canGroup(\n selection: Selection,\n getFeature: (id: string) => Feature | undefined,\n): boolean {\n if (selection.type !== 'feature' || selection.ids.length < 2) return false;\n let layerId: string | undefined;\n for (const id of selection.ids) {\n const feature = getFeature(id);\n if (!feature) return false;\n if (layerId === undefined) layerId = feature.layerId;\n else if (feature.layerId !== layerId) return false;\n }\n return true;\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// A drop in the layer tree, converted to a call of core.\n//\n// The tree reports the node, its new parent and its index among the parent's children after the\n// move, counted from the front (the top of the tree). Core counts from the back, and its lists\n// can hold IDs the tree does not show (a dataset in the stacking order; the features of a layer\n// when the tree shows only the groups). So the index is not mirrored by arithmetic: the node is\n// placed just in front of the node that is behind it in the tree (the one below it after the\n// move), at that node's position in core's list plus one, or at the back (0) when nothing in the\n// tree is behind it.\n//\n// - a layer: `layers.reorder` with the layers in their new order from the back. The entries of\n// the stacking order that are not layers are left out of it, and core keeps their positions\n// - a group: `groups.move` to `{ layerId, index }`\n// - a feature: `features.move` to `{ layerId, index }`, or to `{ groupId, index }` in a group\n\nimport type { TreeMove } from '@sakuzu/kata/svelte';\nimport type { Group, Layer, MoveTarget } from '@sakuzu/maplibre-gl-draw';\nimport { canDropInto, indexNodes, type LayerTreeNode } from './tree.js';\n\n/** The call of core a drop makes */\nexport type MovePlan =\n | { kind: 'layers'; order: string[] }\n | { kind: 'group'; id: string; to: MoveTarget }\n | { kind: 'feature'; id: string; to: MoveTarget };\n\n/** A list with an ID taken out and put back at an index */\nfunction placed(ids: readonly string[], id: string, index: number): string[] {\n const out = ids.filter((x) => x !== id);\n out.splice(Math.max(0, Math.min(index, out.length)), 0, id);\n return out;\n}\n\n/**\n * The position in a list of core, from the back, of an item that goes just in front of `behind`\n * (a node of the tree, or undefined when the item goes to the back)\n */\nexport function coreIndex(\n coreList: readonly string[],\n id: string,\n behind: string | undefined,\n): number {\n if (behind === undefined) return 0;\n const at = coreList.filter((x) => x !== id).indexOf(behind);\n return at === -1 ? 0 : at + 1;\n}\n\n/**\n * The call of core for a drop in the tree\n *\n * @param move - What the tree reported: the node, its new parent (null for the root) and its\n * index among the parent's children after the move, from the front\n * @param nodes - The nodes the tree showed when the node was dropped\n * @returns The call, or null when the drop is not one the tree allows\n */\nexport function planMove(move: TreeMove, nodes: readonly LayerTreeNode[]): MovePlan | null {\n const index = indexNodes(nodes);\n const at = index.get(move.id);\n if (!at) return null;\n const parent = move.parentId === null ? null : (index.get(move.parentId)?.node ?? null);\n if (move.parentId !== null && !parent) return null;\n if (!canDropInto(at.node, parent)) return null;\n\n if (at.node.kind === 'layer') {\n const front = placed(\n nodes.map((n) => n.id),\n move.id,\n move.index,\n );\n return { kind: 'layers', order: front.reverse() };\n }\n if (!parent) return null;\n\n // The children of the new parent from the front, after the move; the one after the node is\n // the one behind it\n const shown = placed(\n (parent.children ?? []).map((n) => n.id),\n move.id,\n move.index,\n );\n const behind = shown[shown.indexOf(move.id) + 1];\n if (parent.kind === 'layer') {\n const layer = parent.data as Layer;\n const to = { layerId: layer.id, index: coreIndex(layer.items, move.id, behind) };\n return at.node.kind === 'group'\n ? { kind: 'group', id: move.id, to }\n : { kind: 'feature', id: move.id, to };\n }\n const group = parent.data as Group;\n return {\n kind: 'feature',\n id: move.id,\n to: { groupId: group.id, index: coreIndex(group.featureIds, move.id, behind) },\n };\n}\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import PenLine from '@lucide/svelte/icons/pen-line';\n import {\n Icon,\n type IconComponent,\n LayerTree,\n Markbox,\n type MenuModel,\n Swatch,\n type TreeMove,\n type TreeNode,\n } from '@sakuzu/kata/svelte';\n import type { Feature } from '@sakuzu/maplibre-gl-draw';\n import type { Snippet } from 'svelte';\n import { planMove } from '../layers/move.js';\n import {\n buildNodes,\n canDropInto,\n canGroup,\n indexNodes,\n type NodeKind,\n selectedIds,\n selectionOf,\n } from '../layers/tree.js';\n import type { Messages } from '../messages.js';\n import { type Box, follow } from '../store.js';\n import type { LayerPanelDraw } from '../types.js';\n\n // LayerPanel: kata's LayerTree of the layers, their groups and their features, from the front.\n //\n // It keeps nothing of the drawing. The nodes are built from draw again on document.changed,\n // hidden.changed and options.changed, the selected rows are draw.selection.get(), read again on selection.changed,\n // and the active layer is draw.layers.getActive(). Every action calls the public API of draw:\n // the eye `update({ visible })` (and shows again what this client hid), the lock\n // `update({ locked })`, renaming the name (`properties.name` for a feature), a drop\n // `layers.reorder`, `groups.move` or `features.move`, a press `selection.set` (and\n // `layers.setActive` for a layer), the add menu `layers.create` and `selection.group`.\n let {\n draw,\n messages,\n features = true,\n add = true,\n reorder = true,\n }: {\n draw: LayerPanelDraw;\n messages: Box<Messages>;\n /** Whether the features show under the layers and the groups */\n features?: boolean;\n /** Whether the add menu shows */\n add?: boolean;\n /** Whether the rows can be dragged */\n reorder?: boolean;\n } = $props();\n\n const m = $derived(messages.get());\n const tree = $derived(\n // options.changed: the default look of each type gives the color of the marks\n follow(draw, ['document.changed', 'hidden.changed', 'options.changed'], () =>\n buildNodes(draw, messages.get(), { features }),\n ),\n );\n const selection = $derived(follow(draw, ['selection.changed'], () => draw.selection.get()));\n // Core has no event for a change of the active layer alone: it is read again on a change of the\n // document, and after the panel changes it\n const active = $derived(\n follow(draw, ['document.changed'], () => draw.layers.getActive()?.id ?? null),\n );\n\n const nodes = $derived(tree.get());\n const index = $derived(indexNodes(nodes));\n const selected = $derived(selectedIds(selection.get()));\n const activeId = $derived(active.get());\n\n // The groups that are closed; every other group is open, so a new layer opens\n let collapsed = $state<string[]>([]);\n const expanded = $derived(\n [...index.values()]\n .filter(({ node }) => node.children && !collapsed.includes(node.id))\n .map(({ node }) => node.id),\n );\n function setExpanded(ids: string[]) {\n const open = new Set(ids);\n collapsed = [...index.values()]\n .filter(({ node }) => node.children && !open.has(node.id))\n .map(({ node }) => node.id);\n }\n // What is selected elsewhere (on the map) shows: the groups around it open\n $effect(() => {\n const around = new Set<string>();\n for (const id of selected) {\n for (let p = index.get(id)?.parentId ?? null; p; p = index.get(p)?.parentId ?? null) {\n around.add(p);\n }\n }\n if (around.size === 0) return;\n const next = collapsed.filter((id) => !around.has(id));\n if (next.length !== collapsed.length) collapsed = next;\n });\n\n const addMenu = $derived<MenuModel[] | undefined>(\n add\n ? [\n { id: 'layer', label: m.newLayer },\n {\n id: 'group',\n label: m.newGroup,\n disabled: !canGroup(selection.get(), (id) => draw.features.get(id)),\n },\n ]\n : undefined,\n );\n\n const kindOf = (id: string) => index.get(id)?.node.kind as NodeKind | undefined;\n\n // The kind of the row pressed last, read before the tree reports the new selection\n let pressed: { id: string; kind: NodeKind } | undefined;\n function onclickcapture(e: MouseEvent) {\n const item = (e.target as Element | null)?.closest?.('[data-sortable-item]');\n const id = item?.getAttribute('data-id');\n const kind = id ? kindOf(id) : undefined;\n pressed = id && kind ? { id, kind } : undefined;\n }\n\n function onselect(ids: string[]) {\n const last = pressed;\n pressed = undefined;\n const next = selectionOf(ids, kindOf, last?.kind);\n if (!next) {\n draw.selection.clear();\n return;\n }\n draw.selection.set(next.type, next.ids);\n if (next.type === 'layer') {\n const layerId = last?.kind === 'layer' ? last.id : next.ids[next.ids.length - 1];\n draw.layers.setActive(layerId);\n active.refresh();\n }\n }\n\n function onvisible(id: string, visible: boolean) {\n const kind = kindOf(id);\n if (!kind) return;\n if (visible && draw.hidden.has(id)) draw.hidden.remove(id);\n const entity = index.get(id)?.node.data as { visible: boolean } | undefined;\n if (entity?.visible === visible) return;\n if (kind === 'layer') draw.layers.update(id, { visible });\n else if (kind === 'group') draw.groups.update(id, { visible });\n else draw.features.update(id, { visible });\n }\n\n function onlock(id: string, locked: boolean) {\n const kind = kindOf(id);\n if (kind === 'layer') draw.layers.update(id, { locked });\n else if (kind === 'group') draw.groups.update(id, { locked });\n else if (kind === 'feature') draw.features.update(id, { locked });\n }\n\n function onrename(id: string, value: string) {\n const kind = kindOf(id);\n const name = value.trim();\n if (kind === 'feature') {\n // An empty name removes it: the feature is named by its type again\n const feature = index.get(id)?.node.data as Feature;\n if ((feature.properties?.name ?? '') === name) return;\n draw.features.update(id, { properties: { name: name === '' ? undefined : name } });\n return;\n }\n if (name === '') return;\n if (kind === 'layer') draw.layers.update(id, { name });\n else if (kind === 'group') draw.groups.update(id, { name });\n }\n\n function onmove(move: TreeMove) {\n const plan = planMove(move, nodes);\n if (!plan) return;\n if (plan.kind === 'layers') draw.layers.reorder(plan.order);\n else if (plan.kind === 'group') draw.groups.move(plan.id, plan.to);\n else draw.features.move(plan.id, plan.to);\n }\n\n function onadd(id: string) {\n if (id === 'layer') {\n const layer = draw.layers.create({});\n if (layer) {\n draw.layers.setActive(layer.id);\n active.refresh();\n }\n } else if (id === 'group') {\n draw.selection.group();\n }\n }\n\n const ACTIVE_ICON = PenLine as unknown as IconComponent;\n</script>\n\n{#snippet row(node: TreeNode, name: Snippet<[TreeNode]>)}\n {#if node.icon}\n <Markbox>\n {#if node.iconColor}\n <Swatch shape=\"icon\" icon={node.icon} color={node.iconColor} />\n {:else}\n <Icon name={node.icon} />\n {/if}\n </Markbox>\n {/if}\n {@render name(node)}\n {#if node.kind === 'layer' && node.id === activeId}\n <span class=\"active\" role=\"img\" aria-label={m.activeLayer} title={m.activeLayer}>\n <Icon name={ACTIVE_ICON} tone=\"blue\" />\n </span>\n {/if}\n{/snippet}\n\n<div class=\"layer-panel\" data-role=\"layer-panel\" onclickcapture={onclickcapture}>\n <LayerTree\n label={m.layers}\n {nodes}\n head={add}\n bind:expanded={() => expanded, setExpanded}\n bind:selected={() => selected, () => {}}\n {onselect}\n {onvisible}\n {onlock}\n {onrename}\n onmove={reorder ? onmove : undefined}\n canDrop={canDropInto}\n {addMenu}\n {onadd}\n addLabel={m.add}\n {row}\n />\n</div>\n\n<style>\n .layer-panel {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n .active {\n display: inline-flex;\n flex: none;\n }\n</style>\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The rows of the legend: for each layer with a style rule, from the front, the rows core derives\n// from the rule (`deriveLegend`), with the words of the interface for the labels that are not\n// values of the data.\n//\n// A layer without a rule has no rows: the colors of its features come from the default look of\n// each type and from the style of each feature, which a legend of the layer cannot sum up.\n\nimport {\n type Messages as CoreMessages,\n deriveLegend,\n type Feature,\n getStyleRuleChannel,\n type Layer,\n type LegendEntry,\n} from '@sakuzu/maplibre-gl-draw';\nimport type { Messages } from '../messages.js';\n\n/** The shape of the swatches of a layer, after the kind of what its features draw */\nexport type LegendShape = 'box' | 'dot' | 'line' | 'area';\n\n/** The legend of one layer */\nexport interface LegendBlock {\n /** The ID of the layer */\n layerId: string;\n /** The name of the layer */\n name: string;\n /** The rows, in the order to show them */\n entries: LegendEntry[];\n /** The shape of the swatches */\n shape: LegendShape;\n}\n\n/** What the legend reads from the draw instance */\nexport interface LegendSource {\n readonly layers: {\n get(id: string): Layer | undefined;\n getOrder(): readonly string[];\n };\n readonly features: { list(filter?: { layerId?: string }): Feature[] };\n}\n\n/** Fills the placeholders `{name}` of a sentence */\nfunction fill(text: string, values: Record<string, string>): string {\n return text.replace(/\\{(\\w+)\\}/g, (all, key: string) => values[key] ?? all);\n}\n\n/** The words of the labels of a legend, for `deriveLegend` */\nexport function legendMessages(m: Messages): Partial<CoreMessages> {\n return {\n legendAll: m.legendAll,\n legendOther: m.legendOther,\n legendBelow: (upper) => fill(m.legendBelow, { upper }),\n legendAtLeast: (lower) => fill(m.legendAtLeast, { lower }),\n legendRange: (lower, upper) => fill(m.legendRange, { lower, upper }),\n };\n}\n\n/**\n * The shape of the swatches for the features of a layer: a dot for points, a line for lines, an\n * area for areas, and a box when they are mixed or there are none\n */\nexport function legendShape(features: readonly Feature[]): LegendShape {\n let channel: string | undefined;\n for (const feature of features) {\n if (feature.type === 'Image') continue;\n const next = getStyleRuleChannel(feature.type);\n if (channel === undefined) channel = next;\n else if (channel !== next) return 'box';\n }\n if (channel === 'point') return 'dot';\n if (channel === 'stroke') return 'line';\n if (channel === 'fill') return 'area';\n return 'box';\n}\n\n/** The legend of every layer with a style rule, from the front */\nexport function legendBlocks(source: LegendSource, m: Messages): LegendBlock[] {\n const words = legendMessages(m);\n const blocks: LegendBlock[] = [];\n for (const id of [...source.layers.getOrder()].reverse()) {\n const layer = source.layers.get(id);\n if (!layer?.styleRule) continue;\n blocks.push({\n layerId: layer.id,\n name: layer.name,\n entries: deriveLegend(layer.styleRule, words),\n shape: legendShape(source.features.list({ layerId: layer.id })),\n });\n }\n return blocks;\n}\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { List, ListItem, SectionHeader, Stack, State, Swatch, Text } from '@sakuzu/kata/svelte';\n import { legendBlocks } from '../layers/legend.js';\n import type { Messages } from '../messages.js';\n import { type Box, follow } from '../store.js';\n import type { LegendDraw } from '../types.js';\n\n // Legend: for each layer with a style rule, from the front, its name and the rows core derives\n // from the rule (deriveLegend), each a Swatch and a label. It only reads: the rules are changed\n // with draw.layers.update. It is built again on document.changed.\n let {\n draw,\n messages,\n }: {\n draw: LegendDraw;\n messages: Box<Messages>;\n } = $props();\n\n const m = $derived(messages.get());\n const legend = $derived(\n follow(draw, ['document.changed'], () => legendBlocks(draw, messages.get())),\n );\n const blocks = $derived(legend.get());\n</script>\n\n<div class=\"legend\" data-role=\"legend\">\n {#if blocks.length === 0}\n <State text={m.noLegend} />\n {:else}\n <Stack gap={0}>\n {#each blocks as block (block.layerId)}\n <SectionHeader label={block.name} flush>\n <List label={block.name}>\n {#each block.entries as entry, i (i)}\n <ListItem columns=\"auto minmax(0, 1fr)\" plain>\n <Swatch shape={block.shape} color={entry.color} />\n <Text clamp>{entry.label}</Text>\n </ListItem>\n {/each}\n </List>\n </SectionHeader>\n {/each}\n </Stack>\n {/if}\n</div>\n\n<style>\n .legend {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n</style>\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import { Button, Icon, Panel, Tabs, Toolbar } from '@sakuzu/kata/svelte';\n import type { Messages } from '../messages.js';\n import type { Box } from '../store.js';\n import type { LayerPanelDraw, LeftSettings, LegendDraw } from '../types.js';\n import LayerPanel from './LayerPanel.svelte';\n import Legend from './Legend.svelte';\n\n // LeftPanel: the left region of the interface, a Panel with the layer panel and the legend in\n // two tabs (Tabs in the Toolbar of its head). With one of them only, the head is its title.\n let {\n draw,\n messages,\n settings,\n onclose,\n }: {\n draw: LayerPanelDraw & LegendDraw;\n messages: Box<Messages>;\n settings: LeftSettings;\n /** Shows a close button at the end of the head; called when it is pressed */\n onclose?: () => void;\n } = $props();\n\n const m = $derived(messages.get());\n const tabs = $derived([\n ...(settings.layers ? [{ id: 'layers', label: m.layers }] : []),\n ...(settings.legend ? [{ id: 'legend', label: m.legend }] : []),\n ]);\n // The tab shown; the first one when the one chosen is gone\n let chosen = $state('layers');\n const current = $derived(tabs.some((t) => t.id === chosen) ? chosen : (tabs[0]?.id ?? ''));\n const both = $derived(`${m.layers}, ${m.legend}`);\n // The head: the tabs, or the title of the one view. The layer tree has a head of its own (its\n // title and the add menu), which then stands for the title\n // title. A close button needs the head whatever the view\n const titled = $derived(\n !!onclose || tabs.length > 1 || current !== 'layers' || !settings.layers?.add,\n );\n</script>\n\n{#snippet close()}\n {#if onclose}\n <Button variant=\"ghost\" icon aria-label={m.close} onclick={onclose}>\n <Icon name=\"x\" />\n </Button>\n {/if}\n{/snippet}\n\n{#snippet head()}\n {#if tabs.length > 1}\n <Toolbar rule tail={!!onclose} end={onclose ? close : undefined}>\n <Tabs {tabs} {current} label={both} onselect={(id) => (chosen = id)} />\n </Toolbar>\n {:else}\n <Toolbar title={tabs[0]?.label} rule tail={!!onclose} end={onclose ? close : undefined} />\n {/if}\n{/snippet}\n\n<Panel label={tabs.length === 1 ? tabs[0].label : both} head={titled ? head : undefined}>\n {#if current === 'layers' && settings.layers}\n <LayerPanel {draw} {messages} {...settings.layers} />\n {:else if current === 'legend'}\n <Legend {draw} {messages} />\n {/if}\n</Panel>\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import {\n Drawbar,\n type DrawbarToggle,\n type DrawbarTool,\n formatShortcut,\n } from '@sakuzu/kata/svelte';\n import type { Messages } from '../messages.js';\n import { type Box, follow } from '../store.js';\n import { BUILTIN_ICONS, DELETE_ID, drawbarTools, SNAPPING_ID, toSpec } from '../tools.js';\n import type { ToolbarDraw, ToolEntry } from '../types.js';\n\n // Toolbar: kata's Drawbar with the tools, the delete button and the snapping switch.\n //\n // It keeps nothing of the drawing: the current tool is the one whose mode is draw.getMode(),\n // read again on mode.changed; the delete button is off while draw.selection.get() is empty,\n // read again on selection.changed; the switch shows draw.options.get(). Pressing a tool calls\n // draw.setMode, delete calls draw.selection.delete and the switch draw.options.update.\n let {\n draw,\n tools,\n messages,\n deletable = true,\n snapping = true,\n keys = false,\n }: {\n draw: ToolbarDraw;\n /** The tools, in order */\n tools: Box<ToolEntry[]>;\n messages: Box<Messages>;\n /** Whether the delete button shows */\n deletable?: boolean;\n /** Whether the snapping switch shows */\n snapping?: boolean;\n /** Whether the tooltips show the keys (when the keyboard shortcuts are on) */\n keys?: boolean;\n } = $props();\n\n const mode = $derived(follow(draw, ['mode.changed'], () => draw.getMode()));\n const selected = $derived(\n follow(draw, ['selection.changed'], () => draw.selection.get().ids.length),\n );\n // Core has no event for a change of the options: the switch reads them again after its own\n // change\n const snapOn = $derived(follow(draw, [], () => draw.options.get().snapping?.enabled !== false));\n\n const m = $derived(messages.get());\n const specs = $derived(tools.get().map((entry) => toSpec(entry, m)));\n const current = $derived.by(() => {\n const now = mode.get();\n return specs.find((spec) => spec.mode === now)?.id;\n });\n const barTools = $derived<DrawbarTool[]>([\n ...drawbarTools(specs, keys),\n ...(deletable\n ? [\n {\n id: DELETE_ID,\n label: m.delete,\n icon: BUILTIN_ICONS[DELETE_ID],\n kbd: keys ? formatShortcut('delete') : undefined,\n group: DELETE_ID,\n tone: 'danger' as const,\n disabled: selected.get() === 0,\n },\n ]\n : []),\n ]);\n const toggles = $derived<DrawbarToggle[]>(\n snapping\n ? [\n {\n id: SNAPPING_ID,\n label: m.snapping,\n icon: BUILTIN_ICONS[SNAPPING_ID],\n on: snapOn.get(),\n onchange: (on: boolean) => {\n draw.options.update({ snapping: { enabled: on } });\n snapOn.refresh();\n },\n },\n ]\n : [],\n );\n\n function onselect(id: string) {\n if (deletable && id === DELETE_ID) {\n draw.selection.delete();\n return;\n }\n const spec = specs.find((s) => s.id === id);\n if (spec) draw.setMode(spec.mode);\n }\n</script>\n\n<Drawbar label={m.toolbar} tools={barTools} {toggles} {current} {onselect} />\n","<!--\n SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n SPDX-License-Identifier: AGPL-3.0-only\n-->\n<script lang=\"ts\">\n import Layers from '@lucide/svelte/icons/layers';\n import Moon from '@lucide/svelte/icons/moon';\n import Sun from '@lucide/svelte/icons/sun';\n import {\n Button,\n Floating,\n formatShortcut,\n Icon,\n type IconComponent,\n Shell,\n type ShellLayout,\n type Shortcut,\n } from '@sakuzu/kata/svelte';\n import { tick } from 'svelte';\n import type {\n InspectorDraw,\n InspectorSectionSpec,\n InspectorSettings,\n } from '../inspector/types.js';\n import type { Messages } from '../messages.js';\n import type { Beside } from '../padding.js';\n import { fromMapCanvas, toolbarShortcuts } from '../shortcuts.js';\n import { type Box, follow } from '../store.js';\n import { toSpec } from '../tools.js';\n import type {\n DrawUIDraw,\n LayerPanelDraw,\n LeftSettings,\n LegendDraw,\n ToolbarSettings,\n ToolEntry,\n } from '../types.js';\n import Inspector from './Inspector.svelte';\n import LeftPanel from './LeftPanel.svelte';\n import Toolbar from './Toolbar.svelte';\n\n // DrawUI: kata's Shell laid over the map (overlay). The stage is left empty, so the map shows\n // through and keeps its own pointer and keys; the regions of the shell take the pointer where\n // they are. The keyboard shortcuts are those of the toolbar's buttons. onbeside reports which\n // side regions stand beside the stage, open, once the shell has drawn them, so that the map's\n // padding can follow them. While the left region is closed, a small button floats at the top\n // left of the map to open it again. At the top right, a button switches the theme to the look\n // that is not shown now (light reads the look the root shows, which the theme control keeps).\n let {\n draw,\n tools,\n messages,\n toolbar,\n left,\n shortcuts = true,\n inspector,\n sections,\n onbeside,\n side: sideMode = 'floating',\n light,\n themeToggle = true,\n ontheme,\n }: {\n draw: DrawUIDraw & LayerPanelDraw & LegendDraw & InspectorDraw;\n tools: Box<ToolEntry[]>;\n messages: Box<Messages>;\n toolbar: Box<ToolbarSettings | null>;\n /** The left region: the layer panel and the legend */\n left: Box<LeftSettings | null>;\n /** Whether the keyboard shortcuts are on */\n shortcuts?: boolean;\n /** The inspector on the right, or null when there is none */\n inspector: Box<InspectorSettings | null>;\n /** The sections the application added to the inspector */\n sections: Box<InspectorSectionSpec[]>;\n /** Called with the side regions beside the stage after the layout or the open panes change */\n onbeside?: (beside: Beside) => void;\n /** Where the side regions go on a wide map: floating over it or beside it */\n side?: 'floating' | 'beside';\n /** Whether the root shows the light look now */\n light: Box<boolean>;\n /** Whether the button that switches the theme shows */\n themeToggle?: boolean;\n /** Called with the theme the button switches to */\n ontheme?: (theme: 'light' | 'dark') => void;\n } = $props();\n\n // The inspector is open while something is selected; closing it clears the selection\n const inspectorSettings = $derived(inspector.get());\n const selected = $derived(\n follow(draw, ['selection.changed'], () => draw.selection.get().ids.length > 0),\n );\n\n function closeInspector(open: boolean) {\n if (!open) draw.selection.clear();\n }\n\n const m = $derived(messages.get());\n const bar = $derived(toolbar.get());\n const keys = $derived<Shortcut[]>(\n shortcuts && bar\n ? toolbarShortcuts(\n draw,\n tools.get().map((entry) => toSpec(entry, m)),\n m,\n bar.deletable,\n )\n : [],\n );\n const side = $derived(left.get());\n // The left region is open at first; the shell closes it (Escape, the scrim, the sheet's close\n // button) and Shift+L opens and closes it\n let leftOpen = $state(true);\n const LAYERS_ICON = Layers as unknown as IconComponent;\n const leftKeys = $derived<Shortcut[]>(\n shortcuts && side\n ? [\n {\n key: 'shift+l',\n label: m.toggleLayers,\n group: m.panelsGroup,\n run: () => {\n leftOpen = !leftOpen;\n },\n },\n ]\n : [],\n );\n\n // Where the shell puts the side regions (beside the stage, floating or sheets), by its width\n let layout = $state<ShellLayout | null>(null);\n $effect(() => {\n const now: Beside = {\n left: !!side && leftOpen && layout?.leftMode === 'beside',\n right: !!inspectorSettings && selected.get() && layout?.rightMode === 'beside',\n };\n // Also when the toolbar comes or goes\n void bar;\n if (!onbeside) return;\n const report = onbeside;\n // After the shell has drawn the regions\n tick().then(() => report(now));\n });\n\n // The theme button: the look it switches to, and its place. While the inspector is open\n // floating or beside the map, it sits to the left of the inspector's pane, gap-md from it (the\n // pane is gap-md from the right and a panel wide, or a panel wide at the right edge); a sheet\n // comes from the bottom and leaves it at the corner\n const SUN_ICON = Sun as unknown as IconComponent;\n const MOON_ICON = Moon as unknown as IconComponent;\n const isLight = $derived(light.get());\n const besideInspector = $derived(\n !!inspectorSettings && selected.get() && !!layout && layout.rightMode !== 'sheet',\n );\n\n // Escape on the canvas is core's (it cancels the drawing or clears the selection). Elsewhere,\n // with no pane to close, it clears the selection\n function onescape(e: KeyboardEvent) {\n if (fromMapCanvas(draw, e) || draw.selection.get().ids.length === 0) return false;\n draw.selection.clear();\n }\n</script>\n\n{#snippet bottom()}\n {#if bar}\n <Toolbar\n {draw}\n {tools}\n {messages}\n deletable={bar.deletable}\n snapping={bar.snapping}\n keys={shortcuts}\n />\n {/if}\n{/snippet}\n\n{#snippet leftRegion()}\n {#if side}\n <LeftPanel\n {draw}\n {messages}\n settings={side}\n onclose={() => {\n leftOpen = false;\n }}\n />\n {/if}\n{/snippet}\n\n{#snippet right()}\n {#if inspectorSettings}\n <Inspector {draw} {messages} settings={inspectorSettings} {sections} />\n {/if}\n{/snippet}\n\n<Shell\n overlay\n side={sideMode}\n bind:leftOpen\n bind:rightOpen={() => selected.get(), closeInspector}\n leftLabel={m.layers}\n rightLabel={m.inspector}\n shortcuts={[...keys, ...leftKeys]}\n {onescape}\n onlayout={(next) => {\n layout = next;\n }}\n left={side ? leftRegion : undefined}\n right={inspectorSettings ? right : undefined}\n bottom={bar ? bottom : undefined}\n/>\n\n{#if side && !leftOpen}\n <!-- Outside the shell's regions: the root gives it the pointer (data-role=\"reopen\") -->\n <div data-role=\"reopen\">\n <Floating left=\"md\" top=\"md\">\n <Button\n variant=\"ghost\"\n icon\n aria-label={m.layers}\n shortcut={shortcuts ? formatShortcut('shift+l') : undefined}\n onclick={() => {\n leftOpen = true;\n }}\n >\n <Icon name={LAYERS_ICON} />\n </Button>\n </Floating>\n </div>\n{/if}\n\n{#if themeToggle}\n <!-- Outside the shell's regions: the root gives it the pointer (data-role=\"theme\") -->\n <div data-role=\"theme\">\n <Floating\n right={besideInspector ? 'calc(var(--kata-width-panel) + var(--kata-gap-md) * 2)' : 'md'}\n top=\"md\"\n >\n <Button\n variant=\"ghost\"\n icon\n aria-label={isLight ? m.toDark : m.toLight}\n onclick={() => ontheme?.(isLight ? 'dark' : 'light')}\n >\n <Icon name={isLight ? MOON_ICON : SUN_ICON} />\n </Button>\n </Floating>\n </div>\n{/if}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// maplibre-gl's own controls on the map, and the bottom corners of the map kept clear of the\n// toolbar.\n//\n// - mapControls() adds the controls as maplibre-gl draws them: at the bottom right, from the top,\n// the globe, the compass (with the pitch) and the zoom; at the bottom left, the scale. Their look\n// is maplibre-gl's style sheet, which the page imports\n// - cornerLift() lifts a bottom corner of the map (its controls and the attribution) above the\n// toolbar while the toolbar reaches it, as it does on a narrow map. The toolbar floats over the\n// map at the bottom centre, above the corners\n\nimport {\n type ControlPosition,\n GlobeControl,\n type IControl,\n NavigationControl,\n ScaleControl,\n} from 'maplibre-gl';\nimport type { MapControlsOptions } from './types.js';\n\n/** The members of the map the controls use */\nexport interface ControlsMap {\n addControl(control: IControl, position?: ControlPosition): unknown;\n removeControl(control: IControl): unknown;\n}\n\n/** The controls added to a map, to remove */\nexport interface MapControls {\n /** Removes the controls from the map. A second call does nothing */\n destroy(): void;\n}\n\n/**\n * Adds maplibre-gl's controls to a map: all four with `true` or `undefined`, none with `false`,\n * those not set to false with an object.\n *\n * maplibre-gl puts a control added to a bottom corner above those already there, so the controls\n * of the bottom right are added from the bottom: the zoom, the compass, then the globe.\n */\nexport function mapControls(\n map: ControlsMap,\n option: boolean | MapControlsOptions | undefined,\n): MapControls {\n const want: MapControlsOptions | null =\n option === false ? null : option === true || option === undefined ? {} : option;\n const added: IControl[] = [];\n const add = (control: IControl, position: ControlPosition) => {\n map.addControl(control, position);\n added.push(control);\n };\n if (want) {\n if (want.zoom !== false) {\n add(new NavigationControl({ showZoom: true, showCompass: false }), 'bottom-right');\n }\n if (want.compass !== false) {\n add(\n new NavigationControl({ showZoom: false, showCompass: true, visualizePitch: true }),\n 'bottom-right',\n );\n }\n if (want.globe !== false) add(new GlobeControl(), 'bottom-right');\n if (want.scale !== false) add(new ScaleControl(), 'bottom-left');\n }\n let destroyed = false;\n return {\n destroy() {\n if (destroyed) return;\n destroyed = true;\n for (const control of added) {\n try {\n map.removeControl(control);\n } catch {\n // The map is gone\n }\n }\n added.length = 0;\n },\n };\n}\n\n/** The attribute on the map's container while the interface lifts its bottom corners */\nexport const LIFT_ATTRIBUTE = 'data-mgd-ui-lift';\n\n/** The bottom corners of the map, lifted above the toolbar while it reaches them */\nexport interface CornerLift {\n /** Measures again after the toolbar came, went or changed */\n update(): void;\n /** Stops following and puts the corners back */\n destroy(): void;\n}\n\n/**\n * Lifts the bottom corners of maplibre-gl's controls in `container` (the map's container) above\n * the toolbar of the interface in `root`, each while the toolbar reaches it across: by the\n * distance from the top of the toolbar to the bottom of the map. root.css moves the corners by\n * the custom properties this sets on the container (--mgd-ui-lift-left and --mgd-ui-lift-right).\n */\nexport function cornerLift(container: HTMLElement, root: HTMLElement): CornerLift {\n let destroyed = false;\n let observer: ResizeObserver | undefined;\n let observed: Element[] = [];\n let last = '';\n container.setAttribute(LIFT_ATTRIBUTE, '');\n\n const corner = (side: 'left' | 'right') =>\n container.querySelector<HTMLElement>(\n `:scope > .maplibregl-control-container > .maplibregl-ctrl-bottom-${side}`,\n );\n const bar = () => root.querySelector<HTMLElement>('[data-region=\"bottom\"] [data-role=\"drawbar\"]');\n\n function set(left: number, right: number) {\n const key = `${left} ${right}`;\n if (key === last) return;\n last = key;\n container.style.setProperty('--mgd-ui-lift-left', `${left}px`);\n container.style.setProperty('--mgd-ui-lift-right', `${right}px`);\n }\n\n function apply() {\n if (destroyed) return;\n const toolbar = bar();\n if (!toolbar || !container.isConnected) {\n set(0, 0);\n return;\n }\n const box = container.getBoundingClientRect();\n const b = toolbar.getBoundingClientRect();\n if (b.width === 0 || b.height === 0) {\n set(0, 0);\n return;\n }\n const band = Math.round(Math.max(0, Math.min(box.bottom - b.top, box.height)));\n // A transform moves a corner up and down only, so across it stays where it is measured\n const reaches = (side: 'left' | 'right') => {\n const el = corner(side);\n if (!el) return false;\n const r = el.getBoundingClientRect();\n if (r.width === 0) return false;\n return side === 'left' ? r.right > b.left : r.left < b.right;\n };\n set(reaches('left') ? band : 0, reaches('right') ? band : 0);\n }\n\n function follow() {\n const next = [container, bar(), corner('left'), corner('right')].filter(\n (el): el is HTMLElement => !!el,\n );\n if (next.length === observed.length && next.every((el, i) => el === observed[i])) return;\n observer?.disconnect();\n observed = next;\n if (typeof ResizeObserver === 'undefined') return;\n observer ??= new ResizeObserver(apply);\n for (const el of observed) observer.observe(el);\n }\n\n return {\n update() {\n if (destroyed) return;\n follow();\n apply();\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n observer?.disconnect();\n observer = undefined;\n observed = [];\n container.removeAttribute(LIFT_ATTRIBUTE);\n container.style.removeProperty('--mgd-ui-lift-left');\n container.style.removeProperty('--mgd-ui-lift-right');\n },\n };\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The padding of the map under the interface. The side regions that stand beside the stage cover\n// the edges of the map, and the toolbar its bottom, so the map is told to keep its view (fitBounds,\n// easeTo, the centre) clear of them. A floating pane or a sheet lies over the map only for a\n// moment and leaves the padding at 0.\n\n/** The padding of a map in px, as maplibre-gl has it */\nexport interface PaddingOptions {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n}\n\n/** The members of the map the padding uses */\nexport interface PaddingMap {\n getContainer(): HTMLElement;\n getPadding(): PaddingOptions;\n setPadding(padding: PaddingOptions): unknown;\n}\n\n/** Which side regions stand beside the stage now, open */\nexport interface Beside {\n left: boolean;\n right: boolean;\n}\n\n/** The padding of a map, kept to the regions of the interface */\nexport interface MapPadding {\n /** Measures the regions again after the layout changed, and follows their sizes */\n update(beside: Beside): void;\n /** Stops following and gives the map back the padding it had before */\n destroy(): void;\n}\n\nconst ZERO: Beside = { left: false, right: false };\n\n/**\n * Keeps the padding of a map to the regions of the interface in `root`: the width of a side region\n * beside the stage on its side, and the height of the toolbar with its gap at the bottom.\n *\n * Every call to the map is guarded: once the map is removed, or its container leaves the page,\n * nothing is done.\n */\nexport function mapPadding(map: PaddingMap, root: HTMLElement): MapPadding {\n let before: PaddingOptions | null = null;\n try {\n before = { ...map.getPadding() };\n } catch {\n before = null;\n }\n let beside: Beside = ZERO;\n let last = '';\n let destroyed = false;\n let observer: ResizeObserver | undefined;\n let observed: Element[] = [];\n\n /** The element of a region of the shell, or null */\n const region = (name: string) =>\n root.querySelector<HTMLElement>(`[data-role=\"shell\"] [data-region=\"${name}\"]`);\n\n function sources() {\n return {\n left: beside.left ? region('left') : null,\n right: beside.right ? region('right') : null,\n bottom: region('bottom'),\n bar: root.querySelector<HTMLElement>('[data-region=\"bottom\"] [data-role=\"drawbar\"]'),\n };\n }\n\n function apply() {\n if (destroyed) return;\n try {\n const container = map.getContainer();\n if (!container.isConnected) return;\n const box = container.getBoundingClientRect();\n const { left, right, bottom, bar } = sources();\n const clamp = (v: number, max: number) => Math.round(Math.max(0, Math.min(v, max)));\n const next = {\n top: 0,\n left: left ? clamp(left.getBoundingClientRect().right - box.left, box.width) : 0,\n right: right ? clamp(box.right - right.getBoundingClientRect().left, box.width) : 0,\n // The toolbar's height and its gap: from the top of the bar to the bottom edge of the\n // toolbar's place (which rises over the sheets, so a sheet does not count)\n bottom:\n bottom && bar\n ? clamp(\n bottom.getBoundingClientRect().bottom - bar.getBoundingClientRect().top,\n box.height,\n )\n : 0,\n };\n const key = `${next.left} ${next.right} ${next.bottom}`;\n if (key === last) return;\n last = key;\n map.setPadding(next);\n } catch {\n // The map is gone\n }\n }\n\n function follow() {\n const { left, right, bar } = sources();\n let container: HTMLElement | undefined;\n try {\n container = map.getContainer();\n } catch {\n container = undefined;\n }\n const next = [left, right, bar, container].filter((el): el is HTMLElement => !!el);\n if (next.length === observed.length && next.every((el, i) => el === observed[i])) return;\n observer?.disconnect();\n observed = next;\n if (typeof ResizeObserver === 'undefined') return;\n observer ??= new ResizeObserver(apply);\n for (const el of observed) observer.observe(el);\n }\n\n return {\n update(now: Beside) {\n if (destroyed) return;\n beside = { ...now };\n follow();\n apply();\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n observer?.disconnect();\n observer = undefined;\n observed = [];\n if (!before || last === '') return;\n try {\n if (!map.getContainer().isConnected) return;\n map.setPadding(before);\n } catch {\n // The map is gone\n }\n },\n };\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n// The theme of the root element of the interface. kata's tokens are dark; data-color-mode=\"light\"\n// on the root element switches every one of them to kata's light theme (the build moves kata's\n// light block onto the root element), and the root's color-scheme with them.\n//\n// - light: data-color-mode=\"light\" on the root element\n// - dark: no attribute, kata's own theme\n// - auto: light while the system prefers light (prefers-color-scheme), and it follows a change\n// at once\n//\n// A page that sets data-color-mode=\"light\" on an element around the root turns it light too,\n// whatever the theme of the interface.\n\n/** The theme of the interface: `light`, `dark`, or `auto` to follow the system */\nexport type Theme = 'light' | 'dark' | 'auto';\n\n/** The query of the system's preference that `auto` follows */\nexport const LIGHT_QUERY = '(prefers-color-scheme: light)';\n\nconst THEMES: readonly Theme[] = ['light', 'dark', 'auto'];\n\n/** The theme of the options, `auto` when left out */\nexport function checkTheme(theme: Theme | undefined): Theme {\n if (theme === undefined) return 'auto';\n if (!THEMES.includes(theme)) throw new Error(`There is no theme \"${String(theme)}\"`);\n return theme;\n}\n\n/** The light or dark of a root element */\nfunction setLight(root: HTMLElement, light: boolean): void {\n if (light) root.setAttribute('data-color-mode', 'light');\n else root.removeAttribute('data-color-mode');\n}\n\n/** The theme of a root element, to change and to stop following the system */\nexport interface ThemeControl {\n /** Changes the theme */\n set(theme: Theme): void;\n /** Stops following the system. A second call does nothing */\n destroy(): void;\n}\n\n/**\n * Keeps the theme of a root element. With `auto`, it follows the system's preference while it\n * lasts; without `window.matchMedia`, `auto` is dark.\n *\n * `onlook` is called with the look applied (true for light) each time it is applied: at once,\n * on each change of the theme and, with `auto`, on each change of the system's preference.\n *\n * @throws Error when the theme is not `light`, `dark` or `auto`\n */\nexport function themeControl(\n root: HTMLElement,\n theme: Theme | undefined,\n onlook?: (light: boolean) => void,\n): ThemeControl {\n let query: MediaQueryList | null = null;\n const look = (light: boolean) => {\n setLight(root, light);\n onlook?.(light);\n };\n const onchange = (e: MediaQueryListEvent) => look(e.matches);\n const stop = () => {\n query?.removeEventListener('change', onchange);\n query = null;\n };\n const apply = (next: Theme) => {\n stop();\n if (next !== 'auto') {\n look(next === 'light');\n return;\n }\n const media = typeof window !== 'undefined' ? window.matchMedia : undefined;\n query = typeof media === 'function' ? media.call(window, LIGHT_QUERY) : null;\n query?.addEventListener('change', onchange);\n look(query?.matches ?? false);\n };\n apply(checkTheme(theme));\n let destroyed = false;\n return {\n set(next) {\n if (destroyed) return;\n apply(checkTheme(next));\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n stop();\n },\n };\n}\n","// SPDX-FileCopyrightText: 2026 SAKAIDA Atsushi\n// SPDX-License-Identifier: AGPL-3.0-only\n\n/**\n * The standard user interface of `@sakuzu/maplibre-gl-draw`: a toolbar of the drawing tools at\n * the bottom of the map, with keyboard shortcuts.\n *\n * The interface keeps nothing of the drawing. It reads the draw instance and follows its events\n * (the current tool is `draw.getMode()`, the selection `draw.selection.get()`), and every button\n * calls the public API of the draw instance, so an application can mix it with controls of its\n * own and they never disagree.\n *\n * ```ts\n * import { createDraw } from '@sakuzu/maplibre-gl-draw';\n * import { createDrawUI } from '@sakuzu/maplibre-gl-draw-ui';\n * import '@sakuzu/maplibre-gl-draw-ui/style.css';\n *\n * const draw = createDraw(map);\n * const ui = createDrawUI(draw, { locale: 'ja' });\n * ```\n *\n * @module maplibre-gl-draw-ui\n */\n\nimport type { Draw } from '@sakuzu/maplibre-gl-draw';\nimport { flushSync, mount, unmount } from 'svelte';\nimport DrawUIView from './components/DrawUI.svelte';\nimport InspectorView from './components/Inspector.svelte';\nimport LayerPanelView from './components/LayerPanel.svelte';\nimport LegendView from './components/Legend.svelte';\nimport ToolbarView from './components/Toolbar.svelte';\nimport { cornerLift, mapControls } from './controls.js';\nimport { inspectorSettings, sectionsHandle } from './inspector/sections.js';\nimport type {\n InspectorHandle,\n InspectorOptions,\n InspectorSectionSpec,\n InspectorSettings,\n} from './inspector/types.js';\nimport {\n applyKataMessages,\n type Locale,\n localeLanguage,\n type Messages,\n resolveMessages,\n} from './messages.js';\nimport { type Beside, type MapPadding, mapPadding } from './padding.js';\nimport { Box } from './store.js';\nimport { checkTheme, type Theme, themeControl } from './theme.js';\nimport { checkSpec, entryId, insertTool, normalizeTools, toSpec } from './tools.js';\nimport type {\n AloneOptions,\n DrawUI,\n DrawUIOptions,\n LayerPanelHandle,\n LayerPanelOptions,\n LeftSettings,\n LegendHandle,\n ToolbarHandle,\n ToolbarOptions,\n ToolbarSettings,\n ToolEntry,\n ToolSpec,\n ToolsHandle,\n} from './types.js';\n\nexport type {\n InspectorField,\n InspectorFieldKind,\n InspectorHandle,\n InspectorOptions,\n InspectorSectionSpec,\n InspectorSectionsHandle,\n InspectorTab,\n Units,\n} from './inspector/types.js';\nexport type { Locale, Messages } from './messages.js';\nexport type { Theme } from './theme.js';\nexport type {\n AloneOptions,\n DrawUI,\n DrawUIOptions,\n LayerPanelHandle,\n LayerPanelOptions,\n LegendHandle,\n MapControlsOptions,\n ToolbarHandle,\n ToolbarOptions,\n ToolEntry,\n ToolId,\n ToolSpec,\n ToolsHandle,\n} from './types.js';\n\n/** The class of the root element of the interface */\nconst ROOT_CLASS = 'mgd-ui';\n\n/**\n * Creates the root element of the interface inside a container. It is kata's root in a page kata\n * does not own (data-kata-root): the tooltips and the probes of the tokens that kata appends go\n * into it, where the tokens, the language and the theme apply.\n */\nfunction createRoot(container: HTMLElement, overlay: boolean): HTMLElement {\n const root = document.createElement('div');\n root.className = ROOT_CLASS;\n root.setAttribute('data-kata-root', '');\n if (overlay) root.dataset.overlay = '';\n container.appendChild(root);\n return root;\n}\n\n/** Applies a locale: the words of the interface, those of kata, and the language of the root */\nfunction applyLocale(root: HTMLElement, messages: Box<Messages>, locale: Locale): void {\n const next = resolveMessages(locale);\n messages.set(next);\n applyKataMessages(next);\n const lang = localeLanguage(locale);\n if (lang) root.lang = lang;\n else root.removeAttribute('lang');\n}\n\n/** The tools of a toolbar, to add to and to remove from */\nfunction toolsHandle(tools: Box<ToolEntry[]>, messages: Box<Messages>): ToolsHandle {\n const remove = (id: string): boolean => {\n const entries = tools.get();\n const next = entries.filter((entry) => entryId(entry) !== id);\n if (next.length === entries.length) return false;\n tools.set(next);\n return true;\n };\n return {\n add(spec: ToolSpec) {\n checkSpec(spec);\n if (tools.get().some((entry) => entryId(entry) === spec.id)) {\n throw new Error(`There is a tool with the ID \"${spec.id}\" already`);\n }\n tools.set(insertTool(tools.get(), spec));\n let removed = false;\n return () => {\n if (removed) return;\n removed = true;\n remove(spec.id);\n };\n },\n remove,\n list() {\n const m = messages.get();\n return tools.get().map((entry) => toSpec(entry, m));\n },\n };\n}\n\n/**\n * Lays the interface over the map of a draw instance: kata's Shell with the toolbar at the\n * bottom and the keyboard shortcuts.\n *\n * It draws the toolbar, the shortcuts, the layer panel and the legend on the left, and the\n * inspector on the right while something is selected. The map's padding follows the interface:\n * the width of a panel that stands beside the map (on a wide container) and the toolbar's height\n * at the bottom, so that `fitBounds` and `easeTo` keep clear of them; `destroy()` gives the map\n * its padding back. A button at the top right switches between the light and the dark look, and\n * maplibre-gl's own controls go to the bottom corners of the map (the globe, the compass and the\n * zoom at the right, the scale at the left); `destroy()` removes them.\n *\n * @param draw - The draw instance\n * @param options - What to show, the words and the keys\n * @returns The interface, to change and to remove\n * @throws Error when a tool of `options.toolbar.tools` is not valid, a tab of\n * `options.inspector.tabs` is not `style` or `attributes`, or the theme is not `light`, `dark`\n * or `auto`\n */\nexport function createDrawUI(draw: Draw, options: DrawUIOptions = {}): DrawUI {\n const themeName = checkTheme(options.theme);\n const bar: ToolbarOptions | null =\n options.toolbar === false ? null : options.toolbar === true ? {} : (options.toolbar ?? {});\n const tools = new Box(normalizeTools(bar?.tools));\n const messages = new Box(resolveMessages(options.locale));\n const toolbar = new Box<ToolbarSettings | null>(\n bar ? { deletable: bar.delete !== false, snapping: bar.snapping !== false } : null,\n );\n const left = new Box<LeftSettings | null>(leftSettings(options));\n const inspector = new Box<InspectorSettings | null>(\n options.inspector === false\n ? null\n : inspectorSettings(options.inspector === true ? {} : options.inspector, options.units),\n );\n const sections = new Box<InspectorSectionSpec[]>([]);\n\n const map = draw.getMap();\n const root = createRoot(options.container ?? map.getContainer(), true);\n // The look the root shows, which the theme button follows\n const light = new Box(false);\n const theme = themeControl(root, themeName, (next) => light.set(next));\n applyLocale(root, messages, options.locale ?? 'en');\n // maplibre-gl's own controls at the bottom corners, lifted above the toolbar where it reaches\n // them\n const controls = mapControls(map, options.mapControls);\n const lift = cornerLift(map.getContainer(), root);\n // The map keeps its view clear of the panels beside the stage and of the toolbar\n const padding: MapPadding | null = options.padding === false ? null : mapPadding(map, root);\n const view = mount(DrawUIView, {\n target: root,\n props: {\n draw,\n tools,\n messages,\n toolbar,\n left,\n shortcuts: options.shortcuts !== false,\n inspector,\n sections,\n onbeside: (beside: Beside) => {\n padding?.update(beside);\n lift.update();\n },\n side: options.side,\n light,\n themeToggle: options.themeToggle !== false,\n ontheme: (next: Theme) => theme.set(next),\n },\n });\n // The shell opens the left region in an effect: run it now, so that the panels are there when\n // this returns\n flushSync();\n\n let destroyed = false;\n const dropLeft = (part: 'layers' | 'legend') => {\n const now = left.get();\n if (!now) return;\n const next = { ...now, [part]: part === 'layers' ? null : false };\n left.set(next.layers || next.legend ? next : null);\n };\n const layersHandle: LayerPanelHandle = {\n get element() {\n return root.querySelector<HTMLElement>('[data-role=\"layer-panel\"]') ?? root;\n },\n destroy() {\n dropLeft('layers');\n },\n };\n const legendHandle: LegendHandle = {\n get element() {\n return root.querySelector<HTMLElement>('[data-role=\"legend\"]') ?? root;\n },\n destroy() {\n dropLeft('legend');\n },\n };\n const toolbarHandle: ToolbarHandle = {\n get element() {\n return root.querySelector<HTMLElement>('[data-role=\"drawbar\"]') ?? root;\n },\n destroy() {\n toolbar.set(null);\n },\n };\n\n const inspectorHandle: InspectorHandle = {\n get element() {\n return root.querySelector<HTMLElement>('[data-role=\"inspector\"]') ?? root;\n },\n sections: sectionsHandle(sections),\n destroy() {\n inspector.set(null);\n },\n };\n\n return {\n element: root,\n get toolbar() {\n return !destroyed && toolbar.get() ? toolbarHandle : null;\n },\n get inspector() {\n return !destroyed && inspector.get() ? inspectorHandle : null;\n },\n tools: toolsHandle(tools, messages),\n get layers() {\n return !destroyed && left.get()?.layers ? layersHandle : null;\n },\n get legend() {\n return !destroyed && left.get()?.legend ? legendHandle : null;\n },\n setLocale(locale: Locale) {\n if (destroyed) return;\n applyLocale(root, messages, locale);\n },\n setTheme(next: Theme) {\n if (destroyed) return;\n theme.set(next);\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n theme.destroy();\n padding?.destroy();\n lift.destroy();\n controls.destroy();\n unmount(view);\n root.remove();\n },\n };\n}\n\n/**\n * Puts the toolbar alone in an element: the tools, the delete button and the snapping switch,\n * without the keyboard shortcuts. The bar floats at the bottom centre of `target`, which must be\n * positioned (the map's container, or a positioned box over the map).\n *\n * @param draw - The draw instance\n * @param options - The element to put it in, what it shows, the words (`en` by default) and the\n * theme (`auto` by default)\n * @returns The toolbar, to remove\n * @throws Error when a tool of `options.tools` is not valid, or the theme is not `light`, `dark`\n * or `auto`\n */\nexport function createToolbar(draw: Draw, options: ToolbarOptions & AloneOptions): ToolbarHandle {\n const tools = new Box(normalizeTools(options.tools));\n const themeName = checkTheme(options.theme);\n const messages = new Box(resolveMessages(options.locale));\n const root = createRoot(options.target, true);\n const theme = themeControl(root, themeName);\n applyLocale(root, messages, options.locale ?? 'en');\n const view = mount(ToolbarView, {\n target: root,\n props: {\n draw,\n tools,\n messages,\n deletable: options.delete !== false,\n snapping: options.snapping !== false,\n },\n });\n let destroyed = false;\n return {\n get element() {\n return root.querySelector<HTMLElement>('[data-role=\"drawbar\"]') ?? root;\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n theme.destroy();\n unmount(view);\n root.remove();\n },\n };\n}\n\n/** The layer panel with the options filled in */\nfunction layerSettings(options: LayerPanelOptions = {}): Required<LayerPanelOptions> {\n return {\n features: options.features !== false,\n add: options.add !== false,\n reorder: options.reorder !== false,\n };\n}\n\n/** What the left region of `createDrawUI` shows, or null for none */\nfunction leftSettings(options: DrawUIOptions): LeftSettings | null {\n const layers =\n options.layers === false\n ? null\n : layerSettings(options.layers === true ? {} : (options.layers ?? {}));\n const legend = options.legend !== false;\n return layers || legend ? { layers, legend } : null;\n}\n\n/** Puts a component alone in an element, in a root element of the interface */\nfunction mountAlone(\n { target, locale, theme: themeOption }: AloneOptions,\n component: typeof LayerPanelView | typeof LegendView,\n props: Record<string, unknown>,\n role: string,\n): { element: HTMLElement; destroy(): void } {\n const themeName = checkTheme(themeOption);\n const messages = new Box(resolveMessages(locale));\n const root = createRoot(target, false);\n const theme = themeControl(root, themeName);\n applyLocale(root, messages, locale ?? 'en');\n const view = mount(component as typeof LayerPanelView, {\n target: root,\n props: { ...props, messages } as never,\n });\n let destroyed = false;\n return {\n get element() {\n return root.querySelector<HTMLElement>(`[data-role=\"${role}\"]`) ?? root;\n },\n destroy() {\n if (destroyed) return;\n destroyed = true;\n theme.destroy();\n unmount(view);\n root.remove();\n },\n };\n}\n\n/**\n * Puts the layer panel alone in an element: the tree of the layers, their groups and their\n * features, from the front, with the eye, the lock, renaming, dragging and the add menu. It fills\n * `target`, which gives it its size and its scrolling.\n *\n * @param draw - The draw instance\n * @param options - The element to put it in, what it shows, the words (`en` by default) and the\n * theme (`auto` by default)\n * @returns The layer panel, to remove\n * @throws Error when the theme is not `light`, `dark` or `auto`\n */\nexport function createLayerPanel(\n draw: Draw,\n options: LayerPanelOptions & AloneOptions,\n): LayerPanelHandle {\n return mountAlone(options, LayerPanelView, { draw, ...layerSettings(options) }, 'layer-panel');\n}\n\n/**\n * Puts the legend alone in an element: the rows of the style rule of each layer that has one,\n * from the front. It only reads; the rules change with `draw.layers.update`.\n *\n * @param draw - The draw instance\n * @param options - The element to put it in, the words (`en` by default) and the theme (`auto` by\n * default)\n * @returns The legend, to remove\n * @throws Error when the theme is not `light`, `dark` or `auto`\n */\nexport function createLegend(draw: Draw, options: AloneOptions): LegendHandle {\n return mountAlone(options, LegendView, { draw }, 'legend');\n}\n\n/**\n * Puts the inspector alone in an element: the panel of what is selected (a feature, several\n * features, a layer or a group), with an empty state while nothing is. The panel fills the height\n * of `target`.\n *\n * @param draw - The draw instance\n * @param options - The element to put it in, the tabs, the measurements, the operations, the\n * units, the words (`en` by default) and the theme (`auto` by default)\n * @returns The inspector, to add sections to and to remove\n * @throws Error when a tab of `options.tabs` is not `style` or `attributes`, or the theme is not\n * `light`, `dark` or `auto`\n */\nexport function createInspector(\n draw: Draw,\n options: InspectorOptions & AloneOptions,\n): InspectorHandle {\n const settings = inspectorSettings(options);\n const themeName = checkTheme(options.theme);\n const messages = new Box(resolveMessages(options.locale));\n const sections = new Box<InspectorSectionSpec[]>([]);\n const root = createRoot(options.target, false);\n const theme = themeControl(root, themeName);\n root.dataset.panel = '';\n applyLocale(root, messages, options.locale ?? 'en');\n const view = mount(InspectorView, {\n target: root,\n props: { draw, messages, settings, sections },\n });\n let destroyed = false;\n return {\n get element() {\n return root.querySelector<HTMLElement>('[data-role=\"inspector\"]') ?? root;\n },\n sections: sectionsHandle(sections),\n destroy() {\n if (destroyed) return;\n destroyed = true;\n theme.destroy();\n unmount(view);\n root.remove();\n },\n };\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,143,144,145],"mappings":";;;;;;;;;;;;;;;AAOA,IAAM,oBAAoB;CACtB,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,MAAM;CACN,QAAQ;CACR,gBAAgB;CAChB,kBAAkB;CAClB,mBAAmB;AACvB;;;;;;;;;;;;;;;;ACJA,IAAa,gBAAgB,GAAG,YAAY,QACvC,QAAQ,WAAW,OAAO,UAAU;CACrC,OAAQ,QAAQ,SAAS,KACrB,UAAU,KAAK,MAAM,MACrB,MAAM,QAAQ,SAAS,MAAM;AACrC,CAAC,CAAC,CACG,KAAK,GAAG,CAAC,CACT,KAAK;;;;;;;;;;ACXV,SAAS,UAAU,OAAO;CACtB,OAAO,UAAU,QAAQ,UAAU,KAAA;AACvC;;;;;;;AAOA,SAAS,oBAAoB,MAAM,SAAS,CAAC,GAAG;CAC5C,MAAM,iBAAiB,OAAO,kBAAkB,CAAC;CACjD,MAAM,oBAAoB,kBAAkB,eAAe,kBAAkB;CAC7E,MAAM,eAAe,KAAK,QAAQ,KA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