<script setup>

import {ref} from "vue"
import TInputText from "@/components/ui/TInputText.vue";

const props = defineProps(["v-cond"])

const {cond} = (function () {
	let cond = {
		isRequest: true,
		param: "${requestPath}",
		operator: "prefix",
		value: "/",
		isCaseInsensitive: false
	}
	if (props.vCond != null && typeof props.vCond.value == "string") {
		cond.value = props.vCond.value
	}
	return {
		cond: ref(cond)
	}
})()

const changeCaseInsensitive = function (isCaseInsensitive) {
	cond.value.isCaseInsensitive = isCaseInsensitive
}

defineExpose({
	changeCaseInsensitive
})

</script>

<template>
	<div>
		<input type="hidden" name="condJSON" :value="JSON.stringify(cond)"/>
		<TInputText type="text" v-model="cond.value" disabled="disabled" style="background: #eee" class="w-full"/>
		<p class="comment">支持全站所有URL。</p>
	</div>
</template>

<style scoped>
</style>
