gitea push

This commit is contained in:
2026-05-09 12:19:29 -06:00
parent 06113c95b8
commit 429461e985
1481 changed files with 74306 additions and 52475 deletions
+4844 -297
View File
File diff suppressed because it is too large Load Diff
+11 -479
View File
@@ -1,509 +1,41 @@
{
"hash": "8e064f63",
"hash": "844107a7",
"configHash": "9602e671",
"lockfileHash": "2af5d584",
"browserHash": "c9ed3368",
"lockfileHash": "fd298a34",
"browserHash": "57d41eee",
"optimized": {
"vue-router": {
"src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js",
"fileHash": "c505db30",
"fileHash": "e85c52d8",
"needsInterop": false
},
"vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "27ec1265",
"fileHash": "ed648fc1",
"needsInterop": false
},
"vuetify": {
"src": "../../vuetify/lib/framework.js",
"file": "vuetify.js",
"fileHash": "a3d44ba9",
"needsInterop": false
},
"vuetify/components/VAlert": {
"src": "../../vuetify/lib/components/VAlert/index.js",
"file": "vuetify_components_VAlert.js",
"fileHash": "0494828d",
"needsInterop": false
},
"vuetify/components/VApp": {
"src": "../../vuetify/lib/components/VApp/index.js",
"file": "vuetify_components_VApp.js",
"fileHash": "8691f9fe",
"needsInterop": false
},
"vuetify/components/VAppBar": {
"src": "../../vuetify/lib/components/VAppBar/index.js",
"file": "vuetify_components_VAppBar.js",
"fileHash": "ef23c19d",
"needsInterop": false
},
"vuetify/components/VAvatar": {
"src": "../../vuetify/lib/components/VAvatar/index.js",
"file": "vuetify_components_VAvatar.js",
"fileHash": "5ce8925c",
"needsInterop": false
},
"vuetify/components/VBtn": {
"src": "../../vuetify/lib/components/VBtn/index.js",
"file": "vuetify_components_VBtn.js",
"fileHash": "cf4c48b6",
"needsInterop": false
},
"vuetify/components/VBtnToggle": {
"src": "../../vuetify/lib/components/VBtnToggle/index.js",
"file": "vuetify_components_VBtnToggle.js",
"fileHash": "d1a4f67d",
"needsInterop": false
},
"vuetify/components/VCard": {
"src": "../../vuetify/lib/components/VCard/index.js",
"file": "vuetify_components_VCard.js",
"fileHash": "baee0497",
"needsInterop": false
},
"vuetify/components/VChip": {
"src": "../../vuetify/lib/components/VChip/index.js",
"file": "vuetify_components_VChip.js",
"fileHash": "40af6466",
"needsInterop": false
},
"vuetify/components/VCode": {
"src": "../../vuetify/lib/components/VCode/index.js",
"file": "vuetify_components_VCode.js",
"fileHash": "73fb1a0d",
"needsInterop": false
},
"vuetify/components/VDataTable": {
"src": "../../vuetify/lib/components/VDataTable/index.js",
"file": "vuetify_components_VDataTable.js",
"fileHash": "0015d97a",
"needsInterop": false
},
"vuetify/components/VDialog": {
"src": "../../vuetify/lib/components/VDialog/index.js",
"file": "vuetify_components_VDialog.js",
"fileHash": "96235b6a",
"needsInterop": false
},
"vuetify/components/VDivider": {
"src": "../../vuetify/lib/components/VDivider/index.js",
"file": "vuetify_components_VDivider.js",
"fileHash": "22b91c53",
"needsInterop": false
},
"vuetify/components/VEmptyState": {
"src": "../../vuetify/lib/components/VEmptyState/index.js",
"file": "vuetify_components_VEmptyState.js",
"fileHash": "6fcb7e7d",
"needsInterop": false
},
"vuetify/components/VExpansionPanel": {
"src": "../../vuetify/lib/components/VExpansionPanel/index.js",
"file": "vuetify_components_VExpansionPanel.js",
"fileHash": "4b5f700a",
"needsInterop": false
},
"vuetify/components/VFileInput": {
"src": "../../vuetify/lib/components/VFileInput/index.js",
"file": "vuetify_components_VFileInput.js",
"fileHash": "767d6c24",
"needsInterop": false
},
"vuetify/components/VForm": {
"src": "../../vuetify/lib/components/VForm/index.js",
"file": "vuetify_components_VForm.js",
"fileHash": "f956317f",
"needsInterop": false
},
"vuetify/components/VGrid": {
"src": "../../vuetify/lib/components/VGrid/index.js",
"file": "vuetify_components_VGrid.js",
"fileHash": "4bbfc290",
"needsInterop": false
},
"vuetify/components/VIcon": {
"src": "../../vuetify/lib/components/VIcon/index.js",
"file": "vuetify_components_VIcon.js",
"fileHash": "6bf4db8a",
"needsInterop": false
},
"vuetify/components/VImg": {
"src": "../../vuetify/lib/components/VImg/index.js",
"file": "vuetify_components_VImg.js",
"fileHash": "9c4fdff1",
"needsInterop": false
},
"vuetify/components/VList": {
"src": "../../vuetify/lib/components/VList/index.js",
"file": "vuetify_components_VList.js",
"fileHash": "14e9b6f5",
"needsInterop": false
},
"vuetify/components/VMain": {
"src": "../../vuetify/lib/components/VMain/index.js",
"file": "vuetify_components_VMain.js",
"fileHash": "818f7c3d",
"needsInterop": false
},
"vuetify/components/VMenu": {
"src": "../../vuetify/lib/components/VMenu/index.js",
"file": "vuetify_components_VMenu.js",
"fileHash": "6d91a786",
"needsInterop": false
},
"vuetify/components/VNavigationDrawer": {
"src": "../../vuetify/lib/components/VNavigationDrawer/index.js",
"file": "vuetify_components_VNavigationDrawer.js",
"fileHash": "7f6e5d05",
"needsInterop": false
},
"vuetify/components/VProgressLinear": {
"src": "../../vuetify/lib/components/VProgressLinear/index.js",
"file": "vuetify_components_VProgressLinear.js",
"fileHash": "198b1e0f",
"needsInterop": false
},
"vuetify/components/VSelect": {
"src": "../../vuetify/lib/components/VSelect/index.js",
"file": "vuetify_components_VSelect.js",
"fileHash": "a88065a3",
"needsInterop": false
},
"vuetify/components/VSheet": {
"src": "../../vuetify/lib/components/VSheet/index.js",
"file": "vuetify_components_VSheet.js",
"fileHash": "bbb3fab6",
"needsInterop": false
},
"vuetify/components/VSnackbar": {
"src": "../../vuetify/lib/components/VSnackbar/index.js",
"file": "vuetify_components_VSnackbar.js",
"fileHash": "13b79196",
"needsInterop": false
},
"vuetify/components/VSwitch": {
"src": "../../vuetify/lib/components/VSwitch/index.js",
"file": "vuetify_components_VSwitch.js",
"fileHash": "e04d0dea",
"needsInterop": false
},
"vuetify/components/VTabs": {
"src": "../../vuetify/lib/components/VTabs/index.js",
"file": "vuetify_components_VTabs.js",
"fileHash": "ea54a15a",
"needsInterop": false
},
"vuetify/components/VTextField": {
"src": "../../vuetify/lib/components/VTextField/index.js",
"file": "vuetify_components_VTextField.js",
"fileHash": "2fdbd616",
"needsInterop": false
},
"vuetify/components/VTextarea": {
"src": "../../vuetify/lib/components/VTextarea/index.js",
"file": "vuetify_components_VTextarea.js",
"fileHash": "d7862242",
"needsInterop": false
},
"vuetify/components/VTimeline": {
"src": "../../vuetify/lib/components/VTimeline/index.js",
"file": "vuetify_components_VTimeline.js",
"fileHash": "f6ba4991",
"needsInterop": false
},
"vuetify/components/VToolbar": {
"src": "../../vuetify/lib/components/VToolbar/index.js",
"file": "vuetify_components_VToolbar.js",
"fileHash": "822ddc35",
"needsInterop": false
},
"vuetify/components/transitions": {
"src": "../../vuetify/lib/components/transitions/index.js",
"file": "vuetify_components_transitions.js",
"fileHash": "0f566edd",
"fileHash": "502892be",
"needsInterop": false
},
"vuetify/labs/VDateInput": {
"src": "../../vuetify/lib/labs/VDateInput/index.js",
"file": "vuetify_labs_VDateInput.js",
"fileHash": "682c9f40",
"fileHash": "09ba9c15",
"needsInterop": false
}
},
"chunks": {
"VAvatar-BHEBKXii": {
"file": "VAvatar-BHEBKXii.js",
"resizeObserver-DXFuuv3h": {
"file": "resizeObserver-DXFuuv3h.js",
"isDynamicEntry": false
},
"VBadge-DTJk6Mtd": {
"file": "VBadge-DTJk6Mtd.js",
"isDynamicEntry": false
},
"VBtn-Bm4dgaEe": {
"file": "VBtn-Bm4dgaEe.js",
"isDynamicEntry": false
},
"VBtnToggle-BtUiWTgd": {
"file": "VBtnToggle-BtUiWTgd.js",
"isDynamicEntry": false
},
"VChip-D8z4sLH7": {
"file": "VChip-D8z4sLH7.js",
"isDynamicEntry": false
},
"VDefaultsProvider-C3Dl0By9": {
"file": "VDefaultsProvider-C3Dl0By9.js",
"isDynamicEntry": false
},
"VDivider-Bm22Quav": {
"file": "VDivider-Bm22Quav.js",
"isDynamicEntry": false
},
"VField-CDtYQTyk": {
"file": "VField-CDtYQTyk.js",
"isDynamicEntry": false
},
"VGrid-xu6tptBP": {
"file": "VGrid-xu6tptBP.js",
"isDynamicEntry": false
},
"VIcon-DqvHH35X": {
"file": "VIcon-DqvHH35X.js",
"isDynamicEntry": false
},
"VImg-D29ak-Ji": {
"file": "VImg-D29ak-Ji.js",
"isDynamicEntry": false
},
"VLabel-BK6j7Ce3": {
"file": "VLabel-BK6j7Ce3.js",
"isDynamicEntry": false
},
"VList-BhbWLtAc": {
"file": "VList-BhbWLtAc.js",
"isDynamicEntry": false
},
"VMenu-g8bPIWQQ": {
"file": "VMenu-g8bPIWQQ.js",
"isDynamicEntry": false
},
"VOverlay-BntBXXGT": {
"file": "VOverlay-BntBXXGT.js",
"isDynamicEntry": false
},
"VProgressCircular-z2FRmexp": {
"file": "VProgressCircular-z2FRmexp.js",
"isDynamicEntry": false
},
"VProgressLinear-Wk0zAkvE": {
"file": "VProgressLinear-Wk0zAkvE.js",
"isDynamicEntry": false
},
"VSelect-9P7g-lSZ": {
"file": "VSelect-9P7g-lSZ.js",
"isDynamicEntry": false
},
"VSelectionControl-DGk6dNy-": {
"file": "VSelectionControl-DGk6dNy-.js",
"isDynamicEntry": false
},
"VSheet-CdUUbWcK": {
"file": "VSheet-CdUUbWcK.js",
"isDynamicEntry": false
},
"VSlideGroup-CVNSOV5n": {
"file": "VSlideGroup-CVNSOV5n.js",
"isDynamicEntry": false
},
"VTextField-CbHSipIH": {
"file": "VTextField-CbHSipIH.js",
"isDynamicEntry": false
},
"VToolbar-DAPb7QHO": {
"file": "VToolbar-DAPb7QHO.js",
"isDynamicEntry": false
},
"anchor-Co261iQQ": {
"file": "anchor-Co261iQQ.js",
"isDynamicEntry": false
},
"animation-gSo9lwa6": {
"file": "animation-gSo9lwa6.js",
"isDynamicEntry": false
},
"autofocus-xE7ffHAe": {
"file": "autofocus-xE7ffHAe.js",
"isDynamicEntry": false
},
"border-DgwbzrV0": {
"file": "border-DgwbzrV0.js",
"isDynamicEntry": false
},
"box-BNWMOtF7": {
"file": "box-BNWMOtF7.js",
"isDynamicEntry": false
},
"color-B0NTWdor": {
"file": "color-B0NTWdor.js",
"isDynamicEntry": false
},
"colorUtils-CIHuTsPA": {
"file": "colorUtils-CIHuTsPA.js",
"isDynamicEntry": false
},
"component-W6F5nwNC": {
"file": "component-W6F5nwNC.js",
"isDynamicEntry": false
},
"createSimpleFunctional-DYAlCmHj": {
"file": "createSimpleFunctional-DYAlCmHj.js",
"isDynamicEntry": false
},
"date-DVxTP86R": {
"file": "date-DVxTP86R.js",
"isDynamicEntry": false
},
"deepEqual-BC7T2p7H": {
"file": "deepEqual-BC7T2p7H.js",
"isDynamicEntry": false
},
"defineComponent-D5UWd5Vb": {
"file": "defineComponent-D5UWd5Vb.js",
"isDynamicEntry": false
},
"density-Dey2iIaF": {
"file": "density-Dey2iIaF.js",
"isDynamicEntry": false
},
"dimensions-DYqEoPdw": {
"file": "dimensions-DYqEoPdw.js",
"isDynamicEntry": false
},
"display-BD8QD-8J": {
"file": "display-BD8QD-8J.js",
"isDynamicEntry": false
},
"easing-DfcvkbkS": {
"file": "easing-DfcvkbkS.js",
"isDynamicEntry": false
},
"elevation-DF9Lgrr_": {
"file": "elevation-DF9Lgrr_.js",
"isDynamicEntry": false
},
"focusTrap-BRlT3Jgx": {
"file": "focusTrap-BRlT3Jgx.js",
"isDynamicEntry": false
},
"form-DdDtsBxc": {
"file": "form-DdDtsBxc.js",
"isDynamicEntry": false
},
"forwardRefs-C50LZ3ti": {
"file": "forwardRefs-C50LZ3ti.js",
"isDynamicEntry": false
},
"getScrollParent-DuXs8SPu": {
"file": "getScrollParent-DuXs8SPu.js",
"isDynamicEntry": false
},
"goto-B27jmATn": {
"file": "goto-B27jmATn.js",
"isDynamicEntry": false
},
"group-sYL2sZpA": {
"file": "group-sYL2sZpA.js",
"isDynamicEntry": false
},
"icons-czM1t0u4": {
"file": "icons-czM1t0u4.js",
"isDynamicEntry": false
},
"intersect-CzF7r7uD": {
"file": "intersect-CzF7r7uD.js",
"isDynamicEntry": false
},
"layout-DcSzssSI": {
"file": "layout-DcSzssSI.js",
"isDynamicEntry": false
},
"lazy-CSlNPYYk": {
"file": "lazy-CSlNPYYk.js",
"isDynamicEntry": false
},
"loader-Dn_UJdiG": {
"file": "loader-Dn_UJdiG.js",
"isDynamicEntry": false
},
"locale-DTRSr4yu": {
"file": "locale-DTRSr4yu.js",
"isDynamicEntry": false
},
"location-DD-AfEFw": {
"file": "location-DD-AfEFw.js",
"isDynamicEntry": false
},
"position-7CDSPI1P": {
"file": "position-7CDSPI1P.js",
"isDynamicEntry": false
},
"proxiedModel-BOZtsMxA": {
"file": "proxiedModel-BOZtsMxA.js",
"isDynamicEntry": false
},
"resizeObserver-BhsZsTWI": {
"file": "resizeObserver-BhsZsTWI.js",
"isDynamicEntry": false
},
"ripple-Q8q1hNUv": {
"file": "ripple-Q8q1hNUv.js",
"isDynamicEntry": false
},
"rounded-m6mNMWh4": {
"file": "rounded-m6mNMWh4.js",
"isDynamicEntry": false
},
"router-CiYG9tKT": {
"file": "router-CiYG9tKT.js",
"isDynamicEntry": false
},
"scopeId-BbFYJclW": {
"file": "scopeId-BbFYJclW.js",
"isDynamicEntry": false
},
"ssrBoot-Dt2Wz9ZC": {
"file": "ssrBoot-Dt2Wz9ZC.js",
"isDynamicEntry": false
},
"tag-CIFqtlp2": {
"file": "tag-CIFqtlp2.js",
"isDynamicEntry": false
},
"theme-C1b955Ym": {
"file": "theme-C1b955Ym.js",
"isDynamicEntry": false
},
"transition-BieT_XBo": {
"file": "transition-BieT_XBo.js",
"isDynamicEntry": false
},
"transitions-llwxsiay": {
"file": "transitions-llwxsiay.js",
"isDynamicEntry": false
},
"useRender-DB_YiTtB": {
"file": "useRender-DB_YiTtB.js",
"isDynamicEntry": false
},
"variant-BcdnKFgE": {
"file": "variant-BcdnKFgE.js",
"isDynamicEntry": false
},
"vue.runtime.esm-bundler-BvoXUmaf": {
"file": "vue.runtime.esm-bundler-BvoXUmaf.js",
"vue.runtime.esm-bundler-C6sZGmPl": {
"file": "vue.runtime.esm-bundler-C6sZGmPl.js",
"isDynamicEntry": false
}
}
-25
View File
@@ -1,25 +0,0 @@
import "./vue.runtime.esm-bundler-BvoXUmaf.js";
//#region node_modules/vuetify/lib/util/easing.js
var standardEasing = "cubic-bezier(0.4, 0, 0.2, 1)";
var deceleratedEasing = "cubic-bezier(0.0, 0, 0.2, 1)";
var acceleratedEasing = "cubic-bezier(0.4, 0, 1, 1)";
var easingPatterns = {
linear: (t) => t,
easeInQuad: (t) => t ** 2,
easeOutQuad: (t) => t * (2 - t),
easeInOutQuad: (t) => t < .5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t,
easeInCubic: (t) => t ** 3,
easeOutCubic: (t) => --t ** 3 + 1,
easeInOutCubic: (t) => t < .5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,
easeInQuart: (t) => t ** 4,
easeOutQuart: (t) => 1 - --t ** 4,
easeInOutQuart: (t) => t < .5 ? 8 * t ** 4 : 1 - 8 * --t ** 4,
easeInQuint: (t) => t ** 5,
easeOutQuint: (t) => 1 + --t ** 5,
easeInOutQuint: (t) => t < .5 ? 16 * t ** 5 : 1 + 16 * --t ** 5,
instant: (t) => 1
};
//#endregion
export { standardEasing as i, deceleratedEasing as n, easingPatterns as r, acceleratedEasing as t };
//# sourceMappingURL=easing-DfcvkbkS.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"easing-DfcvkbkS.js","names":[],"sources":["../../vuetify/lib/util/easing.js"],"sourcesContent":["// Utilities\nimport { computed, shallowRef, toValue, watch } from 'vue';\nimport { clamp } from \"./helpers.js\";\nimport { PREFERS_REDUCED_MOTION } from \"./globals.js\"; // Types\nexport const standardEasing = 'cubic-bezier(0.4, 0, 0.2, 1)';\nexport const deceleratedEasing = 'cubic-bezier(0.0, 0, 0.2, 1)'; // Entering\nexport const acceleratedEasing = 'cubic-bezier(0.4, 0, 1, 1)'; // Leaving\n\nexport const easingPatterns = {\n linear: t => t,\n easeInQuad: t => t ** 2,\n easeOutQuad: t => t * (2 - t),\n easeInOutQuad: t => t < 0.5 ? 2 * t ** 2 : -1 + (4 - 2 * t) * t,\n easeInCubic: t => t ** 3,\n easeOutCubic: t => --t ** 3 + 1,\n easeInOutCubic: t => t < 0.5 ? 4 * t ** 3 : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1,\n easeInQuart: t => t ** 4,\n easeOutQuart: t => 1 - --t ** 4,\n easeInOutQuart: t => t < 0.5 ? 8 * t ** 4 : 1 - 8 * --t ** 4,\n easeInQuint: t => t ** 5,\n easeOutQuint: t => 1 + --t ** 5,\n easeInOutQuint: t => t < 0.5 ? 16 * t ** 5 : 1 + 16 * --t ** 5,\n instant: t => 1\n};\nexport function useTransition(source, options) {\n const defaultTransition = {\n duration: 300,\n transition: easingPatterns.easeInOutCubic\n };\n let raf = -1;\n const outputRef = shallowRef(toValue(source));\n watch(() => toValue(source), async to => {\n cancelAnimationFrame(raf);\n const easing = {\n ...defaultTransition,\n ...toValue(options)\n };\n await executeTransition(outputRef, outputRef.value, to, easing);\n });\n function executeTransition(out, from, to, options) {\n const startTime = performance.now();\n const ease = PREFERS_REDUCED_MOTION() ? easingPatterns.instant : options.transition ?? easingPatterns.easeInOutCubic;\n return new Promise(resolve => {\n raf = requestAnimationFrame(function step(currentTime) {\n const timeElapsed = currentTime - startTime;\n const progress = timeElapsed / options.duration;\n out.value = from + (to - from) * ease(clamp(progress, 0, 1));\n if (progress < 1) {\n raf = requestAnimationFrame(step);\n } else {\n out.value = to;\n resolve();\n }\n });\n });\n }\n return computed(() => outputRef.value);\n}\n//# sourceMappingURL=easing.js.map"],"mappings":";;AAIA,IAAa,iBAAiB;AAC9B,IAAa,oBAAoB;AACjC,IAAa,oBAAoB;AAEjC,IAAa,iBAAiB;CAC5B,SAAQ,MAAK;CACb,aAAY,MAAK,KAAK;CACtB,cAAa,MAAK,KAAK,IAAI;CAC3B,gBAAe,MAAK,IAAI,KAAM,IAAI,KAAK,IAAI,MAAM,IAAI,IAAI,KAAK;CAC9D,cAAa,MAAK,KAAK;CACvB,eAAc,MAAK,EAAE,KAAK,IAAI;CAC9B,iBAAgB,MAAK,IAAI,KAAM,IAAI,KAAK,KAAK,IAAI,MAAM,IAAI,IAAI,MAAM,IAAI,IAAI,KAAK;CAClF,cAAa,MAAK,KAAK;CACvB,eAAc,MAAK,IAAI,EAAE,KAAK;CAC9B,iBAAgB,MAAK,IAAI,KAAM,IAAI,KAAK,IAAI,IAAI,IAAI,EAAE,KAAK;CAC3D,cAAa,MAAK,KAAK;CACvB,eAAc,MAAK,IAAI,EAAE,KAAK;CAC9B,iBAAgB,MAAK,IAAI,KAAM,KAAK,KAAK,IAAI,IAAI,KAAK,EAAE,KAAK;CAC7D,UAAS,MAAK;CACf"}
-34
View File
@@ -1,34 +0,0 @@
//#region node_modules/vuetify/lib/util/getScrollParent.js
function getScrollParent(el, includeHidden = false) {
while (el) {
if (includeHidden ? isPotentiallyScrollable(el) : hasScrollbar(el)) return el;
el = el.parentElement;
}
return document.scrollingElement;
}
function getScrollParents(el, stopAt) {
const elements = [];
if (stopAt && el && !stopAt.contains(el)) return elements;
while (el) {
if (hasScrollbar(el)) elements.push(el);
if (el === stopAt) break;
el = el.parentElement;
}
return elements;
}
function hasScrollbar(el) {
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
const style = window.getComputedStyle(el);
const hasVerticalScrollbar = style.overflowY === "scroll" || style.overflowY === "auto" && el.scrollHeight > el.clientHeight;
const hasHorizontalScrollbar = style.overflowX === "scroll" || style.overflowX === "auto" && el.scrollWidth > el.clientWidth;
return hasVerticalScrollbar || hasHorizontalScrollbar;
}
function isPotentiallyScrollable(el) {
if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;
const style = window.getComputedStyle(el);
return ["scroll", "auto"].includes(style.overflowY);
}
//#endregion
export { getScrollParents as n, hasScrollbar as r, getScrollParent as t };
//# sourceMappingURL=getScrollParent-DuXs8SPu.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"getScrollParent-DuXs8SPu.js","names":[],"sources":["../../vuetify/lib/util/getScrollParent.js"],"sourcesContent":["export function getScrollParent(el, includeHidden = false) {\n while (el) {\n if (includeHidden ? isPotentiallyScrollable(el) : hasScrollbar(el)) return el;\n el = el.parentElement;\n }\n return document.scrollingElement;\n}\nexport function getScrollParents(el, stopAt) {\n const elements = [];\n if (stopAt && el && !stopAt.contains(el)) return elements;\n while (el) {\n if (hasScrollbar(el)) elements.push(el);\n if (el === stopAt) break;\n el = el.parentElement;\n }\n return elements;\n}\nexport function hasScrollbar(el) {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;\n const style = window.getComputedStyle(el);\n const hasVerticalScrollbar = style.overflowY === 'scroll' || style.overflowY === 'auto' && el.scrollHeight > el.clientHeight;\n const hasHorizontalScrollbar = style.overflowX === 'scroll' || style.overflowX === 'auto' && el.scrollWidth > el.clientWidth;\n return hasVerticalScrollbar || hasHorizontalScrollbar;\n}\nfunction isPotentiallyScrollable(el) {\n if (!el || el.nodeType !== Node.ELEMENT_NODE) return false;\n const style = window.getComputedStyle(el);\n return ['scroll', 'auto'].includes(style.overflowY);\n}\n//# sourceMappingURL=getScrollParent.js.map"],"mappings":";AAAA,SAAgB,gBAAgB,IAAI,gBAAgB,OAAO;AACzD,QAAO,IAAI;AACT,MAAI,gBAAgB,wBAAwB,GAAG,GAAG,aAAa,GAAG,CAAE,QAAO;AAC3E,OAAK,GAAG;;AAEV,QAAO,SAAS;;AAElB,SAAgB,iBAAiB,IAAI,QAAQ;CAC3C,MAAM,WAAW,EAAE;AACnB,KAAI,UAAU,MAAM,CAAC,OAAO,SAAS,GAAG,CAAE,QAAO;AACjD,QAAO,IAAI;AACT,MAAI,aAAa,GAAG,CAAE,UAAS,KAAK,GAAG;AACvC,MAAI,OAAO,OAAQ;AACnB,OAAK,GAAG;;AAEV,QAAO;;AAET,SAAgB,aAAa,IAAI;AAC/B,KAAI,CAAC,MAAM,GAAG,aAAa,KAAK,aAAc,QAAO;CACrD,MAAM,QAAQ,OAAO,iBAAiB,GAAG;CACzC,MAAM,uBAAuB,MAAM,cAAc,YAAY,MAAM,cAAc,UAAU,GAAG,eAAe,GAAG;CAChH,MAAM,yBAAyB,MAAM,cAAc,YAAY,MAAM,cAAc,UAAU,GAAG,cAAc,GAAG;AACjH,QAAO,wBAAwB;;AAEjC,SAAS,wBAAwB,IAAI;AACnC,KAAI,CAAC,MAAM,GAAG,aAAa,KAAK,aAAc,QAAO;CACrD,MAAM,QAAQ,OAAO,iBAAiB,GAAG;AACzC,QAAO,CAAC,UAAU,OAAO,CAAC,SAAS,MAAM,UAAU"}
+1 -1
View File
@@ -1,4 +1,4 @@
import { Kn as ref, Nt as onDeactivated, Ot as nextTick, U as computed, Ut as provide, Wn as reactive, Yn as shallowRef, _n as watchEffect, gn as watch, kt as onActivated, nr as unref, nt as defineComponent, pt as h, qn as shallowReactive, ut as getCurrentInstance, xt as inject, zt as onUnmounted } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { Kn as ref, Nt as onDeactivated, Ot as nextTick, U as computed, Ut as provide, Wn as reactive, Yn as shallowRef, _n as watchEffect, gn as watch, kt as onActivated, nr as unref, nt as defineComponent, pt as h, qn as shallowReactive, ut as getCurrentInstance, xt as inject, zt as onUnmounted } from "./vue.runtime.esm-bundler-C6sZGmPl.js";
//#region node_modules/@vue/devtools-api/lib/esm/env.js
function getDevtoolsGlobalHook() {
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
import { $ as createTextVNode, $n as toRefs, $t as resolveTransitionHooks, A as ErrorCodes, An as customRef, At as onBeforeMount, B as callWithErrorHandling, Bn as markRaw, Bt as onUpdated, C as vShow, Cn as withDirectives, Ct as isRuntimeOnly, D as BaseTransitionPropsValidators, Dn as ReactiveEffect, Dt as mergeProps, E as BaseTransition, En as EffectScope, Et as mergeModels, F as Suspense, Fn as isProxy, Ft as onMounted, G as createBlock, Gn as readonly, Gt as queuePostFlushCb, H as compatUtils, Hn as onWatcherCleanup, Ht as popScopeId, I as Teleport, In as isReactive, It as onRenderTracked, J as createHydrationRenderer, Jn as shallowReadonly, Jt as renderSlot, K as createCommentVNode, Kn as ref, Kt as registerRuntimeCompiler, L as Text, Ln as isReadonly, Lt as onRenderTriggered, M as Fragment, Mn as effectScope, Mt as onBeforeUpdate, N as KeepAlive, Nn as getCurrentScope, Nt as onDeactivated, O as Comment, On as TrackOpTypes, Ot as nextTick, P as Static, Pn as getCurrentWatcher, Pt as onErrorCaptured, Q as createStaticVNode, Qn as toRef, Qt as resolveFilter, R as assertNumber, Rn as isRef, Rt as onServerPrefetch, S as vModelText, Sn as withDefaults, St as isMemoSame, T as withModifiers, Tn as withScopeId, Tt as mergeDefaults, U as computed, Un as proxyRefs, Ut as provide, V as cloneVNode, Vn as onScopeDispose, Vt as openBlock, W as createBaseVNode, Wn as reactive, Wt as pushScopeId, X as createRenderer, Xn as stop, Xt as resolveDirective, Y as createPropsRestProxy, Yn as shallowRef, Yt as resolveComponent, Z as createSlots, Zn as toRaw, Zt as resolveDynamicComponent, _ as useShadowRoot, _n as watchEffect, _t as hydrateOnInteraction, a as createApp, an as toHandlers, ar as normalizeClass, at as defineModel, b as vModelRadio, bn as withAsyncContext, bt as initCustomFormatter, c as defineSSRCustomElement, cn as useId, cr as toDisplayString, ct as defineSlots, d as nodeOps, dn as useSlots, dt as getTransitionRawChildren, en as setBlockTracking, er as toValue, et as createVNode, f as patchProp, fn as useTemplateRef, ft as guardReactiveProps, g as useHost, gn as watch, gt as hydrateOnIdle, h as useCssVars, hn as warn, ht as hasInjectionContext, i as VueElement, in as ssrUtils, ir as capitalize, it as defineExpose, j as ErrorTypeStrings, jn as effect, jt as onBeforeUnmount, k as DeprecationTypes, kn as TriggerOpTypes, kt as onActivated, l as hydrate, ln as useModel, lr as toHandlerKey, lt as devtools, m as useCssModule, mn as version, mt as handleError, n as Transition, nn as setTransitionHooks, nr as unref, nt as defineComponent, o as createSSRApp, on as transformVNodeArgs, or as normalizeProps, ot as defineOptions, p as render, pn as useTransitionState, pt as h, q as createElementBlock, qn as shallowReactive, qt as renderList, r as TransitionGroup, rn as ssrContextKey, rr as camelize, rt as defineEmits, s as defineCustomElement, sn as useAttrs, sr as normalizeStyle, st as defineProps, t as compile, tn as setDevtoolsHook, tr as triggerRef, tt as defineAsyncComponent, u as initDirectivesForSSR, un as useSSRContext, ut as getCurrentInstance, v as vModelCheckbox, vn as watchPostEffect, vt as hydrateOnMediaQuery, w as withKeys, wn as withMemo, wt as isVNode, x as vModelSelect, xn as withCtx, xt as inject, y as vModelDynamic, yn as watchSyncEffect, yt as hydrateOnVisible, z as callWithAsyncErrorHandling, zn as isShallow, zt as onUnmounted } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { $ as createTextVNode, $n as toRefs, $t as resolveTransitionHooks, A as ErrorCodes, An as customRef, At as onBeforeMount, B as callWithErrorHandling, Bn as markRaw, Bt as onUpdated, C as vShow, Cn as withDirectives, Ct as isRuntimeOnly, D as BaseTransitionPropsValidators, Dn as ReactiveEffect, Dt as mergeProps, E as BaseTransition, En as EffectScope, Et as mergeModels, F as Suspense, Fn as isProxy, Ft as onMounted, G as createBlock, Gn as readonly, Gt as queuePostFlushCb, H as compatUtils, Hn as onWatcherCleanup, Ht as popScopeId, I as Teleport, In as isReactive, It as onRenderTracked, J as createHydrationRenderer, Jn as shallowReadonly, Jt as renderSlot, K as createCommentVNode, Kn as ref, Kt as registerRuntimeCompiler, L as Text, Ln as isReadonly, Lt as onRenderTriggered, M as Fragment, Mn as effectScope, Mt as onBeforeUpdate, N as KeepAlive, Nn as getCurrentScope, Nt as onDeactivated, O as Comment, On as TrackOpTypes, Ot as nextTick, P as Static, Pn as getCurrentWatcher, Pt as onErrorCaptured, Q as createStaticVNode, Qn as toRef, Qt as resolveFilter, R as assertNumber, Rn as isRef, Rt as onServerPrefetch, S as vModelText, Sn as withDefaults, St as isMemoSame, T as withModifiers, Tn as withScopeId, Tt as mergeDefaults, U as computed, Un as proxyRefs, Ut as provide, V as cloneVNode, Vn as onScopeDispose, Vt as openBlock, W as createBaseVNode, Wn as reactive, Wt as pushScopeId, X as createRenderer, Xn as stop, Xt as resolveDirective, Y as createPropsRestProxy, Yn as shallowRef, Yt as resolveComponent, Z as createSlots, Zn as toRaw, Zt as resolveDynamicComponent, _ as useShadowRoot, _n as watchEffect, _t as hydrateOnInteraction, a as createApp, an as toHandlers, ar as normalizeClass, at as defineModel, b as vModelRadio, bn as withAsyncContext, bt as initCustomFormatter, c as defineSSRCustomElement, cn as useId, cr as toDisplayString, ct as defineSlots, d as nodeOps, dn as useSlots, dt as getTransitionRawChildren, en as setBlockTracking, er as toValue, et as createVNode, f as patchProp, fn as useTemplateRef, ft as guardReactiveProps, g as useHost, gn as watch, gt as hydrateOnIdle, h as useCssVars, hn as warn, ht as hasInjectionContext, i as VueElement, in as ssrUtils, ir as capitalize, it as defineExpose, j as ErrorTypeStrings, jn as effect, jt as onBeforeUnmount, k as DeprecationTypes, kn as TriggerOpTypes, kt as onActivated, l as hydrate, ln as useModel, lr as toHandlerKey, lt as devtools, m as useCssModule, mn as version, mt as handleError, n as Transition, nn as setTransitionHooks, nr as unref, nt as defineComponent, o as createSSRApp, on as transformVNodeArgs, or as normalizeProps, ot as defineOptions, p as render, pn as useTransitionState, pt as h, q as createElementBlock, qn as shallowReactive, qt as renderList, r as TransitionGroup, rn as ssrContextKey, rr as camelize, rt as defineEmits, s as defineCustomElement, sn as useAttrs, sr as normalizeStyle, st as defineProps, t as compile, tn as setDevtoolsHook, tr as triggerRef, tt as defineAsyncComponent, u as initDirectivesForSSR, un as useSSRContext, ut as getCurrentInstance, v as vModelCheckbox, vn as watchPostEffect, vt as hydrateOnMediaQuery, w as withKeys, wn as withMemo, wt as isVNode, x as vModelSelect, xn as withCtx, xt as inject, y as vModelDynamic, yn as watchSyncEffect, yt as hydrateOnVisible, z as callWithAsyncErrorHandling, zn as isShallow, zt as onUnmounted } from "./vue.runtime.esm-bundler-C6sZGmPl.js";
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getCurrentWatcher, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, hydrateOnIdle, hydrateOnInteraction, hydrateOnMediaQuery, hydrateOnVisible, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, nodeOps, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, onWatcherCleanup, openBlock, patchProp, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useHost, useId, useModel, useSSRContext, useShadowRoot, useSlots, useTemplateRef, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+231 -104
View File
@@ -1,12 +1,233 @@
import { Mn as effectScope, Ot as nextTick, U as computed, Vn as onScopeDispose, Wn as reactive, er as toValue, gn as watch, pt as h } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { B as isObject, K as mergeDeep, L as includes, a as createDefaults, i as DefaultsSymbol, lt as consoleWarn, rt as IN_BROWSER, s as useDefaults, t as defineComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { o as VSvgIcon, r as VClassIcon, t as IconSymbol } from "./icons-czM1t0u4.js";
import { a as useTheme, n as createTheme, t as ThemeSymbol } from "./theme-C1b955Ym.js";
import { i as useRtl, n as createLocale, r as useLocale, t as LocaleSymbol } from "./locale-DTRSr4yu.js";
import { a as useLayout } from "./layout-DcSzssSI.js";
import { a as useDisplay, r as createDisplay, t as DisplaySymbol } from "./display-BD8QD-8J.js";
import { n as DateOptionsSymbol, o as useDate, r as createDate, t as DateAdapterSymbol } from "./date-DVxTP86R.js";
import { n as createGoTo, r as useGoTo, t as GoToSymbol } from "./goto-B27jmATn.js";
import { Mn as effectScope, Ot as nextTick, Qn as toRef, U as computed, Vn as onScopeDispose, Wn as reactive, er as toValue, gn as watch, pt as h, xt as inject$1 } from "./vue.runtime.esm-bundler-C6sZGmPl.js";
import { A as easingPatterns, B as propsFactory, C as IconSymbol, Ct as PREFERS_REDUCED_MOTION, E as VSvgIcon, Et as consoleWarn, F as createDefaults, J as clamp, L as useDefaults, M as defineComponent, P as DefaultsSymbol, St as IN_BROWSER, T as VClassIcon, _ as LocaleSymbol, b as useRtl, c as createDisplay, ct as includes, d as DateAdapterSymbol, f as DateOptionsSymbol, g as useDate, mt as mergeDeep, n as ThemeSymbol, o as useTheme, p as createDate, r as createTheme, s as DisplaySymbol, u as useDisplay, ut as isObject, v as createLocale, y as useLocale, yt as refElement } from "./resizeObserver-DXFuuv3h.js";
//#region node_modules/vuetify/lib/iconsets/mdi.js
var aliases = {
collapse: "mdi-chevron-up",
complete: "mdi-check",
cancel: "mdi-close-circle",
close: "mdi-close",
delete: "mdi-close-circle",
clear: "mdi-close-circle",
success: "mdi-check-circle",
info: "mdi-information",
warning: "mdi-alert-circle",
error: "mdi-close-circle",
prev: "mdi-chevron-left",
next: "mdi-chevron-right",
checkboxOn: "mdi-checkbox-marked",
checkboxOff: "mdi-checkbox-blank-outline",
checkboxIndeterminate: "mdi-minus-box",
delimiter: "mdi-circle",
sortAsc: "mdi-arrow-up",
sortDesc: "mdi-arrow-down",
expand: "mdi-chevron-down",
menu: "mdi-menu",
subgroup: "mdi-menu-down",
dropdown: "mdi-menu-down",
radioOn: "mdi-radiobox-marked",
radioOff: "mdi-radiobox-blank",
edit: "mdi-pencil",
ratingEmpty: "mdi-star-outline",
ratingFull: "mdi-star",
ratingHalf: "mdi-star-half-full",
loading: "mdi-cached",
first: "mdi-page-first",
last: "mdi-page-last",
unfold: "mdi-unfold-more-horizontal",
file: "mdi-paperclip",
plus: "mdi-plus",
minus: "mdi-minus",
calendar: "mdi-calendar",
treeviewCollapse: "mdi-menu-down",
treeviewExpand: "mdi-menu-right",
tableGroupCollapse: "mdi-chevron-down",
tableGroupExpand: "mdi-chevron-right",
eyeDropper: "mdi-eyedropper",
upload: "mdi-cloud-upload",
color: "mdi-palette",
command: "mdi-apple-keyboard-command",
ctrl: "mdi-apple-keyboard-control",
space: "mdi-keyboard-space",
shift: "mdi-apple-keyboard-shift",
alt: "mdi-apple-keyboard-option",
enter: "mdi-keyboard-return",
arrowup: "mdi-arrow-up",
arrowdown: "mdi-arrow-down",
arrowleft: "mdi-arrow-left",
arrowright: "mdi-arrow-right",
backspace: "mdi-backspace",
play: "mdi-play",
pause: "mdi-pause",
fullscreen: "mdi-fullscreen",
fullscreenExit: "mdi-fullscreen-exit",
volumeHigh: "mdi-volume-high",
volumeMedium: "mdi-volume-medium",
volumeLow: "mdi-volume-low",
volumeOff: "mdi-volume-variant-off",
search: "mdi-magnify"
};
var mdi = { component: (props) => h(VClassIcon, {
...props,
class: "mdi"
}) };
//#endregion
//#region node_modules/vuetify/lib/icons.js
function genDefaults$1() {
return {
svg: { component: VSvgIcon },
class: { component: VClassIcon }
};
}
function createIcons(options) {
const sets = genDefaults$1();
const defaultSet = options?.defaultSet ?? "mdi";
if (defaultSet === "mdi" && !sets.mdi) sets.mdi = mdi;
return mergeDeep({
defaultSet,
sets,
aliases: {
...aliases,
vuetify: ["M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z", ["M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z", .6]],
"vuetify-outline": "svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z",
"vuetify-play": ["m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z", ["M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z", .6]]
}
}, options);
}
//#endregion
//#region node_modules/vuetify/lib/composables/goto.js
var GoToSymbol = Symbol.for("vuetify:goto");
function genDefaults() {
return {
container: void 0,
duration: 300,
layout: false,
offset: 0,
easing: "easeInOutCubic",
patterns: easingPatterns
};
}
function getContainer(el) {
return getTarget(el) ?? (document.scrollingElement || document.body);
}
function getTarget(el) {
return typeof el === "string" ? document.querySelector(el) : refElement(el);
}
function getOffset(target, horizontal, rtl) {
if (typeof target === "number") return horizontal && rtl ? -target : target;
let el = getTarget(target);
let totalOffset = 0;
while (el) {
totalOffset += horizontal ? el.offsetLeft : el.offsetTop;
el = el.offsetParent;
}
return totalOffset;
}
function createGoTo(options, locale) {
return {
rtl: locale.isRtl,
options: mergeDeep(genDefaults(), options)
};
}
async function scrollTo(_target, _options, horizontal, goTo) {
const property = horizontal ? "scrollLeft" : "scrollTop";
const options = mergeDeep(goTo?.options ?? genDefaults(), _options);
const rtl = goTo?.rtl.value;
const target = (typeof _target === "number" ? _target : getTarget(_target)) ?? 0;
const container = options.container === "parent" && target instanceof HTMLElement ? target.parentElement : getContainer(options.container);
const ease = PREFERS_REDUCED_MOTION() ? options.patterns.instant : typeof options.easing === "function" ? options.easing : options.patterns[options.easing];
if (!ease) throw new TypeError(`Easing function "${options.easing}" not found.`);
let targetLocation;
if (typeof target === "number") targetLocation = getOffset(target, horizontal, rtl);
else {
targetLocation = getOffset(target, horizontal, rtl) - getOffset(container, horizontal, rtl);
if (options.layout) {
const layoutOffset = window.getComputedStyle(target).getPropertyValue("--v-layout-top");
if (layoutOffset) targetLocation -= parseInt(layoutOffset, 10);
}
}
targetLocation += options.offset;
targetLocation = clampTarget(container, targetLocation, !!rtl, !!horizontal);
const startLocation = container[property] ?? 0;
if (targetLocation === startLocation) return Promise.resolve(targetLocation);
const startTime = performance.now();
return new Promise((resolve) => requestAnimationFrame(function step(currentTime) {
const progress = (currentTime - startTime) / options.duration;
const location = Math.floor(startLocation + (targetLocation - startLocation) * ease(clamp(progress, 0, 1)));
container[property] = location;
if (progress >= 1 && Math.abs(location - container[property]) < 10) return resolve(targetLocation);
else if (progress > 2) {
consoleWarn("Scroll target is not reachable");
return resolve(container[property]);
}
requestAnimationFrame(step);
}));
}
function useGoTo(_options = {}) {
const goToInstance = inject$1(GoToSymbol);
const { isRtl } = useRtl();
if (!goToInstance) throw new Error("[Vuetify] Could not find injected goto instance");
const goTo = {
...goToInstance,
rtl: toRef(() => goToInstance.rtl.value || isRtl.value)
};
async function go(target, options) {
return scrollTo(target, mergeDeep(_options, options), false, goTo);
}
go.horizontal = async (target, options) => {
return scrollTo(target, mergeDeep(_options, options), true, goTo);
};
return go;
}
/**
* Clamp target value to achieve a smooth scroll animation
* when the value goes outside the scroll container size
*/
function clampTarget(container, value, rtl, horizontal) {
const { scrollWidth, scrollHeight } = container;
const [containerWidth, containerHeight] = container === document.scrollingElement ? [window.innerWidth, window.innerHeight] : [container.offsetWidth, container.offsetHeight];
let min;
let max;
if (horizontal) if (rtl) {
min = -(scrollWidth - containerWidth);
max = 0;
} else {
min = 0;
max = scrollWidth - containerWidth;
}
else {
min = 0;
max = scrollHeight + -containerHeight;
}
return clamp(value, min, max);
}
//#endregion
//#region node_modules/vuetify/lib/composables/layout.js
var VuetifyLayoutKey = Symbol.for("vuetify:layout");
propsFactory({
overlaps: {
type: Array,
default: () => []
},
fullHeight: Boolean
}, "layout");
propsFactory({
name: { type: String },
order: {
type: [Number, String],
default: 0
},
absolute: Boolean
}, "layout-item");
function useLayout() {
const layout = inject$1(VuetifyLayoutKey);
if (!layout) throw new Error("[Vuetify] Could not find injected layout");
return {
getLayoutItem: layout.getLayoutItem,
mainRect: layout.mainRect,
mainStyles: layout.mainStyles
};
}
//#endregion
//#region node_modules/vuetify/lib/composables/hotkey/key-aliases.js
/**
* Centralized key alias mapping for consistent key normalization across the hotkey system.
@@ -384,100 +605,6 @@ function useMask(props) {
};
}
//#endregion
//#region node_modules/vuetify/lib/iconsets/mdi.js
var aliases = {
collapse: "mdi-chevron-up",
complete: "mdi-check",
cancel: "mdi-close-circle",
close: "mdi-close",
delete: "mdi-close-circle",
clear: "mdi-close-circle",
success: "mdi-check-circle",
info: "mdi-information",
warning: "mdi-alert-circle",
error: "mdi-close-circle",
prev: "mdi-chevron-left",
next: "mdi-chevron-right",
checkboxOn: "mdi-checkbox-marked",
checkboxOff: "mdi-checkbox-blank-outline",
checkboxIndeterminate: "mdi-minus-box",
delimiter: "mdi-circle",
sortAsc: "mdi-arrow-up",
sortDesc: "mdi-arrow-down",
expand: "mdi-chevron-down",
menu: "mdi-menu",
subgroup: "mdi-menu-down",
dropdown: "mdi-menu-down",
radioOn: "mdi-radiobox-marked",
radioOff: "mdi-radiobox-blank",
edit: "mdi-pencil",
ratingEmpty: "mdi-star-outline",
ratingFull: "mdi-star",
ratingHalf: "mdi-star-half-full",
loading: "mdi-cached",
first: "mdi-page-first",
last: "mdi-page-last",
unfold: "mdi-unfold-more-horizontal",
file: "mdi-paperclip",
plus: "mdi-plus",
minus: "mdi-minus",
calendar: "mdi-calendar",
treeviewCollapse: "mdi-menu-down",
treeviewExpand: "mdi-menu-right",
tableGroupCollapse: "mdi-chevron-down",
tableGroupExpand: "mdi-chevron-right",
eyeDropper: "mdi-eyedropper",
upload: "mdi-cloud-upload",
color: "mdi-palette",
command: "mdi-apple-keyboard-command",
ctrl: "mdi-apple-keyboard-control",
space: "mdi-keyboard-space",
shift: "mdi-apple-keyboard-shift",
alt: "mdi-apple-keyboard-option",
enter: "mdi-keyboard-return",
arrowup: "mdi-arrow-up",
arrowdown: "mdi-arrow-down",
arrowleft: "mdi-arrow-left",
arrowright: "mdi-arrow-right",
backspace: "mdi-backspace",
play: "mdi-play",
pause: "mdi-pause",
fullscreen: "mdi-fullscreen",
fullscreenExit: "mdi-fullscreen-exit",
volumeHigh: "mdi-volume-high",
volumeMedium: "mdi-volume-medium",
volumeLow: "mdi-volume-low",
volumeOff: "mdi-volume-variant-off",
search: "mdi-magnify"
};
var mdi = { component: (props) => h(VClassIcon, {
...props,
class: "mdi"
}) };
//#endregion
//#region node_modules/vuetify/lib/icons.js
function genDefaults() {
return {
svg: { component: VSvgIcon },
class: { component: VClassIcon }
};
}
function createIcons(options) {
const sets = genDefaults();
const defaultSet = options?.defaultSet ?? "mdi";
if (defaultSet === "mdi" && !sets.mdi) sets.mdi = mdi;
return mergeDeep({
defaultSet,
sets,
aliases: {
...aliases,
vuetify: ["M8.2241 14.2009L12 21L22 3H14.4459L8.2241 14.2009Z", ["M7.26303 12.4733L7.00113 12L2 3H12.5261C12.5261 3 12.5261 3 12.5261 3L7.26303 12.4733Z", .6]],
"vuetify-outline": "svg:M7.26 12.47 12.53 3H2L7.26 12.47ZM14.45 3 8.22 14.2 12 21 22 3H14.45ZM18.6 5 12 16.88 10.51 14.2 15.62 5ZM7.26 8.35 5.4 5H9.13L7.26 8.35Z",
"vuetify-play": ["m6.376 13.184-4.11-7.192C1.505 4.66 2.467 3 4.003 3h8.532l-.953 1.576-.006.01-.396.677c-.429.732-.214 1.507.194 2.015.404.503 1.092.878 1.869.806a3.72 3.72 0 0 1 1.005.022c.276.053.434.143.523.237.138.146.38.635-.25 2.09-.893 1.63-1.553 1.722-1.847 1.677-.213-.033-.468-.158-.756-.406a4.95 4.95 0 0 1-.8-.927c-.39-.564-1.04-.84-1.66-.846-.625-.006-1.316.27-1.693.921l-.478.826-.911 1.506Z", ["M9.093 11.552c.046-.079.144-.15.32-.148a.53.53 0 0 1 .43.207c.285.414.636.847 1.046 1.2.405.35.914.662 1.516.754 1.334.205 2.502-.698 3.48-2.495l.014-.028.013-.03c.687-1.574.774-2.852-.005-3.675-.37-.391-.861-.586-1.333-.676a5.243 5.243 0 0 0-1.447-.044c-.173.016-.393-.073-.54-.257-.145-.18-.127-.316-.082-.392l.393-.672L14.287 3h5.71c1.536 0 2.499 1.659 1.737 2.992l-7.997 13.996c-.768 1.344-2.706 1.344-3.473 0l-3.037-5.314 1.377-2.278.004-.006.004-.007.481-.831Z", .6]]
}
}, options);
}
//#endregion
//#region node_modules/vuetify/lib/framework.js
function createVuetify(vuetify = {}) {
const { blueprint, ...rest } = vuetify;
@@ -552,7 +679,7 @@ function createVuetify(vuetify = {}) {
};
});
}
var version = "4.0.6";
var version = "4.0.7";
createVuetify.version = version;
function inject(key) {
const vm = this.$;
+1 -1
View File
File diff suppressed because one or more lines are too long
-46
View File
@@ -1,46 +0,0 @@
import { W as createBaseVNode, ar as normalizeClass, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { q as omit, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { i as provideTheme, r as makeThemeProps } from "./theme-C1b955Ym.js";
import { i as useRtl } from "./locale-DTRSr4yu.js";
import { i as makeLayoutProps, n as createLayout } from "./layout-DcSzssSI.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VApp/VApp.css";
//#region node_modules/vuetify/lib/components/VApp/VApp.js
var makeVAppProps = propsFactory({
...makeComponentProps(),
...omit(makeLayoutProps(), ["fullHeight"]),
...makeThemeProps()
}, "VApp");
var VApp = genericComponent()({
name: "VApp",
props: makeVAppProps(),
setup(props, { slots }) {
const theme = provideTheme(props);
const { layoutClasses, getLayoutItem, items, layoutRef } = createLayout({
...props,
fullHeight: true
});
const { rtlClasses } = useRtl();
useRender(() => createBaseVNode("div", {
"ref": layoutRef,
"class": normalizeClass([
"v-application",
theme.themeClasses.value,
layoutClasses.value,
rtlClasses.value,
props.class
]),
"style": normalizeStyle([props.style])
}, [createBaseVNode("div", { "class": "v-application__wrap" }, [slots.default?.()])]));
return {
getLayoutItem,
items,
theme
};
}
});
//#endregion
export { VApp };
//# sourceMappingURL=vuetify_components_VApp.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"vuetify_components_VApp.js","names":["_createElementVNode","_normalizeClass","_normalizeStyle"],"sources":["../../vuetify/lib/components/VApp/VApp.js"],"sourcesContent":["import { createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle } from \"vue\";\n// Styles\nimport \"./VApp.css\";\n\n// Composables\nimport { makeComponentProps } from \"../../composables/component.js\";\nimport { createLayout, makeLayoutProps } from \"../../composables/layout.js\";\nimport { useRtl } from \"../../composables/locale.js\";\nimport { makeThemeProps, provideTheme } from \"../../composables/theme.js\"; // Utilities\nimport { genericComponent, omit, propsFactory, useRender } from \"../../util/index.js\";\nexport const makeVAppProps = propsFactory({\n ...makeComponentProps(),\n ...omit(makeLayoutProps(), ['fullHeight']),\n ...makeThemeProps()\n}, 'VApp');\nexport const VApp = genericComponent()({\n name: 'VApp',\n props: makeVAppProps(),\n setup(props, {\n slots\n }) {\n const theme = provideTheme(props);\n const {\n layoutClasses,\n getLayoutItem,\n items,\n layoutRef\n } = createLayout({\n ...props,\n fullHeight: true\n });\n const {\n rtlClasses\n } = useRtl();\n useRender(() => _createElementVNode(\"div\", {\n \"ref\": layoutRef,\n \"class\": _normalizeClass(['v-application', theme.themeClasses.value, layoutClasses.value, rtlClasses.value, props.class]),\n \"style\": _normalizeStyle([props.style])\n }, [_createElementVNode(\"div\", {\n \"class\": \"v-application__wrap\"\n }, [slots.default?.()])]));\n return {\n getLayoutItem,\n items,\n theme\n };\n }\n});\n//# sourceMappingURL=VApp.js.map"],"mappings":";;;;;;;;;AAUA,IAAa,gBAAgB,aAAa;CACxC,GAAG,oBAAoB;CACvB,GAAG,KAAK,iBAAiB,EAAE,CAAC,aAAa,CAAC;CAC1C,GAAG,gBAAgB;CACpB,EAAE,OAAO;AACV,IAAa,OAAO,kBAAkB,CAAC;CACrC,MAAM;CACN,OAAO,eAAe;CACtB,MAAM,OAAO,EACX,SACC;EACD,MAAM,QAAQ,aAAa,MAAM;EACjC,MAAM,EACJ,eACA,eACA,OACA,cACE,aAAa;GACf,GAAG;GACH,YAAY;GACb,CAAC;EACF,MAAM,EACJ,eACE,QAAQ;AACZ,kBAAgBA,gBAAoB,OAAO;GACzC,OAAO;GACP,SAASC,eAAgB;IAAC;IAAiB,MAAM,aAAa;IAAO,cAAc;IAAO,WAAW;IAAO,MAAM;IAAM,CAAC;GACzH,SAASC,eAAgB,CAAC,MAAM,MAAM,CAAC;GACxC,EAAE,CAACF,gBAAoB,OAAO,EAC7B,SAAS,uBACV,EAAE,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1B,SAAO;GACL;GACA;GACA;GACD;;CAEJ,CAAC"}
-259
View File
@@ -1,259 +0,0 @@
import { Dt as mergeProps, Ft as onMounted, Kn as ref, Qn as toRef, U as computed, Yn as shallowRef, _n as watchEffect, et as createVNode, gn as watch, jt as onBeforeUnmount } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { _ as clamp, lt as consoleWarn, q as omit, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { n as useToggleScope, t as useProxiedModel } from "./proxiedModel-BOZtsMxA.js";
import { o as useLayoutItem, r as makeLayoutItemProps } from "./layout-DcSzssSI.js";
import { t as useSsrBoot } from "./ssrBoot-Dt2Wz9ZC.js";
import { i as makeVToolbarTitleProps, n as makeVToolbarProps, r as VToolbarTitle, t as VToolbar } from "./VToolbar-DAPb7QHO.js";
import { n as makeVBtnProps, t as VBtn } from "./VBtn-Bm4dgaEe.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VAppBar/VAppBar.css";
//#region node_modules/vuetify/lib/composables/scroll.js
var makeScrollProps = propsFactory({
scrollTarget: { type: String },
scrollThreshold: {
type: [String, Number],
default: 300
}
}, "scroll");
function useScroll(props, args = {}) {
const { canScroll, layoutSize } = args;
let previousScroll = 0;
let previousScrollHeight = 0;
const target = ref(null);
const currentScroll = shallowRef(0);
const savedScroll = shallowRef(0);
const currentThreshold = shallowRef(0);
const isScrollActive = shallowRef(false);
const isScrollingUp = shallowRef(false);
const isAtBottom = shallowRef(false);
const reachedBottomWhileScrollingDown = shallowRef(false);
const hasEnoughScrollableSpace = shallowRef(true);
const scrollThreshold = computed(() => {
return Number(props.scrollThreshold);
});
/**
* 1: at top
* 0: at threshold
*/
const scrollRatio = computed(() => {
return clamp((scrollThreshold.value - currentScroll.value) / scrollThreshold.value || 0);
});
function getScrollMetrics(targetEl) {
return {
clientHeight: "window" in targetEl ? window.innerHeight : targetEl.clientHeight,
scrollHeight: "window" in targetEl ? document.documentElement.scrollHeight : targetEl.scrollHeight
};
}
function checkScrollableSpace() {
const targetEl = target.value;
if (!targetEl) return;
const { clientHeight, scrollHeight } = getScrollMetrics(targetEl);
const maxScrollableDistance = scrollHeight - clientHeight;
const elementHeight = layoutSize?.value || 0;
hasEnoughScrollableSpace.value = maxScrollableDistance > scrollThreshold.value + elementHeight;
}
function onResize() {
checkScrollableSpace();
}
function onScroll() {
const targetEl = target.value;
if (!targetEl || canScroll && !canScroll.value) return;
previousScroll = currentScroll.value;
currentScroll.value = "window" in targetEl ? targetEl.pageYOffset : targetEl.scrollTop;
const currentScrollHeight = targetEl instanceof Window ? document.documentElement.scrollHeight : targetEl.scrollHeight;
if (previousScrollHeight !== currentScrollHeight) {
if (currentScrollHeight > previousScrollHeight) checkScrollableSpace();
previousScrollHeight = currentScrollHeight;
}
isScrollingUp.value = currentScroll.value < previousScroll;
currentThreshold.value = Math.abs(currentScroll.value - scrollThreshold.value);
const { clientHeight, scrollHeight } = getScrollMetrics(targetEl);
const atBottom = currentScroll.value + clientHeight >= scrollHeight - 5;
if (!isScrollingUp.value && atBottom && currentScroll.value >= scrollThreshold.value && hasEnoughScrollableSpace.value) reachedBottomWhileScrollingDown.value = true;
const scrollJumped = Math.abs(currentScroll.value - previousScroll) > 100;
const atTop = currentScroll.value <= 5;
if (isScrollingUp.value && previousScroll - currentScroll.value > 1 && !atBottom || scrollJumped && currentScroll.value < scrollThreshold.value || atTop) reachedBottomWhileScrollingDown.value = false;
isAtBottom.value = atBottom;
}
watch(isScrollingUp, () => {
savedScroll.value = savedScroll.value || currentScroll.value;
});
watch(isScrollActive, () => {
savedScroll.value = 0;
});
onMounted(() => {
watch(() => props.scrollTarget, (scrollTarget) => {
const newTarget = scrollTarget ? document.querySelector(scrollTarget) : window;
if (!newTarget) {
consoleWarn(`Unable to locate element with identifier ${scrollTarget}`);
return;
}
if (newTarget === target.value) return;
target.value?.removeEventListener("scroll", onScroll);
target.value = newTarget;
target.value.addEventListener("scroll", onScroll, { passive: true });
Promise.resolve().then(() => {
checkScrollableSpace();
});
}, { immediate: true });
window.addEventListener("resize", onResize, { passive: true });
});
onBeforeUnmount(() => {
target.value?.removeEventListener("scroll", onScroll);
window.removeEventListener("resize", onResize);
});
canScroll && watch(canScroll, onScroll, { immediate: true });
return {
scrollThreshold,
currentScroll,
currentThreshold,
isScrollActive,
scrollRatio,
isScrollingUp,
savedScroll,
isAtBottom,
reachedBottomWhileScrollingDown,
hasEnoughScrollableSpace
};
}
//#endregion
//#region node_modules/vuetify/lib/components/VAppBar/VAppBar.js
var makeVAppBarProps = propsFactory({
scrollBehavior: String,
modelValue: {
type: Boolean,
default: true
},
location: {
type: String,
default: "top",
validator: (value) => ["top", "bottom"].includes(value)
},
...omit(makeVToolbarProps(), ["location"]),
...makeLayoutItemProps(),
...makeScrollProps(),
height: {
type: [Number, String],
default: 64
}
}, "VAppBar");
var VAppBar = genericComponent()({
name: "VAppBar",
props: makeVAppBarProps(),
emits: { "update:modelValue": (value) => true },
setup(props, { slots }) {
const vToolbarRef = ref();
const isActive = useProxiedModel(props, "modelValue");
const scrollBehavior = computed(() => {
const behavior = new Set(props.scrollBehavior?.split(" ") ?? []);
return {
hide: behavior.has("hide"),
fullyHide: behavior.has("fully-hide"),
inverted: behavior.has("inverted"),
collapse: behavior.has("collapse"),
elevate: behavior.has("elevate"),
fadeImage: behavior.has("fade-image")
};
});
const { currentScroll, scrollThreshold, isScrollingUp, scrollRatio, isAtBottom, reachedBottomWhileScrollingDown, hasEnoughScrollableSpace } = useScroll(props, {
canScroll: computed(() => {
const behavior = scrollBehavior.value;
return behavior.hide || behavior.fullyHide || behavior.inverted || behavior.collapse || behavior.elevate || behavior.fadeImage || !isActive.value;
}),
layoutSize: computed(() => {
return (vToolbarRef.value?.contentHeight ?? 0) + (vToolbarRef.value?.extensionHeight ?? 0);
})
});
const canHide = toRef(() => scrollBehavior.value.hide || scrollBehavior.value.fullyHide);
const isCollapsed = computed(() => props.collapse || scrollBehavior.value.collapse && (scrollBehavior.value.inverted ? scrollRatio.value > 0 : scrollRatio.value === 0));
const isFlat = computed(() => props.flat || scrollBehavior.value.fullyHide && !isActive.value || scrollBehavior.value.elevate && (scrollBehavior.value.inverted ? currentScroll.value > 0 : currentScroll.value === 0));
const opacity = computed(() => scrollBehavior.value.fadeImage ? scrollBehavior.value.inverted ? 1 - scrollRatio.value : scrollRatio.value : void 0);
const height = computed(() => {
if (scrollBehavior.value.hide && scrollBehavior.value.inverted) return 0;
const height = vToolbarRef.value?.contentHeight ?? 0;
const extensionHeight = vToolbarRef.value?.extensionHeight ?? 0;
if (!canHide.value) return height + extensionHeight;
return currentScroll.value < scrollThreshold.value || scrollBehavior.value.fullyHide ? height + extensionHeight : height;
});
useToggleScope(() => !!props.scrollBehavior, () => {
watchEffect(() => {
if (!canHide.value) {
isActive.value = true;
return;
}
if (scrollBehavior.value.inverted) {
isActive.value = currentScroll.value > scrollThreshold.value;
return;
}
if (!hasEnoughScrollableSpace.value) {
isActive.value = true;
return;
}
if (reachedBottomWhileScrollingDown.value) {
isActive.value = false;
return;
}
isActive.value = isScrollingUp.value && !isAtBottom.value || currentScroll.value < scrollThreshold.value;
});
});
const { ssrBootStyles } = useSsrBoot();
const { layoutItemStyles } = useLayoutItem({
id: props.name,
order: computed(() => parseInt(props.order, 10)),
position: toRef(() => props.location),
layoutSize: height,
elementSize: shallowRef(void 0),
active: isActive,
absolute: toRef(() => props.absolute)
});
useRender(() => {
const toolbarProps = omit(VToolbar.filterProps(props), ["location"]);
return createVNode(VToolbar, mergeProps({
"ref": vToolbarRef,
"class": [
"v-app-bar",
{ "v-app-bar--bottom": props.location === "bottom" },
props.class
],
"style": [{
...layoutItemStyles.value,
"--v-toolbar-image-opacity": opacity.value,
height: void 0,
...ssrBootStyles.value
}, props.style]
}, toolbarProps, {
"collapse": isCollapsed.value,
"flat": isFlat.value
}), slots);
});
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VAppBar/VAppBarNavIcon.js
var makeVAppBarNavIconProps = propsFactory({ ...omit(makeVBtnProps({
icon: "$menu",
variant: "text"
}), ["spaced"]) }, "VAppBarNavIcon");
var VAppBarNavIcon = genericComponent()({
name: "VAppBarNavIcon",
props: makeVAppBarNavIconProps(),
setup(props, { slots }) {
useRender(() => createVNode(VBtn, mergeProps(props, { "class": ["v-app-bar-nav-icon"] }), slots));
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VAppBar/VAppBarTitle.js
var VAppBarTitle = genericComponent()({
name: "VAppBarTitle",
props: makeVToolbarTitleProps(),
setup(props, { slots }) {
useRender(() => createVNode(VToolbarTitle, mergeProps(props, { "class": "v-app-bar-title" }), slots));
return {};
}
});
//#endregion
export { VAppBar, VAppBarNavIcon, VAppBarTitle };
//# sourceMappingURL=vuetify_components_VAppBar.js.map
File diff suppressed because one or more lines are too long
-2
View File
@@ -1,2 +0,0 @@
import { t as VAvatar } from "./VAvatar-BHEBKXii.js";
export { VAvatar };
-2
View File
@@ -1,2 +0,0 @@
import { t as VBtn } from "./VBtn-Bm4dgaEe.js";
export { VBtn };
-352
View File
@@ -1,352 +0,0 @@
import { Cn as withDirectives, Dt as mergeProps, M as Fragment, W as createBaseVNode, Yn as shallowRef, ar as normalizeClass, cr as toDisplayString, et as createVNode, gn as watch, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { o as provideDefaults, r as genericComponent, u as propsFactory, v as convertToUnit } from "./defineComponent-D5UWd5Vb.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { t as createSimpleFunctional } from "./createSimpleFunctional-DYAlCmHj.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { n as IconValue } from "./icons-czM1t0u4.js";
import { t as VIcon } from "./VIcon-DqvHH35X.js";
import { t as makeTagProps } from "./tag-CIFqtlp2.js";
import { i as provideTheme, r as makeThemeProps } from "./theme-C1b955Ym.js";
import { n as useDimension, t as makeDimensionProps } from "./dimensions-DYqEoPdw.js";
import { n as useLocation, t as makeLocationProps } from "./location-DD-AfEFw.js";
import { n as useRounded, t as makeRoundedProps } from "./rounded-m6mNMWh4.js";
import { t as VDefaultsProvider } from "./VDefaultsProvider-C3Dl0By9.js";
import { t as VImg } from "./VImg-D29ak-Ji.js";
import { n as useBorder, t as makeBorderProps } from "./border-DgwbzrV0.js";
import { n as useDensity, t as makeDensityProps } from "./density-Dey2iIaF.js";
import { n as makeVariantProps, r as useVariant, t as genOverlays } from "./variant-BcdnKFgE.js";
import { t as VAvatar } from "./VAvatar-BHEBKXii.js";
import { r as useLink, t as makeRouterProps } from "./router-CiYG9tKT.js";
import { n as useElevation, t as makeElevationProps } from "./elevation-DF9Lgrr_.js";
import { t as Ripple } from "./ripple-Q8q1hNUv.js";
import { n as makeLoaderProps, r as useLoader, t as LoaderSlot } from "./loader-Dn_UJdiG.js";
import { n as usePosition, t as makePositionProps } from "./position-7CDSPI1P.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VCard/VCard.css";
//#region node_modules/vuetify/lib/components/VCard/VCardActions.js
var makeVCardActionsProps = propsFactory({
...makeComponentProps(),
...makeTagProps()
}, "VCardActions");
var VCardActions = genericComponent()({
name: "VCardActions",
props: makeVCardActionsProps(),
setup(props, { slots }) {
provideDefaults({ VBtn: {
slim: true,
variant: "text"
} });
useRender(() => createVNode(props.tag, {
"class": normalizeClass(["v-card-actions", props.class]),
"style": normalizeStyle(props.style)
}, slots));
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VCard/VCardSubtitle.js
var makeVCardSubtitleProps = propsFactory({
opacity: [Number, String],
...makeComponentProps(),
...makeTagProps()
}, "VCardSubtitle");
var VCardSubtitle = genericComponent()({
name: "VCardSubtitle",
props: makeVCardSubtitleProps(),
setup(props, { slots }) {
useRender(() => createVNode(props.tag, {
"class": normalizeClass(["v-card-subtitle", props.class]),
"style": normalizeStyle([{ "--v-card-subtitle-opacity": props.opacity }, props.style])
}, slots));
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VCard/VCardTitle.js
var VCardTitle = createSimpleFunctional("v-card-title");
//#endregion
//#region node_modules/vuetify/lib/components/VCard/VCardItem.js
var makeCardItemProps = propsFactory({
appendAvatar: String,
appendIcon: IconValue,
prependAvatar: String,
prependIcon: IconValue,
subtitle: {
type: [
String,
Number,
Boolean
],
default: void 0
},
title: {
type: [
String,
Number,
Boolean
],
default: void 0
},
...makeComponentProps(),
...makeDensityProps(),
...makeTagProps()
}, "VCardItem");
var VCardItem = genericComponent()({
name: "VCardItem",
props: makeCardItemProps(),
setup(props, { slots }) {
useRender(() => {
const hasPrependMedia = !!(props.prependAvatar || props.prependIcon);
const hasPrepend = !!(hasPrependMedia || slots.prepend);
const hasAppendMedia = !!(props.appendAvatar || props.appendIcon);
const hasAppend = !!(hasAppendMedia || slots.append);
const hasTitle = !!(props.title != null || slots.title);
const hasSubtitle = !!(props.subtitle != null || slots.subtitle);
return createVNode(props.tag, {
"class": normalizeClass(["v-card-item", props.class]),
"style": normalizeStyle(props.style)
}, { default: () => [
hasPrepend && createBaseVNode("div", {
"key": "prepend",
"class": "v-card-item__prepend"
}, [!slots.prepend ? createBaseVNode(Fragment, null, [props.prependAvatar && createVNode(VAvatar, {
"key": "prepend-avatar",
"density": props.density,
"image": props.prependAvatar
}, null), props.prependIcon && createVNode(VIcon, {
"key": "prepend-icon",
"density": props.density,
"icon": props.prependIcon
}, null)]) : createVNode(VDefaultsProvider, {
"key": "prepend-defaults",
"disabled": !hasPrependMedia,
"defaults": {
VAvatar: {
density: props.density,
image: props.prependAvatar
},
VIcon: {
density: props.density,
icon: props.prependIcon
}
}
}, slots.prepend)]),
createBaseVNode("div", { "class": "v-card-item__content" }, [
hasTitle && createVNode(VCardTitle, { "key": "title" }, { default: () => [slots.title?.() ?? toDisplayString(props.title)] }),
hasSubtitle && createVNode(VCardSubtitle, { "key": "subtitle" }, { default: () => [slots.subtitle?.() ?? toDisplayString(props.subtitle)] }),
slots.default?.()
]),
hasAppend && createBaseVNode("div", {
"key": "append",
"class": "v-card-item__append"
}, [!slots.append ? createBaseVNode(Fragment, null, [props.appendIcon && createVNode(VIcon, {
"key": "append-icon",
"density": props.density,
"icon": props.appendIcon
}, null), props.appendAvatar && createVNode(VAvatar, {
"key": "append-avatar",
"density": props.density,
"image": props.appendAvatar
}, null)]) : createVNode(VDefaultsProvider, {
"key": "append-defaults",
"disabled": !hasAppendMedia,
"defaults": {
VAvatar: {
density: props.density,
image: props.appendAvatar
},
VIcon: {
density: props.density,
icon: props.appendIcon
}
}
}, slots.append)])
] });
});
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VCard/VCardText.js
var makeVCardTextProps = propsFactory({
opacity: [Number, String],
...makeComponentProps(),
...makeTagProps()
}, "VCardText");
var VCardText = genericComponent()({
name: "VCardText",
props: makeVCardTextProps(),
setup(props, { slots }) {
useRender(() => createVNode(props.tag, {
"class": normalizeClass(["v-card-text", props.class]),
"style": normalizeStyle([{ "--v-card-text-opacity": props.opacity }, props.style])
}, slots));
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VCard/VCard.js
var makeVCardProps = propsFactory({
appendAvatar: String,
appendIcon: IconValue,
disabled: Boolean,
flat: Boolean,
hover: Boolean,
image: String,
link: {
type: Boolean,
default: void 0
},
prependAvatar: String,
prependIcon: IconValue,
ripple: {
type: [Boolean, Object],
default: true
},
subtitle: {
type: [
String,
Number,
Boolean
],
default: void 0
},
text: {
type: [
String,
Number,
Boolean
],
default: void 0
},
title: {
type: [
String,
Number,
Boolean
],
default: void 0
},
...makeBorderProps(),
...makeComponentProps(),
...makeDensityProps(),
...makeDimensionProps(),
...makeElevationProps(),
...makeLoaderProps(),
...makeLocationProps(),
...makePositionProps(),
...makeRoundedProps(),
...makeRouterProps(),
...makeTagProps(),
...makeThemeProps(),
...makeVariantProps({ variant: "elevated" })
}, "VCard");
var VCard = genericComponent()({
name: "VCard",
directives: { vRipple: Ripple },
props: makeVCardProps(),
setup(props, { attrs, slots }) {
const { themeClasses } = provideTheme(props);
const { borderClasses } = useBorder(props);
const { colorClasses, colorStyles, variantClasses } = useVariant(props);
const { densityClasses } = useDensity(props);
const { dimensionStyles } = useDimension(props);
const { elevationClasses } = useElevation(props);
const { loaderClasses } = useLoader(props);
const { locationStyles } = useLocation(props);
const { positionClasses } = usePosition(props);
const { roundedClasses } = useRounded(props);
const link = useLink(props, attrs);
const loadingColor = shallowRef(void 0);
watch(() => props.loading, (val, old) => {
loadingColor.value = !val && typeof old === "string" ? old : typeof val === "boolean" ? void 0 : val;
}, { immediate: true });
useRender(() => {
const isLink = props.link !== false && link.isLink.value;
const isClickable = !props.disabled && props.link !== false && (props.link || link.isClickable.value);
const Tag = isLink ? "a" : props.tag;
const hasTitle = !!(slots.title || props.title != null);
const hasSubtitle = !!(slots.subtitle || props.subtitle != null);
const hasHeader = hasTitle || hasSubtitle;
const hasAppend = !!(slots.append || props.appendAvatar || props.appendIcon);
const hasPrepend = !!(slots.prepend || props.prependAvatar || props.prependIcon);
const hasImage = !!(slots.image || props.image);
const hasCardItem = hasHeader || hasPrepend || hasAppend;
const hasText = !!(slots.text || props.text != null);
return withDirectives(createVNode(Tag, mergeProps(link.linkProps, {
"class": [
"v-card",
{
"v-card--disabled": props.disabled,
"v-card--flat": props.flat,
"v-card--hover": props.hover && !(props.disabled || props.flat),
"v-card--link": isClickable
},
themeClasses.value,
borderClasses.value,
colorClasses.value,
densityClasses.value,
elevationClasses.value,
loaderClasses.value,
positionClasses.value,
roundedClasses.value,
variantClasses.value,
props.class
],
"style": [
colorStyles.value,
dimensionStyles.value,
locationStyles.value,
{ "--v-card-height": convertToUnit(props.height) },
props.style
],
"onClick": isClickable && link.navigate.value,
"tabindex": props.disabled ? -1 : void 0
}), { default: () => [
hasImage && createBaseVNode("div", {
"key": "image",
"class": "v-card__image"
}, [!slots.image ? createVNode(VImg, {
"key": "image-img",
"cover": true,
"src": props.image
}, null) : createVNode(VDefaultsProvider, {
"key": "image-defaults",
"disabled": !props.image,
"defaults": { VImg: {
cover: true,
src: props.image
} }
}, slots.image)]),
createVNode(LoaderSlot, {
"name": "v-card",
"active": !!props.loading,
"color": loadingColor.value
}, { default: slots.loader }),
hasCardItem && createVNode(VCardItem, {
"key": "item",
"prependAvatar": props.prependAvatar,
"prependIcon": props.prependIcon,
"title": props.title,
"subtitle": props.subtitle,
"appendAvatar": props.appendAvatar,
"appendIcon": props.appendIcon
}, {
default: slots.item,
prepend: slots.prepend,
title: slots.title,
subtitle: slots.subtitle,
append: slots.append
}),
hasText && createVNode(VCardText, { "key": "text" }, { default: () => [slots.text?.() ?? props.text] }),
slots.default?.(),
slots.actions && createVNode(VCardActions, null, { default: slots.actions }),
genOverlays(isClickable, "v-card")
] }), [[Ripple, isClickable && props.ripple]]);
});
return {};
}
});
//#endregion
export { VCard, VCardActions, VCardItem, VCardSubtitle, VCardText, VCardTitle };
//# sourceMappingURL=vuetify_components_VCard.js.map
File diff suppressed because one or more lines are too long
-8
View File
@@ -1,8 +0,0 @@
import { t as createSimpleFunctional } from "./createSimpleFunctional-DYAlCmHj.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VCode/VCode.css";
//#region node_modules/vuetify/lib/components/VCode/index.js
var VCode = createSimpleFunctional("v-code", "code");
//#endregion
export { VCode };
//# sourceMappingURL=vuetify_components_VCode.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"vuetify_components_VCode.js","names":[],"sources":["../../vuetify/lib/components/VCode/index.js"],"sourcesContent":["// Styles\nimport \"./VCode.css\";\n\n// Utilities\nimport { createSimpleFunctional } from \"../../util/index.js\";\nexport const VCode = createSimpleFunctional('v-code', 'code');\n//# sourceMappingURL=index.js.map"],"mappings":";;;AAKA,IAAa,QAAQ,uBAAuB,UAAU,OAAO"}
-88
View File
@@ -1,88 +0,0 @@
import { Dt as mergeProps, Kn as ref, Ot as nextTick, et as createVNode, gn as watch } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { q as omit, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { n as makeVOverlayProps, t as VOverlay } from "./VOverlay-BntBXXGT.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { t as useProxiedModel } from "./proxiedModel-BOZtsMxA.js";
import { t as VDefaultsProvider } from "./VDefaultsProvider-C3Dl0By9.js";
import { _ as VDialogTransition } from "./transitions-llwxsiay.js";
import { t as useScopeId } from "./scopeId-BbFYJclW.js";
import { t as forwardRefs } from "./forwardRefs-C50LZ3ti.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VDialog/VDialog.css";
//#region node_modules/vuetify/lib/components/VDialog/VDialog.js
var makeVDialogProps = propsFactory({
fullscreen: Boolean,
scrollable: Boolean,
...omit(makeVOverlayProps({
captureFocus: true,
origin: "center center",
scrollStrategy: "block",
transition: { component: VDialogTransition },
zIndex: 2400,
retainFocus: true
}), ["disableInitialFocus"])
}, "VDialog");
var VDialog = genericComponent()({
name: "VDialog",
props: makeVDialogProps(),
emits: {
"update:modelValue": (value) => true,
afterEnter: () => true,
afterLeave: () => true
},
setup(props, { emit, slots }) {
const isActive = useProxiedModel(props, "modelValue");
const { scopeId } = useScopeId();
const overlay = ref();
function onAfterEnter() {
emit("afterEnter");
if ((props.scrim || props.retainFocus) && overlay.value?.contentEl && !overlay.value.contentEl.contains(document.activeElement)) overlay.value.contentEl.focus({ preventScroll: true });
}
function onAfterLeave() {
emit("afterLeave");
}
watch(isActive, async (val) => {
if (!val) {
await nextTick();
overlay.value.activatorEl?.focus({ preventScroll: true });
}
});
useRender(() => {
const overlayProps = VOverlay.filterProps(props);
const activatorProps = mergeProps({ "aria-haspopup": "dialog" }, props.activatorProps);
const contentProps = mergeProps({ tabindex: -1 }, props.contentProps);
return createVNode(VOverlay, mergeProps({
"ref": overlay,
"class": [
"v-dialog",
{
"v-dialog--fullscreen": props.fullscreen,
"v-dialog--scrollable": props.scrollable
},
props.class
],
"style": props.style
}, overlayProps, {
"modelValue": isActive.value,
"onUpdate:modelValue": ($event) => isActive.value = $event,
"aria-modal": "true",
"activatorProps": activatorProps,
"contentProps": contentProps,
"height": !props.fullscreen ? props.height : void 0,
"width": !props.fullscreen ? props.width : void 0,
"maxHeight": !props.fullscreen ? props.maxHeight : void 0,
"maxWidth": !props.fullscreen ? props.maxWidth : void 0,
"role": "dialog",
"onAfterEnter": onAfterEnter,
"onAfterLeave": onAfterLeave
}, scopeId), {
activator: slots.activator,
default: (...args) => createVNode(VDefaultsProvider, { "root": "VDialog" }, { default: () => [slots.default?.(...args)] })
});
});
return forwardRefs({}, overlay);
}
});
//#endregion
export { VDialog };
//# sourceMappingURL=vuetify_components_VDialog.js.map
File diff suppressed because one or more lines are too long
-2
View File
@@ -1,2 +0,0 @@
import { t as VDivider } from "./VDivider-Bm22Quav.js";
export { VDivider };
-259
View File
@@ -1,259 +0,0 @@
import { C as vShow, Cn as withDirectives, Qn as toRef, U as computed, Ut as provide, W as createBaseVNode, ar as normalizeClass, et as createVNode, sr as normalizeStyle, xt as inject } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { Z as pick, o as provideDefaults, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { t as useBackgroundColor } from "./color-B0NTWdor.js";
import { n as IconValue } from "./icons-czM1t0u4.js";
import { t as VIcon } from "./VIcon-DqvHH35X.js";
import { t as makeTagProps } from "./tag-CIFqtlp2.js";
import { i as provideTheme, r as makeThemeProps } from "./theme-C1b955Ym.js";
import { n as useDimension, t as makeDimensionProps } from "./dimensions-DYqEoPdw.js";
import { n as useRounded, t as makeRoundedProps } from "./rounded-m6mNMWh4.js";
import { t as VDefaultsProvider } from "./VDefaultsProvider-C3Dl0By9.js";
import { i as VExpandTransition } from "./transitions-llwxsiay.js";
import { n as useLazy, t as makeLazyProps } from "./lazy-CSlNPYYk.js";
import { n as useElevation, t as makeElevationProps } from "./elevation-DF9Lgrr_.js";
import { t as Ripple } from "./ripple-Q8q1hNUv.js";
import { i as useGroupItem, n as makeGroupProps, r as useGroup, t as makeGroupItemProps } from "./group-sYL2sZpA.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VExpansionPanel/VExpansionPanel.css";
//#region node_modules/vuetify/lib/components/VExpansionPanel/shared.js
var VExpansionPanelSymbol = Symbol.for("vuetify:v-expansion-panel");
//#endregion
//#region node_modules/vuetify/lib/components/VExpansionPanel/VExpansionPanelText.js
var makeVExpansionPanelTextProps = propsFactory({
...makeComponentProps(),
...makeLazyProps()
}, "VExpansionPanelText");
var VExpansionPanelText = genericComponent()({
name: "VExpansionPanelText",
props: makeVExpansionPanelTextProps(),
setup(props, { slots }) {
const expansionPanel = inject(VExpansionPanelSymbol);
if (!expansionPanel) throw new Error("[Vuetify] v-expansion-panel-text needs to be placed inside v-expansion-panel");
const { hasContent, onAfterLeave } = useLazy(props, expansionPanel.isSelected);
useRender(() => createVNode(VExpandTransition, { "onAfterLeave": onAfterLeave }, { default: () => [withDirectives(createBaseVNode("div", {
"class": normalizeClass(["v-expansion-panel-text", props.class]),
"style": normalizeStyle(props.style)
}, [slots.default && hasContent.value && createBaseVNode("div", { "class": "v-expansion-panel-text__wrapper" }, [slots.default?.()])]), [[vShow, expansionPanel.isSelected.value]])] }));
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VExpansionPanel/VExpansionPanelTitle.js
var makeVExpansionPanelTitleProps = propsFactory({
color: String,
expandIcon: {
type: IconValue,
default: "$expand"
},
collapseIcon: {
type: IconValue,
default: "$collapse"
},
hideActions: Boolean,
focusable: Boolean,
static: Boolean,
ripple: {
type: [Boolean, Object],
default: false
},
readonly: Boolean,
...makeComponentProps(),
...makeDimensionProps()
}, "VExpansionPanelTitle");
var VExpansionPanelTitle = genericComponent()({
name: "VExpansionPanelTitle",
directives: { vRipple: Ripple },
props: makeVExpansionPanelTitleProps(),
setup(props, { slots }) {
const expansionPanel = inject(VExpansionPanelSymbol);
if (!expansionPanel) throw new Error("[Vuetify] v-expansion-panel-title needs to be placed inside v-expansion-panel");
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.color);
const { dimensionStyles } = useDimension(props);
const slotProps = computed(() => ({
collapseIcon: props.collapseIcon,
disabled: expansionPanel.disabled.value,
expanded: expansionPanel.isSelected.value,
expandIcon: props.expandIcon,
readonly: props.readonly
}));
const icon = toRef(() => expansionPanel.isSelected.value ? props.collapseIcon : props.expandIcon);
useRender(() => withDirectives(createBaseVNode("button", {
"class": normalizeClass([
"v-expansion-panel-title",
{
"v-expansion-panel-title--active": expansionPanel.isSelected.value,
"v-expansion-panel-title--focusable": props.focusable,
"v-expansion-panel-title--static": props.static
},
backgroundColorClasses.value,
props.class
]),
"style": normalizeStyle([
backgroundColorStyles.value,
dimensionStyles.value,
props.style
]),
"type": "button",
"tabindex": expansionPanel.disabled.value ? -1 : void 0,
"disabled": expansionPanel.disabled.value,
"aria-expanded": expansionPanel.isSelected.value,
"onClick": !props.readonly ? expansionPanel.toggle : void 0
}, [
createBaseVNode("span", { "class": "v-expansion-panel-title__overlay" }, null),
slots.default?.(slotProps.value),
!props.hideActions && createVNode(VDefaultsProvider, { "defaults": { VIcon: { icon: icon.value } } }, { default: () => [createBaseVNode("span", { "class": "v-expansion-panel-title__icon" }, [slots.actions?.(slotProps.value) ?? createVNode(VIcon, null, null)])] })
]), [[Ripple, props.ripple]]));
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VExpansionPanel/VExpansionPanel.js
var makeVExpansionPanelProps = propsFactory({
title: String,
text: String,
bgColor: String,
...makeElevationProps(),
...makeGroupItemProps(),
...makeRoundedProps(),
...makeTagProps(),
...makeVExpansionPanelTitleProps(),
...makeVExpansionPanelTextProps()
}, "VExpansionPanel");
var VExpansionPanel = genericComponent()({
name: "VExpansionPanel",
props: makeVExpansionPanelProps(),
emits: { "group:selected": (val) => true },
setup(props, { slots }) {
const groupItem = useGroupItem(props, VExpansionPanelSymbol);
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.bgColor);
const { elevationClasses } = useElevation(props);
const { roundedClasses } = useRounded(props);
const isDisabled = toRef(() => groupItem?.disabled.value || props.disabled);
const selectedIndices = computed(() => groupItem.group.items.value.reduce((arr, item, index) => {
if (groupItem.group.selected.value.includes(item.id)) arr.push(index);
return arr;
}, []));
const isBeforeSelected = computed(() => {
const index = groupItem.group.items.value.findIndex((item) => item.id === groupItem.id);
return !groupItem.isSelected.value && selectedIndices.value.some((selectedIndex) => selectedIndex - index === 1);
});
const isAfterSelected = computed(() => {
const index = groupItem.group.items.value.findIndex((item) => item.id === groupItem.id);
return !groupItem.isSelected.value && selectedIndices.value.some((selectedIndex) => selectedIndex - index === -1);
});
provide(VExpansionPanelSymbol, groupItem);
useRender(() => {
const hasText = !!(slots.text || props.text);
const hasTitle = !!(slots.title || props.title);
const expansionPanelTitleProps = VExpansionPanelTitle.filterProps(props);
const expansionPanelTextProps = VExpansionPanelText.filterProps(props);
return createVNode(props.tag, {
"class": normalizeClass([
"v-expansion-panel",
{
"v-expansion-panel--active": groupItem.isSelected.value,
"v-expansion-panel--before-active": isBeforeSelected.value,
"v-expansion-panel--after-active": isAfterSelected.value,
"v-expansion-panel--disabled": isDisabled.value
},
roundedClasses.value,
backgroundColorClasses.value,
props.class
]),
"style": normalizeStyle([backgroundColorStyles.value, props.style])
}, { default: () => [createBaseVNode("div", { "class": normalizeClass(["v-expansion-panel__shadow", ...elevationClasses.value]) }, null), createVNode(VDefaultsProvider, { "defaults": {
VExpansionPanelTitle: { ...expansionPanelTitleProps },
VExpansionPanelText: { ...expansionPanelTextProps }
} }, { default: () => [
hasTitle && createVNode(VExpansionPanelTitle, { "key": "title" }, { default: () => [slots.title ? slots.title() : props.title] }),
hasText && createVNode(VExpansionPanelText, { "key": "text" }, { default: () => [slots.text ? slots.text() : props.text] }),
slots.default?.()
] })] });
});
return { groupItem };
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VExpansionPanel/VExpansionPanels.js
var allowedVariants = [
"default",
"accordion",
"inset",
"popout"
];
var makeVExpansionPanelsProps = propsFactory({
flat: Boolean,
...makeGroupProps(),
...pick(makeVExpansionPanelProps(), [
"bgColor",
"collapseIcon",
"color",
"eager",
"elevation",
"expandIcon",
"focusable",
"hideActions",
"readonly",
"ripple",
"static"
]),
...makeRoundedProps(),
...makeThemeProps(),
...makeComponentProps(),
...makeTagProps(),
variant: {
type: String,
default: "default",
validator: (v) => allowedVariants.includes(v)
}
}, "VExpansionPanels");
var VExpansionPanels = genericComponent()({
name: "VExpansionPanels",
props: makeVExpansionPanelsProps(),
emits: { "update:modelValue": (val) => true },
setup(props, { slots }) {
const { next, prev } = useGroup(props, VExpansionPanelSymbol);
const { themeClasses } = provideTheme(props);
const { roundedClasses } = useRounded(props);
const variantClass = toRef(() => props.variant && `v-expansion-panels--variant-${props.variant}`);
provideDefaults({ VExpansionPanel: {
bgColor: toRef(() => props.bgColor),
collapseIcon: toRef(() => props.collapseIcon),
color: toRef(() => props.color),
eager: toRef(() => props.eager),
elevation: toRef(() => props.elevation),
expandIcon: toRef(() => props.expandIcon),
focusable: toRef(() => props.focusable),
hideActions: toRef(() => props.hideActions),
readonly: toRef(() => props.readonly),
ripple: toRef(() => props.ripple),
static: toRef(() => props.static)
} });
useRender(() => createVNode(props.tag, {
"class": normalizeClass([
"v-expansion-panels",
{
"v-expansion-panels--flat": props.flat,
"v-expansion-panels--tile": props.tile
},
themeClasses.value,
roundedClasses.value,
variantClass.value,
props.class
]),
"style": normalizeStyle(props.style)
}, { default: () => [slots.default?.({
prev,
next
})] }));
return {
next,
prev
};
}
});
//#endregion
export { VExpansionPanel, VExpansionPanelText, VExpansionPanelTitle, VExpansionPanels };
//# sourceMappingURL=vuetify_components_VExpansionPanel.js.map
File diff suppressed because one or more lines are too long
-2
View File
@@ -1,2 +0,0 @@
import { i as VContainer, n as VRow, r as VCol, t as VSpacer } from "./VGrid-xu6tptBP.js";
export { VCol, VContainer, VRow, VSpacer };
-3
View File
@@ -1,3 +0,0 @@
import { a as VLigatureIcon, i as VComponentIcon, o as VSvgIcon, r as VClassIcon } from "./icons-czM1t0u4.js";
import { t as VIcon } from "./VIcon-DqvHH35X.js";
export { VClassIcon, VComponentIcon, VIcon, VLigatureIcon, VSvgIcon };
-2
View File
@@ -1,2 +0,0 @@
import { t as VImg } from "./VImg-D29ak-Ji.js";
export { VImg };
-2
View File
@@ -1,2 +0,0 @@
import { c as VListItem, d as VListGroup, i as VList, l as VListItemTitle, n as VListItemAction, r as VListImg, s as VListSubheader, t as VListItemMedia, u as VListItemSubtitle } from "./VList-BhbWLtAc.js";
export { VList, VListGroup, VListImg, VListItem, VListItemAction, VListItemMedia, VListItemSubtitle, VListItemTitle, VListSubheader };
-43
View File
@@ -1,43 +0,0 @@
import { W as createBaseVNode, ar as normalizeClass, et as createVNode, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { t as makeTagProps } from "./tag-CIFqtlp2.js";
import { n as useDimension, t as makeDimensionProps } from "./dimensions-DYqEoPdw.js";
import { a as useLayout } from "./layout-DcSzssSI.js";
import { t as useSsrBoot } from "./ssrBoot-Dt2Wz9ZC.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VMain/VMain.css";
//#region node_modules/vuetify/lib/components/VMain/VMain.js
var makeVMainProps = propsFactory({
scrollable: Boolean,
...makeComponentProps(),
...makeDimensionProps(),
...makeTagProps({ tag: "main" })
}, "VMain");
var VMain = genericComponent()({
name: "VMain",
props: makeVMainProps(),
setup(props, { slots }) {
const { dimensionStyles } = useDimension(props);
const { mainStyles } = useLayout();
const { ssrBootStyles } = useSsrBoot();
useRender(() => createVNode(props.tag, {
"class": normalizeClass([
"v-main",
{ "v-main--scrollable": props.scrollable },
props.class
]),
"style": normalizeStyle([
mainStyles.value,
ssrBootStyles.value,
dimensionStyles.value,
props.style
])
}, { default: () => [props.scrollable ? createBaseVNode("div", { "class": "v-main__scroller" }, [slots.default?.()]) : slots.default?.()] }));
return {};
}
});
//#endregion
export { VMain };
//# sourceMappingURL=vuetify_components_VMain.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"vuetify_components_VMain.js","names":["_createVNode","_normalizeClass","_normalizeStyle","_createElementVNode"],"sources":["../../vuetify/lib/components/VMain/VMain.js"],"sourcesContent":["import { createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createVNode as _createVNode } from \"vue\";\n// Styles\nimport \"./VMain.css\";\n\n// Composables\nimport { makeComponentProps } from \"../../composables/component.js\";\nimport { makeDimensionProps, useDimension } from \"../../composables/dimensions.js\";\nimport { useLayout } from \"../../composables/layout.js\";\nimport { useSsrBoot } from \"../../composables/ssrBoot.js\";\nimport { makeTagProps } from \"../../composables/tag.js\"; // Utilities\nimport { genericComponent, propsFactory, useRender } from \"../../util/index.js\";\nexport const makeVMainProps = propsFactory({\n scrollable: Boolean,\n ...makeComponentProps(),\n ...makeDimensionProps(),\n ...makeTagProps({\n tag: 'main'\n })\n}, 'VMain');\nexport const VMain = genericComponent()({\n name: 'VMain',\n props: makeVMainProps(),\n setup(props, {\n slots\n }) {\n const {\n dimensionStyles\n } = useDimension(props);\n const {\n mainStyles\n } = useLayout();\n const {\n ssrBootStyles\n } = useSsrBoot();\n useRender(() => _createVNode(props.tag, {\n \"class\": _normalizeClass(['v-main', {\n 'v-main--scrollable': props.scrollable\n }, props.class]),\n \"style\": _normalizeStyle([mainStyles.value, ssrBootStyles.value, dimensionStyles.value, props.style])\n }, {\n default: () => [props.scrollable ? _createElementVNode(\"div\", {\n \"class\": \"v-main__scroller\"\n }, [slots.default?.()]) : slots.default?.()]\n }));\n return {};\n }\n});\n//# sourceMappingURL=VMain.js.map"],"mappings":";;;;;;;;;;AAWA,IAAa,iBAAiB,aAAa;CACzC,YAAY;CACZ,GAAG,oBAAoB;CACvB,GAAG,oBAAoB;CACvB,GAAG,aAAa,EACd,KAAK,QACN,CAAC;CACH,EAAE,QAAQ;AACX,IAAa,QAAQ,kBAAkB,CAAC;CACtC,MAAM;CACN,OAAO,gBAAgB;CACvB,MAAM,OAAO,EACX,SACC;EACD,MAAM,EACJ,oBACE,aAAa,MAAM;EACvB,MAAM,EACJ,eACE,WAAW;EACf,MAAM,EACJ,kBACE,YAAY;AAChB,kBAAgBA,YAAa,MAAM,KAAK;GACtC,SAASC,eAAgB;IAAC;IAAU,EAClC,sBAAsB,MAAM,YAC7B;IAAE,MAAM;IAAM,CAAC;GAChB,SAASC,eAAgB;IAAC,WAAW;IAAO,cAAc;IAAO,gBAAgB;IAAO,MAAM;IAAM,CAAC;GACtG,EAAE,EACD,eAAe,CAAC,MAAM,aAAaC,gBAAoB,OAAO,EAC5D,SAAS,oBACV,EAAE,CAAC,MAAM,WAAW,CAAC,CAAC,GAAG,MAAM,WAAW,CAAC,EAC7C,CAAC,CAAC;AACH,SAAO,EAAE;;CAEZ,CAAC"}
-2
View File
@@ -1,2 +0,0 @@
import { t as VMenu } from "./VMenu-g8bPIWQQ.js";
export { VMenu };
@@ -1,481 +0,0 @@
import { Dt as mergeProps, Ft as onMounted, Gn as readonly, Kn as ref, M as Fragment, Ot as nextTick, Qn as toRef, U as computed, Vn as onScopeDispose, W as createBaseVNode, Yn as shallowRef, _n as watchEffect, et as createVNode, gn as watch, jt as onBeforeUnmount, n as Transition } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { _ as clamp, d as CircularBuffer, o as provideDefaults, q as omit, r as genericComponent, u as propsFactory, v as convertToUnit } from "./defineComponent-D5UWd5Vb.js";
import { o as toPhysical } from "./anchor-Co261iQQ.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { t as useBackgroundColor } from "./color-B0NTWdor.js";
import { t as makeTagProps } from "./tag-CIFqtlp2.js";
import { i as provideTheme, r as makeThemeProps } from "./theme-C1b955Ym.js";
import { n as useToggleScope, t as useProxiedModel } from "./proxiedModel-BOZtsMxA.js";
import { i as useRtl } from "./locale-DTRSr4yu.js";
import { n as useRounded, t as makeRoundedProps } from "./rounded-m6mNMWh4.js";
import { t as VDefaultsProvider } from "./VDefaultsProvider-C3Dl0By9.js";
import { t as VImg } from "./VImg-D29ak-Ji.js";
import { n as useBorder, t as makeBorderProps } from "./border-DgwbzrV0.js";
import { o as useLayoutItem, r as makeLayoutItemProps } from "./layout-DcSzssSI.js";
import { i as useDelay, n as useFocusTrap, r as makeDelayProps, t as makeFocusTrapProps } from "./focusTrap-BRlT3Jgx.js";
import { a as useDisplay, i as makeDisplayProps } from "./display-BD8QD-8J.js";
import { i as useRouter } from "./router-CiYG9tKT.js";
import { t as useScopeId } from "./scopeId-BbFYJclW.js";
import { t as useSsrBoot } from "./ssrBoot-Dt2Wz9ZC.js";
import { n as useElevation, t as makeElevationProps } from "./elevation-DF9Lgrr_.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VNavigationDrawer/VNavigationDrawer.css";
//#region node_modules/vuetify/lib/components/VNavigationDrawer/sticky.js
function useSticky({ rootEl, isSticky, layoutItemStyles }) {
const isStuck = shallowRef(false);
const stuckPosition = shallowRef(0);
const stickyStyles = computed(() => {
const side = typeof isStuck.value === "boolean" ? "top" : isStuck.value;
return [isSticky.value ? {
top: "auto",
bottom: "auto",
height: void 0
} : void 0, isStuck.value ? { [side]: convertToUnit(stuckPosition.value) } : { top: layoutItemStyles.value.top }];
});
onMounted(() => {
watch(isSticky, (val) => {
if (val) window.addEventListener("scroll", onScroll, { passive: true });
else window.removeEventListener("scroll", onScroll);
}, { immediate: true });
});
onBeforeUnmount(() => {
window.removeEventListener("scroll", onScroll);
});
let lastScrollTop = 0;
function onScroll() {
const direction = lastScrollTop > window.scrollY ? "up" : "down";
const rect = rootEl.value.getBoundingClientRect();
const layoutTop = parseFloat(layoutItemStyles.value.top ?? 0);
const top = window.scrollY - Math.max(0, stuckPosition.value - layoutTop);
const bottom = rect.height + Math.max(stuckPosition.value, layoutTop) - window.scrollY - window.innerHeight;
const bodyScroll = parseFloat(getComputedStyle(rootEl.value).getPropertyValue("--v-body-scroll-y")) || 0;
if (rect.height < window.innerHeight - layoutTop) {
isStuck.value = "top";
stuckPosition.value = layoutTop;
} else if (direction === "up" && isStuck.value === "bottom" || direction === "down" && isStuck.value === "top") {
stuckPosition.value = window.scrollY + rect.top - bodyScroll;
isStuck.value = true;
} else if (direction === "down" && bottom <= 0) {
stuckPosition.value = 0;
isStuck.value = "bottom";
} else if (direction === "up" && top <= 0) {
if (!bodyScroll) {
stuckPosition.value = rect.top + top;
isStuck.value = "top";
} else if (isStuck.value !== "top") {
stuckPosition.value = -top + bodyScroll + layoutTop;
isStuck.value = "top";
}
}
lastScrollTop = window.scrollY;
}
return {
isStuck,
stickyStyles
};
}
//#endregion
//#region node_modules/vuetify/lib/composables/touch.js
var HORIZON = 100;
var HISTORY = 20;
/** @see https://android.googlesource.com/platform/frameworks/native/+/master/libs/input/VelocityTracker.cpp */
function kineticEnergyToVelocity(work) {
return (work < 0 ? -1 : 1) * Math.sqrt(Math.abs(work)) * 1.41421356237;
}
/**
* Returns pointer velocity in px/s
*/
function calculateImpulseVelocity(samples) {
if (samples.length < 2) return 0;
if (samples.length === 2) {
if (samples[1].t === samples[0].t) return 0;
return (samples[1].d - samples[0].d) / (samples[1].t - samples[0].t);
}
let work = 0;
for (let i = samples.length - 1; i > 0; i--) {
if (samples[i].t === samples[i - 1].t) continue;
const vprev = kineticEnergyToVelocity(work);
const vcurr = (samples[i].d - samples[i - 1].d) / (samples[i].t - samples[i - 1].t);
work += (vcurr - vprev) * Math.abs(vcurr);
if (i === samples.length - 1) work *= .5;
}
return kineticEnergyToVelocity(work) * 1e3;
}
function useVelocity() {
const touches = {};
function addMovement(e) {
Array.from(e.changedTouches).forEach((touch) => {
(touches[touch.identifier] ?? (touches[touch.identifier] = new CircularBuffer(HISTORY))).push([e.timeStamp, touch]);
});
}
function endTouch(e) {
Array.from(e.changedTouches).forEach((touch) => {
delete touches[touch.identifier];
});
}
function getVelocity(id) {
const samples = touches[id]?.values().reverse();
if (!samples) throw new Error(`No samples for touch id ${id}`);
const newest = samples[0];
const x = [];
const y = [];
for (const val of samples) {
if (newest[0] - val[0] > HORIZON) break;
x.push({
t: val[0],
d: val[1].clientX
});
y.push({
t: val[0],
d: val[1].clientY
});
}
return {
x: calculateImpulseVelocity(x),
y: calculateImpulseVelocity(y),
get direction() {
const { x, y } = this;
const [absX, absY] = [Math.abs(x), Math.abs(y)];
return absX > absY && x >= 0 ? "right" : absX > absY && x <= 0 ? "left" : absY > absX && y >= 0 ? "down" : absY > absX && y <= 0 ? "up" : oops$1();
}
};
}
return {
addMovement,
endTouch,
getVelocity
};
}
function oops$1() {
throw new Error();
}
//#endregion
//#region node_modules/vuetify/lib/components/VNavigationDrawer/touch.js
function useTouch({ el, isActive, isTemporary, width, touchless, position }) {
onMounted(() => {
window.addEventListener("touchstart", onTouchstart, { passive: true });
window.addEventListener("touchmove", onTouchmove, { passive: false });
window.addEventListener("touchend", onTouchend, { passive: true });
});
onBeforeUnmount(() => {
window.removeEventListener("touchstart", onTouchstart);
window.removeEventListener("touchmove", onTouchmove);
window.removeEventListener("touchend", onTouchend);
});
const isHorizontal = computed(() => ["left", "right"].includes(position.value));
const { addMovement, endTouch, getVelocity } = useVelocity();
let maybeDragging = false;
const isDragging = shallowRef(false);
const dragProgress = shallowRef(0);
const offset = shallowRef(0);
let start;
function getOffset(pos, active) {
return (position.value === "left" ? pos : position.value === "right" ? document.documentElement.clientWidth - pos : position.value === "top" ? pos : position.value === "bottom" ? document.documentElement.clientHeight - pos : oops()) - (active ? width.value : 0);
}
function getProgress(pos, limit = true) {
const progress = position.value === "left" ? (pos - offset.value) / width.value : position.value === "right" ? (document.documentElement.clientWidth - pos - offset.value) / width.value : position.value === "top" ? (pos - offset.value) / width.value : position.value === "bottom" ? (document.documentElement.clientHeight - pos - offset.value) / width.value : oops();
return limit ? clamp(progress) : progress;
}
function onTouchstart(e) {
if (touchless.value) return;
const touchX = e.changedTouches[0].clientX;
const touchY = e.changedTouches[0].clientY;
const touchZone = 25;
const inTouchZone = position.value === "left" ? touchX < touchZone : position.value === "right" ? touchX > document.documentElement.clientWidth - touchZone : position.value === "top" ? touchY < touchZone : position.value === "bottom" ? touchY > document.documentElement.clientHeight - touchZone : oops();
const inElement = isActive.value && (position.value === "left" ? touchX < width.value : position.value === "right" ? touchX > document.documentElement.clientWidth - width.value : position.value === "top" ? touchY < width.value : position.value === "bottom" ? touchY > document.documentElement.clientHeight - width.value : oops());
if (inTouchZone || inElement || isActive.value && isTemporary.value) {
start = [touchX, touchY];
offset.value = getOffset(isHorizontal.value ? touchX : touchY, isActive.value);
dragProgress.value = getProgress(isHorizontal.value ? touchX : touchY);
maybeDragging = offset.value > -20 && offset.value < 80;
endTouch(e);
addMovement(e);
}
}
function onTouchmove(e) {
const touchX = e.changedTouches[0].clientX;
const touchY = e.changedTouches[0].clientY;
if (maybeDragging) {
if (!e.cancelable) {
maybeDragging = false;
return;
}
const dx = Math.abs(touchX - start[0]);
const dy = Math.abs(touchY - start[1]);
if (isHorizontal.value ? dx > dy && dx > 3 : dy > dx && dy > 3) {
isDragging.value = true;
maybeDragging = false;
} else if ((isHorizontal.value ? dy : dx) > 3) maybeDragging = false;
}
if (!isDragging.value) return;
e.preventDefault();
addMovement(e);
const progress = getProgress(isHorizontal.value ? touchX : touchY, false);
dragProgress.value = Math.max(0, Math.min(1, progress));
if (progress > 1) offset.value = getOffset(isHorizontal.value ? touchX : touchY, true);
else if (progress < 0) offset.value = getOffset(isHorizontal.value ? touchX : touchY, false);
}
function onTouchend(e) {
maybeDragging = false;
if (!isDragging.value) return;
addMovement(e);
isDragging.value = false;
const velocity = getVelocity(e.changedTouches[0].identifier);
const vx = Math.abs(velocity.x);
const vy = Math.abs(velocity.y);
if (isHorizontal.value ? vx > vy && vx > 400 : vy > vx && vy > 3) isActive.value = velocity.direction === ({
left: "right",
right: "left",
top: "down",
bottom: "up"
}[position.value] || oops());
else isActive.value = dragProgress.value > .5;
}
const dragStyles = computed(() => {
return isDragging.value ? {
transform: position.value === "left" ? `translateX(calc(-100% + ${dragProgress.value * width.value}px))` : position.value === "right" ? `translateX(calc(100% - ${dragProgress.value * width.value}px))` : position.value === "top" ? `translateY(calc(-100% + ${dragProgress.value * width.value}px))` : position.value === "bottom" ? `translateY(calc(100% - ${dragProgress.value * width.value}px))` : oops(),
transition: "none"
} : void 0;
});
useToggleScope(isDragging, () => {
const transform = el.value?.style.transform ?? null;
const transition = el.value?.style.transition ?? null;
watchEffect(() => {
el.value?.style.setProperty("transform", dragStyles.value?.transform || "none");
el.value?.style.setProperty("transition", dragStyles.value?.transition || null);
});
onScopeDispose(() => {
el.value?.style.setProperty("transform", transform);
el.value?.style.setProperty("transition", transition);
});
});
return {
isDragging,
dragProgress,
dragStyles
};
}
function oops() {
throw new Error();
}
//#endregion
//#region node_modules/vuetify/lib/components/VNavigationDrawer/VNavigationDrawer.js
var locations = [
"start",
"end",
"left",
"right",
"top",
"bottom"
];
var makeVNavigationDrawerProps = propsFactory({
color: String,
disableResizeWatcher: Boolean,
disableRouteWatcher: Boolean,
expandOnHover: Boolean,
floating: Boolean,
modelValue: {
type: Boolean,
default: null
},
permanent: Boolean,
rail: {
type: Boolean,
default: null
},
railWidth: {
type: [Number, String],
default: 56
},
scrim: {
type: [Boolean, String],
default: true
},
image: String,
temporary: Boolean,
persistent: Boolean,
touchless: Boolean,
width: {
type: [Number, String],
default: 256
},
location: {
type: String,
default: "start",
validator: (value) => locations.includes(value)
},
sticky: Boolean,
...makeBorderProps(),
...makeComponentProps(),
...makeDelayProps(),
...makeDisplayProps({ mobile: null }),
...makeElevationProps(),
...makeLayoutItemProps(),
...makeRoundedProps(),
...omit(makeFocusTrapProps(), ["disableInitialFocus"]),
...makeTagProps({ tag: "nav" }),
...makeThemeProps()
}, "VNavigationDrawer");
var VNavigationDrawer = genericComponent()({
name: "VNavigationDrawer",
props: makeVNavigationDrawerProps(),
emits: {
"update:modelValue": (val) => true,
"update:rail": (val) => true
},
setup(props, { attrs, emit, slots }) {
const { isRtl } = useRtl();
const { themeClasses } = provideTheme(props);
const { borderClasses } = useBorder(props);
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.color);
const { elevationClasses } = useElevation(props);
const { displayClasses, mobile } = useDisplay(props);
const { roundedClasses } = useRounded(props);
const router = useRouter();
const isActive = useProxiedModel(props, "modelValue", null, (v) => !!v);
const { ssrBootStyles } = useSsrBoot();
const { scopeId } = useScopeId();
const rootEl = ref();
const isHovering = shallowRef(false);
const { runOpenDelay, runCloseDelay } = useDelay(props, (value) => {
isHovering.value = value;
});
const width = computed(() => {
return props.rail && props.expandOnHover && isHovering.value ? Number(props.width) : Number(props.rail ? props.railWidth : props.width);
});
const location = computed(() => {
return toPhysical(props.location, isRtl.value);
});
const isPersistent = toRef(() => props.persistent);
const isTemporary = computed(() => !props.permanent && (mobile.value || props.temporary));
const isSticky = computed(() => props.sticky && !isTemporary.value && location.value !== "bottom");
useFocusTrap(props, {
isActive,
localTop: isTemporary,
contentEl: rootEl
});
useToggleScope(() => props.expandOnHover && props.rail != null, () => {
watch(isHovering, (val) => emit("update:rail", !val));
});
useToggleScope(() => !props.disableResizeWatcher, () => {
watch(isTemporary, (val) => !props.permanent && nextTick(() => isActive.value = !val));
});
useToggleScope(() => !props.disableRouteWatcher && !!router, () => {
watch(router.currentRoute, () => isTemporary.value && (isActive.value = false));
});
watch(() => props.permanent, (val) => {
if (val) isActive.value = true;
});
if (props.modelValue == null && !isTemporary.value) isActive.value = props.permanent || !mobile.value;
const { isDragging, dragProgress } = useTouch({
el: rootEl,
isActive,
isTemporary,
width,
touchless: toRef(() => props.touchless),
position: location
});
const layoutSize = computed(() => {
const size = isTemporary.value ? 0 : props.rail && props.expandOnHover ? Number(props.railWidth) : width.value;
return isDragging.value ? size * dragProgress.value : size;
});
const { layoutItemStyles, layoutItemScrimStyles } = useLayoutItem({
id: props.name,
order: computed(() => parseInt(props.order, 10)),
position: location,
layoutSize,
elementSize: width,
active: readonly(isActive),
disableTransitions: toRef(() => isDragging.value),
absolute: computed(() => props.absolute || isSticky.value && typeof isStuck.value !== "string")
});
const { isStuck, stickyStyles } = useSticky({
rootEl,
isSticky,
layoutItemStyles
});
const scrimColor = useBackgroundColor(() => {
return typeof props.scrim === "string" ? props.scrim : null;
});
const scrimStyles = computed(() => ({
...isDragging.value ? {
opacity: dragProgress.value * .2,
transition: "none"
} : void 0,
...layoutItemScrimStyles.value
}));
provideDefaults({ VList: { bgColor: "transparent" } });
useRender(() => {
const hasImage = slots.image || props.image;
return createBaseVNode(Fragment, null, [createVNode(props.tag, mergeProps({
"ref": rootEl,
"onMouseenter": runOpenDelay,
"onMouseleave": runCloseDelay,
"class": [
"v-navigation-drawer",
`v-navigation-drawer--${location.value}`,
{
"v-navigation-drawer--expand-on-hover": props.expandOnHover,
"v-navigation-drawer--floating": props.floating,
"v-navigation-drawer--is-hovering": isHovering.value,
"v-navigation-drawer--rail": props.rail,
"v-navigation-drawer--temporary": isTemporary.value,
"v-navigation-drawer--persistent": isPersistent.value,
"v-navigation-drawer--active": isActive.value,
"v-navigation-drawer--sticky": isSticky.value
},
themeClasses.value,
backgroundColorClasses.value,
borderClasses.value,
displayClasses.value,
elevationClasses.value,
roundedClasses.value,
props.class
],
"style": [
backgroundColorStyles.value,
layoutItemStyles.value,
ssrBootStyles.value,
stickyStyles.value,
props.style
],
"inert": !isActive.value
}, scopeId, attrs), { default: () => [
hasImage && createBaseVNode("div", {
"key": "image",
"class": "v-navigation-drawer__img"
}, [!slots.image ? createVNode(VImg, {
"key": "image-img",
"alt": "",
"cover": true,
"height": "inherit",
"src": props.image
}, null) : createVNode(VDefaultsProvider, {
"key": "image-defaults",
"disabled": !props.image,
"defaults": { VImg: {
alt: "",
cover: true,
height: "inherit",
src: props.image
} }
}, slots.image)]),
slots.prepend && createBaseVNode("div", { "class": "v-navigation-drawer__prepend" }, [slots.prepend?.()]),
createBaseVNode("div", { "class": "v-navigation-drawer__content" }, [slots.default?.()]),
slots.append && createBaseVNode("div", { "class": "v-navigation-drawer__append" }, [slots.append?.()])
] }), createVNode(Transition, { "name": "fade-transition" }, { default: () => [isTemporary.value && (isDragging.value || isActive.value) && !!props.scrim && createBaseVNode("div", mergeProps({
"class": ["v-navigation-drawer__scrim", scrimColor.backgroundColorClasses.value],
"style": [scrimStyles.value, scrimColor.backgroundColorStyles.value],
"onClick": () => {
if (isPersistent.value) return;
isActive.value = false;
}
}, scopeId), null)] })]);
});
return { isStuck };
}
});
//#endregion
export { VNavigationDrawer };
//# sourceMappingURL=vuetify_components_VNavigationDrawer.js.map
File diff suppressed because one or more lines are too long
-2
View File
@@ -1,2 +0,0 @@
import { t as VSelect } from "./VSelect-9P7g-lSZ.js";
export { VSelect };
-2
View File
@@ -1,2 +0,0 @@
import { t as VSheet } from "./VSheet-CdUUbWcK.js";
export { VSheet };
-145
View File
@@ -1,145 +0,0 @@
import { Dt as mergeProps, Kn as ref, M as Fragment, Qn as toRef, W as createBaseVNode, ar as normalizeClass, cn as useId, et as createVNode, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { E as filterInputAttrs, ot as SUPPORTS_MATCH_MEDIA, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { t as VIcon } from "./VIcon-DqvHH35X.js";
import { t as useProxiedModel } from "./proxiedModel-BOZtsMxA.js";
import { t as VDefaultsProvider } from "./VDefaultsProvider-C3Dl0By9.js";
import { c as VScaleTransition } from "./transitions-llwxsiay.js";
import { t as forwardRefs } from "./forwardRefs-C50LZ3ti.js";
import { t as VProgressCircular } from "./VProgressCircular-z2FRmexp.js";
import { r as useLoader, t as LoaderSlot } from "./loader-Dn_UJdiG.js";
import { a as useFocus, n as VInput, r as makeVInputProps } from "./VLabel-BK6j7Ce3.js";
import { n as makeVSelectionControlProps, t as VSelectionControl } from "./VSelectionControl-DGk6dNy-.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VSwitch/VSwitch.css";
//#region node_modules/vuetify/lib/components/VSwitch/VSwitch.js
var makeVSwitchProps = propsFactory({
indeterminate: Boolean,
inset: Boolean,
flat: Boolean,
loading: {
type: [Boolean, String],
default: false
},
...makeVInputProps(),
...makeVSelectionControlProps()
}, "VSwitch");
var VSwitch = genericComponent()({
name: "VSwitch",
inheritAttrs: false,
props: makeVSwitchProps(),
emits: {
"update:focused": (focused) => true,
"update:modelValue": (value) => true,
"update:indeterminate": (value) => true
},
setup(props, { attrs, slots }) {
const indeterminate = useProxiedModel(props, "indeterminate");
const model = useProxiedModel(props, "modelValue");
const { loaderClasses } = useLoader(props);
const { isFocused, focus, blur } = useFocus(props);
const control = ref();
const inputRef = ref();
const isForcedColorsModeActive = SUPPORTS_MATCH_MEDIA && window.matchMedia("(forced-colors: active)").matches;
const loaderColor = toRef(() => {
return typeof props.loading === "string" && props.loading !== "" ? props.loading : props.color;
});
const uid = useId();
const id = toRef(() => props.id || `switch-${uid}`);
function onChange() {
if (indeterminate.value) indeterminate.value = false;
}
function onTrackClick(e) {
e.stopPropagation();
e.preventDefault();
control.value?.input?.click();
}
useRender(() => {
const [rootAttrs, controlAttrs] = filterInputAttrs(attrs);
const inputProps = VInput.filterProps(props);
const controlProps = VSelectionControl.filterProps(props);
return createVNode(VInput, mergeProps({
"ref": inputRef,
"class": [
"v-switch",
{ "v-switch--flat": props.flat },
{ "v-switch--inset": props.inset },
{ "v-switch--indeterminate": indeterminate.value },
loaderClasses.value,
props.class
]
}, rootAttrs, inputProps, {
"modelValue": model.value,
"onUpdate:modelValue": ($event) => model.value = $event,
"id": id.value,
"focused": isFocused.value,
"style": props.style
}), {
...slots,
default: ({ id, messagesId, isDisabled, isReadonly, isValid }) => {
const slotProps = {
model,
isValid
};
return createVNode(VSelectionControl, mergeProps({ "ref": control }, controlProps, {
"modelValue": model.value,
"onUpdate:modelValue": [($event) => model.value = $event, onChange],
"id": id.value,
"aria-describedby": messagesId.value,
"type": "checkbox",
"aria-checked": indeterminate.value ? "mixed" : void 0,
"disabled": isDisabled.value,
"readonly": isReadonly.value,
"onFocus": focus,
"onBlur": blur
}, controlAttrs), {
...slots,
default: ({ backgroundColorClasses, backgroundColorStyles }) => createBaseVNode("div", {
"class": normalizeClass(["v-switch__track", !isForcedColorsModeActive ? backgroundColorClasses.value : void 0]),
"style": normalizeStyle(backgroundColorStyles.value),
"onClick": onTrackClick
}, [slots["track-true"] && createBaseVNode("div", {
"key": "prepend",
"class": "v-switch__track-true"
}, [slots["track-true"](slotProps)]), slots["track-false"] && createBaseVNode("div", {
"key": "append",
"class": "v-switch__track-false"
}, [slots["track-false"](slotProps)])]),
input: ({ inputNode, icon, backgroundColorClasses, backgroundColorStyles }) => createBaseVNode(Fragment, null, [inputNode, createBaseVNode("div", {
"class": normalizeClass([
"v-switch__thumb",
{ "v-switch__thumb--filled": icon || props.loading },
props.inset || isForcedColorsModeActive ? void 0 : backgroundColorClasses.value
]),
"style": normalizeStyle(props.inset ? void 0 : backgroundColorStyles.value)
}, [slots.thumb ? createVNode(VDefaultsProvider, { "defaults": { VIcon: {
icon,
size: "x-small"
} } }, { default: () => [slots.thumb({
...slotProps,
icon
})] }) : createVNode(VScaleTransition, null, { default: () => [!props.loading ? icon && createVNode(VIcon, {
"key": String(icon),
"icon": icon,
"size": "x-small"
}, null) : createVNode(LoaderSlot, {
"name": "v-switch",
"active": true,
"color": isValid.value === false ? void 0 : loaderColor.value
}, { default: (slotProps) => slots.loader ? slots.loader(slotProps) : createVNode(VProgressCircular, {
"active": slotProps.isActive,
"color": slotProps.color,
"indeterminate": true,
"size": "16",
"width": "2"
}, null) })] })])])
});
}
});
});
return forwardRefs({}, inputRef);
}
});
//#endregion
export { VSwitch };
//# sourceMappingURL=vuetify_components_VSwitch.js.map
File diff suppressed because one or more lines are too long
-702
View File
@@ -1,702 +0,0 @@
import { C as vShow, Cn as withDirectives, Dt as mergeProps, Kn as ref, M as Fragment, Ot as nextTick, Qn as toRef, U as computed, Ut as provide, W as createBaseVNode, Yn as shallowRef, ar as normalizeClass, et as createVNode, gn as watch, sr as normalizeStyle, xt as inject } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { B as isObject, W as keys, Z as pick, it as PREFERS_REDUCED_MOTION, o as provideDefaults, q as omit, r as genericComponent, rt as IN_BROWSER, u as propsFactory, v as convertToUnit } from "./defineComponent-D5UWd5Vb.js";
import { t as animate } from "./animation-gSo9lwa6.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { i as standardEasing } from "./easing-DfcvkbkS.js";
import { t as getScrollParent } from "./getScrollParent-DuXs8SPu.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { r as useTextColor, t as useBackgroundColor } from "./color-B0NTWdor.js";
import { t as makeTagProps } from "./tag-CIFqtlp2.js";
import { i as provideTheme, r as makeThemeProps } from "./theme-C1b955Ym.js";
import { t as useProxiedModel } from "./proxiedModel-BOZtsMxA.js";
import { i as useRtl, r as useLocale } from "./locale-DTRSr4yu.js";
import { t as MaybeTransition } from "./transition-BieT_XBo.js";
import { n as useDensity, t as makeDensityProps } from "./density-Dey2iIaF.js";
import { n as useLazy, t as makeLazyProps } from "./lazy-CSlNPYYk.js";
import { t as useScopeId } from "./scopeId-BbFYJclW.js";
import { t as forwardRefs } from "./forwardRefs-C50LZ3ti.js";
import { t as useSsrBoot } from "./ssrBoot-Dt2Wz9ZC.js";
import { i as useGroupItem, r as useGroup, t as makeGroupItemProps } from "./group-sYL2sZpA.js";
import { n as makeVBtnProps, t as VBtn } from "./VBtn-Bm4dgaEe.js";
import { r as makeVSlideGroupProps, t as VSlideGroup } from "./VSlideGroup-CVNSOV5n.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VTabs/VTab.css";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VTabs/VTabs.css";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VWindow/VWindow.css";
//#region node_modules/vuetify/lib/components/VTabs/shared.js
var VTabsSymbol = Symbol.for("vuetify:v-tabs");
//#endregion
//#region node_modules/vuetify/lib/components/VTabs/VTab.js
var makeVTabProps = propsFactory({
fixed: Boolean,
sliderColor: String,
sliderTransition: String,
sliderTransitionDuration: [String, Number],
hideSlider: Boolean,
inset: Boolean,
direction: {
type: String,
default: "horizontal"
},
...omit(makeVBtnProps({
selectedClass: "v-tab--selected",
variant: "text"
}), [
"active",
"block",
"flat",
"location",
"position",
"symbol"
])
}, "VTab");
var VTab = genericComponent()({
name: "VTab",
props: makeVTabProps(),
setup(props, { slots, attrs }) {
const { textColorClasses: sliderColorClasses, textColorStyles: sliderColorStyles } = useTextColor(() => props.sliderColor);
const { backgroundColorClasses: insetColorClasses, backgroundColorStyles: insetColorStyles } = useBackgroundColor(() => props.sliderColor);
const rootEl = ref();
const sliderEl = ref();
const isHorizontal = computed(() => props.direction === "horizontal");
const isSelected = computed(() => rootEl.value?.group?.isSelected.value ?? false);
function fade(nextEl, prevEl) {
return { opacity: [0, 1] };
}
function grow(nextEl, prevEl) {
return props.direction === "vertical" ? { transform: ["scaleY(0)", "scaleY(1)"] } : { transform: ["scaleX(0)", "scaleX(1)"] };
}
function shift(nextEl, prevEl) {
const prevBox = prevEl.getBoundingClientRect();
const nextBox = nextEl.getBoundingClientRect();
const xy = isHorizontal.value ? "x" : "y";
const XY = isHorizontal.value ? "X" : "Y";
const rightBottom = isHorizontal.value ? "right" : "bottom";
const widthHeight = isHorizontal.value ? "width" : "height";
const delta = prevBox[xy] > nextBox[xy] ? prevBox[rightBottom] - nextBox[rightBottom] : prevBox[xy] - nextBox[xy];
const origin = Math.sign(delta) > 0 ? isHorizontal.value ? "right" : "bottom" : Math.sign(delta) < 0 ? isHorizontal.value ? "left" : "top" : "center";
const scale = (Math.abs(delta) + (Math.sign(delta) < 0 ? prevBox[widthHeight] : nextBox[widthHeight])) / Math.max(prevBox[widthHeight], nextBox[widthHeight]) || 0;
const initialScale = prevBox[widthHeight] / nextBox[widthHeight] || 0;
const sigma = 1.5;
return {
transform: [
`translate${XY}(${delta}px) scale${XY}(${initialScale})`,
`translate${XY}(${delta / sigma}px) scale${XY}(${(scale - 1) / sigma + 1})`,
"none"
],
transformOrigin: Array(3).fill(origin)
};
}
function updateSlider({ value }) {
if (value) {
const prevEl = rootEl.value?.$el.parentElement?.querySelector(".v-tab--selected .v-tab__slider");
const nextEl = sliderEl.value;
if (!prevEl || !nextEl) return;
const color = getComputedStyle(prevEl).backgroundColor;
const keyframes = {
fade,
grow,
shift
}[props.sliderTransition ?? "shift"] ?? shift;
const duration = Number(props.sliderTransitionDuration) || ({
fade: 400,
grow: 350,
shift: 225
}[props.sliderTransition ?? "shift"] ?? 225);
animate(nextEl, {
backgroundColor: [color, color],
...keyframes(nextEl, prevEl)
}, {
duration,
easing: standardEasing
});
}
}
useRender(() => {
const btnProps = VBtn.filterProps(props);
return createVNode(VBtn, mergeProps({
"symbol": VTabsSymbol,
"ref": rootEl,
"class": [
"v-tab",
props.class,
isSelected.value && props.inset ? insetColorClasses.value : []
],
"style": [
props.style,
isSelected.value && props.inset ? insetColorStyles.value : [],
{ backgroundColor: isSelected.value && props.inset ? "transparent !important" : void 0 }
],
"tabindex": isSelected.value ? 0 : -1,
"role": "tab",
"aria-selected": String(isSelected.value),
"active": false
}, btnProps, attrs, {
"block": props.fixed,
"maxWidth": props.fixed ? 300 : void 0,
"onGroup:selected": updateSlider
}), {
...slots,
default: () => createBaseVNode(Fragment, null, [slots.default?.() ?? props.text, !props.hideSlider && createBaseVNode("div", {
"ref": sliderEl,
"class": normalizeClass(["v-tab__slider", props.inset ? insetColorClasses.value : sliderColorClasses.value]),
"style": normalizeStyle([sliderColorStyles.value, props.inset ? insetColorStyles.value : sliderColorClasses.value])
}, null)])
});
});
return forwardRefs({}, rootEl);
}
});
//#endregion
//#region node_modules/vuetify/lib/directives/touch/index.js
var handleGesture = (wrapper) => {
const { touchstartX, touchendX, touchstartY, touchendY } = wrapper;
const dirRatio = .5;
const minDistance = 16;
wrapper.offsetX = touchendX - touchstartX;
wrapper.offsetY = touchendY - touchstartY;
if (Math.abs(wrapper.offsetY) < dirRatio * Math.abs(wrapper.offsetX)) {
wrapper.left && touchendX < touchstartX - minDistance && wrapper.left(wrapper);
wrapper.right && touchendX > touchstartX + minDistance && wrapper.right(wrapper);
}
if (Math.abs(wrapper.offsetX) < dirRatio * Math.abs(wrapper.offsetY)) {
wrapper.up && touchendY < touchstartY - minDistance && wrapper.up(wrapper);
wrapper.down && touchendY > touchstartY + minDistance && wrapper.down(wrapper);
}
};
function touchstart(event, wrapper) {
const touch = event.changedTouches[0];
wrapper.touchstartX = touch.clientX;
wrapper.touchstartY = touch.clientY;
wrapper.start?.({
originalEvent: event,
...wrapper
});
}
function touchend(event, wrapper) {
const touch = event.changedTouches[0];
wrapper.touchendX = touch.clientX;
wrapper.touchendY = touch.clientY;
wrapper.end?.({
originalEvent: event,
...wrapper
});
handleGesture(wrapper);
}
function touchmove(event, wrapper) {
const touch = event.changedTouches[0];
wrapper.touchmoveX = touch.clientX;
wrapper.touchmoveY = touch.clientY;
wrapper.move?.({
originalEvent: event,
...wrapper
});
}
function createHandlers(value = {}) {
const wrapper = {
touchstartX: 0,
touchstartY: 0,
touchendX: 0,
touchendY: 0,
touchmoveX: 0,
touchmoveY: 0,
offsetX: 0,
offsetY: 0,
left: value.left,
right: value.right,
up: value.up,
down: value.down,
start: value.start,
move: value.move,
end: value.end
};
return {
touchstart: (e) => touchstart(e, wrapper),
touchend: (e) => touchend(e, wrapper),
touchmove: (e) => touchmove(e, wrapper)
};
}
function mounted(el, binding) {
const value = binding.value;
const target = value?.parent ? el.parentElement : el;
const options = value?.options ?? { passive: true };
const uid = binding.instance?.$.uid;
if (!target || uid === void 0) return;
const handlers = createHandlers(binding.value);
target._touchHandlers = target._touchHandlers ?? Object.create(null);
target._touchHandlers[uid] = handlers;
keys(handlers).forEach((eventName) => {
target.addEventListener(eventName, handlers[eventName], options);
});
}
function unmounted(el, binding) {
const target = binding.value?.parent ? el.parentElement : el;
const uid = binding.instance?.$.uid;
if (!target?._touchHandlers || uid === void 0) return;
const handlers = target._touchHandlers[uid];
keys(handlers).forEach((eventName) => {
target.removeEventListener(eventName, handlers[eventName]);
});
delete target._touchHandlers[uid];
}
var Touch = {
mounted,
unmounted
};
//#endregion
//#region node_modules/vuetify/lib/components/VWindow/VWindow.js
var VWindowSymbol = Symbol.for("vuetify:v-window");
var VWindowGroupSymbol = Symbol.for("vuetify:v-window-group");
var makeVWindowProps = propsFactory({
continuous: Boolean,
nextIcon: {
type: [
Boolean,
String,
Function,
Object
],
default: "$next"
},
prevIcon: {
type: [
Boolean,
String,
Function,
Object
],
default: "$prev"
},
reverse: Boolean,
showArrows: {
type: [Boolean, String],
validator: (v) => typeof v === "boolean" || v === "hover"
},
verticalArrows: [Boolean, String],
touch: {
type: [Object, Boolean],
default: void 0
},
direction: {
type: String,
default: "horizontal"
},
modelValue: null,
disabled: Boolean,
selectedClass: {
type: String,
default: "v-window-item--active"
},
mandatory: {
type: [Boolean, String],
default: "force"
},
crossfade: Boolean,
transitionDuration: Number,
...makeComponentProps(),
...makeTagProps(),
...makeThemeProps()
}, "VWindow");
var VWindow = genericComponent()({
name: "VWindow",
directives: { vTouch: Touch },
props: makeVWindowProps(),
emits: { "update:modelValue": (value) => true },
setup(props, { slots }) {
const { themeClasses } = provideTheme(props);
const { isRtl } = useRtl();
const { t } = useLocale();
const group = useGroup(props, VWindowGroupSymbol);
const rootRef = ref();
const isRtlReverse = computed(() => isRtl.value ? !props.reverse : props.reverse);
const isReversed = shallowRef(false);
const transition = computed(() => {
if (props.crossfade) return "v-window-crossfade-transition";
return `v-window-${props.direction === "vertical" ? "y" : "x"}${(isRtlReverse.value ? !isReversed.value : isReversed.value) ? "-reverse" : ""}-transition`;
});
const transitionCount = shallowRef(0);
const transitionHeight = ref(void 0);
const activeIndex = computed(() => {
return group.items.value.findIndex((item) => group.selected.value.includes(item.id));
});
watch(activeIndex, (newVal, oldVal) => {
let scrollableParent;
const savedScrollPosition = {
left: 0,
top: 0
};
if (IN_BROWSER && oldVal >= 0) {
scrollableParent = getScrollParent(rootRef.value);
savedScrollPosition.left = scrollableParent?.scrollLeft;
savedScrollPosition.top = scrollableParent?.scrollTop;
}
const itemsLength = group.items.value.length;
const lastIndex = itemsLength - 1;
if (itemsLength <= 2) isReversed.value = newVal < oldVal;
else if (newVal === lastIndex && oldVal === 0) isReversed.value = false;
else if (newVal === 0 && oldVal === lastIndex) isReversed.value = true;
else isReversed.value = newVal < oldVal;
nextTick(() => {
if (!IN_BROWSER || !scrollableParent) return;
if (scrollableParent.scrollTop !== savedScrollPosition.top) scrollableParent.scrollTo({
...savedScrollPosition,
behavior: "instant"
});
requestAnimationFrame(() => {
if (!scrollableParent) return;
if (scrollableParent.scrollTop !== savedScrollPosition.top) scrollableParent.scrollTo({
...savedScrollPosition,
behavior: "instant"
});
});
});
}, { flush: "sync" });
provide(VWindowSymbol, {
transition,
isReversed,
transitionCount,
transitionHeight,
rootRef
});
const canMoveBack = toRef(() => props.continuous || activeIndex.value !== 0);
const canMoveForward = toRef(() => props.continuous || activeIndex.value !== group.items.value.length - 1);
function prev() {
canMoveBack.value && group.prev();
}
function next() {
canMoveForward.value && group.next();
}
const arrows = computed(() => {
const arrows = [];
const prevProps = {
icon: isRtl.value ? props.nextIcon : props.prevIcon,
class: `v-window__${isRtlReverse.value ? "right" : "left"}`,
onClick: group.prev,
"aria-label": t("$vuetify.carousel.prev")
};
arrows.push(canMoveBack.value ? slots.prev ? slots.prev({ props: prevProps }) : createVNode(VBtn, prevProps, null) : createBaseVNode("div", null, null));
const nextProps = {
icon: isRtl.value ? props.prevIcon : props.nextIcon,
class: `v-window__${isRtlReverse.value ? "left" : "right"}`,
onClick: group.next,
"aria-label": t("$vuetify.carousel.next")
};
arrows.push(canMoveForward.value ? slots.next ? slots.next({ props: nextProps }) : createVNode(VBtn, nextProps, null) : createBaseVNode("div", null, null));
return arrows;
});
const touchOptions = computed(() => {
if (props.touch === false) return props.touch;
return {
left: () => {
isRtlReverse.value ? prev() : next();
},
right: () => {
isRtlReverse.value ? next() : prev();
},
start: ({ originalEvent }) => {
originalEvent.stopPropagation();
},
...props.touch === true ? {} : props.touch
};
});
function onKeyDown(e) {
if (props.direction === "horizontal" && e.key === "ArrowLeft" || props.direction === "vertical" && e.key === "ArrowUp") {
e.preventDefault();
prev();
nextTick(() => {
canMoveBack.value ? focusArrow(0) : focusArrow(1);
});
}
if (props.direction === "horizontal" && e.key === "ArrowRight" || props.direction === "vertical" && e.key === "ArrowDown") {
e.preventDefault();
next();
nextTick(() => {
canMoveForward.value ? focusArrow(1) : focusArrow(0);
});
}
}
function focusArrow(index) {
const arrow = arrows.value[index];
if (!arrow) return;
(Array.isArray(arrow) ? arrow[0] : arrow).el?.focus();
}
useRender(() => withDirectives(createVNode(props.tag, {
"ref": rootRef,
"class": normalizeClass([
"v-window",
{
"v-window--show-arrows-on-hover": props.showArrows === "hover",
"v-window--vertical-arrows": !!props.verticalArrows,
"v-window--crossfade": !!props.crossfade
},
themeClasses.value,
props.class
]),
"style": normalizeStyle([props.style, { "--v-window-transition-duration": !PREFERS_REDUCED_MOTION() ? convertToUnit(props.transitionDuration, "ms") : null }])
}, { default: () => [createBaseVNode("div", {
"class": "v-window__container",
"style": { height: transitionHeight.value }
}, [slots.default?.({ group }), props.showArrows !== false && createBaseVNode("div", {
"class": normalizeClass([
"v-window__controls",
{ "v-window__controls--left": props.verticalArrows === "left" || props.verticalArrows === true },
{ "v-window__controls--right": props.verticalArrows === "right" }
]),
"onKeydown": onKeyDown
}, [arrows.value])]), slots.additional?.({ group })] }), [[Touch, touchOptions.value]]));
return { group };
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VTabs/VTabsWindow.js
var makeVTabsWindowProps = propsFactory({ ...omit(makeVWindowProps(), [
"continuous",
"nextIcon",
"prevIcon",
"showArrows",
"touch",
"mandatory"
]) }, "VTabsWindow");
var VTabsWindow = genericComponent()({
name: "VTabsWindow",
props: makeVTabsWindowProps(),
emits: { "update:modelValue": (v) => true },
setup(props, { slots }) {
const group = inject(VTabsSymbol, null);
const _model = useProxiedModel(props, "modelValue");
const model = computed({
get() {
if (_model.value != null || !group) return _model.value;
return group.items.value.find((item) => group.selected.value.includes(item.id))?.value;
},
set(val) {
_model.value = val;
}
});
useRender(() => {
return createVNode(VWindow, mergeProps({ "_as": "VTabsWindow" }, VWindow.filterProps(props), {
"modelValue": model.value,
"onUpdate:modelValue": ($event) => model.value = $event,
"class": ["v-tabs-window", props.class],
"style": props.style,
"mandatory": false,
"touch": false
}), slots);
});
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VWindow/VWindowItem.js
var makeVWindowItemProps = propsFactory({
reverseTransition: {
type: [Boolean, String],
default: void 0
},
transition: {
type: [Boolean, String],
default: void 0
},
...makeComponentProps(),
...makeGroupItemProps(),
...makeLazyProps()
}, "VWindowItem");
var VWindowItem = genericComponent()({
name: "VWindowItem",
directives: { vTouch: Touch },
props: makeVWindowItemProps(),
emits: { "group:selected": (val) => true },
setup(props, { slots }) {
const window = inject(VWindowSymbol);
const groupItem = useGroupItem(props, VWindowGroupSymbol);
const { isBooted } = useSsrBoot();
if (!window || !groupItem) throw new Error("[Vuetify] VWindowItem must be used inside VWindow");
const isTransitioning = shallowRef(false);
const hasTransition = computed(() => isBooted.value && (window.isReversed.value ? props.reverseTransition !== false : props.transition !== false));
function onAfterTransition() {
if (!isTransitioning.value || !window) return;
isTransitioning.value = false;
if (window.transitionCount.value > 0) {
window.transitionCount.value -= 1;
if (window.transitionCount.value === 0) window.transitionHeight.value = void 0;
}
}
function onBeforeTransition() {
if (isTransitioning.value || !window) return;
isTransitioning.value = true;
if (window.transitionCount.value === 0) window.transitionHeight.value = convertToUnit(window.rootRef.value?.clientHeight);
window.transitionCount.value += 1;
}
function onTransitionCancelled() {
onAfterTransition();
}
function onEnterTransition(el) {
if (!isTransitioning.value) return;
nextTick(() => {
if (!hasTransition.value || !isTransitioning.value || !window) return;
window.transitionHeight.value = convertToUnit(el.clientHeight);
});
}
const transition = computed(() => {
const name = window.isReversed.value ? props.reverseTransition : props.transition;
return !hasTransition.value ? false : {
name: typeof name !== "string" ? window.transition.value : name,
onBeforeEnter: onBeforeTransition,
onAfterEnter: onAfterTransition,
onEnterCancelled: onTransitionCancelled,
onBeforeLeave: onBeforeTransition,
onAfterLeave: onAfterTransition,
onLeaveCancelled: onTransitionCancelled,
onEnter: onEnterTransition
};
});
const { hasContent } = useLazy(props, groupItem.isSelected);
useRender(() => createVNode(MaybeTransition, {
"transition": transition.value,
"disabled": !isBooted.value
}, { default: () => [withDirectives(createBaseVNode("div", {
"class": normalizeClass([
"v-window-item",
groupItem.selectedClass.value,
props.class
]),
"style": normalizeStyle(props.style)
}, [hasContent.value && slots.default?.()]), [[vShow, groupItem.isSelected.value]])] }));
return { groupItem };
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VTabs/VTabsWindowItem.js
var makeVTabsWindowItemProps = propsFactory({ ...makeVWindowItemProps() }, "VTabsWindowItem");
var VTabsWindowItem = genericComponent()({
name: "VTabsWindowItem",
props: makeVTabsWindowItemProps(),
setup(props, { slots }) {
useRender(() => {
return createVNode(VWindowItem, mergeProps({ "_as": "VTabsWindowItem" }, VWindowItem.filterProps(props), {
"class": ["v-tabs-window-item", props.class],
"style": props.style
}), slots);
});
return {};
}
});
//#endregion
//#region node_modules/vuetify/lib/components/VTabs/VTabs.js
function parseItems(items) {
if (!items) return [];
return items.map((item) => {
if (!isObject(item)) return {
text: item,
value: item
};
return item;
});
}
var makeVTabsProps = propsFactory({
alignTabs: {
type: String,
default: "start"
},
color: String,
fixedTabs: Boolean,
items: {
type: Array,
default: () => []
},
stacked: Boolean,
bgColor: String,
grow: Boolean,
height: {
type: [Number, String],
default: void 0
},
hideSlider: Boolean,
inset: Boolean,
insetPadding: [String, Number],
insetRadius: [String, Number],
sliderColor: String,
...pick(makeVTabProps(), [
"spaced",
"sliderTransition",
"sliderTransitionDuration"
]),
...makeVSlideGroupProps({
mandatory: "force",
selectedClass: "v-tab-item--selected"
}),
...makeDensityProps(),
...makeTagProps()
}, "VTabs");
var VTabs = genericComponent()({
name: "VTabs",
props: makeVTabsProps(),
emits: { "update:modelValue": (v) => true },
setup(props, { attrs, slots }) {
const model = useProxiedModel(props, "modelValue");
const items = computed(() => parseItems(props.items));
const { densityClasses } = useDensity(props);
const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.bgColor);
const { scopeId } = useScopeId();
provideDefaults({ VTab: {
color: toRef(props, "color"),
direction: toRef(props, "direction"),
stacked: toRef(props, "stacked"),
fixed: toRef(props, "fixedTabs"),
inset: toRef(props, "inset"),
sliderColor: toRef(props, "sliderColor"),
sliderTransition: toRef(props, "sliderTransition"),
sliderTransitionDuration: toRef(props, "sliderTransitionDuration"),
hideSlider: toRef(props, "hideSlider")
} });
useRender(() => {
const slideGroupProps = VSlideGroup.filterProps(props);
const hasWindow = !!(slots.window || props.items.length > 0);
return createBaseVNode(Fragment, null, [createVNode(VSlideGroup, mergeProps(slideGroupProps, {
"modelValue": model.value,
"onUpdate:modelValue": ($event) => model.value = $event,
"class": [
"v-tabs",
`v-tabs--${props.direction}`,
`v-tabs--align-tabs-${props.alignTabs}`,
{
"v-tabs--fixed-tabs": props.fixedTabs,
"v-tabs--grow": props.grow,
"v-tabs--inset": props.inset,
"v-tabs--stacked": props.stacked
},
densityClasses.value,
backgroundColorClasses.value,
props.class
],
"style": [
{
"--v-tabs-height": convertToUnit(props.height),
"--v-tabs-inset-padding": props.inset ? convertToUnit(props.insetPadding) : void 0,
"--v-tabs-inset-radius": props.inset ? convertToUnit(props.insetRadius) : void 0
},
backgroundColorStyles.value,
props.style
],
"role": "tablist",
"symbol": VTabsSymbol
}, scopeId, attrs), {
default: slots.default ?? (() => items.value.map((item) => slots.tab?.({ item }) ?? createVNode(VTab, mergeProps(item, {
"key": item.text,
"value": item.value,
"spaced": props.spaced
}), { default: slots[`tab.${item.value}`] ? () => slots[`tab.${item.value}`]?.({ item }) : void 0 }))),
prev: slots.prev,
next: slots.next
}), hasWindow && createVNode(VTabsWindow, mergeProps({
"modelValue": model.value,
"onUpdate:modelValue": ($event) => model.value = $event,
"key": "tabs-window"
}, scopeId), { default: () => [items.value.map((item) => slots.item?.({ item }) ?? createVNode(VTabsWindowItem, { "value": item.value }, { default: () => slots[`item.${item.value}`]?.({ item }) })), slots.window?.()] })]);
});
return {};
}
});
//#endregion
export { VTab, VTabs, VTabsWindow, VTabsWindowItem };
//# sourceMappingURL=vuetify_components_VTabs.js.map
File diff suppressed because one or more lines are too long
-31
View File
@@ -1,31 +0,0 @@
import { Qn as toRef, W as createBaseVNode, ar as normalizeClass, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { o as provideDefaults, r as genericComponent, u as propsFactory } from "./defineComponent-D5UWd5Vb.js";
import { t as makeComponentProps } from "./component-W6F5nwNC.js";
import { t as useRender } from "./useRender-DB_YiTtB.js";
import { n as makeVariantProps } from "./variant-BcdnKFgE.js";
import { r as VToolbarTitle, t as VToolbar } from "./VToolbar-DAPb7QHO.js";
//#region node_modules/vuetify/lib/components/VToolbar/VToolbarItems.js
var makeVToolbarItemsProps = propsFactory({
...makeComponentProps(),
...makeVariantProps({ variant: "text" })
}, "VToolbarItems");
var VToolbarItems = genericComponent()({
name: "VToolbarItems",
props: makeVToolbarItemsProps(),
setup(props, { slots }) {
provideDefaults({ VBtn: {
color: toRef(() => props.color),
height: "inherit",
variant: toRef(() => props.variant)
} });
useRender(() => createBaseVNode("div", {
"class": normalizeClass(["v-toolbar-items", props.class]),
"style": normalizeStyle(props.style)
}, [slots.default?.()]));
return {};
}
});
//#endregion
export { VToolbar, VToolbarItems, VToolbarTitle };
//# sourceMappingURL=vuetify_components_VToolbar.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"file":"vuetify_components_VToolbar.js","names":["_createElementVNode","_normalizeClass","_normalizeStyle"],"sources":["../../vuetify/lib/components/VToolbar/VToolbarItems.js"],"sourcesContent":["import { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode } from \"vue\";\n// Composables\nimport { makeComponentProps } from \"../../composables/component.js\";\nimport { provideDefaults } from \"../../composables/defaults.js\";\nimport { makeVariantProps } from \"../../composables/variant.js\"; // Utilities\nimport { toRef } from 'vue';\nimport { genericComponent, propsFactory, useRender } from \"../../util/index.js\";\nexport const makeVToolbarItemsProps = propsFactory({\n ...makeComponentProps(),\n ...makeVariantProps({\n variant: 'text'\n })\n}, 'VToolbarItems');\nexport const VToolbarItems = genericComponent()({\n name: 'VToolbarItems',\n props: makeVToolbarItemsProps(),\n setup(props, {\n slots\n }) {\n provideDefaults({\n VBtn: {\n color: toRef(() => props.color),\n height: 'inherit',\n variant: toRef(() => props.variant)\n }\n });\n useRender(() => _createElementVNode(\"div\", {\n \"class\": _normalizeClass(['v-toolbar-items', props.class]),\n \"style\": _normalizeStyle(props.style)\n }, [slots.default?.()]));\n return {};\n }\n});\n//# sourceMappingURL=VToolbarItems.js.map"],"mappings":";;;;;;;AAOA,IAAa,yBAAyB,aAAa;CACjD,GAAG,oBAAoB;CACvB,GAAG,iBAAiB,EAClB,SAAS,QACV,CAAC;CACH,EAAE,gBAAgB;AACnB,IAAa,gBAAgB,kBAAkB,CAAC;CAC9C,MAAM;CACN,OAAO,wBAAwB;CAC/B,MAAM,OAAO,EACX,SACC;AACD,kBAAgB,EACd,MAAM;GACJ,OAAO,YAAY,MAAM,MAAM;GAC/B,QAAQ;GACR,SAAS,YAAY,MAAM,QAAQ;GACpC,EACF,CAAC;AACF,kBAAgBA,gBAAoB,OAAO;GACzC,SAASC,eAAgB,CAAC,mBAAmB,MAAM,MAAM,CAAC;GAC1D,SAASC,eAAgB,MAAM,MAAM;GACtC,EAAE,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC;AACxB,SAAO,EAAE;;CAEZ,CAAC"}
+28 -11
View File
@@ -1946,7 +1946,7 @@ var flow = superClass => class FlowParserMixin extends superClass {
}
flowParseDeclareVariable(node) {
this.next();
node.id = this.flowParseTypeAnnotatableIdentifier(true);
node.id = this.flowParseTypeAnnotatableIdentifier();
this.scope.declareName(node.id.name, 5, node.id.loc.start);
this.semicolon();
return this.finishNode(node, "DeclareVariable");
@@ -2120,9 +2120,14 @@ var flow = superClass => class FlowParserMixin extends superClass {
reservedType: word
});
}
flowParseRestrictedIdentifier(liberal, declaration) {
flowParseRestrictedIdentifierName(liberal, declaration) {
this.checkReservedType(this.state.value, this.state.startLoc, declaration);
return this.parseIdentifier(liberal);
return this.parseIdentifierName(liberal);
}
flowParseRestrictedIdentifier(liberal, declaration) {
const node = this.startNode();
const name = this.flowParseRestrictedIdentifierName(liberal, declaration);
return this.createIdentifier(node, name);
}
flowParseTypeAlias(node) {
node.id = this.flowParseRestrictedIdentifier(false, true);
@@ -2156,14 +2161,21 @@ var flow = superClass => class FlowParserMixin extends superClass {
this.semicolon();
return this.finishNode(node, "OpaqueType");
}
flowParseTypeParameterBound() {
if (this.match(14) || this.isContextual(81)) {
const node = this.startNode();
this.next();
node.typeAnnotation = this.flowParseType();
return this.finishNode(node, "TypeAnnotation");
}
}
flowParseTypeParameter(requireDefault = false) {
const nodeStartLoc = this.state.startLoc;
const node = this.startNode();
const variance = this.flowParseVariance();
const ident = this.flowParseTypeAnnotatableIdentifier();
node.name = ident.name;
node.name = this.flowParseRestrictedIdentifierName();
node.variance = variance;
node.bound = ident.typeAnnotation;
node.bound = this.flowParseTypeParameterBound();
if (this.match(29)) {
this.eat(29);
node.default = this.flowParseType();
@@ -2860,13 +2872,13 @@ var flow = superClass => class FlowParserMixin extends superClass {
node.typeAnnotation = this.flowParseTypeInitialiser();
return this.finishNode(node, "TypeAnnotation");
}
flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
flowParseTypeAnnotatableIdentifier() {
const node = this.startNode();
const name = this.parseIdentifierName();
if (this.match(14)) {
ident.typeAnnotation = this.flowParseTypeAnnotation();
this.resetEndLocation(ident);
node.typeAnnotation = this.flowParseTypeAnnotation();
}
return ident;
return this.createIdentifier(node, name);
}
typeCastToParameter(node) {
node.expression.typeAnnotation = node.typeAnnotation;
@@ -5093,6 +5105,7 @@ class CommentsParser extends BaseParser {
adjustInnerComments(node, node.properties, commentWS);
break;
case "CallExpression":
case "NewExpression":
case "OptionalCallExpression":
adjustInnerComments(node, node.arguments, commentWS);
break;
@@ -5105,6 +5118,7 @@ class CommentsParser extends BaseParser {
case "ObjectMethod":
case "ClassMethod":
case "ClassPrivateMethod":
case "TSTypeParameterDeclaration":
adjustInnerComments(node, node.params, commentWS);
break;
case "ArrayExpression":
@@ -5121,6 +5135,9 @@ class CommentsParser extends BaseParser {
case "TSEnumBody":
adjustInnerComments(node, node.members, commentWS);
break;
case "TSInterfaceBody":
adjustInnerComments(node, node.body, commentWS);
break;
default:
{
if (node.type === "RecordExpression") {
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@babel/parser",
"version": "7.29.2",
"version": "7.29.3",
"description": "A JavaScript parser",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-parser",
+8
View File
@@ -1,5 +1,13 @@
# @clack/core
## 1.3.0
### Minor Changes
- 78fd3ae: Remove unused `debug` option key.
- ea5702e: fix: add engines field expressing node >=20.12 requirement
- 814ab9a: Add new multiline prompt for multi-line text input.
## 1.2.0
### Minor Changes
+18 -4
View File
@@ -100,7 +100,6 @@ interface PromptOptions<TValue, Self extends Prompt<TValue>> {
validate?: ((value: TValue | undefined) => string | Error | undefined) | undefined;
input?: Readable;
output?: Writable;
debug?: boolean;
signal?: AbortSignal;
}
declare class Prompt<TValue> {
@@ -148,6 +147,7 @@ declare class Prompt<TValue> {
emit<T extends keyof ClackEvents<TValue>>(event: T, ...data: Parameters<ClackEvents<TValue>[T]>): void;
prompt(): Promise<symbol | TValue | undefined>;
protected _isActionKey(char: string | undefined, _key: Key): boolean;
protected _shouldSubmit(_char: string | undefined, _key: Key): boolean;
protected _setValue(value: TValue | undefined): void;
protected _setUserInput(value: string | undefined, write?: boolean): void;
protected _clearUserInput(): void;
@@ -258,6 +258,20 @@ declare class GroupMultiSelectPrompt<T extends {
constructor(opts: GroupMultiSelectOptions<T>);
}
interface MultiLineOptions extends PromptOptions<string, MultiLinePrompt> {
placeholder?: string;
defaultValue?: string;
showSubmit?: boolean;
}
declare class MultiLinePrompt extends Prompt<string> {
#private;
focused: 'editor' | 'submit';
get userInputWithCursor(): string;
get cursor(): number;
protected _shouldSubmit(_char: string | undefined, _key: Key): boolean;
constructor(opts: MultiLineOptions);
}
interface OptionLike {
value: any;
disabled?: boolean;
@@ -343,7 +357,7 @@ interface BlockOptions {
declare function block({ input, output, overwrite, hideCursor, }?: BlockOptions): () => void;
declare const getColumns: (output: Writable) => number;
declare const getRows: (output: Writable) => number;
declare function wrapTextWithPrefix(output: Writable | undefined, text: string, prefix: string, startPrefix?: string): string;
declare function wrapTextWithPrefix(output: Writable | undefined, text: string, prefix: string, startPrefix?: string, lineFormatter?: (line: string, index: number) => string): string;
export { AutocompletePrompt, ConfirmPrompt, DatePrompt, GroupMultiSelectPrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, TextPrompt, block, getColumns, getRows, isCancel, settings, updateSettings, wrapTextWithPrefix };
export type { AutocompleteOptions, ClackSettings, ConfirmOptions, DateFormat, DateOptions, DateParts, GroupMultiSelectOptions, MultiSelectOptions, PasswordOptions, PromptOptions, SelectKeyOptions, SelectOptions, ClackState as State, TextOptions };
export { AutocompletePrompt, ConfirmPrompt, DatePrompt, GroupMultiSelectPrompt, MultiLinePrompt, MultiSelectPrompt, PasswordPrompt, Prompt, SelectKeyPrompt, SelectPrompt, TextPrompt, block, getColumns, getRows, isCancel, settings, updateSettings, wrapTextWithPrefix };
export type { AutocompleteOptions, ClackSettings, ConfirmOptions, DateFormat, DateOptions, DateParts, GroupMultiSelectOptions, MultiLineOptions, MultiSelectOptions, PasswordOptions, PromptOptions, SelectKeyOptions, SelectOptions, ClackState as State, TextOptions };
+16 -10
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@clack/core",
"version": "1.2.0",
"version": "1.3.0",
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
@@ -46,8 +46,11 @@
"url": "https://twitter.com/n_moore"
},
"license": "MIT",
"engines": {
"node": ">= 20.12.0"
},
"dependencies": {
"fast-wrap-ansi": "^0.1.3",
"fast-wrap-ansi": "^0.2.0",
"sisteransi": "^1.0.5"
},
"devDependencies": {
+15
View File
@@ -1,5 +1,20 @@
# @clack/prompts
## 1.3.0
### Minor Changes
- ea5702e: fix: add engines field expressing node >=20.12 requirement
- 814ab9a: Add new multiline prompt for multi-line text input.
### Patch Changes
- 5b897a7: Fix mixed type-only and runtime exports from @clack/core.
- Updated dependencies [78fd3ae]
- Updated dependencies [ea5702e]
- Updated dependencies [814ab9a]
- @clack/core@1.3.0
## 1.2.0
### Minor Changes
+107 -2
View File
@@ -11,7 +11,7 @@ Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stack
- 🤏 80% smaller than other options
- 💎 Beautiful, minimal UI
- ✅ Simple API
- 🧱 Comes with `text`, `confirm`, `select`, `multiselect`, and `spinner` components
- 🧱 Comes with `text`, `password`, `confirm`, `date`, `select`, `autocomplete`, `selectKey`, `multiselect`, `path`, and `spinner` components
## Basics
@@ -63,6 +63,22 @@ const meaning = await text({
});
```
### Password
The password component behaves like `text`, but masks the input as the user types.
```js
import { password } from '@clack/prompts';
const secret = await password({
message: 'Set a password.',
mask: '*',
validate(value) {
if (!value || value.length < 8) return 'Password must be at least 8 characters.';
},
});
```
### Confirm
The confirm component accepts a yes or no answer. The result is a boolean value of `true` or `false`.
@@ -75,6 +91,21 @@ const shouldContinue = await confirm({
});
```
### Date
The date component accepts a calendar date and returns a `Date` value.
```js
import { date } from '@clack/prompts';
const dueDate = await date({
message: 'Pick a due date.',
format: 'YMD',
minDate: new Date(Date.UTC(2026, 0, 1)),
maxDate: new Date(Date.UTC(2026, 11, 31)),
});
```
### Select
The select component allows a user to choose one value from a list of options. The result is the `value` prop of a given option.
@@ -92,6 +123,42 @@ const projectType = await select({
});
```
### Autocomplete
The autocomplete component lets a user filter a list by typing, then choose one option from the matching results. By default, matching uses each option's `label`, `hint`, and `value`. The result is the selected option's `value`.
```js
import { autocomplete } from '@clack/prompts';
const framework = await autocomplete({
message: 'Pick a framework.',
placeholder: 'Type to search...',
options: [
{ value: 'next', label: 'Next.js' },
{ value: 'nuxt', label: 'Nuxt' },
{ value: 'sveltekit', label: 'SvelteKit' },
{ value: 'remix', label: 'Remix' },
],
});
```
### Select Key
The `selectKey` component lets a user choose an option by pressing its single-character string `value` key directly.
```js
import { selectKey } from '@clack/prompts';
const action = await selectKey({
message: 'Pick an action.',
options: [
{ value: 'd', label: 'Deploy' },
{ value: 't', label: 'Run tests' },
{ value: 'q', label: 'Quit' },
],
});
```
### Multi-Select
The `multiselect` component allows a user to choose many values from a list of options. The result is an array with all selected `value` props.
@@ -132,6 +199,44 @@ const basket = await groupMultiselect({
});
```
### Multi-Line Text
The multi-line text component accepts multiple lines of text input. By default, pressing `Enter` twice submits the input.
```js
import { multiline } from '@clack/prompts';
const bio = await multiline({
message: 'Tell us about yourself.',
placeholder: 'Start typing...',
validate(value) {
if (value.length === 0) return `value is required`;
},
});
```
Set `showSubmit` to display an explicit submit button instead of double `Enter` submission:
```js
const bio = await multiline({
message: 'Tell us about yourself.',
showSubmit: true,
});
```
### Path
The path component offers filesystem path suggestions and returns the selected path as a string. When `directory: true` is set, only directories can be selected.
```js
import { path } from '@clack/prompts';
const targetDir = await path({
message: 'Select an existing directory.',
directory: true,
});
```
### Spinner
The spinner component surfaces a pending action, such as a long-running download or dependency installation.
@@ -157,7 +262,7 @@ p.start('Downloading archive');
// Do download here
p.advance(3, 'Downloading (30%)');
// ...
p.advance(8, 'Downloading (80%)');
p.advance(5, 'Downloading (80%)');
// ...
p.stop('Archive downloaded');
```
+16 -11
View File
@@ -251,6 +251,20 @@ declare const cancel: (message?: string, opts?: CommonOptions) => void;
declare const intro: (title?: string, opts?: CommonOptions) => void;
declare const outro: (message?: string, opts?: CommonOptions) => void;
interface TextOptions extends CommonOptions {
message: string;
placeholder?: string;
defaultValue?: string;
initialValue?: string;
validate?: (value: string | undefined) => string | Error | undefined;
}
declare const text: (opts: TextOptions) => Promise<string | symbol>;
interface MultiLineOptions extends TextOptions {
showSubmit?: boolean;
}
declare const multiline: (opts: MultiLineOptions) => Promise<string | symbol>;
interface MultiSelectOptions<Value> extends CommonOptions {
message: string;
options: Option<Value>[];
@@ -378,14 +392,5 @@ declare const taskLog: (opts: TaskLogOptions) => {
success(message: string, opts?: TaskLogCompletionOptions): void;
};
interface TextOptions extends CommonOptions {
message: string;
placeholder?: string;
defaultValue?: string;
initialValue?: string;
validate?: (value: string | undefined) => string | Error | undefined;
}
declare const text: (opts: TextOptions) => Promise<string | symbol>;
export { S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
export type { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, CommonOptions, ConfirmOptions, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions };
export { S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
export type { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, CommonOptions, ConfirmOptions, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiLineOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions };
+114 -107
View File
@@ -1,137 +1,144 @@
import{getColumns as X,getRows as ke,AutocompletePrompt as ve,settings as I,ConfirmPrompt as Le,wrapTextWithPrefix as N,DatePrompt as De,isCancel as We,GroupMultiSelectPrompt as Fe,MultiSelectPrompt as He,PasswordPrompt as Ue,block as Ke,SelectPrompt as qe,SelectKeyPrompt as Je,TextPrompt as Ye}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import{styleText as t,stripVTControlCharacters as ne}from"node:util";import P from"node:process";import{wrapAnsi as q}from"fast-wrap-ansi";import B from"fast-string-width";import{existsSync as Xe,lstatSync as we,readdirSync as ze}from"node:fs";import{dirname as be,join as Qe}from"node:path";import{cursor as Se,erase as Ce}from"sisteransi";function Ze(){return P.platform!=="win32"?P.env.TERM!=="linux":!!P.env.CI||!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask==="{cmd::Cmder}"||P.env.TERM_PROGRAM==="Terminus-Sublime"||P.env.TERM_PROGRAM==="vscode"||P.env.TERM==="xterm-256color"||P.env.TERM==="alacritty"||P.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const ee=Ze(),ae=()=>process.env.CI==="true",Te=e=>e.isTTY===!0,w=(e,i)=>ee?e:i,_e=w("\u25C6","*"),oe=w("\u25A0","x"),ue=w("\u25B2","x"),F=w("\u25C7","o"),le=w("\u250C","T"),d=w("\u2502","|"),E=w("\u2514","\u2014"),Ie=w("\u2510","T"),Ee=w("\u2518","\u2014"),z=w("\u25CF",">"),H=w("\u25CB"," "),te=w("\u25FB","[\u2022]"),U=w("\u25FC","[+]"),J=w("\u25FB","[ ]"),xe=w("\u25AA","\u2022"),se=w("\u2500","-"),ce=w("\u256E","+"),Ge=w("\u251C","+"),$e=w("\u256F","+"),de=w("\u2570","+"),Oe=w("\u256D","+"),he=w("\u25CF","\u2022"),pe=w("\u25C6","*"),me=w("\u25B2","!"),ge=w("\u25A0","x"),V=e=>{switch(e){case"initial":case"active":return t("cyan",_e);case"cancel":return t("red",oe);case"error":return t("yellow",ue);case"submit":return t("green",F)}},ye=e=>{switch(e){case"initial":case"active":return t("cyan",d);case"cancel":return t("red",d);case"error":return t("yellow",d);case"submit":return t("green",d)}},et=(e,i,s,r,u)=>{let n=i,o=0;for(let c=s;c<r;c++){const a=e[c];if(n=n-a.length,o++,n<=u)break}return{lineCount:n,removals:o}},Y=({cursor:e,options:i,style:s,output:r=process.stdout,maxItems:u=Number.POSITIVE_INFINITY,columnPadding:n=0,rowPadding:o=4})=>{const c=X(r)-n,a=ke(r),l=t("dim","..."),$=Math.max(a-o,0),y=Math.max(Math.min(u,$),5);let p=0;e>=y-3&&(p=Math.max(Math.min(e-y+3,i.length-y),0));let m=y<i.length&&p>0,g=y<i.length&&p+y<i.length;const S=Math.min(p+y,i.length),h=[];let f=0;m&&f++,g&&f++;const v=p+(m?1:0),T=S-(g?1:0);for(let b=v;b<T;b++){const x=q(s(i[b],b===e),c,{hard:!0,trim:!1}).split(`
`);h.push(x),f+=x.length}if(f>$){let b=0,x=0,G=f;const M=e-v,R=(j,D)=>et(h,G,j,D,$);m?({lineCount:G,removals:b}=R(0,M),G>$&&({lineCount:G,removals:x}=R(M+1,h.length))):({lineCount:G,removals:x}=R(M+1,h.length),G>$&&({lineCount:G,removals:b}=R(0,M))),b>0&&(m=!0,h.splice(0,b)),x>0&&(g=!0,h.splice(h.length-x,x))}const C=[];m&&C.push(l);for(const b of h)for(const x of b)C.push(x);return g&&C.push(l),C};function Me(e){return e.label??String(e.value??"")}function Re(e,i){if(!e)return!0;const s=(i.label??String(i.value??"")).toLowerCase(),r=(i.hint??"").toLowerCase(),u=String(i.value).toLowerCase(),n=e.toLowerCase();return s.includes(n)||r.includes(n)||u.includes(n)}function tt(e,i){const s=[];for(const r of i)e.includes(r.value)&&s.push(r);return s}const Ae=e=>new ve({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((i,s)=>Re(i,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){const i=e.withGuide??I.withGuide,s=i?[`${t("gray",d)}`,`${V(this.state)} ${e.message}`]:[`${V(this.state)} ${e.message}`],r=this.userInput,u=this.options,n=e.placeholder,o=r===""&&n!==void 0,c=(a,l)=>{const $=Me(a),y=a.hint&&a.value===this.focusedValue?t("dim",` (${a.hint})`):"";switch(l){case"active":return`${t("green",z)} ${$}${y}`;case"inactive":return`${t("dim",H)} ${t("dim",$)}`;case"disabled":return`${t("gray",H)} ${t(["strikethrough","gray"],$)}`}};switch(this.state){case"submit":{const a=tt(this.selectedValues,u),l=a.length>0?` ${t("dim",a.map(Me).join(", "))}`:"",$=i?t("gray",d):"";return`${s.join(`
import{getColumns as X,getRows as Bt,AutocompletePrompt as vt,settings as _,ConfirmPrompt as Lt,wrapTextWithPrefix as O,DatePrompt as Dt,isCancel as Wt,GroupMultiSelectPrompt as Ft,MultiLinePrompt as Ht,MultiSelectPrompt as Ut,PasswordPrompt as Kt,block as qt,SelectPrompt as Jt,SelectKeyPrompt as Yt,TextPrompt as Xt}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import{styleText as e,stripVTControlCharacters as nt}from"node:util";import j from"node:process";import{wrapAnsi as q}from"fast-wrap-ansi";import k from"fast-string-width";import{existsSync as zt,lstatSync as wt,readdirSync as Qt}from"node:fs";import{dirname as bt,join as Zt}from"node:path";import{cursor as St,erase as Ct}from"sisteransi";function te(){return j.platform!=="win32"?j.env.TERM!=="linux":!!j.env.CI||!!j.env.WT_SESSION||!!j.env.TERMINUS_SUBLIME||j.env.ConEmuTask==="{cmd::Cmder}"||j.env.TERM_PROGRAM==="Terminus-Sublime"||j.env.TERM_PROGRAM==="vscode"||j.env.TERM==="xterm-256color"||j.env.TERM==="alacritty"||j.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const tt=te(),at=()=>process.env.CI==="true",Tt=t=>t.isTTY===!0,w=(t,r)=>tt?t:r,_t=w("\u25C6","*"),ot=w("\u25A0","x"),ut=w("\u25B2","x"),F=w("\u25C7","o"),lt=w("\u250C","T"),$=w("\u2502","|"),E=w("\u2514","\u2014"),It=w("\u2510","T"),Et=w("\u2518","\u2014"),z=w("\u25CF",">"),H=w("\u25CB"," "),et=w("\u25FB","[\u2022]"),U=w("\u25FC","[+]"),J=w("\u25FB","[ ]"),Gt=w("\u25AA","\u2022"),st=w("\u2500","-"),ct=w("\u256E","+"),xt=w("\u251C","+"),$t=w("\u256F","+"),dt=w("\u2570","+"),Ot=w("\u256D","+"),ht=w("\u25CF","\u2022"),pt=w("\u25C6","*"),mt=w("\u25B2","!"),gt=w("\u25A0","x"),M=t=>{switch(t){case"initial":case"active":return e("cyan",_t);case"cancel":return e("red",ot);case"error":return e("yellow",ut);case"submit":return e("green",F)}},yt=t=>{switch(t){case"initial":case"active":return e("cyan",$);case"cancel":return e("red",$);case"error":return e("yellow",$);case"submit":return e("green",$)}},ee=(t,r,s,i,u)=>{let n=r,o=0;for(let c=s;c<i;c++){const a=t[c];if(n=n-a.length,o++,n<=u)break}return{lineCount:n,removals:o}},Y=({cursor:t,options:r,style:s,output:i=process.stdout,maxItems:u=Number.POSITIVE_INFINITY,columnPadding:n=0,rowPadding:o=4})=>{const c=X(i)-n,a=Bt(i),l=e("dim","..."),d=Math.max(a-o,0),y=Math.max(Math.min(u,d),5);let p=0;t>=y-3&&(p=Math.max(Math.min(t-y+3,r.length-y),0));let m=y<r.length&&p>0,g=y<r.length&&p+y<r.length;const S=Math.min(p+y,r.length),h=[];let f=0;m&&f++,g&&f++;const v=p+(m?1:0),T=S-(g?1:0);for(let b=v;b<T;b++){const G=q(s(r[b],b===t),c,{hard:!0,trim:!1}).split(`
`);h.push(G),f+=G.length}if(f>d){let b=0,G=0,x=f;const A=t-v,P=(N,D)=>ee(h,x,N,D,d);m?({lineCount:x,removals:b}=P(0,A),x>d&&({lineCount:x,removals:G}=P(A+1,h.length))):({lineCount:x,removals:G}=P(A+1,h.length),x>d&&({lineCount:x,removals:b}=P(0,A))),b>0&&(m=!0,h.splice(0,b)),G>0&&(g=!0,h.splice(h.length-G,G))}const C=[];m&&C.push(l);for(const b of h)for(const G of b)C.push(G);return g&&C.push(l),C};function Mt(t){return t.label??String(t.value??"")}function Rt(t,r){if(!t)return!0;const s=(r.label??String(r.value??"")).toLowerCase(),i=(r.hint??"").toLowerCase(),u=String(r.value).toLowerCase(),n=t.toLowerCase();return s.includes(n)||i.includes(n)||u.includes(n)}function se(t,r){const s=[];for(const i of r)t.includes(i.value)&&s.push(i);return s}const At=t=>new vt({options:t.options,initialValue:t.initialValue?[t.initialValue]:void 0,initialUserInput:t.initialUserInput,placeholder:t.placeholder,filter:t.filter??((r,s)=>Rt(r,s)),signal:t.signal,input:t.input,output:t.output,validate:t.validate,render(){const r=t.withGuide??_.withGuide,s=r?[`${e("gray",$)}`,`${M(this.state)} ${t.message}`]:[`${M(this.state)} ${t.message}`],i=this.userInput,u=this.options,n=t.placeholder,o=i===""&&n!==void 0,c=(a,l)=>{const d=Mt(a),y=a.hint&&a.value===this.focusedValue?e("dim",` (${a.hint})`):"";switch(l){case"active":return`${e("green",z)} ${d}${y}`;case"inactive":return`${e("dim",H)} ${e("dim",d)}`;case"disabled":return`${e("gray",H)} ${e(["strikethrough","gray"],d)}`}};switch(this.state){case"submit":{const a=se(this.selectedValues,u),l=a.length>0?` ${e("dim",a.map(Mt).join(", "))}`:"",d=r?e("gray",$):"";return`${s.join(`
`)}
${$}${l}`}case"cancel":{const a=r?` ${t(["strikethrough","dim"],r)}`:"",l=i?t("gray",d):"";return`${s.join(`
${d}${l}`}case"cancel":{const a=i?` ${e(["strikethrough","dim"],i)}`:"",l=r?e("gray",$):"";return`${s.join(`
`)}
${l}${a}`}default:{const a=this.state==="error"?"yellow":"cyan",l=i?`${t(a,d)} `:"",$=i?t(a,E):"";let y="";if(this.isNavigating||o){const v=o?n:r;y=v!==""?` ${t("dim",v)}`:""}else y=` ${this.userInputWithCursor}`;const p=this.filteredOptions.length!==u.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",m=this.filteredOptions.length===0&&r?[`${l}${t("yellow","No matches found")}`]:[],g=this.state==="error"?[`${l}${t("yellow",this.error)}`]:[];i&&s.push(`${l.trimEnd()}`),s.push(`${l}${t("dim","Search:")}${y}${p}`,...m,...g);const S=[`${t("dim","\u2191/\u2193")} to select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],h=[`${l}${S.join(" \u2022 ")}`,$],f=this.filteredOptions.length===0?[]:Y({cursor:this.cursor,options:this.filteredOptions,columnPadding:i?3:0,rowPadding:s.length+h.length,style:(v,T)=>c(v,v.disabled?"disabled":T?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...f.map(v=>`${l}${v}`),...h].join(`
`)}}}}).prompt(),st=e=>{const i=(r,u,n,o)=>{const c=n.includes(r.value),a=r.label??String(r.value??""),l=r.hint&&o!==void 0&&r.value===o?t("dim",` (${r.hint})`):"",$=c?t("green",U):t("dim",J);return r.disabled?`${t("gray",J)} ${t(["strikethrough","gray"],a)}`:u?`${$} ${a}${l}`:`${$} ${t("dim",a)}`},s=new ve({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,u)=>Re(r,u)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){const r=e.withGuide??I.withGuide,u=`${r?`${t("gray",d)}
`:""}${V(this.state)} ${e.message}
`,n=this.userInput,o=e.placeholder,c=n===""&&o!==void 0,a=this.isNavigating||c?t("dim",c?o:n):this.userInputWithCursor,l=this.options,$=this.filteredOptions.length!==l.length?t("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${u}${r?`${t("gray",d)} `:""}${t("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${u}${r?`${t("gray",d)} `:""}${t(["strikethrough","dim"],n)}`;default:{const y=this.state==="error"?"yellow":"cyan",p=r?`${t(y,d)} `:"",m=r?t(y,E):"",g=[`${t("dim","\u2191/\u2193")} to navigate`,`${t("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${t("dim","Enter:")} confirm`,`${t("dim","Type:")} to search`],S=this.filteredOptions.length===0&&n?[`${p}${t("yellow","No matches found")}`]:[],h=this.state==="error"?[`${p}${t("yellow",this.error)}`]:[],f=[...`${u}${r?t(y,d):""}`.split(`
`),`${p}${t("dim","Search:")} ${a}${$}`,...S,...h],v=[`${p}${g.join(" \u2022 ")}`,m],T=Y({cursor:this.cursor,options:this.filteredOptions,style:(C,b)=>i(C,b,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:f.length+v.length});return[...f,...T.map(C=>`${p}${C}`),...v].join(`
`)}}}});return s.prompt()},rt=[Oe,ce,de,$e],it=[le,Ie,E,Ee];function Pe(e,i,s,r){let u=s,n=s;return r==="center"?u=Math.floor((i-e)/2):r==="right"&&(u=i-e-s),n=i-u-e,[u,n]}const nt=e=>e,at=(e="",i="",s)=>{const r=s?.output??process.stdout,u=X(r),n=2,o=s?.titlePadding??1,c=s?.contentPadding??2,a=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),l=s?.withGuide??I.withGuide?`${d} `:"",$=s?.formatBorder??nt,y=(s?.rounded?rt:it).map($),p=$(se),m=$(d),g=B(l),S=B(i),h=u-g;let f=Math.floor(u*a)-g;if(s?.width==="auto"){const R=e.split(`
`);let j=S+o*2;for(const ie of R){const W=B(ie)+c*2;W>j&&(j=W)}const D=j+n;D<f&&(f=D)}f%2!==0&&(f<h?f++:f--);const v=f-n,T=v-o*2,C=S>T?`${i.slice(0,T-3)}...`:i,[b,x]=Pe(B(C),v,o,s?.titleAlign),G=q(e,v-c*2,{hard:!0,trim:!1});r.write(`${l}${y[0]}${p.repeat(b)}${C}${p.repeat(x)}${y[1]}
`);const M=G.split(`
`);for(const R of M){const[j,D]=Pe(B(R),v,c,s?.contentAlign);r.write(`${l}${m}${" ".repeat(j)}${R}${" ".repeat(D)}${m}
`)}r.write(`${l}${y[2]}${p.repeat(v)}${y[3]}
`)},ot=e=>{const i=e.active??"Yes",s=e.inactive??"No";return new Le({active:i,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){const r=e.withGuide??I.withGuide,u=`${V(this.state)} `,n=r?`${t("gray",d)} `:"",o=N(e.output,e.message,n,u),c=`${r?`${t("gray",d)}
${l}${a}`}default:{const a=this.state==="error"?"yellow":"cyan",l=r?`${e(a,$)} `:"",d=r?e(a,E):"";let y="";if(this.isNavigating||o){const v=o?n:i;y=v!==""?` ${e("dim",v)}`:""}else y=` ${this.userInputWithCursor}`;const p=this.filteredOptions.length!==u.length?e("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",m=this.filteredOptions.length===0&&i?[`${l}${e("yellow","No matches found")}`]:[],g=this.state==="error"?[`${l}${e("yellow",this.error)}`]:[];r&&s.push(`${l.trimEnd()}`),s.push(`${l}${e("dim","Search:")}${y}${p}`,...m,...g);const S=[`${e("dim","\u2191/\u2193")} to select`,`${e("dim","Enter:")} confirm`,`${e("dim","Type:")} to search`],h=[`${l}${S.join(" \u2022 ")}`,d],f=this.filteredOptions.length===0?[]:Y({cursor:this.cursor,options:this.filteredOptions,columnPadding:r?3:0,rowPadding:s.length+h.length,style:(v,T)=>c(v,v.disabled?"disabled":T?"active":"inactive"),maxItems:t.maxItems,output:t.output});return[...s,...f.map(v=>`${l}${v}`),...h].join(`
`)}}}}).prompt(),ie=t=>{const r=(i,u,n,o)=>{const c=n.includes(i.value),a=i.label??String(i.value??""),l=i.hint&&o!==void 0&&i.value===o?e("dim",` (${i.hint})`):"",d=c?e("green",U):e("dim",J);return i.disabled?`${e("gray",J)} ${e(["strikethrough","gray"],a)}`:u?`${d} ${a}${l}`:`${d} ${e("dim",a)}`},s=new vt({options:t.options,multiple:!0,placeholder:t.placeholder,filter:t.filter??((i,u)=>Rt(i,u)),validate:()=>{if(t.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:t.initialValues,signal:t.signal,input:t.input,output:t.output,render(){const i=t.withGuide??_.withGuide,u=`${i?`${e("gray",$)}
`:""}${M(this.state)} ${t.message}
`,n=this.userInput,o=t.placeholder,c=n===""&&o!==void 0,a=this.isNavigating||c?e("dim",c?o:n):this.userInputWithCursor,l=this.options,d=this.filteredOptions.length!==l.length?e("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${u}${i?`${e("gray",$)} `:""}${e("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${u}${i?`${e("gray",$)} `:""}${e(["strikethrough","dim"],n)}`;default:{const y=this.state==="error"?"yellow":"cyan",p=i?`${e(y,$)} `:"",m=i?e(y,E):"",g=[`${e("dim","\u2191/\u2193")} to navigate`,`${e("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${e("dim","Enter:")} confirm`,`${e("dim","Type:")} to search`],S=this.filteredOptions.length===0&&n?[`${p}${e("yellow","No matches found")}`]:[],h=this.state==="error"?[`${p}${e("yellow",this.error)}`]:[],f=[...`${u}${i?e(y,$):""}`.split(`
`),`${p}${e("dim","Search:")} ${a}${d}`,...S,...h],v=[`${p}${g.join(" \u2022 ")}`,m],T=Y({cursor:this.cursor,options:this.filteredOptions,style:(C,b)=>r(C,b,this.selectedValues,this.focusedValue),maxItems:t.maxItems,output:t.output,rowPadding:f.length+v.length});return[...f,...T.map(C=>`${p}${C}`),...v].join(`
`)}}}});return s.prompt()},re=[Ot,ct,dt,$t],ne=[lt,It,E,Et];function Pt(t,r,s,i){let u=s,n=s;return i==="center"?u=Math.floor((r-t)/2):i==="right"&&(u=r-t-s),n=r-u-t,[u,n]}const ae=t=>t,oe=(t="",r="",s)=>{const i=s?.output??process.stdout,u=X(i),n=2,o=s?.titlePadding??1,c=s?.contentPadding??2,a=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),l=s?.withGuide??_.withGuide?`${$} `:"",d=s?.formatBorder??ae,y=(s?.rounded?re:ne).map(d),p=d(st),m=d($),g=k(l),S=k(r),h=u-g;let f=Math.floor(u*a)-g;if(s?.width==="auto"){const P=t.split(`
`);let N=S+o*2;for(const rt of P){const W=k(rt)+c*2;W>N&&(N=W)}const D=N+n;D<f&&(f=D)}f%2!==0&&(f<h?f++:f--);const v=f-n,T=v-o*2,C=S>T?`${r.slice(0,T-3)}...`:r,[b,G]=Pt(k(C),v,o,s?.titleAlign),x=q(t,v-c*2,{hard:!0,trim:!1});i.write(`${l}${y[0]}${p.repeat(b)}${C}${p.repeat(G)}${y[1]}
`);const A=x.split(`
`);for(const P of A){const[N,D]=Pt(k(P),v,c,s?.contentAlign);i.write(`${l}${m}${" ".repeat(N)}${P}${" ".repeat(D)}${m}
`)}i.write(`${l}${y[2]}${p.repeat(v)}${y[3]}
`)},ue=t=>{const r=t.active??"Yes",s=t.inactive??"No";return new Lt({active:r,inactive:s,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){const i=t.withGuide??_.withGuide,u=`${M(this.state)} `,n=i?`${e("gray",$)} `:"",o=O(t.output,t.message,n,u),c=`${i?`${e("gray",$)}
`:""}${o}
`,a=this.value?i:s;switch(this.state){case"submit":{const l=r?`${t("gray",d)} `:"";return`${c}${l}${t("dim",a)}`}case"cancel":{const l=r?`${t("gray",d)} `:"";return`${c}${l}${t(["strikethrough","dim"],a)}${r?`
${t("gray",d)}`:""}`}default:{const l=r?`${t("cyan",d)} `:"",$=r?t("cyan",E):"";return`${c}${l}${this.value?`${t("green",z)} ${i}`:`${t("dim",H)} ${t("dim",i)}`}${e.vertical?r?`
${t("cyan",d)} `:`
`:` ${t("dim","/")} `}${this.value?`${t("dim",H)} ${t("dim",s)}`:`${t("green",z)} ${s}`}
${$}
`}}}}).prompt()},ut=e=>{const i=e.validate;return new De({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:i?i(s):I.date.messages.required;const r=u=>u.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(i)return i(s)},render(){const s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${t("gray",d)}
`:""}${V(this.state)} `}${e.message}
`,u=this.state!=="initial"?this.state:"active",n=lt(this,u),o=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{const c=this.error?` ${t("yellow",this.error)}`:"",a=s?`${t("yellow",d)} `:"",l=s?t("yellow",E):"";return`${r.trim()}
`,a=this.value?r:s;switch(this.state){case"submit":{const l=i?`${e("gray",$)} `:"";return`${c}${l}${e("dim",a)}`}case"cancel":{const l=i?`${e("gray",$)} `:"";return`${c}${l}${e(["strikethrough","dim"],a)}${i?`
${e("gray",$)}`:""}`}default:{const l=i?`${e("cyan",$)} `:"",d=i?e("cyan",E):"";return`${c}${l}${this.value?`${e("green",z)} ${r}`:`${e("dim",H)} ${e("dim",r)}`}${t.vertical?i?`
${e("cyan",$)} `:`
`:` ${e("dim","/")} `}${this.value?`${e("dim",H)} ${e("dim",s)}`:`${e("green",z)} ${s}`}
${d}
`}}}}).prompt()},le=t=>{const r=t.validate;return new Dt({...t,validate(s){if(s===void 0)return t.defaultValue!==void 0?void 0:r?r(s):_.date.messages.required;const i=u=>u.toISOString().slice(0,10);if(t.minDate&&i(s)<i(t.minDate))return _.date.messages.afterMin(t.minDate);if(t.maxDate&&i(s)>i(t.maxDate))return _.date.messages.beforeMax(t.maxDate);if(r)return r(s)},render(){const s=(t?.withGuide??_.withGuide)!==!1,i=`${`${s?`${e("gray",$)}
`:""}${M(this.state)} `}${t.message}
`,u=this.state!=="initial"?this.state:"active",n=ce(this,u),o=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{const c=this.error?` ${e("yellow",this.error)}`:"",a=s?`${e("yellow",$)} `:"",l=s?e("yellow",E):"";return`${i.trim()}
${a}${n}
${l}${c}
`}case"submit":{const c=o?` ${t("dim",o)}`:"",a=s?t("gray",d):"";return`${r}${a}${c}`}case"cancel":{const c=o?` ${t(["strikethrough","dim"],o)}`:"",a=s?t("gray",d):"";return`${r}${a}${c}${o.trim()?`
${a}`:""}`}default:{const c=s?`${t("cyan",d)} `:"",a=s?t("cyan",E):"",l=s?`${t("cyan",d)} `:"",$=this.inlineError?`
${l}${t("yellow",this.inlineError)}`:"";return`${r}${c}${n}${$}
`}case"submit":{const c=o?` ${e("dim",o)}`:"",a=s?e("gray",$):"";return`${i}${a}${c}`}case"cancel":{const c=o?` ${e(["strikethrough","dim"],o)}`:"",a=s?e("gray",$):"";return`${i}${a}${c}${o.trim()?`
${a}`:""}`}default:{const c=s?`${e("cyan",$)} `:"",a=s?e("cyan",E):"",l=s?`${e("cyan",$)} `:"",d=this.inlineError?`
${l}${e("yellow",this.inlineError)}`:"";return`${i}${c}${n}${d}
${a}
`}}}}).prompt()};function lt(e,i){const s=e.segmentValues,r=e.segmentCursor;if(i==="submit"||i==="cancel")return e.formattedValue;const u=t("gray",e.separator);return e.segments.map((n,o)=>{const c=o===r.segmentIndex&&!["submit","cancel"].includes(i),a=$t[n.type];return ct(s[n.type],{isActive:c,label:a})}).join(u)}function ct(e,i){const s=!e||e.replace(/_/g,"")==="";return i.isActive?t("inverse",s?i.label:e.replace(/_/g," ")):s?t("dim",i.label):e.replace(/_/g,t("dim"," "))}const $t={year:"yyyy",month:"mm",day:"dd"},dt=async(e,i)=>{const s={},r=Object.keys(e);for(const u of r){const n=e[u],o=await n({results:s})?.catch(c=>{throw c});if(typeof i?.onCancel=="function"&&We(o)){s[u]="canceled",i.onCancel({results:s});continue}s[u]=o}return s},ht=e=>{const{selectableGroups:i=!0,groupSpacing:s=0}=e,r=(n,o,c=[])=>{const a=n.label??String(n.value),l=typeof n.group=="string",$=l&&(c[c.indexOf(n)+1]??{group:!0}),y=l&&$&&$.group===!0,p=l?i?`${y?E:d} `:" ":"";let m="";if(s>0&&!l){const S=`
${t("cyan",d)}`;m=`${S.repeat(s-1)}${S} `}if(o==="active")return`${m}${t("dim",p)}${t("cyan",te)} ${a}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`;if(o==="group-active")return`${m}${p}${t("cyan",te)} ${t("dim",a)}`;if(o==="group-active-selected")return`${m}${p}${t("green",U)} ${t("dim",a)}`;if(o==="selected"){const S=l||i?t("green",U):"";return`${m}${t("dim",p)}${S} ${t("dim",a)}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`}if(o==="cancelled")return`${t(["strikethrough","dim"],a)}`;if(o==="active-selected")return`${m}${t("dim",p)}${t("green",U)} ${a}${n.hint?` ${t("dim",`(${n.hint})`)}`:""}`;if(o==="submitted")return`${t("dim",a)}`;const g=l||i?t("dim",J):"";return`${m}${t("dim",p)}${g} ${t("dim",a)}`},u=e.required??!0;return new Fe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:u,cursorAt:e.cursorAt,selectableGroups:i,validate(n){if(u&&(n===void 0||n.length===0))return`Please select at least one option.
${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const n=e.withGuide??I.withGuide,o=`${n?`${t("gray",d)}
`:""}${V(this.state)} ${e.message}
`,c=this.value??[];switch(this.state){case"submit":{const a=this.options.filter(({value:$})=>c.includes($)).map($=>r($,"submitted")),l=a.length===0?"":` ${a.join(t("dim",", "))}`;return`${o}${n?t("gray",d):""}${l}`}case"cancel":{const a=this.options.filter(({value:l})=>c.includes(l)).map(l=>r(l,"cancelled")).join(t("dim",", "));return`${o}${n?`${t("gray",d)} `:""}${a.trim()?`${a}${n?`
${t("gray",d)}`:""}`:""}`}case"error":{const a=this.error.split(`
`).map((l,$)=>$===0?`${n?`${t("yellow",E)} `:""}${t("yellow",l)}`:` ${l}`).join(`
`);return`${o}${n?`${t("yellow",d)} `:""}${this.options.map((l,$,y)=>{const p=c.includes(l.value)||l.group===!0&&this.isGroupSelected(`${l.value}`),m=$===this.cursor;return!m&&typeof l.group=="string"&&this.options[this.cursor].value===l.group?r(l,p?"group-active-selected":"group-active",y):m&&p?r(l,"active-selected",y):p?r(l,"selected",y):r(l,m?"active":"inactive",y)}).join(`
${n?`${t("yellow",d)} `:""}`)}
`}}}}).prompt()};function ce(t,r){const s=t.segmentValues,i=t.segmentCursor;if(r==="submit"||r==="cancel")return t.formattedValue;const u=e("gray",t.separator);return t.segments.map((n,o)=>{const c=o===i.segmentIndex&&!["submit","cancel"].includes(r),a=de[n.type];return $e(s[n.type],{isActive:c,label:a})}).join(u)}function $e(t,r){const s=!t||t.replace(/_/g,"")==="";return r.isActive?e("inverse",s?r.label:t.replace(/_/g," ")):s?e("dim",r.label):t.replace(/_/g,e("dim"," "))}const de={year:"yyyy",month:"mm",day:"dd"},he=async(t,r)=>{const s={},i=Object.keys(t);for(const u of i){const n=t[u],o=await n({results:s})?.catch(c=>{throw c});if(typeof r?.onCancel=="function"&&Wt(o)){s[u]="canceled",r.onCancel({results:s});continue}s[u]=o}return s},pe=t=>{const{selectableGroups:r=!0,groupSpacing:s=0}=t,i=(n,o,c=[])=>{const a=n.label??String(n.value),l=typeof n.group=="string",d=l&&(c[c.indexOf(n)+1]??{group:!0}),y=l&&d&&d.group===!0,p=l?r?`${y?E:$} `:" ":"";let m="";if(s>0&&!l){const S=`
${e("cyan",$)}`;m=`${S.repeat(s-1)}${S} `}if(o==="active")return`${m}${e("dim",p)}${e("cyan",et)} ${a}${n.hint?` ${e("dim",`(${n.hint})`)}`:""}`;if(o==="group-active")return`${m}${p}${e("cyan",et)} ${e("dim",a)}`;if(o==="group-active-selected")return`${m}${p}${e("green",U)} ${e("dim",a)}`;if(o==="selected"){const S=l||r?e("green",U):"";return`${m}${e("dim",p)}${S} ${e("dim",a)}${n.hint?` ${e("dim",`(${n.hint})`)}`:""}`}if(o==="cancelled")return`${e(["strikethrough","dim"],a)}`;if(o==="active-selected")return`${m}${e("dim",p)}${e("green",U)} ${a}${n.hint?` ${e("dim",`(${n.hint})`)}`:""}`;if(o==="submitted")return`${e("dim",a)}`;const g=l||r?e("dim",J):"";return`${m}${e("dim",p)}${g} ${e("dim",a)}`},u=t.required??!0;return new Ft({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:u,cursorAt:t.cursorAt,selectableGroups:r,validate(n){if(u&&(n===void 0||n.length===0))return`Please select at least one option.
${e("reset",e("dim",`Press ${e(["gray","bgWhite","inverse"]," space ")} to select, ${e("gray",e(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const n=t.withGuide??_.withGuide,o=`${n?`${e("gray",$)}
`:""}${M(this.state)} ${t.message}
`,c=this.value??[];switch(this.state){case"submit":{const a=this.options.filter(({value:d})=>c.includes(d)).map(d=>i(d,"submitted")),l=a.length===0?"":` ${a.join(e("dim",", "))}`;return`${o}${n?e("gray",$):""}${l}`}case"cancel":{const a=this.options.filter(({value:l})=>c.includes(l)).map(l=>i(l,"cancelled")).join(e("dim",", "));return`${o}${n?`${e("gray",$)} `:""}${a.trim()?`${a}${n?`
${e("gray",$)}`:""}`:""}`}case"error":{const a=this.error.split(`
`).map((l,d)=>d===0?`${n?`${e("yellow",E)} `:""}${e("yellow",l)}`:` ${l}`).join(`
`);return`${o}${n?`${e("yellow",$)} `:""}${this.options.map((l,d,y)=>{const p=c.includes(l.value)||l.group===!0&&this.isGroupSelected(`${l.value}`),m=d===this.cursor;return!m&&typeof l.group=="string"&&this.options[this.cursor].value===l.group?i(l,p?"group-active-selected":"group-active",y):m&&p?i(l,"active-selected",y):p?i(l,"selected",y):i(l,m?"active":"inactive",y)}).join(`
${n?`${e("yellow",$)} `:""}`)}
${a}
`}default:{const a=this.options.map(($,y,p)=>{const m=c.includes($.value)||$.group===!0&&this.isGroupSelected(`${$.value}`),g=y===this.cursor,S=!g&&typeof $.group=="string"&&this.options[this.cursor].value===$.group;let h="";return S?h=r($,m?"group-active-selected":"group-active",p):g&&m?h=r($,"active-selected",p):m?h=r($,"selected",p):h=r($,g?"active":"inactive",p),`${y!==0&&!h.startsWith(`
`}default:{const a=this.options.map((d,y,p)=>{const m=c.includes(d.value)||d.group===!0&&this.isGroupSelected(`${d.value}`),g=y===this.cursor,S=!g&&typeof d.group=="string"&&this.options[this.cursor].value===d.group;let h="";return S?h=i(d,m?"group-active-selected":"group-active",p):g&&m?h=i(d,"active-selected",p):m?h=i(d,"selected",p):h=i(d,g?"active":"inactive",p),`${y!==0&&!h.startsWith(`
`)?" ":""}${h}`}).join(`
${n?t("cyan",d):""}`),l=a.startsWith(`
`)?"":" ";return`${o}${n?t("cyan",d):""}${l}${a}
${n?t("cyan",E):""}
`}}}}).prompt()},O={message:(e=[],{symbol:i=t("gray",d),secondarySymbol:s=t("gray",d),output:r=process.stdout,spacing:u=1,withGuide:n}={})=>{const o=[],c=n??I.withGuide,a=c?s:"",l=c?`${i} `:"",$=c?`${s} `:"";for(let p=0;p<u;p++)o.push(a);const y=Array.isArray(e)?e:e.split(`
`);if(y.length>0){const[p,...m]=y;p.length>0?o.push(`${l}${p}`):o.push(c?i:"");for(const g of m)g.length>0?o.push(`${$}${g}`):o.push(c?s:"")}r.write(`${o.join(`
${n?e("cyan",$):""}`),l=a.startsWith(`
`)?"":" ";return`${o}${n?e("cyan",$):""}${l}${a}
${n?e("cyan",E):""}
`}}}}).prompt()},R={message:(t=[],{symbol:r=e("gray",$),secondarySymbol:s=e("gray",$),output:i=process.stdout,spacing:u=1,withGuide:n}={})=>{const o=[],c=n??_.withGuide,a=c?s:"",l=c?`${r} `:"",d=c?`${s} `:"";for(let p=0;p<u;p++)o.push(a);const y=Array.isArray(t)?t:t.split(`
`);if(y.length>0){const[p,...m]=y;p.length>0?o.push(`${l}${p}`):o.push(c?r:"");for(const g of m)g.length>0?o.push(`${d}${g}`):o.push(c?s:"")}i.write(`${o.join(`
`)}
`)},info:(e,i)=>{O.message(e,{...i,symbol:t("blue",he)})},success:(e,i)=>{O.message(e,{...i,symbol:t("green",pe)})},step:(e,i)=>{O.message(e,{...i,symbol:t("green",F)})},warn:(e,i)=>{O.message(e,{...i,symbol:t("yellow",me)})},warning:(e,i)=>{O.warn(e,i)},error:(e,i)=>{O.message(e,{...i,symbol:t("red",ge)})}},pt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",E)} `:"";s.write(`${r}${t("red",e)}
`)},info:(t,r)=>{R.message(t,{...r,symbol:e("blue",ht)})},success:(t,r)=>{R.message(t,{...r,symbol:e("green",pt)})},step:(t,r)=>{R.message(t,{...r,symbol:e("green",F)})},warn:(t,r)=>{R.message(t,{...r,symbol:e("yellow",mt)})},warning:(t,r)=>{R.warn(t,r)},error:(t,r)=>{R.message(t,{...r,symbol:e("red",gt)})}},me=(t="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${e("gray",E)} `:"";s.write(`${i}${e("red",t)}
`)},mt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",le)} `:"";s.write(`${r}${e}
`)},gt=(e="",i)=>{const s=i?.output??process.stdout,r=i?.withGuide??I.withGuide?`${t("gray",d)}
${t("gray",E)} `:"";s.write(`${r}${e}
`)},ge=(t="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${e("gray",lt)} `:"";s.write(`${i}${t}
`)},ye=(t="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${e("gray",$)}
${e("gray",E)} `:"";s.write(`${i}${t}
`)},Q=(e,i)=>e.split(`
`).map(s=>i(s)).join(`
`),yt=e=>{const i=(r,u)=>{const n=r.label??String(r.value);return u==="disabled"?`${t("gray",J)} ${Q(n,o=>t(["strikethrough","gray"],o))}${r.hint?` ${t("dim",`(${r.hint??"disabled"})`)}`:""}`:u==="active"?`${t("cyan",te)} ${n}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="selected"?`${t("green",U)} ${Q(n,o=>t("dim",o))}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="cancelled"?`${Q(n,o=>t(["strikethrough","dim"],o))}`:u==="active-selected"?`${t("green",U)} ${n}${r.hint?` ${t("dim",`(${r.hint})`)}`:""}`:u==="submitted"?`${Q(n,o=>t("dim",o))}`:`${t("dim",J)} ${Q(n,o=>t("dim",o))}`},s=e.required??!0;return new He({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
${t("reset",t("dim",`Press ${t(["gray","bgWhite","inverse"]," space ")} to select, ${t("gray",t("bgWhite",t("inverse"," enter ")))} to submit`))}`},render(){const r=e.withGuide??I.withGuide,u=N(e.output,e.message,r?`${ye(this.state)} `:"",`${V(this.state)} `),n=`${r?`${t("gray",d)}
`)},fe=t=>new Ht({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,showSubmit:t.showSubmit,output:t.output,signal:t.signal,input:t.input,render(){const r=t?.withGuide??_.withGuide,s=`${`${r?`${e("gray",$)}
`:""}${M(this.state)} `}${t.message}
`,i=t.placeholder?e("inverse",t.placeholder[0])+e("dim",t.placeholder.slice(1)):e(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:i,n=this.value??"",o=t.showSubmit?`
${e(this.focused==="submit"?"cyan":"dim","[ submit ]")}`:"";switch(this.state){case"error":{const c=`${e("yellow",$)} `,a=r?O(t.output,u,c,void 0):u,l=e("yellow",E);return`${s}${a}
${l} ${e("yellow",this.error)}${o}
`}case"submit":{const c=`${e("gray",$)} `,a=r?O(t.output,n,c,void 0,l=>e("dim",l)):n?e("dim",n):"";return`${s}${a}`}case"cancel":{const c=`${e("gray",$)} `,a=r?O(t.output,n,c,void 0,l=>e(["strikethrough","dim"],l)):n?e(["strikethrough","dim"],n):"";return`${s}${a}`}default:{const c=r?`${e("cyan",$)} `:"",a=r?e("cyan",E):"",l=r?O(t.output,u,c):u;return`${s}${l}
${a}${o}
`}}}}).prompt(),Q=(t,r)=>t.split(`
`).map(s=>r(s)).join(`
`),ve=t=>{const r=(i,u)=>{const n=i.label??String(i.value);return u==="disabled"?`${e("gray",J)} ${Q(n,o=>e(["strikethrough","gray"],o))}${i.hint?` ${e("dim",`(${i.hint??"disabled"})`)}`:""}`:u==="active"?`${e("cyan",et)} ${n}${i.hint?` ${e("dim",`(${i.hint})`)}`:""}`:u==="selected"?`${e("green",U)} ${Q(n,o=>e("dim",o))}${i.hint?` ${e("dim",`(${i.hint})`)}`:""}`:u==="cancelled"?`${Q(n,o=>e(["strikethrough","dim"],o))}`:u==="active-selected"?`${e("green",U)} ${n}${i.hint?` ${e("dim",`(${i.hint})`)}`:""}`:u==="submitted"?`${Q(n,o=>e("dim",o))}`:`${e("dim",J)} ${Q(n,o=>e("dim",o))}`},s=t.required??!0;return new Ut({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:s,cursorAt:t.cursorAt,validate(i){if(s&&(i===void 0||i.length===0))return`Please select at least one option.
${e("reset",e("dim",`Press ${e(["gray","bgWhite","inverse"]," space ")} to select, ${e("gray",e("bgWhite",e("inverse"," enter ")))} to submit`))}`},render(){const i=t.withGuide??_.withGuide,u=O(t.output,t.message,i?`${yt(this.state)} `:"",`${M(this.state)} `),n=`${i?`${e("gray",$)}
`:""}${u}
`,o=this.value??[],c=(a,l)=>{if(a.disabled)return i(a,"disabled");const $=o.includes(a.value);return l&&$?i(a,"active-selected"):$?i(a,"selected"):i(a,l?"active":"inactive")};switch(this.state){case"submit":{const a=this.options.filter(({value:$})=>o.includes($)).map($=>i($,"submitted")).join(t("dim",", "))||t("dim","none"),l=N(e.output,a,r?`${t("gray",d)} `:"");return`${n}${l}`}case"cancel":{const a=this.options.filter(({value:$})=>o.includes($)).map($=>i($,"cancelled")).join(t("dim",", "));if(a.trim()==="")return`${n}${t("gray",d)}`;const l=N(e.output,a,r?`${t("gray",d)} `:"");return`${n}${l}${r?`
${t("gray",d)}`:""}`}case"error":{const a=r?`${t("yellow",d)} `:"",l=this.error.split(`
`).map((p,m)=>m===0?`${r?`${t("yellow",E)} `:""}${t("yellow",p)}`:` ${p}`).join(`
`),$=n.split(`
`,o=this.value??[],c=(a,l)=>{if(a.disabled)return r(a,"disabled");const d=o.includes(a.value);return l&&d?r(a,"active-selected"):d?r(a,"selected"):r(a,l?"active":"inactive")};switch(this.state){case"submit":{const a=this.options.filter(({value:d})=>o.includes(d)).map(d=>r(d,"submitted")).join(e("dim",", "))||e("dim","none"),l=O(t.output,a,i?`${e("gray",$)} `:"");return`${n}${l}`}case"cancel":{const a=this.options.filter(({value:d})=>o.includes(d)).map(d=>r(d,"cancelled")).join(e("dim",", "));if(a.trim()==="")return`${n}${e("gray",$)}`;const l=O(t.output,a,i?`${e("gray",$)} `:"");return`${n}${l}${i?`
${e("gray",$)}`:""}`}case"error":{const a=i?`${e("yellow",$)} `:"",l=this.error.split(`
`).map((p,m)=>m===0?`${i?`${e("yellow",E)} `:""}${e("yellow",p)}`:` ${p}`).join(`
`),d=n.split(`
`).length,y=l.split(`
`).length+1;return`${n}${a}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:$+y,style:c}).join(`
`).length+1;return`${n}${a}${Y({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:a.length,rowPadding:d+y,style:c}).join(`
${a}`)}
${l}
`}default:{const a=r?`${t("cyan",d)} `:"",l=n.split(`
`).length,$=r?2:1;return`${n}${a}${Y({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:a.length,rowPadding:l+$,style:c}).join(`
`}default:{const a=i?`${e("cyan",$)} `:"",l=n.split(`
`).length,d=i?2:1;return`${n}${a}${Y({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:a.length,rowPadding:l+d,style:c}).join(`
${a}`)}
${r?t("cyan",E):""}
`}}}}).prompt()},ft=e=>t("dim",e),vt=(e,i,s)=>{const r={hard:!0,trim:!1},u=q(e,i,r).split(`
`),n=u.reduce((a,l)=>Math.max(B(l),a),0),o=u.map(s).reduce((a,l)=>Math.max(B(l),a),0),c=i-(o-n);return q(e,c,r)},wt=(e="",i="",s)=>{const r=s?.output??P.stdout,u=s?.withGuide??I.withGuide,n=s?.format??ft,o=["",...vt(e,X(r)-6,n).split(`
`).map(n),""],c=B(i),a=Math.max(o.reduce((p,m)=>{const g=B(m);return g>p?g:p},0),c)+2,l=o.map(p=>`${t("gray",d)} ${p}${" ".repeat(a-B(p))}${t("gray",d)}`).join(`
`),$=u?`${t("gray",d)}
`:"",y=u?Ge:de;r.write(`${$}${t("green",F)} ${t("reset",i)} ${t("gray",se.repeat(Math.max(a-c-1,1))+ce)}
${i?e("cyan",E):""}
`}}}}).prompt()},we=t=>e("dim",t),be=(t,r,s)=>{const i={hard:!0,trim:!1},u=q(t,r,i).split(`
`),n=u.reduce((a,l)=>Math.max(k(l),a),0),o=u.map(s).reduce((a,l)=>Math.max(k(l),a),0),c=r-(o-n);return q(t,c,i)},Se=(t="",r="",s)=>{const i=s?.output??j.stdout,u=s?.withGuide??_.withGuide,n=s?.format??we,o=["",...be(t,X(i)-6,n).split(`
`).map(n),""],c=k(r),a=Math.max(o.reduce((p,m)=>{const g=k(m);return g>p?g:p},0),c)+2,l=o.map(p=>`${e("gray",$)} ${p}${" ".repeat(a-k(p))}${e("gray",$)}`).join(`
`),d=u?`${e("gray",$)}
`:"",y=u?xt:dt;i.write(`${d}${e("green",F)} ${e("reset",r)} ${e("gray",st.repeat(Math.max(a-c-1,1))+ct)}
${l}
${t("gray",y+se.repeat(a+2)+$e)}
`)},bt=e=>new Ue({validate:e.validate,mask:e.mask??xe,signal:e.signal,input:e.input,output:e.output,render(){const i=e.withGuide??I.withGuide,s=`${i?`${t("gray",d)}
`:""}${V(this.state)} ${e.message}
`,r=this.userInputWithCursor,u=this.masked;switch(this.state){case"error":{const n=i?`${t("yellow",d)} `:"",o=i?`${t("yellow",E)} `:"",c=u??"";return e.clearOnError&&this.clear(),`${s.trim()}
${e("gray",y+st.repeat(a+2)+$t)}
`)},Ce=t=>new Kt({validate:t.validate,mask:t.mask??Gt,signal:t.signal,input:t.input,output:t.output,render(){const r=t.withGuide??_.withGuide,s=`${r?`${e("gray",$)}
`:""}${M(this.state)} ${t.message}
`,i=this.userInputWithCursor,u=this.masked;switch(this.state){case"error":{const n=r?`${e("yellow",$)} `:"",o=r?`${e("yellow",E)} `:"",c=u??"";return t.clearOnError&&this.clear(),`${s.trim()}
${n}${c}
${o}${t("yellow",this.error)}
`}case"submit":{const n=i?`${t("gray",d)} `:"",o=u?t("dim",u):"";return`${s}${n}${o}`}case"cancel":{const n=i?`${t("gray",d)} `:"",o=u?t(["strikethrough","dim"],u):"";return`${s}${n}${o}${u&&i?`
${t("gray",d)}`:""}`}default:{const n=i?`${t("cyan",d)} `:"",o=i?t("cyan",E):"";return`${s}${n}${r}
${o}${e("yellow",this.error)}
`}case"submit":{const n=r?`${e("gray",$)} `:"",o=u?e("dim",u):"";return`${s}${n}${o}`}case"cancel":{const n=r?`${e("gray",$)} `:"",o=u?e(["strikethrough","dim"],u):"";return`${s}${n}${o}${u&&r?`
${e("gray",$)}`:""}`}default:{const n=r?`${e("cyan",$)} `:"",o=r?e("cyan",E):"";return`${s}${n}${i}
${o}
`}}}}).prompt(),St=e=>{const i=e.validate;return Ae({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(i)return i(s)}},options(){const s=this.userInput;if(s==="")return[];try{let r;Xe(s)?we(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=be(s):r=be(s);const u=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return ze(r).map(n=>{const o=Qe(r,n),c=we(o);return{name:n,path:o,isDirectory:c.isDirectory()}}).filter(({path:n,isDirectory:o})=>n.startsWith(u)&&(o||!e.directory)).map(n=>({value:n.path}))}catch{return[]}}})},Ct=e=>t("magenta",e),fe=({indicator:e="dots",onCancel:i,output:s=process.stdout,cancelMessage:r,errorMessage:u,frames:n=ee?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=ee?80:120,signal:c,...a}={})=>{const l=ae();let $,y,p=!1,m=!1,g="",S,h=performance.now();const f=X(s),v=a?.styleFrame??Ct,T=_=>{const A=_>1?u??I.messages.error:r??I.messages.cancel;m=_===1,p&&(W(A,_),m&&typeof i=="function"&&i())},C=()=>T(2),b=()=>T(1),x=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",T),c&&c.addEventListener("abort",b)},G=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",T),c&&c.removeEventListener("abort",b)},M=()=>{if(S===void 0)return;l&&s.write(`
`);const _=q(S,f,{hard:!0,trim:!1}).split(`
`);_.length>1&&s.write(Se.up(_.length-1)),s.write(Se.to(0)),s.write(Ce.down())},R=_=>_.replace(/\.+$/,""),j=_=>{const A=(performance.now()-_)/1e3,k=Math.floor(A/60),L=Math.floor(A%60);return k>0?`[${k}m ${L}s]`:`[${L}s]`},D=a.withGuide??I.withGuide,ie=(_="")=>{p=!0,$=Ke({output:s}),g=R(_),h=performance.now(),D&&s.write(`${t("gray",d)}
`);let A=0,k=0;x(),y=setInterval(()=>{if(l&&g===S)return;M(),S=g;const L=v(n[A]);let Z;if(l)Z=`${L} ${g}...`;else if(e==="timer")Z=`${L} ${g} ${j(h)}`;else{const Be=".".repeat(Math.floor(k)).slice(0,3);Z=`${L} ${g}${Be}`}const Ne=q(Z,f,{hard:!0,trim:!1});s.write(Ne),A=A+1<n.length?A+1:0,k=k<4?k+.125:0},o)},W=(_="",A=0,k=!1)=>{if(!p)return;p=!1,clearInterval(y),M();const L=A===0?t("green",F):A===1?t("red",oe):t("red",ue);g=_??g,k||(e==="timer"?s.write(`${L} ${g} ${j(h)}
`}}}}).prompt(),Te=t=>{const r=t.validate;return At({...t,initialUserInput:t.initialValue??t.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(r)return r(s)}},options(){const s=this.userInput;if(s==="")return[];try{let i;zt(s)?wt(s).isDirectory()&&(!t.directory||s.endsWith("/"))?i=s:i=bt(s):i=bt(s);const u=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return Qt(i).map(n=>{const o=Zt(i,n),c=wt(o);return{name:n,path:o,isDirectory:c.isDirectory()}}).filter(({path:n,isDirectory:o})=>n.startsWith(u)&&(o||!t.directory)).map(n=>({value:n.path}))}catch{return[]}}})},_e=t=>e("magenta",t),ft=({indicator:t="dots",onCancel:r,output:s=process.stdout,cancelMessage:i,errorMessage:u,frames:n=tt?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=tt?80:120,signal:c,...a}={})=>{const l=at();let d,y,p=!1,m=!1,g="",S,h=performance.now();const f=X(s),v=a?.styleFrame??_e,T=I=>{const V=I>1?u??_.messages.error:i??_.messages.cancel;m=I===1,p&&(W(V,I),m&&typeof r=="function"&&r())},C=()=>T(2),b=()=>T(1),G=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",T),c&&c.addEventListener("abort",b)},x=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",T),c&&c.removeEventListener("abort",b)},A=()=>{if(S===void 0)return;l&&s.write(`
`);const I=q(S,f,{hard:!0,trim:!1}).split(`
`);I.length>1&&s.write(St.up(I.length-1)),s.write(St.to(0)),s.write(Ct.down())},P=I=>I.replace(/\.+$/,""),N=I=>{const V=(performance.now()-I)/1e3,B=Math.floor(V/60),L=Math.floor(V%60);return B>0?`[${B}m ${L}s]`:`[${L}s]`},D=a.withGuide??_.withGuide,rt=(I="")=>{p=!0,d=qt({output:s}),g=P(I),h=performance.now(),D&&s.write(`${e("gray",$)}
`);let V=0,B=0;G(),y=setInterval(()=>{if(l&&g===S)return;A(),S=g;const L=v(n[V]);let Z;if(l)Z=`${L} ${g}...`;else if(t==="timer")Z=`${L} ${g} ${N(h)}`;else{const kt=".".repeat(Math.floor(B)).slice(0,3);Z=`${L} ${g}${kt}`}const Nt=q(Z,f,{hard:!0,trim:!1});s.write(Nt),V=V+1<n.length?V+1:0,B=B<4?B+.125:0},o)},W=(I="",V=0,B=!1)=>{if(!p)return;p=!1,clearInterval(y),A();const L=V===0?e("green",F):V===1?e("red",ot):e("red",ut);g=I??g,B||(t==="timer"?s.write(`${L} ${g} ${N(h)}
`):s.write(`${L} ${g}
`)),G(),$()};return{start:ie,stop:(_="")=>W(_,0),message:(_="")=>{g=R(_??g)},cancel:(_="")=>W(_,1),error:(_="")=>W(_,2),clear:()=>W("",0,!0),get isCancelled(){return m}}},Ve={light:w("\u2500","-"),heavy:w("\u2501","="),block:w("\u2588","#")};function Tt({style:e="heavy",max:i=100,size:s=40,...r}={}){const u=fe(r);let n=0,o="";const c=Math.max(1,i),a=Math.max(1,s),l=m=>{switch(m){case"initial":case"active":return g=>t("magenta",g);case"error":case"cancel":return g=>t("red",g);case"submit":return g=>t("green",g);default:return g=>t("magenta",g)}},$=(m,g)=>{const S=Math.floor(n/c*a);return`${l(m)(Ve[e].repeat(S))}${t("dim",Ve[e].repeat(a-S))} ${g}`},y=(m="")=>{o=m,u.start($("initial",m))},p=(m=1,g)=>{n=Math.min(c,m+n),u.message($("active",g??o)),o=g??o};return{start:y,stop:u.stop,cancel:u.cancel,error:u.error,clear:u.clear,advance:p,isCancelled:u.isCancelled,message:m=>p(0,m)}}const re=(e,i)=>e.includes(`
`)?e.split(`
`).map(s=>i(s)).join(`
`):i(e),_t=e=>{const i=(s,r)=>{const u=s.label??String(s.value);switch(r){case"disabled":return`${t("gray",H)} ${re(u,n=>t("gray",n))}${s.hint?` ${t("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${re(u,n=>t("dim",n))}`;case"active":return`${t("green",z)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${re(u,n=>t(["strikethrough","dim"],n))}`;default:return`${t("dim",H)} ${re(u,n=>t("dim",n))}`}};return new qe({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){const s=e.withGuide??I.withGuide,r=`${V(this.state)} `,u=`${ye(this.state)} `,n=N(e.output,e.message,u,r),o=`${s?`${t("gray",d)}
`)),x(),d()};return{start:rt,stop:(I="")=>W(I,0),message:(I="")=>{g=P(I??g)},cancel:(I="")=>W(I,1),error:(I="")=>W(I,2),clear:()=>W("",0,!0),get isCancelled(){return m}}},Vt={light:w("\u2500","-"),heavy:w("\u2501","="),block:w("\u2588","#")};function Ie({style:t="heavy",max:r=100,size:s=40,...i}={}){const u=ft(i);let n=0,o="";const c=Math.max(1,r),a=Math.max(1,s),l=m=>{switch(m){case"initial":case"active":return g=>e("magenta",g);case"error":case"cancel":return g=>e("red",g);case"submit":return g=>e("green",g);default:return g=>e("magenta",g)}},d=(m,g)=>{const S=Math.floor(n/c*a);return`${l(m)(Vt[t].repeat(S))}${e("dim",Vt[t].repeat(a-S))} ${g}`},y=(m="")=>{o=m,u.start(d("initial",m))},p=(m=1,g)=>{n=Math.min(c,m+n),u.message(d("active",g??o)),o=g??o};return{start:y,stop:u.stop,cancel:u.cancel,error:u.error,clear:u.clear,advance:p,isCancelled:u.isCancelled,message:m=>p(0,m)}}const it=(t,r)=>t.includes(`
`)?t.split(`
`).map(s=>r(s)).join(`
`):r(t),Ee=t=>{const r=(s,i)=>{const u=s.label??String(s.value);switch(i){case"disabled":return`${e("gray",H)} ${it(u,n=>e("gray",n))}${s.hint?` ${e("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${it(u,n=>e("dim",n))}`;case"active":return`${e("green",z)} ${u}${s.hint?` ${e("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${it(u,n=>e(["strikethrough","dim"],n))}`;default:return`${e("dim",H)} ${it(u,n=>e("dim",n))}`}};return new Jt({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){const s=t.withGuide??_.withGuide,i=`${M(this.state)} `,u=`${yt(this.state)} `,n=O(t.output,t.message,u,i),o=`${s?`${e("gray",$)}
`:""}${n}
`;switch(this.state){case"submit":{const c=s?`${t("gray",d)} `:"",a=N(e.output,i(this.options[this.cursor],"selected"),c);return`${o}${a}`}case"cancel":{const c=s?`${t("gray",d)} `:"",a=N(e.output,i(this.options[this.cursor],"cancelled"),c);return`${o}${a}${s?`
${t("gray",d)}`:""}`}default:{const c=s?`${t("cyan",d)} `:"",a=s?t("cyan",E):"",l=o.split(`
`).length,$=s?2:1;return`${o}${c}${Y({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:c.length,rowPadding:l+$,style:(y,p)=>i(y,y.disabled?"disabled":p?"active":"inactive")}).join(`
`;switch(this.state){case"submit":{const c=s?`${e("gray",$)} `:"",a=O(t.output,r(this.options[this.cursor],"selected"),c);return`${o}${a}`}case"cancel":{const c=s?`${e("gray",$)} `:"",a=O(t.output,r(this.options[this.cursor],"cancelled"),c);return`${o}${a}${s?`
${e("gray",$)}`:""}`}default:{const c=s?`${e("cyan",$)} `:"",a=s?e("cyan",E):"",l=o.split(`
`).length,d=s?2:1;return`${o}${c}${Y({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:c.length,rowPadding:l+d,style:(y,p)=>r(y,y.disabled?"disabled":p?"active":"inactive")}).join(`
${c}`)}
${a}
`}}}}).prompt()},It=e=>{const i=(s,r="inactive")=>{const u=s.label??String(s.value);return r==="selected"?`${t("dim",u)}`:r==="cancelled"?`${t(["strikethrough","dim"],u)}`:r==="active"?`${t(["bgCyan","gray"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`:`${t(["gray","bgWhite","inverse"],` ${s.value} `)} ${u}${s.hint?` ${t("dim",`(${s.hint})`)}`:""}`};return new Je({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){const s=e.withGuide??I.withGuide,r=`${s?`${t("gray",d)}
`:""}${V(this.state)} ${e.message}
`;switch(this.state){case"submit":{const u=s?`${t("gray",d)} `:"",n=this.options.find(c=>c.value===this.value)??e.options[0],o=N(e.output,i(n,"selected"),u);return`${r}${o}`}case"cancel":{const u=s?`${t("gray",d)} `:"",n=N(e.output,i(this.options[0],"cancelled"),u);return`${r}${n}${s?`
${t("gray",d)}`:""}`}default:{const u=s?`${t("cyan",d)} `:"",n=s?t("cyan",E):"",o=this.options.map((c,a)=>N(e.output,i(c,a===this.cursor?"active":"inactive"),u)).join(`
`);return`${r}${o}
`}}}}).prompt()},Ge=t=>{const r=(s,i="inactive")=>{const u=s.label??String(s.value);return i==="selected"?`${e("dim",u)}`:i==="cancelled"?`${e(["strikethrough","dim"],u)}`:i==="active"?`${e(["bgCyan","gray"],` ${s.value} `)} ${u}${s.hint?` ${e("dim",`(${s.hint})`)}`:""}`:`${e(["gray","bgWhite","inverse"],` ${s.value} `)} ${u}${s.hint?` ${e("dim",`(${s.hint})`)}`:""}`};return new Yt({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,caseSensitive:t.caseSensitive,render(){const s=t.withGuide??_.withGuide,i=`${s?`${e("gray",$)}
`:""}${M(this.state)} ${t.message}
`;switch(this.state){case"submit":{const u=s?`${e("gray",$)} `:"",n=this.options.find(c=>c.value===this.value)??t.options[0],o=O(t.output,r(n,"selected"),u);return`${i}${o}`}case"cancel":{const u=s?`${e("gray",$)} `:"",n=O(t.output,r(this.options[0],"cancelled"),u);return`${i}${n}${s?`
${e("gray",$)}`:""}`}default:{const u=s?`${e("cyan",$)} `:"",n=s?e("cyan",E):"",o=this.options.map((c,a)=>O(t.output,r(c,a===this.cursor?"active":"inactive"),u)).join(`
`);return`${i}${o}
${n}
`}}}}).prompt()},je=`${t("gray",d)} `,K={message:async(e,{symbol:i=t("gray",d)}={})=>{process.stdout.write(`${t("gray",d)}
${i} `);let s=3;for await(let r of e){r=r.replace(/\n/g,`
${je}`),r.includes(`
`)&&(s=3+ne(r.slice(r.lastIndexOf(`
`))).length);const u=ne(r).length;s+u<process.stdout.columns?(s+=u,process.stdout.write(r)):(process.stdout.write(`
${je}${r.trimStart()}`),s=3+ne(r.trimStart()).length)}process.stdout.write(`
`)},info:e=>K.message(e,{symbol:t("blue",he)}),success:e=>K.message(e,{symbol:t("green",pe)}),step:e=>K.message(e,{symbol:t("green",F)}),warn:e=>K.message(e,{symbol:t("yellow",me)}),warning:e=>K.warn(e),error:e=>K.message(e,{symbol:t("red",ge)})},Et=async(e,i)=>{for(const s of e){if(s.enabled===!1)continue;const r=fe(i);r.start(s.title);const u=await s.task(r.message);r.stop(u||s.title)}},xt=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Gt=e=>{const i=e.output??process.stdout,s=X(i),r=t("gray",d),u=e.spacing??1,n=3,o=e.retainLog===!0,c=!ae()&&Te(i);i.write(`${r}
`),i.write(`${t("green",F)} ${e.title}
`);for(let h=0;h<u;h++)i.write(`${r}
`);const a=[{value:"",full:""}];let l=!1;const $=h=>{if(a.length===0)return;let f=0;h&&(f+=u+2);for(const v of a){const{value:T,result:C}=v;let b=C?.message??T;if(b.length===0)continue;C===void 0&&v.header!==void 0&&v.header!==""&&(b+=`
${v.header}`);const x=b.split(`
`).reduce((G,M)=>M===""?G+1:G+Math.ceil((M.length+n)/s),0);f+=x}f>0&&(f+=1,i.write(Ce.lines(f)))},y=(h,f,v)=>{const T=v?`${h.full}
${h.value}`:h.value;h.header!==void 0&&h.header!==""&&O.message(h.header.split(`
`).map(C=>t("bold",C)),{output:i,secondarySymbol:r,symbol:r,spacing:0}),O.message(T.split(`
`).map(C=>t("dim",C)),{output:i,secondarySymbol:r,symbol:r,spacing:f??u})},p=()=>{for(const h of a){const{header:f,value:v,full:T}=h;(f===void 0||f.length===0)&&v.length===0||y(h,void 0,o===!0&&T.length>0)}},m=(h,f,v)=>{if($(!1),(v?.raw!==!0||!l)&&h.value!==""&&(h.value+=`
`),h.value+=xt(f),l=v?.raw===!0,e.limit!==void 0){const T=h.value.split(`
`),C=T.length-e.limit;if(C>0){const b=T.splice(0,C);o&&(h.full+=(h.full===""?"":`
`}}}}).prompt()},jt=`${e("gray",$)} `,K={message:async(t,{symbol:r=e("gray",$)}={})=>{process.stdout.write(`${e("gray",$)}
${r} `);let s=3;for await(let i of t){i=i.replace(/\n/g,`
${jt}`),i.includes(`
`)&&(s=3+nt(i.slice(i.lastIndexOf(`
`))).length);const u=nt(i).length;s+u<process.stdout.columns?(s+=u,process.stdout.write(i)):(process.stdout.write(`
${jt}${i.trimStart()}`),s=3+nt(i.trimStart()).length)}process.stdout.write(`
`)},info:t=>K.message(t,{symbol:e("blue",ht)}),success:t=>K.message(t,{symbol:e("green",pt)}),step:t=>K.message(t,{symbol:e("green",F)}),warn:t=>K.message(t,{symbol:e("yellow",mt)}),warning:t=>K.warn(t),error:t=>K.message(t,{symbol:e("red",gt)})},xe=async(t,r)=>{for(const s of t){if(s.enabled===!1)continue;const i=ft(r);i.start(s.title);const u=await s.task(i.message);i.stop(u||s.title)}},Oe=t=>t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Me=t=>{const r=t.output??process.stdout,s=X(r),i=e("gray",$),u=t.spacing??1,n=3,o=t.retainLog===!0,c=!at()&&Tt(r);r.write(`${i}
`),r.write(`${e("green",F)} ${t.title}
`);for(let h=0;h<u;h++)r.write(`${i}
`);const a=[{value:"",full:""}];let l=!1;const d=h=>{if(a.length===0)return;let f=0;h&&(f+=u+2);for(const v of a){const{value:T,result:C}=v;let b=C?.message??T;if(b.length===0)continue;C===void 0&&v.header!==void 0&&v.header!==""&&(b+=`
${v.header}`);const G=b.split(`
`).reduce((x,A)=>A===""?x+1:x+Math.ceil((A.length+n)/s),0);f+=G}f>0&&(f+=1,r.write(Ct.lines(f)))},y=(h,f,v)=>{const T=v?`${h.full}
${h.value}`:h.value;h.header!==void 0&&h.header!==""&&R.message(h.header.split(`
`).map(C=>e("bold",C)),{output:r,secondarySymbol:i,symbol:i,spacing:0}),R.message(T.split(`
`).map(C=>e("dim",C)),{output:r,secondarySymbol:i,symbol:i,spacing:f??u})},p=()=>{for(const h of a){const{header:f,value:v,full:T}=h;(f===void 0||f.length===0)&&v.length===0||y(h,void 0,o===!0&&T.length>0)}},m=(h,f,v)=>{if(d(!1),(v?.raw!==!0||!l)&&h.value!==""&&(h.value+=`
`),h.value+=Oe(f),l=v?.raw===!0,t.limit!==void 0){const T=h.value.split(`
`),C=T.length-t.limit;if(C>0){const b=T.splice(0,C);o&&(h.full+=(h.full===""?"":`
`)+b.join(`
`))}h.value=T.join(`
`)}c&&g()},g=()=>{for(const h of a)h.result?h.result.status==="error"?O.error(h.result.message,{output:i,secondarySymbol:r,spacing:0}):O.success(h.result.message,{output:i,secondarySymbol:r,spacing:0}):h.value!==""&&y(h,0)},S=(h,f)=>{$(!1),h.result=f,c&&g()};return{message(h,f){m(a[0],h,f)},group(h){const f={header:h,value:"",full:""};return a.push(f),{message(v,T){m(f,v,T)},error(v){S(f,{status:"error",message:v})},success(v){S(f,{status:"success",message:v})}}},error(h,f){$(!0),O.error(h,{output:i,secondarySymbol:r,spacing:1}),f?.showLog!==!1&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""},success(h,f){$(!0),O.success(h,{output:i,secondarySymbol:r,spacing:1}),f?.showLog===!0&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""}}},Ot=e=>new Ye({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){const i=e?.withGuide??I.withGuide,s=`${`${i?`${t("gray",d)}
`:""}${V(this.state)} `}${e.message}
`,r=e.placeholder?t("inverse",e.placeholder[0])+t("dim",e.placeholder.slice(1)):t(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:r,n=this.value??"";switch(this.state){case"error":{const o=this.error?` ${t("yellow",this.error)}`:"",c=i?`${t("yellow",d)} `:"",a=i?t("yellow",E):"";return`${s.trim()}
`)}c&&g()},g=()=>{for(const h of a)h.result?h.result.status==="error"?R.error(h.result.message,{output:r,secondarySymbol:i,spacing:0}):R.success(h.result.message,{output:r,secondarySymbol:i,spacing:0}):h.value!==""&&y(h,0)},S=(h,f)=>{d(!1),h.result=f,c&&g()};return{message(h,f){m(a[0],h,f)},group(h){const f={header:h,value:"",full:""};return a.push(f),{message(v,T){m(f,v,T)},error(v){S(f,{status:"error",message:v})},success(v){S(f,{status:"success",message:v})}}},error(h,f){d(!0),R.error(h,{output:r,secondarySymbol:i,spacing:1}),f?.showLog!==!1&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""},success(h,f){d(!0),R.success(h,{output:r,secondarySymbol:i,spacing:1}),f?.showLog===!0&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""}}},Re=t=>new Xt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){const r=t?.withGuide??_.withGuide,s=`${`${r?`${e("gray",$)}
`:""}${M(this.state)} `}${t.message}
`,i=t.placeholder?e("inverse",t.placeholder[0])+e("dim",t.placeholder.slice(1)):e(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:i,n=this.value??"";switch(this.state){case"error":{const o=this.error?` ${e("yellow",this.error)}`:"",c=r?`${e("yellow",$)} `:"",a=r?e("yellow",E):"";return`${s.trim()}
${c}${u}
${a}${o}
`}case"submit":{const o=n?` ${t("dim",n)}`:"",c=i?t("gray",d):"";return`${s}${c}${o}`}case"cancel":{const o=n?` ${t(["strikethrough","dim"],n)}`:"",c=i?t("gray",d):"";return`${s}${c}${o}${n.trim()?`
${c}`:""}`}default:{const o=i?`${t("cyan",d)} `:"",c=i?t("cyan",E):"";return`${s}${o}${u}
`}case"submit":{const o=n?` ${e("dim",n)}`:"",c=r?e("gray",$):"";return`${s}${c}${o}`}case"cancel":{const o=n?` ${e(["strikethrough","dim"],n)}`:"",c=r?e("gray",$):"";return`${s}${c}${o}${n.trim()?`
${c}`:""}`}default:{const o=r?`${e("cyan",$)} `:"",c=r?e("cyan",E):"";return`${s}${o}${u}
${c}
`}}}}).prompt();export{d as S_BAR,E as S_BAR_END,Ee as S_BAR_END_RIGHT,se as S_BAR_H,le as S_BAR_START,Ie as S_BAR_START_RIGHT,te as S_CHECKBOX_ACTIVE,J as S_CHECKBOX_INACTIVE,U as S_CHECKBOX_SELECTED,Ge as S_CONNECT_LEFT,de as S_CORNER_BOTTOM_LEFT,$e as S_CORNER_BOTTOM_RIGHT,Oe as S_CORNER_TOP_LEFT,ce as S_CORNER_TOP_RIGHT,ge as S_ERROR,he as S_INFO,xe as S_PASSWORD_MASK,z as S_RADIO_ACTIVE,H as S_RADIO_INACTIVE,_e as S_STEP_ACTIVE,oe as S_STEP_CANCEL,ue as S_STEP_ERROR,F as S_STEP_SUBMIT,pe as S_SUCCESS,me as S_WARN,Ae as autocomplete,st as autocompleteMultiselect,at as box,pt as cancel,ot as confirm,ut as date,dt as group,ht as groupMultiselect,mt as intro,ae as isCI,Te as isTTY,Y as limitOptions,O as log,yt as multiselect,wt as note,gt as outro,bt as password,St as path,Tt as progress,_t as select,It as selectKey,fe as spinner,K as stream,V as symbol,ye as symbolBar,Gt as taskLog,Et as tasks,Ot as text,ee as unicode,w as unicodeOr};
`}}}}).prompt();export{$ as S_BAR,E as S_BAR_END,Et as S_BAR_END_RIGHT,st as S_BAR_H,lt as S_BAR_START,It as S_BAR_START_RIGHT,et as S_CHECKBOX_ACTIVE,J as S_CHECKBOX_INACTIVE,U as S_CHECKBOX_SELECTED,xt as S_CONNECT_LEFT,dt as S_CORNER_BOTTOM_LEFT,$t as S_CORNER_BOTTOM_RIGHT,Ot as S_CORNER_TOP_LEFT,ct as S_CORNER_TOP_RIGHT,gt as S_ERROR,ht as S_INFO,Gt as S_PASSWORD_MASK,z as S_RADIO_ACTIVE,H as S_RADIO_INACTIVE,_t as S_STEP_ACTIVE,ot as S_STEP_CANCEL,ut as S_STEP_ERROR,F as S_STEP_SUBMIT,pt as S_SUCCESS,mt as S_WARN,At as autocomplete,ie as autocompleteMultiselect,oe as box,me as cancel,ue as confirm,le as date,he as group,pe as groupMultiselect,ge as intro,at as isCI,Tt as isTTY,Y as limitOptions,R as log,fe as multiline,ve as multiselect,Se as note,ye as outro,Ce as password,Te as path,Ie as progress,Ee as select,Ge as selectKey,ft as spinner,K as stream,M as symbol,yt as symbolBar,Me as taskLog,xe as tasks,Re as text,tt as unicode,w as unicodeOr};
//# sourceMappingURL=index.mjs.map
File diff suppressed because one or more lines are too long
+7 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@clack/prompts",
"version": "1.2.0",
"version": "1.3.0",
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
@@ -46,11 +46,14 @@
"stdin",
"ui"
],
"engines": {
"node": ">= 20.12.0"
},
"dependencies": {
"fast-string-width": "^1.1.0",
"fast-wrap-ansi": "^0.1.3",
"fast-string-width": "^3.0.2",
"fast-wrap-ansi": "^0.2.0",
"sisteransi": "^1.0.5",
"@clack/core": "1.2.0"
"@clack/core": "1.3.0"
},
"devDependencies": {
"is-unicode-supported": "^1.3.0",
+4 -2
View File
@@ -33,7 +33,7 @@ This package exports the following functions in both ESM and CommonJS format:
- `fixupRule(rule)` - wraps the given rule in a compatibility layer and returns the result
- `fixupPluginRules(plugin)` - wraps each rule in the given plugin using `fixupRule()` and returns a new object that represents the plugin with the fixed-up rules
- `fixupConfigRules(configs)` - wraps all plugins found in an array of config objects using `fixupPluginRules()`
- `includeIgnoreFile(path)` - reads an ignore file (like `.gitignore`) and converts the patterns into the correct format for the config file
- `includeIgnoreFile(path)` (deprecated) - reads an ignore file (like `.gitignore`) and converts the patterns into the correct format for the config file
### Fixing Rules
@@ -149,6 +149,8 @@ module.exports = defineConfig([
### Including Ignore Files
**Deprecated**: The `includeIgnoreFile()` exported by this package has been deprecated ([eslint/rewrite#329](https://github.com/eslint/rewrite/issues/329)). Use the `includeIgnoreFile()` function exported by `@eslint/config-helpers` instead (also available at `eslint/config`). This section is only preserved for historical reference.
If you were using an alternate ignore file in ESLint v8.x, such as using `--ignore-path .gitignore` on the command line, you can include those patterns programmatically in your config file using the `includeIgnoreFile()` function.
The `includeIgnoreFile()` function also accepts a second optional `name` parameter that allows you to set a custom name for this configuration object. If not specified, it defaults to `"Imported .gitignore patterns"`. For example:
@@ -204,7 +206,7 @@ to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="#"><img src="https://images.opencollective.com/aeriusventilations-org/avatar.png" alt="aeriusventilation's Org" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://citadel.co.jp"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
+6
View File
@@ -490,6 +490,9 @@ function fixupConfigRules(config) {
* Converts an ESLint ignore pattern to a minimatch pattern.
* @param {string} pattern The .eslintignore or .gitignore pattern to convert.
* @returns {string} The converted pattern.
*
* @deprecated Use the `convertIgnorePatternToMinimatch()` function exported by
* `@eslint/config-helpers` instead.
*/
function convertIgnorePatternToMinimatch(pattern) {
const isNegated = pattern.startsWith("!");
@@ -538,6 +541,9 @@ function convertIgnorePatternToMinimatch(pattern) {
* @param {string} [name] The name of the ignore file config.
* @returns {FlatConfig} An object with an `ignores` property that is an array of ignore patterns.
* @throws {Error} If the ignore file path is not an absolute path.
*
* @deprecated Use the `includeIgnoreFile()` function exported by
* `@eslint/config-helpers` instead (also available at `eslint/config`).
*/
function includeIgnoreFile(ignoreFilePath, name) {
if (!path.isAbsolute(ignoreFilePath)) {
+6
View File
@@ -13,6 +13,9 @@ export type FixupConfigArray = Array<FixupConfig>;
* Converts an ESLint ignore pattern to a minimatch pattern.
* @param {string} pattern The .eslintignore or .gitignore pattern to convert.
* @returns {string} The converted pattern.
*
* @deprecated Use the `convertIgnorePatternToMinimatch()` function exported by
* `@eslint/config-helpers` instead.
*/
export function convertIgnorePatternToMinimatch(pattern: string): string;
/**
@@ -42,5 +45,8 @@ export function fixupRule(ruleDefinition: FixupRuleDefinition | FixupLegacyRuleD
* @param {string} [name] The name of the ignore file config.
* @returns {FlatConfig} An object with an `ignores` property that is an array of ignore patterns.
* @throws {Error} If the ignore file path is not an absolute path.
*
* @deprecated Use the `includeIgnoreFile()` function exported by
* `@eslint/config-helpers` instead (also available at `eslint/config`).
*/
export function includeIgnoreFile(ignoreFilePath: string, name?: string): FlatConfig;
+6
View File
@@ -13,6 +13,9 @@ export type FixupConfigArray = Array<FixupConfig>;
* Converts an ESLint ignore pattern to a minimatch pattern.
* @param {string} pattern The .eslintignore or .gitignore pattern to convert.
* @returns {string} The converted pattern.
*
* @deprecated Use the `convertIgnorePatternToMinimatch()` function exported by
* `@eslint/config-helpers` instead.
*/
export function convertIgnorePatternToMinimatch(pattern: string): string;
/**
@@ -42,5 +45,8 @@ export function fixupRule(ruleDefinition: FixupRuleDefinition | FixupLegacyRuleD
* @param {string} [name] The name of the ignore file config.
* @returns {FlatConfig} An object with an `ignores` property that is an array of ignore patterns.
* @throws {Error} If the ignore file path is not an absolute path.
*
* @deprecated Use the `includeIgnoreFile()` function exported by
* `@eslint/config-helpers` instead (also available at `eslint/config`).
*/
export function includeIgnoreFile(ignoreFilePath: string, name?: string): FlatConfig;
+6
View File
@@ -489,6 +489,9 @@ function fixupConfigRules(config) {
* Converts an ESLint ignore pattern to a minimatch pattern.
* @param {string} pattern The .eslintignore or .gitignore pattern to convert.
* @returns {string} The converted pattern.
*
* @deprecated Use the `convertIgnorePatternToMinimatch()` function exported by
* `@eslint/config-helpers` instead.
*/
function convertIgnorePatternToMinimatch(pattern) {
const isNegated = pattern.startsWith("!");
@@ -537,6 +540,9 @@ function convertIgnorePatternToMinimatch(pattern) {
* @param {string} [name] The name of the ignore file config.
* @returns {FlatConfig} An object with an `ignores` property that is an array of ignore patterns.
* @throws {Error} If the ignore file path is not an absolute path.
*
* @deprecated Use the `includeIgnoreFile()` function exported by
* `@eslint/config-helpers` instead (also available at `eslint/config`).
*/
function includeIgnoreFile(ignoreFilePath, name) {
if (!path.isAbsolute(ignoreFilePath)) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@eslint/compat",
"version": "2.0.5",
"version": "2.1.0",
"description": "Compatibility utilities for ESLint",
"type": "module",
"main": "dist/esm/index.js",
+185 -36
View File
@@ -54,40 +54,40 @@ Ruler solves this by providing a **single source of truth** for all your AI agen
## Supported AI Agents
| Agent | Rules File(s) | MCP Configuration / Notes | Skills Support / Location |
| ---------------------- | ---------------------------------------------- | ------------------------------------------------ | ------------------------- |
| AGENTS.md | `AGENTS.md` | (pseudo-agent ensuring root `AGENTS.md` exists) | - |
| GitHub Copilot | `AGENTS.md` | `.vscode/mcp.json` | `.claude/skills/` |
| Claude Code | `CLAUDE.md` | `.mcp.json` | `.claude/skills/` |
| OpenAI Codex CLI | `AGENTS.md` | `.codex/config.toml` | `.codex/skills/` |
| Pi Coding Agent | `AGENTS.md` | - | `.pi/skills/` |
| Jules | `AGENTS.md` | - | - |
| Cursor | `AGENTS.md` | `.cursor/mcp.json` | `.cursor/skills/` |
| Windsurf | `AGENTS.md` | `.windsurf/mcp_config.json` | `.windsurf/skills/` |
| Cline | `.clinerules` | - | - |
| Crush | `CRUSH.md` | `.crush.json` | - |
| Amp | `AGENTS.md` | - | `.agents/skills/` |
| Antigravity | `.agent/rules/ruler.md` | - | `.agent/skills/` |
| Amazon Q CLI | `.amazonq/rules/ruler_q_rules.md` | `.amazonq/mcp.json` | - |
| Aider | `AGENTS.md`, `.aider.conf.yml` | `.mcp.json` | - |
| Firebase Studio | `.idx/airules.md` | `.idx/mcp.json` | - |
| Open Hands | `.openhands/microagents/repo.md` | `config.toml` | - |
| Gemini CLI | `AGENTS.md` | `.gemini/settings.json` | `.gemini/skills/` |
| Junie | `.junie/guidelines.md` | `.junie/mcp/mcp.json` | `.junie/skills/` |
| AugmentCode | `.augment/rules/ruler_augment_instructions.md` | - | - |
| Kilo Code | `AGENTS.md` | `.kilocode/mcp.json` | `.claude/skills/` |
| OpenCode | `AGENTS.md` | `opencode.json` | `.opencode/skills/` |
| Goose | `.goosehints` | - | `.agents/skills/` |
| Qwen Code | `AGENTS.md` | `.qwen/settings.json` | - |
| RooCode | `AGENTS.md` | `.roo/mcp.json` | `.roo/skills/` |
| Zed | `AGENTS.md` | `.zed/settings.json` (project root, never $HOME) | - |
| Trae AI | `.trae/rules/project_rules.md` | - | - |
| Warp | `WARP.md` | - | - |
| Kiro | `.kiro/steering/ruler_kiro_instructions.md` | `.kiro/settings/mcp.json` | - |
| Firebender | `firebender.json` | `firebender.json` (rules and MCP in same file) | - |
| Factory Droid | `AGENTS.md` | `.factory/mcp.json` | `.factory/skills/` |
| Mistral Vibe | `AGENTS.md` | `.vibe/config.toml` | `.vibe/skills/` |
| JetBrains AI Assistant | `.aiassistant/rules/AGENTS.md` | - | - |
| Agent | Rules File(s) | MCP Configuration / Notes | Skills Support / Location | Subagents Support / Location |
| ---------------------- | ---------------------------------------------- | ------------------------------------------------ | ------------------------- | ---------------------------- |
| AGENTS.md | `AGENTS.md` | (pseudo-agent ensuring root `AGENTS.md` exists) | - | - |
| GitHub Copilot | `AGENTS.md` | `.vscode/mcp.json` | `.claude/skills/` | `.github/agents/` |
| Claude Code | `CLAUDE.md` | `.mcp.json` | `.claude/skills/` | `.claude/agents/` |
| OpenAI Codex CLI | `AGENTS.md` | `.codex/config.toml` | `.codex/skills/` | `.codex/agents/` (`.toml`) |
| Pi Coding Agent | `AGENTS.md` | - | `.pi/skills/` | - |
| Jules | `AGENTS.md` | - | - | - |
| Cursor | `AGENTS.md` | `.cursor/mcp.json` | `.cursor/skills/` | `.cursor/agents/` |
| Windsurf | `AGENTS.md` | `.windsurf/mcp_config.json` | `.windsurf/skills/` | - |
| Cline | `.clinerules` | - | - | - |
| Crush | `CRUSH.md` | `.crush.json` | - | - |
| Amp | `AGENTS.md` | - | `.agents/skills/` | - |
| Antigravity | `.agent/rules/ruler.md` | - | `.agent/skills/` | - |
| Amazon Q CLI | `.amazonq/rules/ruler_q_rules.md` | `.amazonq/mcp.json` | - | - |
| Aider | `AGENTS.md`, `.aider.conf.yml` | `.mcp.json` | - | - |
| Firebase Studio | `.idx/airules.md` | `.idx/mcp.json` | - | - |
| Open Hands | `.openhands/microagents/repo.md` | `config.toml` | - | - |
| Gemini CLI | `AGENTS.md` | `.gemini/settings.json` | `.gemini/skills/` | - |
| Junie | `.junie/guidelines.md` | `.junie/mcp/mcp.json` | `.junie/skills/` | - |
| AugmentCode | `.augment/rules/ruler_augment_instructions.md` | - | - | - |
| Kilo Code | `AGENTS.md` | `.kilocode/mcp.json` | `.claude/skills/` | - |
| OpenCode | `AGENTS.md` | `opencode.json` | `.opencode/skills/` | - |
| Goose | `.goosehints` | - | `.agents/skills/` | - |
| Qwen Code | `AGENTS.md` | `.qwen/settings.json` | - | - |
| RooCode | `AGENTS.md` | `.roo/mcp.json` | `.roo/skills/` | - |
| Zed | `AGENTS.md` | `.zed/settings.json` (project root, never $HOME) | - | - |
| Trae AI | `.trae/rules/project_rules.md` | - | - | - |
| Warp | `WARP.md` | - | - | - |
| Kiro | `.kiro/steering/ruler_kiro_instructions.md` | `.kiro/settings/mcp.json` | - | - |
| Firebender | `firebender.json` | `firebender.json` (rules and MCP in same file) | - | - |
| Factory Droid | `AGENTS.md` | `.factory/mcp.json` | `.factory/skills/` | - |
| Mistral Vibe | `AGENTS.md` | `.vibe/config.toml` | `.vibe/skills/` | - |
| JetBrains AI Assistant | `.aiassistant/rules/AGENTS.md` | - | - | - |
## Getting Started
@@ -241,9 +241,12 @@ The `apply` command looks for `.ruler/` in the current directory tree, reading t
| `--gitignore-local` | Write managed ignore entries to `.git/info/exclude` instead. |
| `--nested` | Enable nested rule loading (default: inherit from config or disabled). |
| `--no-nested` | Disable nested rule loading even if `nested = true` in config. |
| `--backup` | Toggle creation of `.bak` backup files (default: enabled). |
| `--backup` | Enable creation of `.bak` backup files (default: enabled). |
| `--no-backup` | Disable creation of `.bak` backup files. |
| `--skills` | Enable skills support (experimental, default: enabled). |
| `--no-skills` | Disable skills support. |
| `--subagents` | Enable subagents support (experimental, default: enabled). |
| `--no-subagents` | Disable subagents support. |
| `--dry-run` | Preview changes without writing files. |
| `--local-only` | Skip `$XDG_CONFIG_HOME` when looking for configuration. |
| `--verbose` / `-v` | Display detailed output during execution. |
@@ -663,12 +666,13 @@ When skills support is enabled and gitignore integration is active, Ruler automa
- `.gemini/skills/` (for Gemini CLI)
- `.junie/skills/` (for Junie)
- `.cursor/skills/` (for Cursor)
- `.windsurf/skills/` (for Windsurf)
to your `.gitignore` file within the managed Ruler block.
### Requirements
- **For agents with native skills support** (Claude Code, GitHub Copilot, Kilo Code, OpenAI Codex CLI, OpenCode, Pi Coding Agent, Goose, Amp, Antigravity, Factory Droid, Mistral Vibe, Roo Code, Gemini CLI, Junie, Cursor): No additional requirements.
- **For agents with native skills support** (Claude Code, GitHub Copilot, Kilo Code, OpenAI Codex CLI, OpenCode, Pi Coding Agent, Goose, Amp, Antigravity, Factory Droid, Mistral Vibe, Roo Code, Gemini CLI, Junie, Cursor, Windsurf): No additional requirements.
### Validation
@@ -723,8 +727,153 @@ ruler apply
# - Gemini CLI: .gemini/skills/my-skill/
# - Junie: .junie/skills/my-skill/
# - Cursor: .cursor/skills/my-skill/
# - Windsurf: .windsurf/skills/my-skill/
```
## Subagents Support (Experimental)
> **⚠️ Experimental:** Subagents support is experimental and behavior may change in future releases.
Ruler can distribute named, delegatable **subagents** from a single source of truth (`.ruler/agents/`) to each agent's native subagent location. Each source file is one Markdown file with YAML frontmatter; Ruler transforms it into the format the target agent expects.
### How It Works
For agents with a native subagent primitive, Ruler writes one file per subagent into the target directory:
| Agent | Target location | Format |
| ----------------- | ------------------------------ | ------ |
| Claude Code | `.claude/agents/<name>.md` | Markdown + YAML frontmatter |
| Cursor | `.cursor/agents/<name>.md` | Markdown + YAML frontmatter |
| OpenAI Codex CLI | `.codex/agents/<name>.toml` | TOML (one self-contained file per agent) |
| GitHub Copilot | `.github/agents/<name>.md` | Markdown + YAML frontmatter |
Other agents (Windsurf, RooCode, Aider, Gemini CLI, …) do not yet have a comparable native subagent primitive and are skipped with a warning. Subagent propagation will be added when those agents ship a comparable file format.
### Source Format
Author each subagent as `.ruler/agents/<name>.md`:
```markdown
---
name: code-reviewer
description: Use PROACTIVELY after a feature/fix is implemented. Reviews against SOLID/DRY/KISS. Read-only.
tools: [Read, Grep, Glob, Bash]
model: inherit
readonly: true
is_background: false
---
# Code Reviewer
You operate in a fresh context window with read-only access. Your job is to
review the diff and surrounding code against the design principles and return
a structured verdict.
```
**Required frontmatter fields:**
| Field | Type | Notes |
| ------------- | ------ | ----------------------------------------------------- |
| `name` | string | Must match the filename stem (`code-reviewer.md``name: code-reviewer`). |
| `description` | string | When the parent agent should delegate to this subagent. |
**Optional frontmatter fields:**
| Field | Type | Used by | Default behavior |
| --------------- | ---------------- | ------------------------------------------------ | --------------------------------------------- |
| `tools` | string[] | Claude (verbatim), Copilot (mapped to aliases) | Cursor / Codex ignore; omitted if absent. |
| `model` | string | All four targets | Cursor defaults to `inherit`; others omit. |
| `readonly` | boolean | Cursor (verbatim), Codex (`sandbox_mode`), Copilot (`disable-model-invocation`) | Defaults to `false` for Cursor; omitted otherwise. |
| `is_background` | boolean | Cursor only | Defaults to `false` for Cursor. |
For GitHub Copilot, source `tools` (Claude vocabulary: `Read`, `Grep`, `Bash`, …) are translated to Copilot's aliases (`read`, `search`, `execute`, …). Tools that do not have a Copilot equivalent are dropped silently on a normal apply; pass `--verbose` (or use `--dry-run` to preview) to see which tools were dropped.
### Configuration
Subagent propagation is **disabled by default**. Opt in via CLI flag or `ruler.toml`:
```bash
ruler apply --subagents # enable subagent propagation for one run
```
```toml
# .ruler/ruler.toml
[agents]
enabled = true
# include_in_rules = true # also append .ruler/agents/*.md into top-level CLAUDE.md / AGENTS.md (default: false)
```
> **Note:** the previous release used `[subagents]` for these keys. `[subagents]` is still honored as a fallback with a deprecation warning, and will be removed in a future release. Please migrate to `[agents]`.
`[agents] enabled` controls only native subagent propagation from `.ruler/agents/`. It is independent from `[agents.<name>] enabled` (which toggles per-coding-agent output like `CLAUDE.md` / `AGENTS.md`).
CLI flags take precedence over `ruler.toml`, which takes precedence over the default (disabled).
### Validation
Source files are validated at discovery time:
- Files without YAML frontmatter are skipped with a warning.
- Files missing required `name` or `description` are skipped with a warning.
- Files where `name` does not match the filename stem are skipped with a warning.
- Unknown frontmatter keys are dropped (not errored).
### Dry-Run Mode
Use `--dry-run` to preview which files would be written without touching disk.
### `.gitignore` Integration
When subagents are enabled, the four target directories are added to the Ruler-managed block of `.gitignore`:
```
.claude/agents/
.cursor/agents/
.codex/agents/
.github/agents/
```
Use `--no-gitignore` to opt out.
### Cleanup
Subagent propagation does **not** currently have explicit `ruler revert` support. To remove generated subagent directories, set `[agents] enabled = false` (or pass `--no-subagents`) and run `ruler apply` once. Cleanup will run for all four targets even if no source `.ruler/agents/` directory exists.
### Example Workflow
```bash
# 1. Author a subagent in your project
mkdir -p .ruler/agents
cat > .ruler/agents/code-reviewer.md << 'EOF'
---
name: code-reviewer
description: Reviews changes against SOLID/DRY/KISS
tools: [Read, Grep, Glob]
readonly: true
---
You review code changes for quality.
EOF
# 2. Opt subagents in (default is disabled — see [agents] section above)
echo -e "\n[agents]\nenabled = true" >> .ruler/ruler.toml
# 3. Apply
ruler apply
# 4. The subagent is now available in each agent's native location:
# - Claude Code: .claude/agents/code-reviewer.md
# - Cursor: .cursor/agents/code-reviewer.md
# - Codex CLI: .codex/agents/code-reviewer.toml
# - GitHub Copilot: .github/agents/code-reviewer.md
```
### Limitations
- **No explicit revert command.** Cleanup happens via `[agents] enabled = false` on a subsequent `apply`.
- **Atomic replace, not merge.** Ruler regenerates each agent's subagent directory from the source on every apply. Manual edits to generated files will be overwritten.
- **No support yet for agents without a native subagent primitive.** Windsurf, RooCode, Aider, Gemini CLI, and others are skipped with a warning. Propagation will be added when those agents ship a comparable file format.
## `.gitignore` Integration
Ruler automatically manages your `.gitignore` file to keep generated agent configuration files out of version control.
@@ -58,5 +58,8 @@ class ClaudeAgent extends AbstractAgent_1.AbstractAgent {
supportsNativeSkills() {
return true;
}
supportsNativeSubagents() {
return true;
}
}
exports.ClaudeAgent = ClaudeAgent;
@@ -149,5 +149,8 @@ class CodexCliAgent {
supportsNativeSkills() {
return true;
}
supportsNativeSubagents() {
return true;
}
}
exports.CodexCliAgent = CodexCliAgent;
@@ -42,5 +42,8 @@ class CopilotAgent {
supportsNativeSkills() {
return true;
}
supportsNativeSubagents() {
return true;
}
}
exports.CopilotAgent = CopilotAgent;
@@ -33,5 +33,8 @@ class CursorAgent extends AgentsMdAgent_1.AgentsMdAgent {
supportsNativeSkills() {
return true;
}
supportsNativeSubagents() {
return true;
}
}
exports.CursorAgent = CursorAgent;
+4
View File
@@ -77,6 +77,10 @@ function run() {
.option('skills', {
type: 'boolean',
description: 'Enable/disable skills support (experimental, default: enabled)',
})
.option('subagents', {
type: 'boolean',
description: 'Enable/disable subagents support (experimental, default: enabled)',
});
}, handlers_1.applyHandler)
.command('init', 'Scaffold a .ruler directory with default files', (y) => {
+9 -1
View File
@@ -114,8 +114,16 @@ async function applyHandler(argv) {
else {
skillsEnabled = undefined; // Let config/default decide
}
// Determine subagents preference: CLI > TOML > Default (enabled)
let subagentsEnabled;
if (argv.subagents !== undefined) {
subagentsEnabled = argv.subagents;
}
else {
subagentsEnabled = undefined; // Let config/default decide
}
try {
await (0, lib_1.applyAllAgentConfigs)(projectRoot, agents, configPath, mcpEnabled, mcpStrategy, gitignorePreference, verbose, dryRun, localOnly, nested, backup, skillsEnabled, gitignoreLocalPreference);
await (0, lib_1.applyAllAgentConfigs)(projectRoot, agents, configPath, mcpEnabled, mcpStrategy, gitignorePreference, verbose, dryRun, localOnly, nested, backup, skillsEnabled, gitignoreLocalPreference, subagentsEnabled);
console.log('Ruler apply completed successfully.');
}
catch (err) {
+7 -1
View File
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SKILL_MD_FILENAME = exports.ANTIGRAVITY_SKILLS_PATH = exports.FACTORY_SKILLS_PATH = exports.WINDSURF_SKILLS_PATH = exports.CURSOR_SKILLS_PATH = exports.JUNIE_SKILLS_PATH = exports.GEMINI_SKILLS_PATH = exports.ROO_SKILLS_PATH = exports.VIBE_SKILLS_PATH = exports.GOOSE_SKILLS_PATH = exports.PI_SKILLS_PATH = exports.OPENCODE_SKILLS_PATH = exports.CODEX_SKILLS_PATH = exports.CLAUDE_SKILLS_PATH = exports.RULER_SKILLS_PATH = exports.SKILLS_DIR = exports.DEFAULT_RULES_FILENAME = exports.ERROR_PREFIX = void 0;
exports.COPILOT_SUBAGENTS_PATH = exports.CODEX_SUBAGENTS_PATH = exports.CURSOR_SUBAGENTS_PATH = exports.CLAUDE_SUBAGENTS_PATH = exports.RULER_SUBAGENTS_PATH = exports.SKILL_MD_FILENAME = exports.ANTIGRAVITY_SKILLS_PATH = exports.FACTORY_SKILLS_PATH = exports.WINDSURF_SKILLS_PATH = exports.CURSOR_SKILLS_PATH = exports.JUNIE_SKILLS_PATH = exports.GEMINI_SKILLS_PATH = exports.ROO_SKILLS_PATH = exports.VIBE_SKILLS_PATH = exports.GOOSE_SKILLS_PATH = exports.PI_SKILLS_PATH = exports.OPENCODE_SKILLS_PATH = exports.CODEX_SKILLS_PATH = exports.CLAUDE_SKILLS_PATH = exports.RULER_SKILLS_PATH = exports.SKILLS_DIR = exports.DEFAULT_RULES_FILENAME = exports.ERROR_PREFIX = void 0;
exports.actionPrefix = actionPrefix;
exports.createRulerError = createRulerError;
exports.logVerbose = logVerbose;
@@ -66,3 +66,9 @@ exports.WINDSURF_SKILLS_PATH = '.windsurf/skills';
exports.FACTORY_SKILLS_PATH = '.factory/skills';
exports.ANTIGRAVITY_SKILLS_PATH = '.agent/skills';
exports.SKILL_MD_FILENAME = 'SKILL.md';
// Subagents-related constants
exports.RULER_SUBAGENTS_PATH = '.ruler/agents';
exports.CLAUDE_SUBAGENTS_PATH = '.claude/agents';
exports.CURSOR_SUBAGENTS_PATH = '.cursor/agents';
exports.CODEX_SUBAGENTS_PATH = '.codex/agents';
exports.COPILOT_SUBAGENTS_PATH = '.github/agents';
+79 -1
View File
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports._resetLegacySubagentsWarningForTests = _resetLegacySubagentsWarningForTests;
exports.loadConfig = loadConfig;
const fs_1 = require("fs");
const path = __importStar(require("path"));
@@ -40,6 +41,21 @@ const os = __importStar(require("os"));
const toml_1 = require("@iarna/toml");
const zod_1 = require("zod");
const constants_1 = require("../constants");
// One-shot guard so the deprecation message fires once per process even when
// `loadConfig` is called multiple times (e.g. nested mode walks every
// `.ruler` directory).
let _legacySubagentsWarned = false;
function warnLegacySubagentsSection() {
if (_legacySubagentsWarned)
return;
_legacySubagentsWarned = true;
(0, constants_1.logWarn)('`[subagents]` is deprecated; rename it to `[agents]` in your ruler.toml. ' +
'The legacy section is honored for now and will be removed in a future release.');
}
/** Test helper — re-arms the deprecation guard so suites can assert it fires. */
function _resetLegacySubagentsWarningForTests() {
_legacySubagentsWarned = false;
}
const mcpConfigSchema = zod_1.z
.object({
enabled: zod_1.z.boolean().optional(),
@@ -55,9 +71,21 @@ const agentConfigSchema = zod_1.z
mcp: mcpConfigSchema,
})
.optional();
// `[agents]` is a heterogeneous table that holds two unrelated kinds of keys:
// - reserved subagent-control booleans (`enabled`, `include_in_rules`)
// - one nested table per coding-agent integration (`[agents.claude]`, etc.)
// Reserved keys are validated by the object shape; everything else falls
// through `catchall` and is treated as a per-agent config record.
const SUBAGENT_RESERVED_KEYS = new Set(['enabled', 'include_in_rules']);
const rulerConfigSchema = zod_1.z.object({
default_agents: zod_1.z.array(zod_1.z.string()).optional(),
agents: zod_1.z.record(zod_1.z.string(), agentConfigSchema).optional(),
agents: zod_1.z
.object({
enabled: zod_1.z.boolean().optional(),
include_in_rules: zod_1.z.boolean().optional(),
})
.catchall(agentConfigSchema)
.optional(),
mcp: zod_1.z
.object({
enabled: zod_1.z.boolean().optional(),
@@ -75,6 +103,16 @@ const rulerConfigSchema = zod_1.z.object({
enabled: zod_1.z.boolean().optional(),
})
.optional(),
// Deprecated: kept in the schema only so that legacy `[subagents]` blocks
// are preserved through validation. The parser reads from here as a
// fallback when the new `[agents]` keys are absent and emits a one-time
// deprecation warning. Remove in the next minor release.
subagents: zod_1.z
.object({
enabled: zod_1.z.boolean().optional(),
include_in_rules: zod_1.z.boolean().optional(),
})
.optional(),
nested: zod_1.z.boolean().optional(),
});
/**
@@ -150,6 +188,11 @@ async function loadConfig(options) {
: {};
const agentConfigs = {};
for (const [name, section] of Object.entries(agentsSection)) {
// Reserved subagent-control keys live alongside per-agent records in
// the same `[agents]` table; skip them here so we only process actual
// coding-agent integrations as agent configs.
if (SUBAGENT_RESERVED_KEYS.has(name))
continue;
if (section && typeof section === 'object') {
const sectionObj = section;
const cfg = {};
@@ -214,6 +257,40 @@ async function loadConfig(options) {
if (typeof rawSkillsSection.enabled === 'boolean') {
skillsConfig.enabled = rawSkillsSection.enabled;
}
// Subagent control lives under `[agents]` (alongside per-agent records).
// The reserved keys `enabled` and `include_in_rules` are pulled out here
// and surfaced internally as `LoadedConfig.subagents` for the rest of the
// codebase, which still uses the `Subagent*` naming.
//
// Backward-compatibility: the previous release used `[subagents]` for the
// same two keys. We still read those as a fallback when the matching
// `[agents]` key is absent, and emit a one-time deprecation warning so
// existing configs keep working while users migrate.
const rawLegacySubagentsSection = raw.subagents &&
typeof raw.subagents === 'object' &&
!Array.isArray(raw.subagents)
? raw.subagents
: {};
const legacyHasContent = typeof rawLegacySubagentsSection.enabled === 'boolean' ||
typeof rawLegacySubagentsSection.include_in_rules === 'boolean';
if (legacyHasContent) {
warnLegacySubagentsSection();
}
const subagentsConfig = {};
if (typeof agentsSection.enabled === 'boolean') {
subagentsConfig.enabled = agentsSection.enabled;
}
else if (typeof rawLegacySubagentsSection.enabled === 'boolean') {
subagentsConfig.enabled = rawLegacySubagentsSection.enabled;
}
if (typeof agentsSection.include_in_rules === 'boolean') {
subagentsConfig.include_in_rules =
agentsSection.include_in_rules;
}
else if (typeof rawLegacySubagentsSection.include_in_rules === 'boolean') {
subagentsConfig.include_in_rules =
rawLegacySubagentsSection.include_in_rules;
}
const nestedDefined = typeof raw.nested === 'boolean';
const nested = nestedDefined ? raw.nested : false;
return {
@@ -223,6 +300,7 @@ async function loadConfig(options) {
mcp: globalMcpConfig,
gitignore: gitignoreConfig,
skills: skillsConfig,
subagents: subagentsConfig,
nested,
nestedDefined,
};
+26 -4
View File
@@ -44,6 +44,7 @@ const fs_1 = require("fs");
const path = __importStar(require("path"));
const os = __importStar(require("os"));
const constants_1 = require("../constants");
const SUBAGENTS_DIR_NAME = path.basename(constants_1.RULER_SUBAGENTS_PATH);
/**
* Gets the XDG config directory path, falling back to ~/.config if XDG_CONFIG_HOME is not set.
*/
@@ -93,9 +94,18 @@ async function findRulerDir(startPath, checkGlobal = true) {
/**
* Recursively reads all Markdown (.md) files in rulerDir, returning their paths and contents.
* Files are sorted alphabetically by path.
*
* `.ruler/skills/` is always skipped (skills are propagated separately).
* `.ruler/agents/` is skipped unless `options.includeAgents` is `true`.
*/
async function readMarkdownFiles(rulerDir) {
async function readMarkdownFiles(rulerDir, options = {}) {
const mdFiles = [];
const includeAgents = options.includeAgents === true;
// Tracks whether we skipped a `.ruler/agents` subtree so the root-AGENTS.md
// fallback below still recognises ruler content as present and does not
// resurrect a previously generated root AGENTS.md (which may itself contain
// the very agent docs we're now excluding).
let sawExcludedAgents = false;
// Gather all markdown files (recursive) first
async function walk(dir) {
const entries = await fs_1.promises.readdir(dir, { withFileTypes: true });
@@ -115,13 +125,22 @@ async function readMarkdownFiles(rulerDir) {
}
}
if (isDir) {
// Skip .ruler/skills; skills are propagated separately and should not be concatenated
const relativeFromRoot = path.relative(rulerDir, fullPath);
// Skip .ruler/skills; skills are propagated separately and should not be concatenated
const isSkillsDir = relativeFromRoot === constants_1.SKILLS_DIR ||
relativeFromRoot.startsWith(`${constants_1.SKILLS_DIR}${path.sep}`);
if (isSkillsDir) {
continue;
}
// Skip .ruler/agents unless explicitly opted in via subagents.include_in_rules.
// Subagents are propagated separately to native locations and should not pollute
// the top-level rule concatenation by default.
const isAgentsDir = relativeFromRoot === SUBAGENTS_DIR_NAME ||
relativeFromRoot.startsWith(`${SUBAGENTS_DIR_NAME}${path.sep}`);
if (isAgentsDir && !includeAgents) {
sawExcludedAgents = true;
continue;
}
await walk(fullPath);
}
else if (isFile && entry.name.endsWith('.md')) {
@@ -170,9 +189,12 @@ async function readMarkdownFiles(rulerDir) {
const stat = await fs_1.promises.stat(rootAgentsPath);
if (stat.isFile()) {
const content = await fs_1.promises.readFile(rootAgentsPath, 'utf8');
// Check if this is a generated file and we have other .ruler files
// Check if this is a generated file and we have other .ruler files.
// `sawExcludedAgents` counts as "ruler content present" so a stale
// generated root AGENTS.md isn't resurrected when `.ruler/agents` was
// the only source under `.ruler` and is now being skipped.
const isGenerated = content.startsWith('<!-- Generated by Ruler -->');
const hasRulerFiles = others.length > 0 || primaryFile !== null;
const hasRulerFiles = others.length > 0 || primaryFile !== null || sawExcludedAgents;
// Additional check: if AGENTS.md contains ruler source comments and we have ruler files,
// it's likely a corrupted generated file that should be skipped
const containsRulerSources = content.includes('<!-- Source: .ruler/') ||
+17 -14
View File
@@ -56,25 +56,23 @@ const constants_1 = require("../constants");
async function loadNestedConfigurations(projectRoot, configPath, localOnly, resolvedNested) {
const { dirs: rulerDirs } = await findRulerDirectories(projectRoot, localOnly, true);
const results = [];
const rulerDirConfigs = await processIndependentRulerDirs(rulerDirs);
for (const { rulerDir, files } of rulerDirConfigs) {
// Load config first so we know whether `.ruler/agents/` should be included
// in the rule concatenation for each directory.
for (const rulerDir of rulerDirs) {
const config = await loadConfigForRulerDir(rulerDir, configPath, resolvedNested);
const files = await FileSystemUtils.readMarkdownFiles(rulerDir, {
includeAgents: shouldIncludeAgentsInRules(config),
});
results.push(await createHierarchicalConfiguration(rulerDir, files, config, configPath));
}
return results;
}
/**
* Processes each .ruler directory independently, returning configuration for each.
* Each .ruler directory gets its own rules (not merged with others).
* Returns true when `.ruler/agents/*.md` should be concatenated into the
* generated top-level rule files. Defaults to false.
*/
async function processIndependentRulerDirs(rulerDirs) {
const results = [];
// Process each .ruler directory independently
for (const rulerDir of rulerDirs) {
const files = await FileSystemUtils.readMarkdownFiles(rulerDir);
results.push({ rulerDir, files });
}
return results;
function shouldIncludeAgentsInRules(config) {
return config.subagents?.include_in_rules === true;
}
async function createHierarchicalConfiguration(rulerDir, files, config, cliConfigPath) {
await warnAboutLegacyMcpJson(rulerDir);
@@ -146,6 +144,8 @@ function cloneLoadedConfig(config) {
cliAgents: config.cliAgents ? [...config.cliAgents] : undefined,
mcp: config.mcp ? { ...config.mcp } : undefined,
gitignore: config.gitignore ? { ...config.gitignore } : undefined,
skills: config.skills ? { ...config.skills } : undefined,
subagents: config.subagents ? { ...config.subagents } : undefined,
nested: config.nested,
nestedDefined: config.nestedDefined,
};
@@ -203,8 +203,11 @@ async function loadSingleConfiguration(projectRoot, configPath, localOnly) {
projectRoot,
configPath,
});
// Read rule files
const files = await FileSystemUtils.readMarkdownFiles(rulerDirs[0]);
// Read rule files. `.ruler/agents/` is only included when
// `[agents] include_in_rules = true`.
const files = await FileSystemUtils.readMarkdownFiles(rulerDirs[0], {
includeAgents: shouldIncludeAgentsInRules(config),
});
// Concatenate rules
const concatenatedRules = (0, RuleProcessor_1.concatenateRules)(files, path.dirname(primaryDir));
// Load unified config to get merged MCP configuration
+42 -2
View File
@@ -53,6 +53,23 @@ function resolveSkillsEnabled(cliFlag, configSetting) {
? configSetting
: true; // default to enabled
}
/**
* Resolves subagents enabled state based on precedence:
* CLI flag > ruler.toml > default (disabled).
*
* When neither `[agents] enabled` (nor the legacy `[subagents] enabled`)
* nor a CLI flag is provided, propagation is disabled by default per spec.
* Subagent definitions are an opt-in feature — propagating them silently
* could leak runtime prompts into native subagent locations on projects
* that never intended to use the feature.
*/
function resolveSubagentsEnabled(cliFlag, configSetting) {
return cliFlag !== undefined
? cliFlag
: configSetting !== undefined
? configSetting
: false; // default to disabled — see spec: subagents must opt in
}
/**
* Applies ruler configurations for all supported AI agents.
* @param projectRoot Root directory of the project
@@ -62,7 +79,7 @@ function resolveSkillsEnabled(cliFlag, configSetting) {
* @param projectRoot Root directory of the project
* @param includedAgents Optional list of agent name filters (case-insensitive substrings)
*/
async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cliMcpEnabled = true, cliMcpStrategy, cliGitignoreEnabled, verbose = false, dryRun = false, localOnly = false, nested = false, backup = true, skillsEnabled, cliGitignoreLocal) {
async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cliMcpEnabled = true, cliMcpStrategy, cliGitignoreEnabled, verbose = false, dryRun = false, localOnly = false, nested = false, backup = true, skillsEnabled, cliGitignoreLocal, subagentsEnabled) {
// Load configuration and rules
(0, constants_1.logVerbose)(`Loading configuration from project root: ${projectRoot}`, verbose);
if (configPath) {
@@ -100,6 +117,16 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
await propagateSkills(nestedRoot, selectedAgents, skillsEnabledResolved, verbose, dryRun);
}
}
// Propagate subagents (mirrors skills handling for nested mode).
const subagentsEnabledResolved = resolveSubagentsEnabled(subagentsEnabled, rootConfig.subagents?.enabled);
{
const { propagateSubagents } = await Promise.resolve().then(() => __importStar(require('./core/SubagentsProcessor')));
for (const configEntry of hierarchicalConfigs) {
const nestedRoot = path.dirname(configEntry.rulerDir);
(0, constants_1.logVerbose)(`Propagating subagents for nested directory: ${nestedRoot}`, verbose);
await propagateSubagents(nestedRoot, selectedAgents, subagentsEnabledResolved, verbose, dryRun);
}
}
generatedPaths = await (0, apply_engine_1.processHierarchicalConfigurations)(selectedAgents, hierarchicalConfigs, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup);
}
else {
@@ -117,6 +144,12 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
const { propagateSkills } = await Promise.resolve().then(() => __importStar(require('./core/SkillsProcessor')));
await propagateSkills(projectRoot, selectedAgents, skillsEnabledResolved, verbose, dryRun);
}
// Propagate subagents (mirrors skills handling).
const subagentsEnabledResolvedSingle = resolveSubagentsEnabled(subagentsEnabled, singleConfig.config.subagents?.enabled);
{
const { propagateSubagents } = await Promise.resolve().then(() => __importStar(require('./core/SubagentsProcessor')));
await propagateSubagents(projectRoot, selectedAgents, subagentsEnabledResolvedSingle, verbose, dryRun);
}
generatedPaths = await (0, apply_engine_1.processSingleConfiguration)(selectedAgents, singleConfig, projectRoot, verbose, dryRun, cliMcpEnabled, cliMcpStrategy, backup);
}
// Add skills-generated paths to gitignore if skills are enabled
@@ -126,7 +159,14 @@ async function applyAllAgentConfigs(projectRoot, includedAgents, configPath, cli
// Skills enabled by default or explicitly
const { getSkillsGitignorePaths } = await Promise.resolve().then(() => __importStar(require('./core/SkillsProcessor')));
const skillsPaths = await getSkillsGitignorePaths(projectRoot, selectedAgents);
allGeneratedPaths = [...generatedPaths, ...skillsPaths];
allGeneratedPaths = [...allGeneratedPaths, ...skillsPaths];
}
// Add subagents-generated paths to gitignore if subagents are enabled.
const subagentsEnabledForGitignore = resolveSubagentsEnabled(subagentsEnabled, loadedConfig.subagents?.enabled);
if (subagentsEnabledForGitignore) {
const { getSubagentsGitignorePaths } = await Promise.resolve().then(() => __importStar(require('./core/SubagentsProcessor')));
const subagentPaths = await getSubagentsGitignorePaths(projectRoot, selectedAgents);
allGeneratedPaths = [...allGeneratedPaths, ...subagentPaths];
}
await (0, apply_engine_1.updateGitignore)(projectRoot, allGeneratedPaths, loadedConfig, cliGitignoreEnabled, dryRun, cliGitignoreLocal);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@intellectronica/ruler",
"version": "0.3.38",
"version": "0.3.40",
"description": "Ruler — apply the same rules to all coding agents",
"main": "dist/lib.js",
"scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@oxc-project/types",
"version": "0.127.0",
"version": "0.128.0",
"description": "Types for Oxc AST nodes",
"keywords": [
"AST",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@rolldown/binding-darwin-arm64",
"version": "1.0.0-rc.17",
"version": "1.0.0-rc.18",
"cpu": [
"arm64"
],
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@tailwindcss/node",
"version": "4.2.4",
"version": "4.3.0",
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
"license": "MIT",
"repository": {
@@ -34,12 +34,12 @@
},
"dependencies": {
"@jridgewell/remapping": "^2.3.5",
"enhanced-resolve": "^5.19.0",
"enhanced-resolve": "^5.21.0",
"jiti": "^2.6.1",
"lightningcss": "1.32.0",
"magic-string": "^0.30.21",
"source-map-js": "^1.2.1",
"tailwindcss": "4.2.4"
"tailwindcss": "4.3.0"
},
"scripts": {
"build": "tsup-node",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tailwindcss/oxide-darwin-arm64",
"version": "4.2.4",
"version": "4.3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
+58 -54
View File
@@ -77,8 +77,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-android-arm64')
const bindingPackageVersion = require('@tailwindcss/oxide-android-arm64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -93,8 +93,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-android-arm-eabi')
const bindingPackageVersion = require('@tailwindcss/oxide-android-arm-eabi/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -114,8 +114,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-win32-x64-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -130,8 +130,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-win32-x64-msvc')
const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-msvc/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -147,8 +147,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-win32-ia32-msvc')
const bindingPackageVersion = require('@tailwindcss/oxide-win32-ia32-msvc/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -163,8 +163,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-win32-arm64-msvc')
const bindingPackageVersion = require('@tailwindcss/oxide-win32-arm64-msvc/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -182,8 +182,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-darwin-universal')
const bindingPackageVersion = require('@tailwindcss/oxide-darwin-universal/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -198,8 +198,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-darwin-x64')
const bindingPackageVersion = require('@tailwindcss/oxide-darwin-x64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -214,8 +214,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-darwin-arm64')
const bindingPackageVersion = require('@tailwindcss/oxide-darwin-arm64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -234,8 +234,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-freebsd-x64')
const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-x64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -250,8 +250,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-freebsd-arm64')
const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-arm64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -271,8 +271,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-x64-musl')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-musl/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -287,8 +287,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-x64-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -305,8 +305,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-arm64-musl')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-musl/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -321,8 +321,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-arm64-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -339,8 +339,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-arm-musleabihf')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-musleabihf/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -355,8 +355,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-arm-gnueabihf')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-gnueabihf/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -373,8 +373,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-loong64-musl')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-musl/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -389,8 +389,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-loong64-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -407,8 +407,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-riscv64-musl')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-musl/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -423,8 +423,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-riscv64-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -440,8 +440,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-ppc64-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-ppc64-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -456,8 +456,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-linux-s390x-gnu')
const bindingPackageVersion = require('@tailwindcss/oxide-linux-s390x-gnu/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -476,8 +476,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-openharmony-arm64')
const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -492,8 +492,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-openharmony-x64')
const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-x64/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -508,8 +508,8 @@ function requireNative() {
try {
const binding = require('@tailwindcss/oxide-openharmony-arm')
const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm/package.json').version
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
@@ -536,13 +536,17 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
wasiBindingError = err
}
}
if (!nativeBinding) {
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try {
wasiBinding = require('@tailwindcss/oxide-wasm32-wasi')
nativeBinding = wasiBinding
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
wasiBindingError.cause = err
if (!wasiBindingError) {
wasiBindingError = err
} else {
wasiBindingError.cause = err
}
loadErrors.push(err)
}
}
+16 -16
View File
@@ -1,6 +1,6 @@
{
"name": "@tailwindcss/oxide",
"version": "4.2.4",
"version": "4.3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
@@ -33,9 +33,9 @@
},
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "3.4.1",
"@napi-rs/wasm-runtime": "^1.1.1",
"emnapi": "1.8.1"
"@napi-rs/cli": "3.6.2",
"@napi-rs/wasm-runtime": "^1.1.4",
"emnapi": "1.10.0"
},
"engines": {
"node": ">= 20"
@@ -49,18 +49,18 @@
"access": "public"
},
"optionalDependencies": {
"@tailwindcss/oxide-android-arm64": "4.2.4",
"@tailwindcss/oxide-darwin-arm64": "4.2.4",
"@tailwindcss/oxide-darwin-x64": "4.2.4",
"@tailwindcss/oxide-freebsd-x64": "4.2.4",
"@tailwindcss/oxide-linux-arm64-gnu": "4.2.4",
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.4",
"@tailwindcss/oxide-linux-arm64-musl": "4.2.4",
"@tailwindcss/oxide-linux-x64-musl": "4.2.4",
"@tailwindcss/oxide-linux-x64-gnu": "4.2.4",
"@tailwindcss/oxide-win32-x64-msvc": "4.2.4",
"@tailwindcss/oxide-win32-arm64-msvc": "4.2.4",
"@tailwindcss/oxide-wasm32-wasi": "4.2.4"
"@tailwindcss/oxide-android-arm64": "4.3.0",
"@tailwindcss/oxide-darwin-x64": "4.3.0",
"@tailwindcss/oxide-linux-arm64-gnu": "4.3.0",
"@tailwindcss/oxide-freebsd-x64": "4.3.0",
"@tailwindcss/oxide-darwin-arm64": "4.3.0",
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0",
"@tailwindcss/oxide-linux-arm64-musl": "4.3.0",
"@tailwindcss/oxide-linux-x64-musl": "4.3.0",
"@tailwindcss/oxide-linux-x64-gnu": "4.3.0",
"@tailwindcss/oxide-wasm32-wasi": "4.3.0",
"@tailwindcss/oxide-win32-x64-msvc": "4.3.0",
"@tailwindcss/oxide-win32-arm64-msvc": "4.3.0"
},
"scripts": {
"build": "pnpm run build:platform && pnpm run build:wasm",
File diff suppressed because one or more lines are too long
+6 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@tailwindcss/vite",
"version": "4.2.4",
"version": "4.3.0",
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
"license": "MIT",
"repository": {
@@ -24,13 +24,13 @@
}
},
"dependencies": {
"@tailwindcss/node": "4.2.4",
"@tailwindcss/oxide": "4.2.4",
"tailwindcss": "4.2.4"
"@tailwindcss/node": "4.3.0",
"tailwindcss": "4.3.0",
"@tailwindcss/oxide": "4.3.0"
},
"devDependencies": {
"@types/node": "^20.19.0",
"vite": "^8.0.0"
"@types/node": "^22.19.17",
"vite": "^8.0.10"
},
"peerDependencies": {
"vite": "^5.2.0 || ^6 || ^7 || ^8"
+164 -2
View File
@@ -306,6 +306,141 @@ function asyncifyLoadSync(asyncify, buffer, imports) {
const CHAR_DOT = 46; /* . */
const CHAR_FORWARD_SLASH = 47; /* / */
const CHAR_BACKWARD_SLASH = 92; /* \ */
const CHAR_COLON = 58; /* : */
const CHAR_UPPERCASE_A = 65; /* A */
const CHAR_UPPERCASE_Z = 90; /* Z */
const CHAR_LOWERCASE_A = 97; /* a */
const CHAR_LOWERCASE_Z = 122; /* z */
function isPathSeparatorWin(code) {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
}
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
/**
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
* semantics enough for the WASI shim's needs (drive-letter absolutes
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
*
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
* is "relative", and produces a garbage joined path. Downstream
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
* sees a permanent failure. This function gives us the correct
* Windows-style resolution without taking a Node-only `path` import
* (which would break browser bundles of this package).
*
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
* trimmed to what WASI realpath resolution actually exercises.
*/
function resolveWin32(args) {
let resolvedDevice = '';
let resolvedTail = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1; i--) {
let path;
if (i >= 0) {
path = args[i];
validateString(path, 'path');
if (path.length === 0)
continue;
}
else if (resolvedDevice.length === 0) {
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
}
else {
// Look up per-drive cwd via the `=X:` env var convention; fall back
// to the global cwd if absent.
const envKey = `=${resolvedDevice}`;
const env = (typeof process !== 'undefined') ? process.env : undefined;
path = (env && typeof env[envKey] === 'string')
? env[envKey]
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
if (path === undefined ||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
path = `${resolvedDevice}\\`;
}
}
const len = path.length;
let rootEnd = 0;
let device = '';
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparatorWin(code)) {
rootEnd = 1;
isAbsolute = true;
}
}
else if (isPathSeparatorWin(code)) {
isAbsolute = true;
if (isPathSeparatorWin(path.charCodeAt(1))) {
// UNC path: `\\server\share\…`
let j = 2;
let last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j === len || j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
}
else {
rootEnd = 1;
}
}
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
if (device.length > 0) {
if (resolvedDevice.length > 0) {
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
continue;
}
else {
resolvedDevice = device;
}
}
if (resolvedAbsolute) {
if (resolvedDevice.length > 0)
break;
}
else {
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
resolvedAbsolute = isAbsolute;
if (isAbsolute && resolvedDevice.length > 0)
break;
}
}
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
}
function isPosixPathSeparator(code) {
return code === CHAR_FORWARD_SLASH;
}
@@ -381,6 +516,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
return res;
}
function resolve(...args) {
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
// below treats `D` as a non-`/` character and produces garbage; route
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
// run the original code path unchanged — `_isWin32` is constant-folded
// away on those targets.
if (_isWin32)
return resolveWin32(args);
let resolvedPath = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
@@ -1017,6 +1159,26 @@ function wrapExports(exports, needWrap) {
});
}
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
// Windows — and O_TEMPORARY without O_CREAT is invalid.
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
function _toWinOpenFlags(f) {
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
if ((f & 0x40) !== 0)
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
if ((f & 0x80) !== 0)
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
if ((f & 0x200) !== 0)
r |= 0x200; // O_TRUNC: same value on both
if ((f & 0x400) !== 0)
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
return r;
}
function copyMemory(targets, src) {
if (targets.length === 0 || src.length === 0)
return 0;
@@ -2273,7 +2435,7 @@ class WASI$1 {
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
const r = fs.openSync(resolved_path, flagsRes, 0o666);
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = wasi.fds.getFileTypeByFd(r);
if ((filetype !== 3 /* WasiFileType.DIRECTORY */) &&
((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 ||
@@ -2309,7 +2471,7 @@ class WASI$1 {
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = await wasi.fds.getFileTypeByFd(r);
if ((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 && filetype !== 3 /* WasiFileType.DIRECTORY */) {
return 54 /* WasiErrno.ENOTDIR */;
+164 -2
View File
@@ -306,6 +306,141 @@ function asyncifyLoadSync(asyncify, buffer, imports) {
const CHAR_DOT = 46; /* . */
const CHAR_FORWARD_SLASH = 47; /* / */
const CHAR_BACKWARD_SLASH = 92; /* \ */
const CHAR_COLON = 58; /* : */
const CHAR_UPPERCASE_A = 65; /* A */
const CHAR_UPPERCASE_Z = 90; /* Z */
const CHAR_LOWERCASE_A = 97; /* a */
const CHAR_LOWERCASE_Z = 122; /* z */
function isPathSeparatorWin(code) {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
}
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
/**
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
* semantics enough for the WASI shim's needs (drive-letter absolutes
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
*
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` the
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
* is "relative", and produces a garbage joined path. Downstream
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
* sees a permanent failure. This function gives us the correct
* Windows-style resolution without taking a Node-only `path` import
* (which would break browser bundles of this package).
*
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
* trimmed to what WASI realpath resolution actually exercises.
*/
function resolveWin32(args) {
let resolvedDevice = '';
let resolvedTail = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1; i--) {
let path;
if (i >= 0) {
path = args[i];
validateString(path, 'path');
if (path.length === 0)
continue;
}
else if (resolvedDevice.length === 0) {
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
}
else {
// Look up per-drive cwd via the `=X:` env var convention; fall back
// to the global cwd if absent.
const envKey = `=${resolvedDevice}`;
const env = (typeof process !== 'undefined') ? process.env : undefined;
path = (env && typeof env[envKey] === 'string')
? env[envKey]
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
if (path === undefined ||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
path = `${resolvedDevice}\\`;
}
}
const len = path.length;
let rootEnd = 0;
let device = '';
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparatorWin(code)) {
rootEnd = 1;
isAbsolute = true;
}
}
else if (isPathSeparatorWin(code)) {
isAbsolute = true;
if (isPathSeparatorWin(path.charCodeAt(1))) {
// UNC path: `\\server\share\…`
let j = 2;
let last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j === len || j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
}
else {
rootEnd = 1;
}
}
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
if (device.length > 0) {
if (resolvedDevice.length > 0) {
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
continue;
}
else {
resolvedDevice = device;
}
}
if (resolvedAbsolute) {
if (resolvedDevice.length > 0)
break;
}
else {
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
resolvedAbsolute = isAbsolute;
if (isAbsolute && resolvedDevice.length > 0)
break;
}
}
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
}
function isPosixPathSeparator(code) {
return code === CHAR_FORWARD_SLASH;
}
@@ -381,6 +516,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
return res;
}
function resolve(...args) {
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
// below treats `D` as a non-`/` character and produces garbage; route
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
// run the original code path unchanged — `_isWin32` is constant-folded
// away on those targets.
if (_isWin32)
return resolveWin32(args);
let resolvedPath = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
@@ -1017,6 +1159,26 @@ function wrapExports(exports, needWrap) {
});
}
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
// Windows — and O_TEMPORARY without O_CREAT is invalid.
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
function _toWinOpenFlags(f) {
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
if ((f & 0x40) !== 0)
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
if ((f & 0x80) !== 0)
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
if ((f & 0x200) !== 0)
r |= 0x200; // O_TRUNC: same value on both
if ((f & 0x400) !== 0)
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
return r;
}
function copyMemory(targets, src) {
if (targets.length === 0 || src.length === 0)
return 0;
@@ -2273,7 +2435,7 @@ class WASI$1 {
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
const r = fs.openSync(resolved_path, flagsRes, 0o666);
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = wasi.fds.getFileTypeByFd(r);
if ((filetype !== 3 /* WasiFileType.DIRECTORY */) &&
((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 ||
@@ -2309,7 +2471,7 @@ class WASI$1 {
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = await wasi.fds.getFileTypeByFd(r);
if ((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 && filetype !== 3 /* WasiFileType.DIRECTORY */) {
return 54 /* WasiErrno.ENOTDIR */;
File diff suppressed because one or more lines are too long
+164 -2
View File
@@ -312,6 +312,141 @@
const CHAR_DOT = 46; /* . */
const CHAR_FORWARD_SLASH = 47; /* / */
const CHAR_BACKWARD_SLASH = 92; /* \ */
const CHAR_COLON = 58; /* : */
const CHAR_UPPERCASE_A = 65; /* A */
const CHAR_UPPERCASE_Z = 90; /* Z */
const CHAR_LOWERCASE_A = 97; /* a */
const CHAR_LOWERCASE_Z = 122; /* z */
function isPathSeparatorWin(code) {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
}
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
/**
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
* semantics enough for the WASI shim's needs (drive-letter absolutes
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
*
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` the
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
* is "relative", and produces a garbage joined path. Downstream
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
* sees a permanent failure. This function gives us the correct
* Windows-style resolution without taking a Node-only `path` import
* (which would break browser bundles of this package).
*
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
* trimmed to what WASI realpath resolution actually exercises.
*/
function resolveWin32(args) {
let resolvedDevice = '';
let resolvedTail = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1; i--) {
let path;
if (i >= 0) {
path = args[i];
validateString(path, 'path');
if (path.length === 0)
continue;
}
else if (resolvedDevice.length === 0) {
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
}
else {
// Look up per-drive cwd via the `=X:` env var convention; fall back
// to the global cwd if absent.
const envKey = `=${resolvedDevice}`;
const env = (typeof process !== 'undefined') ? process.env : undefined;
path = (env && typeof env[envKey] === 'string')
? env[envKey]
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
if (path === undefined ||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
path = `${resolvedDevice}\\`;
}
}
const len = path.length;
let rootEnd = 0;
let device = '';
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparatorWin(code)) {
rootEnd = 1;
isAbsolute = true;
}
}
else if (isPathSeparatorWin(code)) {
isAbsolute = true;
if (isPathSeparatorWin(path.charCodeAt(1))) {
// UNC path: `\\server\share\…`
let j = 2;
let last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j === len || j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
}
else {
rootEnd = 1;
}
}
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
if (device.length > 0) {
if (resolvedDevice.length > 0) {
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
continue;
}
else {
resolvedDevice = device;
}
}
if (resolvedAbsolute) {
if (resolvedDevice.length > 0)
break;
}
else {
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
resolvedAbsolute = isAbsolute;
if (isAbsolute && resolvedDevice.length > 0)
break;
}
}
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
}
function isPosixPathSeparator(code) {
return code === CHAR_FORWARD_SLASH;
}
@@ -387,6 +522,13 @@
return res;
}
function resolve(...args) {
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
// below treats `D` as a non-`/` character and produces garbage; route
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
// run the original code path unchanged — `_isWin32` is constant-folded
// away on those targets.
if (_isWin32)
return resolveWin32(args);
let resolvedPath = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
@@ -1023,6 +1165,26 @@
});
}
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
// Windows — and O_TEMPORARY without O_CREAT is invalid.
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
function _toWinOpenFlags(f) {
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
if ((f & 0x40) !== 0)
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
if ((f & 0x80) !== 0)
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
if ((f & 0x200) !== 0)
r |= 0x200; // O_TRUNC: same value on both
if ((f & 0x400) !== 0)
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
return r;
}
function copyMemory(targets, src) {
if (targets.length === 0 || src.length === 0)
return 0;
@@ -2279,7 +2441,7 @@
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
const r = fs.openSync(resolved_path, flagsRes, 0o666);
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = wasi.fds.getFileTypeByFd(r);
if ((filetype !== 3 /* WasiFileType.DIRECTORY */) &&
((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 ||
@@ -2315,7 +2477,7 @@
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = await wasi.fds.getFileTypeByFd(r);
if ((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 && filetype !== 3 /* WasiFileType.DIRECTORY */) {
return 54 /* WasiErrno.ENOTDIR */;
File diff suppressed because one or more lines are too long
+142
View File
@@ -4,6 +4,141 @@ exports.relative = exports.resolve = void 0;
const util_1 = require("./util");
const CHAR_DOT = 46; /* . */
const CHAR_FORWARD_SLASH = 47; /* / */
const CHAR_BACKWARD_SLASH = 92; /* \ */
const CHAR_COLON = 58; /* : */
const CHAR_UPPERCASE_A = 65; /* A */
const CHAR_UPPERCASE_Z = 90; /* Z */
const CHAR_LOWERCASE_A = 97; /* a */
const CHAR_LOWERCASE_Z = 122; /* z */
function isPathSeparatorWin(code) {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
}
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
/**
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
* semantics enough for the WASI shim's needs (drive-letter absolutes
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
*
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` the
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
* is "relative", and produces a garbage joined path. Downstream
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
* sees a permanent failure. This function gives us the correct
* Windows-style resolution without taking a Node-only `path` import
* (which would break browser bundles of this package).
*
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
* trimmed to what WASI realpath resolution actually exercises.
*/
function resolveWin32(args) {
let resolvedDevice = '';
let resolvedTail = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1; i--) {
let path;
if (i >= 0) {
path = args[i];
(0, util_1.validateString)(path, 'path');
if (path.length === 0)
continue;
}
else if (resolvedDevice.length === 0) {
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
}
else {
// Look up per-drive cwd via the `=X:` env var convention; fall back
// to the global cwd if absent.
const envKey = `=${resolvedDevice}`;
const env = (typeof process !== 'undefined') ? process.env : undefined;
path = (env && typeof env[envKey] === 'string')
? env[envKey]
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
if (path === undefined ||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
path = `${resolvedDevice}\\`;
}
}
const len = path.length;
let rootEnd = 0;
let device = '';
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparatorWin(code)) {
rootEnd = 1;
isAbsolute = true;
}
}
else if (isPathSeparatorWin(code)) {
isAbsolute = true;
if (isPathSeparatorWin(path.charCodeAt(1))) {
// UNC path: `\\server\share\…`
let j = 2;
let last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j === len || j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
}
else {
rootEnd = 1;
}
}
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
if (device.length > 0) {
if (resolvedDevice.length > 0) {
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
continue;
}
else {
resolvedDevice = device;
}
}
if (resolvedAbsolute) {
if (resolvedDevice.length > 0)
break;
}
else {
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
resolvedAbsolute = isAbsolute;
if (isAbsolute && resolvedDevice.length > 0)
break;
}
}
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
}
function isPosixPathSeparator(code) {
return code === CHAR_FORWARD_SLASH;
}
@@ -81,6 +216,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
return res;
}
function resolve(...args) {
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
// below treats `D` as a non-`/` character and produces garbage; route
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
// run the original code path unchanged — `_isWin32` is constant-folded
// away on those targets.
if (_isWin32)
return resolveWin32(args);
let resolvedPath = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
+22 -2
View File
@@ -3,6 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.WASI = void 0;
const webassembly_1 = require("../webassembly");
const path_1 = require("./path");
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
// Windows — and O_TEMPORARY without O_CREAT is invalid.
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
function _toWinOpenFlags(f) {
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
if ((f & 0x40) !== 0)
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
if ((f & 0x80) !== 0)
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
if ((f & 0x200) !== 0)
r |= 0x200; // O_TRUNC: same value on both
if ((f & 0x400) !== 0)
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
return r;
}
const types_1 = require("./types");
const fd_1 = require("./fd");
const error_1 = require("./error");
@@ -1266,7 +1286,7 @@ class WASI {
const pathString = decoder.decode((0, util_1.unsharedSlice)(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
const r = fs.openSync(resolved_path, flagsRes, 0o666);
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = wasi.fds.getFileTypeByFd(r);
if ((filetype !== types_1.WasiFileType.DIRECTORY) &&
((o_flags & types_1.WasiFileControlFlag.O_DIRECTORY) !== 0 ||
@@ -1302,7 +1322,7 @@ class WASI {
const pathString = decoder.decode((0, util_1.unsharedSlice)(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = await wasi.fds.getFileTypeByFd(r);
if ((o_flags & types_1.WasiFileControlFlag.O_DIRECTORY) !== 0 && filetype !== types_1.WasiFileType.DIRECTORY) {
return types_1.WasiErrno.ENOTDIR;
+142
View File
@@ -1,6 +1,141 @@
import { validateString } from "./util.mjs";
const CHAR_DOT = 46; /* . */
const CHAR_FORWARD_SLASH = 47; /* / */
const CHAR_BACKWARD_SLASH = 92; /* \ */
const CHAR_COLON = 58; /* : */
const CHAR_UPPERCASE_A = 65; /* A */
const CHAR_UPPERCASE_Z = 90; /* Z */
const CHAR_LOWERCASE_A = 97; /* a */
const CHAR_LOWERCASE_Z = 122; /* z */
function isPathSeparatorWin(code) {
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
}
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
/**
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
* semantics enough for the WASI shim's needs (drive-letter absolutes
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
*
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` the
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
* is "relative", and produces a garbage joined path. Downstream
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
* sees a permanent failure. This function gives us the correct
* Windows-style resolution without taking a Node-only `path` import
* (which would break browser bundles of this package).
*
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
* trimmed to what WASI realpath resolution actually exercises.
*/
function resolveWin32(args) {
let resolvedDevice = '';
let resolvedTail = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1; i--) {
let path;
if (i >= 0) {
path = args[i];
validateString(path, 'path');
if (path.length === 0)
continue;
}
else if (resolvedDevice.length === 0) {
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
}
else {
// Look up per-drive cwd via the `=X:` env var convention; fall back
// to the global cwd if absent.
const envKey = `=${resolvedDevice}`;
const env = (typeof process !== 'undefined') ? process.env : undefined;
path = (env && typeof env[envKey] === 'string')
? env[envKey]
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
? process.cwd()
: '';
if (path === undefined ||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
path = `${resolvedDevice}\\`;
}
}
const len = path.length;
let rootEnd = 0;
let device = '';
let isAbsolute = false;
const code = path.charCodeAt(0);
if (len === 1) {
if (isPathSeparatorWin(code)) {
rootEnd = 1;
isAbsolute = true;
}
}
else if (isPathSeparatorWin(code)) {
isAbsolute = true;
if (isPathSeparatorWin(path.charCodeAt(1))) {
// UNC path: `\\server\share\…`
let j = 2;
let last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
const firstPart = path.slice(last, j);
last = j;
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j < len && j !== last) {
last = j;
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
j++;
if (j === len || j !== last) {
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
rootEnd = j;
}
}
}
}
else {
rootEnd = 1;
}
}
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
device = path.slice(0, 2);
rootEnd = 2;
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
isAbsolute = true;
rootEnd = 3;
}
}
if (device.length > 0) {
if (resolvedDevice.length > 0) {
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
continue;
}
else {
resolvedDevice = device;
}
}
if (resolvedAbsolute) {
if (resolvedDevice.length > 0)
break;
}
else {
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
resolvedAbsolute = isAbsolute;
if (isAbsolute && resolvedDevice.length > 0)
break;
}
}
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
}
function isPosixPathSeparator(code) {
return code === CHAR_FORWARD_SLASH;
}
@@ -78,6 +213,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
return res;
}
export function resolve(...args) {
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
// below treats `D` as a non-`/` character and produces garbage; route
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
// run the original code path unchanged — `_isWin32` is constant-folded
// away on those targets.
if (_isWin32)
return resolveWin32(args);
let resolvedPath = '';
let resolvedAbsolute = false;
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
+22 -2
View File
@@ -1,5 +1,25 @@
import { _WebAssembly } from "../webassembly.mjs";
import { resolve } from "./path.mjs";
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
// Windows — and O_TEMPORARY without O_CREAT is invalid.
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
function _toWinOpenFlags(f) {
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
if ((f & 0x40) !== 0)
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
if ((f & 0x80) !== 0)
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
if ((f & 0x200) !== 0)
r |= 0x200; // O_TRUNC: same value on both
if ((f & 0x400) !== 0)
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
return r;
}
import { WasiErrno, WasiRights, FileControlFlag, WasiFileControlFlag, WasiFdFlag, WasiFileType, WasiClockid, WasiFstFlag, WasiEventType, WasiSubclockflags } from "./types.mjs";
import { concatBuffer, toFileStat, AsyncTable, SyncTable } from "./fd.mjs";
import { WasiError } from "./error.mjs";
@@ -1263,7 +1283,7 @@ export class WASI {
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
const r = fs.openSync(resolved_path, flagsRes, 0o666);
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = wasi.fds.getFileTypeByFd(r);
if ((filetype !== WasiFileType.DIRECTORY) &&
((o_flags & WasiFileControlFlag.O_DIRECTORY) !== 0 ||
@@ -1299,7 +1319,7 @@ export class WASI {
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
const fs = getFs(this);
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
const filetype = await wasi.fds.getFileTypeByFd(r);
if ((o_flags & WasiFileControlFlag.O_DIRECTORY) !== 0 && filetype !== WasiFileType.DIRECTORY) {
return WasiErrno.ENOTDIR;
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@tybys/wasm-util",
"version": "0.10.1",
"version": "0.10.2",
"description": "WASI polyfill for browser and some wasm util",
"main": "./lib/cjs/index.js",
"module": "./dist/wasm-util.esm-bundler.js",

Some files were not shown because too many files have changed in this diff Show More