import { Ft as onMounted, Kn as ref, Qn as toRef, U as computed, W as createBaseVNode, Yn as shallowRef, _n as watchEffect, ar as normalizeClass, et as createVNode, sr as normalizeStyle } from "./vue.runtime.esm-bundler-BvoXUmaf.js";
import { $ as PREFERS_REDUCED_MOTION, _ as convertToUnit, g as clamp, l as propsFactory, n as genericComponent } from "./defineComponent-DB6xIcDy.js";
import { t as makeComponentProps } from "./component-DdiwBe6i.js";
import { t as useRender } from "./useRender-fVtVsZgv.js";
import { r as useTextColor } from "./color-B6vuQruj.js";
import { i as provideTheme, r as makeThemeProps } from "./theme-Cx5kFg0-.js";
import { t as useResizeObserver } from "./resizeObserver-C12jWpYk.js";
import { t as makeTagProps } from "./tag-C_KkCPzB.js";
import { n as makeSizeProps, r as useSize } from "./VIcon-1CJH_3Uo.js";
import { i as useIntersectionObserver } from "./loader-CV4sMFhE.js";
import "/Users/thackmaster/Development/routie2/frontend/node_modules/vuetify/lib/components/VProgressCircular/VProgressCircular.css";
//#region node_modules/vuetify/lib/composables/reveal.js
var makeRevealProps = propsFactory({ reveal: {
	type: [Boolean, Object],
	default: false
} }, "reveal");
function useReveal(props) {
	const defaultDuration = 900;
	const duration = toRef(() => typeof props.reveal === "object" ? Math.max(0, Number(props.reveal.duration ?? defaultDuration)) : defaultDuration);
	const state = shallowRef(props.reveal ? "initial" : "disabled");
	onMounted(async () => {
		if (props.reveal) {
			state.value = "initial";
			await new Promise((resolve) => requestAnimationFrame(resolve));
			state.value = "pending";
			await new Promise((resolve) => setTimeout(resolve, duration.value));
			state.value = "done";
		}
	});
	return {
		duration,
		state
	};
}
//#endregion
//#region node_modules/vuetify/lib/components/VProgressCircular/VProgressCircular.js
var makeVProgressCircularProps = propsFactory({
	bgColor: String,
	color: String,
	indeterminate: [Boolean, String],
	rounded: Boolean,
	modelValue: {
		type: [Number, String],
		default: 0
	},
	rotate: {
		type: [Number, String],
		default: 0
	},
	width: {
		type: [Number, String],
		default: 4
	},
	...makeComponentProps(),
	...makeRevealProps(),
	...makeSizeProps(),
	...makeTagProps({ tag: "div" }),
	...makeThemeProps()
}, "VProgressCircular");
var VProgressCircular = genericComponent()({
	name: "VProgressCircular",
	props: makeVProgressCircularProps(),
	setup(props, { slots }) {
		const MAGIC_RADIUS_CONSTANT = 20;
		const CIRCUMFERENCE = 2 * Math.PI * MAGIC_RADIUS_CONSTANT;
		const root = ref();
		const { themeClasses } = provideTheme(props);
		const { sizeClasses, sizeStyles } = useSize(props);
		const { textColorClasses, textColorStyles } = useTextColor(() => props.color);
		const { textColorClasses: underlayColorClasses, textColorStyles: underlayColorStyles } = useTextColor(() => props.bgColor);
		const { intersectionRef, isIntersecting } = useIntersectionObserver();
		const { resizeRef, contentRect } = useResizeObserver();
		const { state: revealState, duration: revealDuration } = useReveal(props);
		const normalizedValue = toRef(() => revealState.value === "initial" ? 0 : clamp(parseFloat(props.modelValue), 0, 100));
		const width = toRef(() => Number(props.width));
		const size = toRef(() => {
			return sizeStyles.value ? Number(props.size) : contentRect.value ? contentRect.value.width : Math.max(width.value, 32);
		});
		const diameter = toRef(() => MAGIC_RADIUS_CONSTANT / (1 - width.value / size.value) * 2);
		const strokeWidth = toRef(() => width.value / size.value * diameter.value);
		const strokeDashOffset = toRef(() => {
			const baseLength = (100 - normalizedValue.value) / 100 * CIRCUMFERENCE;
			return props.rounded && normalizedValue.value > 0 && normalizedValue.value < 100 ? convertToUnit(Math.min(CIRCUMFERENCE - .01, baseLength + strokeWidth.value)) : convertToUnit(baseLength);
		});
		const startAngle = computed(() => {
			const baseAngle = Number(props.rotate);
			return props.rounded ? baseAngle + strokeWidth.value / 2 / CIRCUMFERENCE * 360 : baseAngle;
		});
		watchEffect(() => {
			intersectionRef.value = root.value;
			resizeRef.value = root.value;
		});
		useRender(() => createVNode(props.tag, {
			"ref": root,
			"class": normalizeClass([
				"v-progress-circular",
				{
					"v-progress-circular--indeterminate": !!props.indeterminate,
					"v-progress-circular--visible": isIntersecting.value,
					"v-progress-circular--disable-shrink": props.indeterminate && (props.indeterminate === "disable-shrink" || PREFERS_REDUCED_MOTION()),
					"v-progress-circular--revealing": ["initial", "pending"].includes(revealState.value)
				},
				themeClasses.value,
				sizeClasses.value,
				textColorClasses.value,
				props.class
			]),
			"style": normalizeStyle([
				sizeStyles.value,
				textColorStyles.value,
				{ "--progress-reveal-duration": `${revealDuration.value}ms` },
				props.style
			]),
			"role": "progressbar",
			"aria-valuemin": "0",
			"aria-valuemax": "100",
			"aria-valuenow": props.indeterminate ? void 0 : normalizedValue.value
		}, { default: () => [createBaseVNode("svg", {
			"style": { transform: `rotate(calc(-90deg + ${startAngle.value}deg))` },
			"xmlns": "http://www.w3.org/2000/svg",
			"viewBox": `0 0 ${diameter.value} ${diameter.value}`
		}, [createBaseVNode("circle", {
			"class": normalizeClass(["v-progress-circular__underlay", underlayColorClasses.value]),
			"style": normalizeStyle(underlayColorStyles.value),
			"fill": "transparent",
			"cx": "50%",
			"cy": "50%",
			"r": MAGIC_RADIUS_CONSTANT,
			"stroke-width": strokeWidth.value,
			"stroke-dasharray": CIRCUMFERENCE,
			"stroke-dashoffset": 0
		}, null), createBaseVNode("circle", {
			"class": "v-progress-circular__overlay",
			"fill": "transparent",
			"cx": "50%",
			"cy": "50%",
			"r": MAGIC_RADIUS_CONSTANT,
			"stroke-width": strokeWidth.value,
			"stroke-dasharray": CIRCUMFERENCE,
			"stroke-dashoffset": strokeDashOffset.value,
			"stroke-linecap": props.rounded ? "round" : void 0
		}, null)]), slots.default && createBaseVNode("div", { "class": "v-progress-circular__content" }, [slots.default({ value: normalizedValue.value })])] }));
		return {};
	}
});
//#endregion
export { VProgressCircular as t };

//# sourceMappingURL=VProgressCircular-yKv2qs75.js.map