@romainbx/wpic-components 0.0.100 → 0.0.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* vee-validate v4.12.8
|
|
3
3
|
* (c) 2024 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/function Te(t){return typeof t=="function"}function fa(t){return t==null}const Jt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Wo(t){return Number(t)>=0}function gp(t){const e=parseFloat(t);return isNaN(e)?t:e}function yp(t){return typeof t=="object"&&t!==null}function bp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ha(t){if(!yp(t)||bp(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ar(t,e){return Object.keys(e).forEach(n=>{if(ha(e[n])&&ha(t[n])){t[n]||(t[n]={}),Ar(t[n],e[n]);return}t[n]=e[n]}),t}function Vr(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Wo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const pa={};function yt(t,e){xp(t,e),pa[t]=e}function kp(t){return pa[t]}function xp(t,e){if(!Te(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function ma(t,e,n){typeof n.value=="object"&&(n.value=ge(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ge(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ge(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(ge(l),ge(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ge(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)ma(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||ma(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),ga=Symbol("vee-validate-field-instance"),Mi=Symbol("Default empty value"),wp=typeof window<"u";function Uo(t){return Te(t)&&!!t.__locatorRef}function bt(t){return!!t&&Te(t.parse)&&t.__type==="VVTypedSchema"}function Ti(t){return!!t&&Te(t.validate)}function _r(t){return t==="checkbox"||t==="radio"}function vp(t){return Jt(t)||Array.isArray(t)}function Cp(t){return Array.isArray(t)?t.length===0:Jt(t)&&Object.keys(t).length===0}function $i(t){return/^\[.+\]$/i.test(t)}function Sp(t){return ya(t)&&t.multiple}function ya(t){return t.tagName==="SELECT"}function Ep(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function Op(t,e){return!Ep(t,e)&&e.type!=="file"&&!_r(e.type)}function ba(t){return qo(t)&&t.target&&"submit"in t.target}function qo(t){return t?!!(typeof Event<"u"&&Te(Event)&&t instanceof Event||t&&t.srcElement):!1}function ka(t,e){return e in t&&t[e]!==Mi}function je(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!je(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!je(r[1],e.get(r[0])))return!1;return!0}if(xa(t)&&xa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!je(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function xa(t){return wp?t instanceof File:!1}function Ko(t){return $i(t)?t.replace(/\[|\]/gi,""):t}function qe(t,e,n){return t?$i(e)?t[Ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>vp(i)&&o in i?i[o]:n,t):n}function Lt(t,e,n){if($i(e)){t[Ko(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||fa(i[r[o]]))&&(i[r[o]]=Wo(r[o+1])?[]:{}),i=i[r[o]]}}function Yo(t,e){if(Array.isArray(t)&&Wo(e)){t.splice(Number(e),1);return}Jt(t)&&delete t[e]}function wa(t,e){if($i(e)){delete t[Ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){Yo(r,n[o]);break}if(!(n[o]in r)||fa(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>qe(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Cp(i[o])){if(o===0){Yo(t,n[0]);continue}Yo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function Jo(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function va(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>je(o,e));return i>=0?r.splice(i,1):r.push(e),r}return je(t,e)?n:e}function Mp(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Ca(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function Tp(t,e){return Jt(e)&&e.number?gp(t):t}function Go(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Zo(t){return Array.isArray(t)?t:t?[t]:[]}function Ni(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function $p(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Xo(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function Qo(t){if(Sa(t))return t._value}function Sa(t){return"_value"in t}function Np(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Bi(t){if(!qo(t))return t;const e=t.target;if(_r(e.type)&&Sa(e))return Qo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Sp(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Qo);if(ya(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Qo(n):e.value}return Np(e)}function Ea(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Jt(t)&&t._$$isNormalized?t:Jt(t)?Object.keys(t).reduce((n,r)=>{const i=Bp(t[r]);return t[r]!==!1&&(n[r]=Oa(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Ap(r);return i.name&&(n[i.name]=Oa(i.params)),n},e):e}function Bp(t){return t===!0?[]:Array.isArray(t)||Jt(t)?t:[t]}function Oa(t){const e=n=>typeof n=="string"&&n[0]==="@"?Vp(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const Ap=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Vp(t){const e=n=>qe(n,t)||n[t];return e.__locatorRef=t,e}function Dp(t){return Array.isArray(t)?t.filter(Uo):Ke(t).filter(e=>Uo(t[e])).map(e=>t[e])}let _p=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const wn=()=>_p;async function Ma(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await Lp(i,t)).errors;return{errors:s,valid:!s.length}}async function Lp(t,e){if(bt(t.rules)||Ti(t.rules))return Pp(e,t.rules);if(Te(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:$a(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Ea(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await Rp(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function Ip(t){return!!t&&t.name==="ValidationError"}function Ta(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Ip(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function Pp(t,e){const r=await(bt(e)?e:Ta(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function Rp(t,e,n){const r=kp(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=zp(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:$a(o)}}function $a(t){const e=wn().generateMessage;return e?e(t):"Field is invalid"}function zp(t,e){const n=r=>Uo(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function jp(t,e){const r=await(bt(t)?t:Ta(t)).parse(ge(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function Fp(t,e,n){const i=Ke(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Ma(qe(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let Na=0;function Hp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Wp(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:c,setErrors:d}=Kp(),u=Na>=Number.MAX_SAFE_INTEGER?0:++Na,f=qp(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function Wp(t,e,n){const r=a.ref(a.unref(e));function i(){return n?qe(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=Up(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return qe(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function Up(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:qe(e.values,a.unref(r),a.unref(n))}function qp(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!je(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function Kp(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=Zo(e)}}}function Ba(t){process.env.NODE_ENV!=="production"&&mp({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},Gp)}const Lr={},Ir={};let It;const Kn=Mp(()=>{setTimeout(async()=>{await a.nextTick(),It==null||It.sendInspectorState(Yn),It==null||It.sendInspectorTree(Yn)},100)},100);function Yp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Lr[t.formId]=Object.assign({},t),Lr[t.formId]._vm=e,a.onUnmounted(()=>{delete Lr[t.formId],Kn()}),Kn()}function Jp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,a.onUnmounted(()=>{delete Ir[t.id],Kn()}),Kn()}const Yn="vee-validate-inspector",Ye={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ce=null;function Gp(t){It=t,t.addInspector({id:Yn,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){await Ce.field.validate();return}if(Ce.type==="form"){await Ce.form.validate();return}Ce.type==="pathState"&&await Ce.form.validateField(Ce.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){Ce.field.resetField();return}Ce.type==="form"&&Ce.form.resetForm(),Ce.type==="pathState"&&Ce.form.resetField(Ce.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Yn)return;const n=Object.values(Lr),r=Object.values(Ir);e.rootNodes=[...n.map(Zp),...r.map(i=>Qp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Yn||n.currentTab!==`custom-inspector:${Yn}`)return;const{form:r,field:i,state:o,type:s}=em(e.nodeId);if(r&&s==="form"){e.state=tm(r),Ce={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Va(o),Ce={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Va({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),Ce={field:i,type:"field"};return}Ce=null})}function Zp(t){const{textColor:e,bgColor:n}=Da(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Lt(r,a.unref(s.path),Xp(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Jt(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:es(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ye.white,backgroundColor:Ye.unknown}]}}function Xp(t,e){return{id:es(e,t),label:a.unref(t.path),tags:Aa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Qp(t,e){return{id:es(e,t),label:a.unref(t.name),tags:Aa(!1,1,t.type,t.meta.valid,e)}}function Aa(t,e,n,r,i){const{textColor:o,bgColor:s}=Da(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ye.black,backgroundColor:Ye.gray},n==="checkbox"?{label:"Checkbox",textColor:Ye.white,backgroundColor:Ye.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ye.white,backgroundColor:Ye.purple}:void 0,t?{label:"Multiple",textColor:Ye.black,backgroundColor:Ye.orange}:void 0].filter(Boolean)}function es(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function em(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Lr[e.f];if(!n&&e.ff){const i=Ir[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Va(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function tm(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Ke(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function Da(t){return{bgColor:t?Ye.success:Ye.error,textColor:t?Ye.black:Ye.white}}function nm(t,e,n){return _r(n==null?void 0:n.type)?im(t,e,n):_a(t,e,n)}function _a(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=rm(n),g=f?Jo(Dr):void 0,y=m||g,b=a.computed(()=>Vr(a.toValue(t))),v=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const X=a.unref(e);return Ti(X)||bt(X)||Te(X)||Array.isArray(X)?X:Ea(X)}),M=!Te(v.value)&&bt(a.toValue(e)),{id:k,value:O,initialValue:C,meta:B,setState:I,errors:_,flags:T}=Hp(b,{modelValue:r,form:y,bails:o,label:c,type:s,validate:v.value?x:void 0,schema:M?e:void 0}),L=a.computed(()=>_.value[0]);p&&om({value:O,prop:p,handleChange:A,shouldValidate:()=>d&&!T.pendingReset});const H=(P,X=!1)=>{B.touched=!0,X&&W()};async function Y(P){var X,he;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(P);return(X=le[a.toValue(b)])!==null&&X!==void 0?X:{valid:!0,errors:[]}}return v.value?Ma(O.value,v.value,{name:a.toValue(b),label:a.toValue(c),values:(he=y==null?void 0:y.values)!==null&&he!==void 0?he:{},bails:o}):{valid:!0,errors:[]}}const W=Go(async()=>(B.pending=!0,B.validated=!0,Y("validated-only")),P=>(T.pendingUnmount[ee.id]||(I({errors:P.errors}),B.pending=!1,B.valid=P.valid),P)),N=Go(async()=>Y("silent"),P=>(B.valid=P.valid,P));function x(P){return(P==null?void 0:P.mode)==="silent"?N():W()}function A(P,X=!0){const he=Bi(P);$(he,X)}a.onMounted(()=>{if(i)return W();(!y||!y.validateSchema)&&N()});function V(P){B.touched=P}function K(P){var X;const he=P&&"value"in P?P.value:C.value;I({value:ge(he),initialValue:ge(he),touched:(X=P==null?void 0:P.touched)!==null&&X!==void 0?X:!1,errors:(P==null?void 0:P.errors)||[]}),B.pending=!1,B.validated=!1,N()}const Q=a.getCurrentInstance();function $(P,X=!0){O.value=Q&&p?Tp(P,Q.props.modelModifiers):P,(X?W:N)()}function F(P){I({errors:Array.isArray(P)?P:[P]})}const D=a.computed({get(){return O.value},set(P){$(P,d)}}),ee={id:k,name:b,label:c,value:D,meta:B,errors:_,errorMessage:L,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:K,handleReset:()=>K(),validate:x,handleChange:A,handleBlur:H,setState:I,setTouched:V,setErrors:F,setValue:$};if(a.provide(ga,ee),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(P,X)=>{je(P,X)||(B.validated?W():N())},{deep:!0}),process.env.NODE_ENV!=="production"&&(ee._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:_.value},B),{value:O.value}),Kn,{deep:!0}),y||Jp(ee)),!y)return ee;const q=a.computed(()=>{const P=v.value;return!P||Te(P)||Ti(P)||bt(P)||Array.isArray(P)?{}:Object.keys(P).reduce((X,he)=>{const le=Dp(P[he]).map(pe=>pe.__locatorRef).reduce((pe,be)=>{const Me=qe(y.values,be)||y.values[be];return Me!==void 0&&(pe[be]=Me),pe},{});return Object.assign(X,le),X},{})});return a.watch(q,(P,X)=>{if(!Object.keys(P).length)return;!je(P,X)&&(B.validated?W():N())}),a.onBeforeUnmount(()=>{var P;const X=(P=a.toValue(ee.keepValueOnUnmount))!==null&&P!==void 0?P:a.toValue(y.keepValuesOnUnmount),he=a.toValue(b);if(X||!y||T.pendingUnmount[ee.id]){y==null||y.removePathState(he,k);return}T.pendingUnmount[ee.id]=!0;const le=y.getPathState(he);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(ee.id):(le==null?void 0:le.id)===ee.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const be=le.value.findIndex(Me=>je(Me,a.toValue(ee.checkedValue)));if(be>-1){const Me=[...le.value];Me.splice(be,1),y.setFieldValue(he,Me)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(ee.id),1)}else y.unsetPathValue(a.toValue(b));y.removePathState(he,k)}}),ee}function rm(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?ts(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function im(t,e,n){const r=n!=null&&n.standalone?void 0:Jo(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>je(p,h))>=0:je(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const g=a.toValue(t),y=r==null?void 0:r.getPathState(g),b=Bi(f);let v=(m=a.toValue(i))!==null&&m!==void 0?m:b;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?v=va(qe(r.values,g)||[],v,void 0):(n==null?void 0:n.type)==="checkbox"&&(v=va(a.toValue(l.value),v,a.toValue(o))),c(v,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(_a(t,e,n))}function om({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{je(l,ts(i,o))||i.emit(s,l)}),a.watch(()=>ts(i,o),l=>{if(l===Mi&&e.value===void 0)return;const c=l===Mi?void 0:l;je(c,e.value)||n(c,r())}))}function ts(t,e){if(t)return t.props[e]}const sm=a.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>wn().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Mi},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:b,setErrors:v}=nm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:am(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),M=function(_,T=!0){f(_,T)},k=a.computed(()=>{const{validateOnInput:I,validateOnChange:_,validateOnBlur:T,validateOnModelUpdate:L}=lm(t);function H(x){h(x,T),Te(e.attrs.onBlur)&&e.attrs.onBlur(x)}function Y(x){M(x,I),Te(e.attrs.onInput)&&e.attrs.onInput(x)}function W(x){M(x,_),Te(e.attrs.onChange)&&e.attrs.onChange(x)}const N={name:t.name,onBlur:H,onInput:Y,onChange:W};return N["onUpdate:modelValue"]=x=>M(x,L),N}),O=a.computed(()=>{const I=Object.assign({},k.value);_r(e.attrs.type)&&b&&(I.checked=b.value);const _=La(t,e);return Op(_,e.attrs)&&(I.value=c.value),I}),C=a.computed(()=>Object.assign(Object.assign({},k.value),{modelValue:c.value}));function B(){return{field:O.value,componentField:C.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:M,handleInput:I=>M(I,!1),handleReset:g,handleBlur:k.value.onBlur,setTouched:p,setErrors:v}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:v,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const I=a.resolveDynamicComponent(La(t,e)),_=Xo(I,e,B);return I?a.h(I,Object.assign(Object.assign({},e.attrs),O.value),_):_}}});function La(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function lm(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=wn();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function am(t,e){return _r(e.attrs.type)?ka(t,"modelValue")?t.modelValue:void 0:ka(t,"modelValue")?t.modelValue:e.attrs.value}const vn=sm;let cm=0;const Ai=["bails","fieldsCount","id","multiple","type","validate"];function Ia(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&bt(r)&&Te(r.cast)?ge(r.cast(n)||{}):ge(n)}function dm(t){var e;const n=cm++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(Ia(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=$p(()=>{f.value=d.value.reduce((E,S)=>(E[Vr(a.toValue(S.path))]=S,E),{})});function p(E,S){const R=x(E);if(!R){typeof E=="string"&&(u.value[Vr(E)]=Zo(S));return}if(typeof E=="string"){const G=Vr(E);u.value[G]&&delete u.value[G]}R.errors=Zo(S),R.valid=!R.errors.length}function m(E){Ke(E).forEach(S=>{p(S,E[S])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const E=d.value.reduce((S,R)=>(R.errors.length&&(S[R.path]=R.errors),S),{});return Object.assign(Object.assign({},u.value),E)}),y=a.computed(()=>Ke(g.value).reduce((E,S)=>{const R=g.value[S];return R!=null&&R.length&&(E[S]=R[0]),E},{})),b=a.computed(()=>d.value.reduce((E,S)=>(E[S.path]={name:S.path||"",label:S.label||""},E),{})),v=a.computed(()=>d.value.reduce((E,S)=>{var R;return E[S.path]=(R=S.bails)!==null&&R!==void 0?R:!0,E},{})),M=Object.assign({},(t==null?void 0:t.initialErrors)||{}),k=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:O,originalInitialValues:C,setInitialValues:B}=fm(d,c,t),I=um(d,c,C,y),_=a.computed(()=>d.value.reduce((E,S)=>{const R=qe(c,S.path);return Lt(E,S.path,R),E},{})),T=t==null?void 0:t.validationSchema;function L(E,S){var R,G;const oe=a.computed(()=>qe(O.value,a.toValue(E))),w=f.value[a.toValue(E)],U=(S==null?void 0:S.type)==="checkbox"||(S==null?void 0:S.type)==="radio";if(w&&U){w.multiple=!0;const Ue=r++;return Array.isArray(w.id)?w.id.push(Ue):w.id=[w.id,Ue],w.fieldsCount++,w.__flags.pendingUnmount[Ue]=!1,w}const Z=a.computed(()=>qe(c,a.toValue(E))),ie=a.toValue(E),se=V.findIndex(Ue=>Ue===ie);se!==-1&&V.splice(se,1);const de=a.computed(()=>{var Ue,st,Un,xn;const _t=a.toValue(T);if(bt(_t))return(st=(Ue=_t.describe)===null||Ue===void 0?void 0:Ue.call(_t,a.toValue(E)).required)!==null&&st!==void 0?st:!1;const Oi=a.toValue(S==null?void 0:S.schema);return bt(Oi)&&(xn=(Un=Oi.describe)===null||Un===void 0?void 0:Un.call(Oi).required)!==null&&xn!==void 0?xn:!1}),me=r++,ve=a.reactive({id:me,path:E,touched:!1,pending:!1,valid:!0,validated:!!(!((R=M[ie])===null||R===void 0)&&R.length),required:de,initialValue:oe,errors:a.shallowRef([]),bails:(G=S==null?void 0:S.bails)!==null&&G!==void 0?G:!1,label:S==null?void 0:S.label,type:(S==null?void 0:S.type)||"default",value:Z,multiple:!1,__flags:{pendingUnmount:{[me]:!1},pendingReset:!1},fieldsCount:1,validate:S==null?void 0:S.validate,dirty:a.computed(()=>!je(a.unref(Z),a.unref(oe)))});return d.value.push(ve),f.value[ie]=ve,h(),y.value[ie]&&!M[ie]&&a.nextTick(()=>{mt(ie,{mode:"silent"})}),a.isRef(E)&&a.watch(E,Ue=>{h();const st=ge(Z.value);f.value[Ue]=ve,a.nextTick(()=>{Lt(c,Ue,st)})}),ve}const H=Ca(Dt,5),Y=Ca(Dt,5),W=Go(async E=>await(E==="silent"?H():Y()),(E,[S])=>{const R=Ke(P.errorBag.value),oe=[...new Set([...Ke(E.results),...d.value.map(w=>w.path),...R])].sort().reduce((w,U)=>{var Z;const ie=U,se=x(ie)||A(ie),de=((Z=E.results[ie])===null||Z===void 0?void 0:Z.errors)||[],me=a.toValue(se==null?void 0:se.path)||ie,ve=hm({errors:de,valid:!de.length},w.results[me]);return w.results[me]=ve,ve.valid||(w.errors[me]=ve.errors[0]),se&&u.value[me]&&delete u.value[me],se?(se.valid=ve.valid,S==="silent"||S==="validated-only"&&!se.validated||p(se,ve.errors),w):(p(me,de),w)},{valid:E.valid,results:{},errors:{}});return E.values&&(oe.values=E.values),Ke(oe.results).forEach(w=>{var U;const Z=x(w);Z&&S!=="silent"&&(S==="validated-only"&&!Z.validated||p(Z,(U=oe.results[w])===null||U===void 0?void 0:U.errors))}),oe});function N(E){d.value.forEach(E)}function x(E){const S=typeof E=="string"?Vr(E):E;return typeof S=="string"?f.value[S]:S}function A(E){return d.value.filter(R=>E.startsWith(R.path)).reduce((R,G)=>R?G.path.length>R.path.length?G:R:G,void 0)}let V=[],K;function Q(E){return V.push(E),K||(K=a.nextTick(()=>{[...V].sort().reverse().forEach(R=>{wa(c,R)}),V=[],K=null})),K}function $(E){return function(R,G){return function(w){return w instanceof Event&&(w.preventDefault(),w.stopPropagation()),N(U=>U.touched=!0),i.value=!0,s.value++,vt().then(U=>{const Z=ge(c);if(U.valid&&typeof R=="function"){const ie=ge(_.value);let se=E?ie:Z;return U.values&&(se=U.values),R(se,{evt:w,controlledValues:ie,setErrors:m,setFieldError:p,setTouched:yn,setFieldTouched:be,setValues:le,setFieldValue:X,resetForm:qt,resetField:bn})}!U.valid&&typeof G=="function"&&G({values:Z,evt:w,errors:U.errors,results:U.results})}).then(U=>(i.value=!1,U),U=>{throw i.value=!1,U})}}}const D=$(!1);D.withControlled=$(!0);function ee(E,S){const R=d.value.findIndex(oe=>oe.path===E&&(Array.isArray(oe.id)?oe.id.includes(S):oe.id===S)),G=d.value[R];if(!(R===-1||!G)){if(a.nextTick(()=>{mt(E,{mode:"silent",warn:!1})}),G.multiple&&G.fieldsCount&&G.fieldsCount--,Array.isArray(G.id)){const oe=G.id.indexOf(S);oe>=0&&G.id.splice(oe,1),delete G.__flags.pendingUnmount[S]}(!G.multiple||G.fieldsCount<=0)&&(d.value.splice(R,1),gt(E),h(),delete f.value[E])}}function q(E){Ke(f.value).forEach(S=>{S.startsWith(E)&&delete f.value[S]}),d.value=d.value.filter(S=>!S.path.startsWith(E)),a.nextTick(()=>{h()})}const P={formId:n,values:c,controlledValues:_,errorBag:g,errors:y,schema:T,submitCount:s,meta:I,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:k,validateSchema:a.unref(T)?W:void 0,validate:vt,setFieldError:p,validateField:mt,setFieldValue:X,setValues:le,setErrors:m,setFieldTouched:be,setTouched:yn,resetForm:qt,resetField:bn,handleSubmit:D,useFieldModel:$r,defineInputBinds:Nr,defineComponentBinds:Br,defineField:kn,stageInitialValue:Vt,unsetInitialValue:gt,setFieldInitialValue:Kt,createPathState:L,getPathState:x,unsetPathValue:Q,removePathState:ee,initialValues:O,getAllPathStates:()=>d.value,destroyPath:q,isFieldTouched:Me,isFieldDirty:pt,isFieldValid:Tr};function X(E,S,R=!0){const G=ge(S),oe=typeof E=="string"?E:E.path;x(oe)||L(oe),Lt(c,oe,G),R&&mt(oe)}function he(E,S=!0){Ke(c).forEach(R=>{delete c[R]}),Ke(E).forEach(R=>{X(R,E[R],!1)}),S&&vt()}function le(E,S=!0){Ar(c,E),l.forEach(R=>R&&R.reset()),S&&vt()}function pe(E,S){const R=x(a.toValue(E))||L(E);return a.computed({get(){return R.value},set(G){var oe;const w=a.toValue(E);X(w,G,(oe=a.toValue(S))!==null&&oe!==void 0?oe:!1)}})}function be(E,S){const R=x(E);R&&(R.touched=S)}function Me(E){const S=x(E);return S?S.touched:d.value.filter(R=>R.path.startsWith(E)).some(R=>R.touched)}function pt(E){const S=x(E);return S?S.dirty:d.value.filter(R=>R.path.startsWith(E)).some(R=>R.dirty)}function Tr(E){const S=x(E);return S?S.valid:d.value.filter(R=>R.path.startsWith(E)).every(R=>R.valid)}function yn(E){if(typeof E=="boolean"){N(S=>{S.touched=E});return}Ke(E).forEach(S=>{be(S,!!E[S])})}function bn(E,S){var R;const G=S&&"value"in S?S.value:qe(O.value,E),oe=x(E);oe&&(oe.__flags.pendingReset=!0),Kt(E,ge(G),!0),X(E,G,!1),be(E,(R=S==null?void 0:S.touched)!==null&&R!==void 0?R:!1),p(E,(S==null?void 0:S.errors)||[]),a.nextTick(()=>{oe&&(oe.__flags.pendingReset=!1)})}function qt(E,S){let R=ge(E!=null&&E.values?E.values:C.value);R=S!=null&&S.force?R:Ar(C.value,R),R=bt(T)&&Te(T.cast)?T.cast(R):R,B(R),N(G=>{var oe;G.__flags.pendingReset=!0,G.validated=!1,G.touched=((oe=E==null?void 0:E.touched)===null||oe===void 0?void 0:oe[G.path])||!1,X(G.path,qe(R,G.path),!1),p(G.path,void 0)}),S!=null&&S.force?he(R,!1):le(R,!1),m((E==null?void 0:E.errors)||{}),s.value=(E==null?void 0:E.submitCount)||0,a.nextTick(()=>{vt({mode:"silent"}),N(G=>{G.__flags.pendingReset=!1})})}async function vt(E){const S=(E==null?void 0:E.mode)||"force";if(S==="force"&&N(w=>w.validated=!0),P.validateSchema)return P.validateSchema(S);o.value=!0;const R=await Promise.all(d.value.map(w=>w.validate?w.validate(E).then(U=>({key:w.path,valid:U.valid,errors:U.errors})):Promise.resolve({key:w.path,valid:!0,errors:[]})));o.value=!1;const G={},oe={};for(const w of R)G[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(oe[w.key]=w.errors[0]);return{valid:R.every(w=>w.valid),results:G,errors:oe}}async function mt(E,S){var R;const G=x(E);if(G&&(S==null?void 0:S.mode)!=="silent"&&(G.validated=!0),T){const{results:w}=await W((S==null?void 0:S.mode)||"validated-only");return w[E]||{errors:[],valid:!0}}return G!=null&&G.validate?G.validate(S):(!G&&((R=S==null?void 0:S.warn)!==null&&R!==void 0?R:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${E} was not found`),Promise.resolve({errors:[],valid:!0}))}function gt(E){wa(O.value,E)}function Vt(E,S,R=!1){Kt(E,S),Lt(c,E,S),R&&!(t!=null&&t.initialValues)&&Lt(C.value,E,ge(S))}function Kt(E,S,R=!1){Lt(O.value,E,ge(S)),R&&Lt(C.value,E,ge(S))}async function Dt(){const E=a.unref(T);if(!E)return{valid:!0,results:{},errors:{}};o.value=!0;const S=Ti(E)||bt(E)?await jp(E,c):await Fp(E,c,{names:b.value,bailsMap:v.value});return o.value=!1,S}const Wn=D((E,{evt:S})=>{ba(S)&&S.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&yn(t.initialTouched),t!=null&&t.validateOnMount){vt();return}P.validateSchema&&P.validateSchema("silent")}),a.isRef(T)&&a.watch(T,()=>{var E;(E=P.validateSchema)===null||E===void 0||E.call(P,"validated-only")}),a.provide(Dr,P),process.env.NODE_ENV!=="production"&&(Yp(P),a.watch(()=>Object.assign(Object.assign({errors:g.value},I.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Kn,{deep:!0}));function kn(E,S){const R=Te(S)||S==null?void 0:S.label,G=x(a.toValue(E))||L(E,{label:R}),oe=()=>Te(S)?S(Ni(G,Ai)):S||{};function w(){var de;G.touched=!0,((de=oe().validateOnBlur)!==null&&de!==void 0?de:wn().validateOnBlur)&&mt(G.path)}function U(){var de;((de=oe().validateOnInput)!==null&&de!==void 0?de:wn().validateOnInput)&&a.nextTick(()=>{mt(G.path)})}function Z(){var de;((de=oe().validateOnChange)!==null&&de!==void 0?de:wn().validateOnChange)&&a.nextTick(()=>{mt(G.path)})}const ie=a.computed(()=>{const de={onChange:Z,onInput:U,onBlur:w};return Te(S)?Object.assign(Object.assign({},de),S(Ni(G,Ai)).props||{}):S!=null&&S.props?Object.assign(Object.assign({},de),S.props(Ni(G,Ai))):de});return[pe(E,()=>{var de,me,ve;return(ve=(de=oe().validateOnModelUpdate)!==null&&de!==void 0?de:(me=wn())===null||me===void 0?void 0:me.validateOnModelUpdate)!==null&&ve!==void 0?ve:!0}),ie]}function $r(E){return Array.isArray(E)?E.map(S=>pe(S,!0)):pe(E)}function Nr(E,S){const[R,G]=kn(E,S);function oe(){G.value.onBlur()}function w(Z){const ie=Bi(Z);X(a.toValue(E),ie,!1),G.value.onInput()}function U(Z){const ie=Bi(Z);X(a.toValue(E),ie,!1),G.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},G.value),{onBlur:oe,onInput:w,onChange:U,value:R.value}))}function Br(E,S){const[R,G]=kn(E,S),oe=x(a.toValue(E));function w(U){R.value=U}return a.computed(()=>{const U=Te(S)?S(Ni(oe,Ai)):S||{};return Object.assign({[U.model||"modelValue"]:R.value,[`onUpdate:${U.model||"modelValue"}`]:w},G.value)})}return Object.assign(Object.assign({},P),{values:a.readonly(c),handleReset:()=>qt(),submitForm:Wn})}function um(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!je(e,a.unref(n)));function s(){const c=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function fm(t,e,n){const r=Ia(n),i=a.ref(r),o=a.ref(ge(r));function s(l,c=!1){i.value=Ar(ge(i.value)||{},ge(l)),o.value=Ar(ge(o.value)||{},ge(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=qe(i.value,d.path);Lt(e,d.path,ge(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function hm(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const pm=a.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:b,setFieldError:v,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetField:B}=dm({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),I=y((x,{evt:A})=>{ba(A)&&A.target.submit()},t.onInvalidSubmit),_=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):I;function T(x){qo(x)&&x.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function L(x,A){return y(typeof x=="function"&&!A?x:A,t.onInvalidSubmit)(x)}function H(){return ge(s)}function Y(){return ge(l.value)}function W(){return ge(i.value)}function N(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:L,handleReset:m,submitForm:I,setErrors:b,setFieldError:v,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetForm:g,resetField:B,getValues:H,getMeta:Y,getErrors:W}}return e.expose({setFieldError:v,setErrors:b,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetForm:g,validate:h,validateField:p,resetField:B,getValues:H,getMeta:Y,getErrors:W,values:s,meta:l,errors:i}),function(){const A=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,V=Xo(A,e,N);if(!A)return V;const K=A==="form"?{novalidate:!0}:{};return a.h(A,Object.assign(Object.assign(Object.assign({},K),e.attrs),{onSubmit:_,onReset:T}),V)}}}),mm=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Dr,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=Xo(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function gm(t){const e=Jo(Dr),n=t?void 0:a.inject(ga);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}yt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),yt("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),yt("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),yt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),yt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),yt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),yt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),yt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),yt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),yt("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),yt("number",t=>parseFloat(t)?!0:"This field must be a number");const ae=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},ym={},bm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},km=[a.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function xm(t,e){return a.openBlock(),a.createElementBlock("svg",bm,km)}const wm=ae(ym,[["render",xm]]),vm={},Cm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Sm=[a.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function Em(t,e){return a.openBlock(),a.createElementBlock("svg",Cm,Sm)}const Om=ae(vm,[["render",Em]]),Mm={class:"relative"},Jn=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",Mm,[a.createVNode(wm,{class:"absolute opacity-25"}),a.createVNode(Om,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let ne={theme:"wpic-tools",popoverTarget:"body"};const Tm=["is","type","disabled"],$m={key:0,class:"absolute inset-0 flex justify-center items-center"},Nm={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},Bm=["onClick"],Pr=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=b=>{r.value&&!r.value.contains(b.target)&&n.value&&!n.value.contains(b.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"bg-transparent text-gray-700 disabled:text-gray-700/50 enabled:hover:bg-gray-900/5 enabled:active:bg-gray-200 enabled:active:shadow-inner dark:enabled:border-gray-900 dark:disabled:border-gray-900 dark:text-gray-400 dark:enabled:hover:bg-gray-900 dark:enabled:active:bg-gray-930 dark:disabled:text-gray-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-wpic-600 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-wpic-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-600"},f={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-iron-100 text-iron-800 disabled:text-iron-800/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:bg-transparent dark:ring-1 dark:ring-gray-800 dark:text-white dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:bg-white/10 dark:enabled:active:text-white/80"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},g={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},y={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(b,v)=>{var M;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:v[0]||(v[0]=k=>{var O;return(O=t.actions)!=null&&O.length?i.value=!i.value:null}),class:a.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled&&!t.hideDisabled,border:t.outline&&!t.plain,[`${l[a.unref(ne).theme]}`]:!0,[`${u[a.unref(ne).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(ne).theme]}`]:t.secondary,[`${p[a.unref(ne).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(ne).theme]}`]:t.primary&&t.plain,[`${y[a.unref(ne).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(ne).theme]}`]:t.colorless,[`${h[a.unref(ne).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(ne).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(ne).theme]}`]:t.destructive&&t.colorless,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",$m,[a.createVNode(Jn,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(M=t.actions)!=null&&M.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",Nm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,k=>(a.openBlock(),a.createElementBlock("div",{onClick:k.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(k.label),9,Bm))),256))])],512)):a.createCommentVNode("",!0)],10,Tm)}}}),Am=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(ne).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),Vm={name:"WpicInputGroup"},Dm={class:"wpic-input-group flex w-full"};function _m(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",Dm,[a.renderSlot(t.$slots,"default")])}const Lm=ae(Vm,[["render",_m]]),Im=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,c)=>(a.openBlock(),a.createBlock(a.unref(pm),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Gn=Math.max,Vi=Math.round,Gt=t=>({x:t,y:t}),Pm={left:"right",right:"left",bottom:"top",top:"bottom"},Rm={start:"end",end:"start"};function ns(t,e,n){return Gn(t,Rr(e,n))}function zr(t,e){return typeof t=="function"?t(e):t}function Cn(t){return t.split("-")[0]}function jr(t){return t.split("-")[1]}function Pa(t){return t==="x"?"y":"x"}function rs(t){return t==="y"?"height":"width"}function Di(t){return["top","bottom"].includes(Cn(t))?"y":"x"}function is(t){return Pa(Di(t))}function zm(t,e,n){n===void 0&&(n=!1);const r=jr(t),i=is(t),o=rs(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=_i(s)),[s,_i(s)]}function jm(t){const e=_i(t);return[ss(t),e,ss(e)]}function ss(t){return t.replace(/start|end/g,e=>Rm[e])}function Fm(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Hm(t,e,n,r){const i=jr(t);let o=Fm(Cn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ss)))),o}function _i(t){return t.replace(/left|right|bottom|top/g,e=>Pm[e])}function Wm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ra(t){return typeof t!="number"?Wm(t):{top:t,right:t,bottom:t,left:t}}function Li(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function za(t,e,n){let{reference:r,floating:i}=t;const o=Di(e),s=is(e),l=rs(s),c=Cn(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(jr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Um=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=za(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:b}=l[g],{x:v,y:M,data:k,reset:O}=await b({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=v??u,f=M??f,p={...p,[y]:{...p[y],...k}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(d=O.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:u,y:f}=za(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function ja(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=zr(e,t),m=Ra(p),y=l[h?f==="floating"?"reference":"floating":f],b=Li(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(M))?await(o.getScale==null?void 0:o.getScale(M))||{x:1,y:1}:{x:1,y:1},O=Li(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:M,strategy:c}):v);return{top:(b.top-O.top+m.top)/k.y,bottom:(O.bottom-b.bottom+m.bottom)/k.y,left:(b.left-O.left+m.left)/k.x,right:(O.right-b.right+m.right)/k.x}}const qm=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=zr(t,e)||{};if(d==null)return{};const f=Ra(u),h={x:n,y:r},p=is(i),m=rs(p),g=await s.getDimensions(d),y=p==="y",b=y?"top":"left",v=y?"bottom":"right",M=y?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-h[p]-o.floating[m],O=h[p]-o.reference[p],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let B=C?C[M]:0;(!B||!await(s.isElement==null?void 0:s.isElement(C)))&&(B=l.floating[M]||o.floating[m]);const I=k/2-O/2,_=B/2-g[m]/2-1,T=Rr(f[b],_),L=Rr(f[v],_),H=T,Y=B-g[m]-L,W=B/2-g[m]/2+I,N=ns(H,W,Y),x=!c.arrow&&jr(i)!=null&&W!==N&&o.reference[m]/2-(W<H?T:L)-g[m]/2<0,A=x?W<H?W-H:W-Y:0;return{[p]:h[p]+A,data:{[p]:N,centerOffset:W-N-A,...x&&{alignmentOffset:A}},reset:x}}}),Km=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=zr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Cn(i),v=Cn(l)===l,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=h||(v||!g?[_i(l)]:jm(l));!h&&m!=="none"&&k.push(...Hm(l,g,m,M));const O=[l,...k],C=await ja(e,y),B=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&B.push(C[b]),f){const H=zm(i,s,M);B.push(C[H[0]],C[H[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(H=>H<=0)){var _,T;const H=(((_=o.flip)==null?void 0:_.index)||0)+1,Y=O[H];if(Y)return{data:{index:H,overflows:I},reset:{placement:Y}};let W=(T=I.filter(N=>N.overflows[0]<=0).sort((N,x)=>N.overflows[1]-x.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(p){case"bestFit":{var L;const N=(L=I.map(x=>[x.placement,x.overflows.filter(A=>A>0).reduce((A,V)=>A+V,0)]).sort((x,A)=>x[1]-A[1])[0])==null?void 0:L[0];N&&(W=N);break}case"initialPlacement":W=l;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function Ym(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Cn(n),l=jr(n),c=Di(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=zr(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Jm=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,c=await Ym(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Gm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...c}=zr(t,e),d={x:n,y:r},u=await ja(e,c),f=Di(Cn(i)),h=Pa(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+u[y],M=p-u[b];p=ns(v,p,M)}if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=m+u[y],M=m-u[b];m=ns(v,m,M)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function Sn(t){return ls(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zt(t){var e;return(e=(ls(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ls(t){return t instanceof Node||t instanceof Qe(t).Node}function Ct(t){return t instanceof Element||t instanceof Qe(t).Element}function St(t){return t instanceof HTMLElement||t instanceof Qe(t).HTMLElement}function Fa(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function Fr(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=kt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Zm(t){return["table","td","th"].includes(Sn(t))}function as(t){const e=cs(),n=kt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Xm(t){let e=Xt(t);for(;St(e)&&!Zn(e);){if(as(e))return e;e=Xt(e)}return null}function cs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(t){return["html","body","#document"].includes(Sn(t))}function kt(t){return Qe(t).getComputedStyle(t)}function Ii(t){return Ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xt(t){if(Sn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fa(t)&&t.host||Zt(t);return Fa(e)?e.host:e}function Ha(t){const e=Xt(t);return Zn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Ha(e)}function ds(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ha(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qe(i);return o?e.concat(s,s.visualViewport||[],Fr(i)?i:[],s.frameElement&&n?ds(s.frameElement):[]):e.concat(i,ds(i,[],n))}function Wa(t){const e=kt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Vi(n)!==o||Vi(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ua(t){return Ct(t)?t:t.contextElement}function Xn(t){const e=Ua(t);if(!St(e))return Gt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Wa(e);let s=(o?Vi(n.width):n.width)/r,l=(o?Vi(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Qm=Gt(0);function qa(t){const e=Qe(t);return!cs()||!e.visualViewport?Qm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function eg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Hr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ua(t);let s=Gt(1);e&&(r?Ct(r)&&(s=Xn(r)):s=Xn(t));const l=eg(o,n,r)?qa(o):Gt(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Qe(o),p=r&&Ct(r)?Qe(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Xn(g),b=g.getBoundingClientRect(),v=kt(g),M=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,k=b.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=M,d+=k,m=Qe(g),g=m.frameElement}}return Li({width:u,height:f,x:c,y:d})}const tg=[":popover-open",":modal"];function us(t){return tg.some(e=>{try{return t.matches(e)}catch{return!1}})}function ng(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Zt(r),l=e?us(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=St(r);if((f||!f&&!o)&&((Sn(r)!=="body"||Fr(s))&&(c=Ii(r)),St(r))){const h=Hr(r);d=Xn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function rg(t){return Array.from(t.getClientRects())}function Ka(t){return Hr(Zt(t)).left+Ii(t).scrollLeft}function ig(t){const e=Zt(t),n=Ii(t),r=t.ownerDocument.body,i=Gn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Gn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ka(t);const l=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=Gn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function og(t,e){const n=Qe(t),r=Zt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=cs();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function sg(t,e){const n=Hr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Xn(t):Gt(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function Ya(t,e,n){let r;if(e==="viewport")r=og(t,n);else if(e==="document")r=ig(Zt(t));else if(Ct(e))r=sg(e,n);else{const i=qa(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Li(r)}function Ja(t,e){const n=Xt(t);return n===e||!Ct(n)||Zn(n)?!1:kt(n).position==="fixed"||Ja(n,e)}function lg(t,e){const n=e.get(t);if(n)return n;let r=ds(t,[],!1).filter(l=>Ct(l)&&Sn(l)!=="body"),i=null;const o=kt(t).position==="fixed";let s=o?Xt(t):t;for(;Ct(s)&&!Zn(s);){const l=kt(s),c=as(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!c&&Ja(t,s))?r=r.filter(u=>u!==s):i=l,s=Xt(s)}return e.set(t,r),r}function ag(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?us(e)?[]:lg(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=Ya(e,u,i);return d.top=Gn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Gn(f.left,d.left),d},Ya(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function cg(t){const{width:e,height:n}=Wa(t);return{width:e,height:n}}function dg(t,e,n){const r=St(e),i=Zt(e),o=n==="fixed",s=Hr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);if(r||!r&&!o)if((Sn(e)!=="body"||Fr(i))&&(l=Ii(e)),r){const f=Hr(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Ka(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function fs(t){return kt(t).position==="static"}function Ga(t,e){return!St(t)||kt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Za(t,e){const n=Qe(t);if(us(t))return n;if(!St(t)){let i=Xt(t);for(;i&&!Zn(i);){if(Ct(i)&&!fs(i))return i;i=Xt(i)}return n}let r=Ga(t,e);for(;r&&Zm(r)&&fs(r);)r=Ga(r,e);return r&&Zn(r)&&fs(r)&&!as(r)?n:r||Xm(t)||n}const ug=async function(t){const e=this.getOffsetParent||Za,n=this.getDimensions,r=await n(t.floating);return{reference:dg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fg(t){return kt(t).direction==="rtl"}const hg={convertOffsetParentRelativeRectToViewportRelativeRect:ng,getDocumentElement:Zt,getClippingRect:ag,getOffsetParent:Za,getElementRects:ug,getClientRects:rg,getDimensions:cg,getScale:Xn,isElement:Ct,isRTL:fg},Xa=Jm,Qa=Gm,ec=Km,pg=qm,tc=(t,e,n)=>{const r=new Map,i={platform:hg,...n},o={...i.platform,_c:r};return Um(t,e,{...i,platform:o})};function mg(t){return t!=null&&typeof t=="object"&&"$el"in t}function gg(t){if(mg(t)){const e=t.$el;return ls(e)&&Sn(e)==="#comment"?null:e}return t}function yg(t){return{name:"arrow",options:t,fn(e){const n=gg(a.unref(t.element));return n==null?{}:pg({element:n,padding:t.padding}).fn(e)}}}const bg={},kg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},xg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function wg(t,e){return a.openBlock(),a.createElementBlock("svg",kg,xg)}const Wr=ae(bg,[["render",wg]]);let Pi;const vg=new Uint8Array(16);function Cg(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(vg)}const Ve=[];for(let t=0;t<256;++t)Ve.push((t+256).toString(16).slice(1));function Sg(t,e=0){return Ve[t[e+0]]+Ve[t[e+1]]+Ve[t[e+2]]+Ve[t[e+3]]+"-"+Ve[t[e+4]]+Ve[t[e+5]]+"-"+Ve[t[e+6]]+Ve[t[e+7]]+"-"+Ve[t[e+8]]+Ve[t[e+9]]+"-"+Ve[t[e+10]]+Ve[t[e+11]]+Ve[t[e+12]]+Ve[t[e+13]]+Ve[t[e+14]]+Ve[t[e+15]]}const nc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hs(t,e,n){if(nc.randomUUID&&!t)return nc.randomUUID();t=t||{};const r=t.random||(t.rng||Cg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Sg(r)}let Eg={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const En=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=hs(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(b){if(d.value)u();else{if(o.noCloseClasses.some(v=>b.target.closest(`.${v}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const b=await tc(l.value,c.value,{placement:o.placement,middleware:[ec(),Qa(),Xa(o.offset)]});c.value.style.left=`${b.x}px`,c.value.style.top=`${b.y}px`}const m=b=>{c.value&&!c.value.contains(b.target)&&l.value&&!l.value.contains(b.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",b=>{b.detail.uuid!==r&&h()})}),a.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(b,v)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",{class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l,onMouseenter:g,onMouseleave:y,onClick:v[0]||(v[0]=a.withModifiers(M=>f(M),["stop"]))},[a.renderSlot(b.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(ne).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(ne).theme]}`]:!d.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(b.$slots,"content")],6))],8,["to"]))],64))}}),Og={},Mg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Tg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function $g(t,e){return a.openBlock(),a.createElementBlock("svg",Mg,Tg)}const rc=ae(Og,[["render",$g]]),Ng={},Bg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ag=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function Vg(t,e){return a.openBlock(),a.createElementBlock("svg",Bg,Ag)}const ps=ae(Ng,[["render",Vg]]),Dg={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},_g={class:"flex items-center gap-2"},Lg={key:0},Ig={class:""},Pg={class:"flex justify-end"},Rg={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},zg={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},jg={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Ur=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",Dg,[a.createElementVNode("div",_g,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Lg,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Ig,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Pg,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(ne).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[a.unref(ne).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",Rg,[a.createElementVNode("div",zg,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",jg,[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Fg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ri=Fg,Hg=typeof On=="object"&&On&&On.Object===Object&&On,ic=Hg,Wg=ic,Ug=typeof self=="object"&&self&&self.Object===Object&&self,qg=Wg||Ug||Function("return this")(),Et=qg,Kg=Et,Yg=function(){return Kg.Date.now()},Jg=Yg,Gg=/\s/;function Zg(t){for(var e=t.length;e--&&Gg.test(t.charAt(e)););return e}var Xg=Zg,Qg=Xg,e0=/^\s+/;function t0(t){return t&&t.slice(0,Qg(t)+1).replace(e0,"")}var n0=t0,r0=Et,i0=r0.Symbol,ms=i0,oc=ms,sc=Object.prototype,o0=sc.hasOwnProperty,s0=sc.toString,Kr=oc?oc.toStringTag:void 0;function l0(t){var e=o0.call(t,Kr),n=t[Kr];try{t[Kr]=void 0;var r=!0}catch{}var i=s0.call(t);return r&&(e?t[Kr]=n:delete t[Kr]),i}var a0=l0,c0=Object.prototype,d0=c0.toString;function u0(t){return d0.call(t)}var f0=u0,lc=ms,h0=a0,p0=f0,m0="[object Null]",g0="[object Undefined]",ac=lc?lc.toStringTag:void 0;function y0(t){return t==null?t===void 0?g0:m0:ac&&ac in Object(t)?h0(t):p0(t)}var Yr=y0;function b0(t){return t!=null&&typeof t=="object"}var Jr=b0,k0=Yr,x0=Jr,w0="[object Symbol]";function v0(t){return typeof t=="symbol"||x0(t)&&k0(t)==w0}var C0=v0,S0=n0,cc=Ri,E0=C0,dc=NaN,O0=/^[-+]0x[0-9a-f]+$/i,M0=/^0b[01]+$/i,T0=/^0o[0-7]+$/i,$0=parseInt;function N0(t){if(typeof t=="number")return t;if(E0(t))return dc;if(cc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=S0(t);var n=M0.test(t);return n||T0.test(t)?$0(t.slice(2),n?2:8):O0.test(t)?dc:+t}var B0=N0,A0=Ri,gs=Jg,uc=B0,V0="Expected a function",D0=Math.max,_0=Math.min;function L0(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(V0);e=uc(e)||0,A0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?D0(uc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(C){var B=r,I=i;return r=i=void 0,d=C,s=t.apply(I,B),s}function m(C){return d=C,l=setTimeout(b,e),u?p(C):s}function g(C){var B=C-c,I=C-d,_=e-B;return f?_0(_,o-I):_}function y(C){var B=C-c,I=C-d;return c===void 0||B>=e||B<0||f&&I>=o}function b(){var C=gs();if(y(C))return v(C);l=setTimeout(b,g(C))}function v(C){return l=void 0,h&&r?p(C):(r=i=void 0,s)}function M(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function k(){return l===void 0?s:v(gs())}function O(){var C=gs(),B=y(C);if(r=arguments,i=this,c=C,B){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(b,e),p(c)}return l===void 0&&(l=setTimeout(b,e)),s}return O.cancel=M,O.flush=k,O}var I0=L0;const fc=qr(I0);function P0(){this.__data__=[],this.size=0}var R0=P0;function z0(t,e){return t===e||t!==t&&e!==e}var hc=z0,j0=hc;function F0(t,e){for(var n=t.length;n--;)if(j0(t[n][0],e))return n;return-1}var zi=F0,H0=zi,W0=Array.prototype,U0=W0.splice;function q0(t){var e=this.__data__,n=H0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():U0.call(e,n,1),--this.size,!0}var K0=q0,Y0=zi;function J0(t){var e=this.__data__,n=Y0(e,t);return n<0?void 0:e[n][1]}var G0=J0,Z0=zi;function X0(t){return Z0(this.__data__,t)>-1}var Q0=X0,ey=zi;function ty(t,e){var n=this.__data__,r=ey(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ny=ty,ry=R0,iy=K0,oy=G0,sy=Q0,ly=ny;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qn.prototype.clear=ry,Qn.prototype.delete=iy,Qn.prototype.get=oy,Qn.prototype.has=sy,Qn.prototype.set=ly;var ji=Qn,ay=ji;function cy(){this.__data__=new ay,this.size=0}var dy=cy;function uy(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var fy=uy;function hy(t){return this.__data__.get(t)}var py=hy;function my(t){return this.__data__.has(t)}var gy=my,yy=Yr,by=Ri,ky="[object AsyncFunction]",xy="[object Function]",wy="[object GeneratorFunction]",vy="[object Proxy]";function Cy(t){if(!by(t))return!1;var e=yy(t);return e==xy||e==wy||e==ky||e==vy}var pc=Cy,Sy=Et,Ey=Sy["__core-js_shared__"],Oy=Ey,ys=Oy,mc=function(){var t=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function My(t){return!!mc&&mc in t}var Ty=My,$y=Function.prototype,Ny=$y.toString;function By(t){if(t!=null){try{return Ny.call(t)}catch{}try{return t+""}catch{}}return""}var gc=By,Ay=pc,Vy=Ty,Dy=Ri,_y=gc,Ly=/[\\^$.*+?()[\]{}|]/g,Iy=/^\[object .+?Constructor\]$/,Py=Function.prototype,Ry=Object.prototype,zy=Py.toString,jy=Ry.hasOwnProperty,Fy=RegExp("^"+zy.call(jy).replace(Ly,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Hy(t){if(!Dy(t)||Vy(t))return!1;var e=Ay(t)?Fy:Iy;return e.test(_y(t))}var Wy=Hy;function Uy(t,e){return t==null?void 0:t[e]}var qy=Uy,Ky=Wy,Yy=qy;function Jy(t,e){var n=Yy(t,e);return Ky(n)?n:void 0}var er=Jy,Gy=er,Zy=Et,Xy=Gy(Zy,"Map"),bs=Xy,Qy=er,e1=Qy(Object,"create"),Fi=e1,yc=Fi;function t1(){this.__data__=yc?yc(null):{},this.size=0}var n1=t1;function r1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var i1=r1,o1=Fi,s1="__lodash_hash_undefined__",l1=Object.prototype,a1=l1.hasOwnProperty;function c1(t){var e=this.__data__;if(o1){var n=e[t];return n===s1?void 0:n}return a1.call(e,t)?e[t]:void 0}var d1=c1,u1=Fi,f1=Object.prototype,h1=f1.hasOwnProperty;function p1(t){var e=this.__data__;return u1?e[t]!==void 0:h1.call(e,t)}var m1=p1,g1=Fi,y1="__lodash_hash_undefined__";function b1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=g1&&e===void 0?y1:e,this}var k1=b1,x1=n1,w1=i1,v1=d1,C1=m1,S1=k1;function tr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}tr.prototype.clear=x1,tr.prototype.delete=w1,tr.prototype.get=v1,tr.prototype.has=C1,tr.prototype.set=S1;var E1=tr,bc=E1,O1=ji,M1=bs;function T1(){this.size=0,this.__data__={hash:new bc,map:new(M1||O1),string:new bc}}var $1=T1;function N1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var B1=N1,A1=B1;function V1(t,e){var n=t.__data__;return A1(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Hi=V1,D1=Hi;function _1(t){var e=D1(this,t).delete(t);return this.size-=e?1:0,e}var L1=_1,I1=Hi;function P1(t){return I1(this,t).get(t)}var R1=P1,z1=Hi;function j1(t){return z1(this,t).has(t)}var F1=j1,H1=Hi;function W1(t,e){var n=H1(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var U1=W1,q1=$1,K1=L1,Y1=R1,J1=F1,G1=U1;function nr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nr.prototype.clear=q1,nr.prototype.delete=K1,nr.prototype.get=Y1,nr.prototype.has=J1,nr.prototype.set=G1;var kc=nr,Z1=ji,X1=bs,Q1=kc,eb=200;function tb(t,e){var n=this.__data__;if(n instanceof Z1){var r=n.__data__;if(!X1||r.length<eb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Q1(r)}return n.set(t,e),this.size=n.size,this}var nb=tb,rb=ji,ib=dy,ob=fy,sb=py,lb=gy,ab=nb;function rr(t){var e=this.__data__=new rb(t);this.size=e.size}rr.prototype.clear=ib,rr.prototype.delete=ob,rr.prototype.get=sb,rr.prototype.has=lb,rr.prototype.set=ab;var cb=rr,db="__lodash_hash_undefined__";function ub(t){return this.__data__.set(t,db),this}var fb=ub;function hb(t){return this.__data__.has(t)}var pb=hb,mb=kc,gb=fb,yb=pb;function Wi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new mb;++e<n;)this.add(t[e])}Wi.prototype.add=Wi.prototype.push=gb,Wi.prototype.has=yb;var bb=Wi;function kb(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var xb=kb;function wb(t,e){return t.has(e)}var vb=wb,Cb=bb,Sb=xb,Eb=vb,Ob=1,Mb=2;function Tb(t,e,n,r,i,o){var s=n&Ob,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&Mb?new Cb:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!Sb(e,function(b,v){if(!Eb(p,v)&&(m===b||i(m,b,n,r,o)))return p.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var xc=Tb,$b=Et,Nb=$b.Uint8Array,Bb=Nb;function Ab(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Vb=Ab;function Db(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var _b=Db,wc=ms,vc=Bb,Lb=hc,Ib=xc,Pb=Vb,Rb=_b,zb=1,jb=2,Fb="[object Boolean]",Hb="[object Date]",Wb="[object Error]",Ub="[object Map]",qb="[object Number]",Kb="[object RegExp]",Yb="[object Set]",Jb="[object String]",Gb="[object Symbol]",Zb="[object ArrayBuffer]",Xb="[object DataView]",Cc=wc?wc.prototype:void 0,ks=Cc?Cc.valueOf:void 0;function Qb(t,e,n,r,i,o,s){switch(n){case Xb:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Zb:return!(t.byteLength!=e.byteLength||!o(new vc(t),new vc(e)));case Fb:case Hb:case qb:return Lb(+t,+e);case Wb:return t.name==e.name&&t.message==e.message;case Kb:case Jb:return t==e+"";case Ub:var l=Pb;case Yb:var c=r&zb;if(l||(l=Rb),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=jb,s.set(t,e);var u=Ib(l(t),l(e),r,i,o,s);return s.delete(t),u;case Gb:if(ks)return ks.call(t)==ks.call(e)}return!1}var e2=Qb;function t2(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var n2=t2,r2=Array.isArray,xs=r2,i2=n2,o2=xs;function s2(t,e,n){var r=e(t);return o2(t)?r:i2(r,n(t))}var l2=s2;function a2(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var c2=a2;function d2(){return[]}var u2=d2,f2=c2,h2=u2,p2=Object.prototype,m2=p2.propertyIsEnumerable,Sc=Object.getOwnPropertySymbols,g2=Sc?function(t){return t==null?[]:(t=Object(t),f2(Sc(t),function(e){return m2.call(t,e)}))}:h2,y2=g2;function b2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var k2=b2,x2=Yr,w2=Jr,v2="[object Arguments]";function C2(t){return w2(t)&&x2(t)==v2}var S2=C2,Ec=S2,E2=Jr,Oc=Object.prototype,O2=Oc.hasOwnProperty,M2=Oc.propertyIsEnumerable,T2=Ec(function(){return arguments}())?Ec:function(t){return E2(t)&&O2.call(t,"callee")&&!M2.call(t,"callee")},$2=T2,Ui={exports:{}};function N2(){return!1}var B2=N2;Ui.exports,function(t,e){var n=Et,r=B2,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||r;t.exports=d}(Ui,Ui.exports);var Mc=Ui.exports,A2=9007199254740991,V2=/^(?:0|[1-9]\d*)$/;function D2(t,e){var n=typeof t;return e=e??A2,!!e&&(n=="number"||n!="symbol"&&V2.test(t))&&t>-1&&t%1==0&&t<e}var _2=D2,L2=9007199254740991;function I2(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=L2}var Tc=I2,P2=Yr,R2=Tc,z2=Jr,j2="[object Arguments]",F2="[object Array]",H2="[object Boolean]",W2="[object Date]",U2="[object Error]",q2="[object Function]",K2="[object Map]",Y2="[object Number]",J2="[object Object]",G2="[object RegExp]",Z2="[object Set]",X2="[object String]",Q2="[object WeakMap]",ek="[object ArrayBuffer]",tk="[object DataView]",nk="[object Float32Array]",rk="[object Float64Array]",ik="[object Int8Array]",ok="[object Int16Array]",sk="[object Int32Array]",lk="[object Uint8Array]",ak="[object Uint8ClampedArray]",ck="[object Uint16Array]",dk="[object Uint32Array]",ke={};ke[nk]=ke[rk]=ke[ik]=ke[ok]=ke[sk]=ke[lk]=ke[ak]=ke[ck]=ke[dk]=!0,ke[j2]=ke[F2]=ke[ek]=ke[H2]=ke[tk]=ke[W2]=ke[U2]=ke[q2]=ke[K2]=ke[Y2]=ke[J2]=ke[G2]=ke[Z2]=ke[X2]=ke[Q2]=!1;function uk(t){return z2(t)&&R2(t.length)&&!!ke[P2(t)]}var fk=uk;function hk(t){return function(e){return t(e)}}var pk=hk,qi={exports:{}};qi.exports,function(t,e){var n=ic,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(qi,qi.exports);var mk=qi.exports,gk=fk,yk=pk,$c=mk,Nc=$c&&$c.isTypedArray,bk=Nc?yk(Nc):gk,Bc=bk,kk=k2,xk=$2,wk=xs,vk=Mc,Ck=_2,Sk=Bc,Ek=Object.prototype,Ok=Ek.hasOwnProperty;function Mk(t,e){var n=wk(t),r=!n&&xk(t),i=!n&&!r&&vk(t),o=!n&&!r&&!i&&Sk(t),s=n||r||i||o,l=s?kk(t.length,String):[],c=l.length;for(var d in t)(e||Ok.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ck(d,c)))&&l.push(d);return l}var Tk=Mk,$k=Object.prototype;function Nk(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$k;return t===n}var Bk=Nk;function Ak(t,e){return function(n){return t(e(n))}}var Vk=Ak,Dk=Vk,_k=Dk(Object.keys,Object),Lk=_k,Ik=Bk,Pk=Lk,Rk=Object.prototype,zk=Rk.hasOwnProperty;function jk(t){if(!Ik(t))return Pk(t);var e=[];for(var n in Object(t))zk.call(t,n)&&n!="constructor"&&e.push(n);return e}var Fk=jk,Hk=pc,Wk=Tc;function Uk(t){return t!=null&&Wk(t.length)&&!Hk(t)}var qk=Uk,Kk=Tk,Yk=Fk,Jk=qk;function Gk(t){return Jk(t)?Kk(t):Yk(t)}var Zk=Gk,Xk=l2,Qk=y2,ex=Zk;function tx(t){return Xk(t,ex,Qk)}var nx=tx,Ac=nx,rx=1,ix=Object.prototype,ox=ix.hasOwnProperty;function sx(t,e,n,r,i,o){var s=n&rx,l=Ac(t),c=l.length,d=Ac(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:ox.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<c;){h=l[f];var b=t[h],v=e[h];if(r)var M=s?r(v,b,h,e,t,o):r(b,v,h,t,e,o);if(!(M===void 0?b===v||i(b,v,n,r,o):M)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var k=t.constructor,O=e.constructor;k!=O&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof O=="function"&&O instanceof O)&&(g=!1)}return o.delete(t),o.delete(e),g}var lx=sx,ax=er,cx=Et,dx=ax(cx,"DataView"),ux=dx,fx=er,hx=Et,px=fx(hx,"Promise"),mx=px,gx=er,yx=Et,bx=gx(yx,"Set"),kx=bx,xx=er,wx=Et,vx=xx(wx,"WeakMap"),Cx=vx,ws=ux,vs=bs,Cs=mx,Ss=kx,Es=Cx,Vc=Yr,ir=gc,Dc="[object Map]",Sx="[object Object]",_c="[object Promise]",Lc="[object Set]",Ic="[object WeakMap]",Pc="[object DataView]",Ex=ir(ws),Ox=ir(vs),Mx=ir(Cs),Tx=ir(Ss),$x=ir(Es),Mn=Vc;(ws&&Mn(new ws(new ArrayBuffer(1)))!=Pc||vs&&Mn(new vs)!=Dc||Cs&&Mn(Cs.resolve())!=_c||Ss&&Mn(new Ss)!=Lc||Es&&Mn(new Es)!=Ic)&&(Mn=function(t){var e=Vc(t),n=e==Sx?t.constructor:void 0,r=n?ir(n):"";if(r)switch(r){case Ex:return Pc;case Ox:return Dc;case Mx:return _c;case Tx:return Lc;case $x:return Ic}return e});var Nx=Mn,Os=cb,Bx=xc,Ax=e2,Vx=lx,Rc=Nx,zc=xs,jc=Mc,Dx=Bc,_x=1,Fc="[object Arguments]",Hc="[object Array]",Ki="[object Object]",Lx=Object.prototype,Wc=Lx.hasOwnProperty;function Ix(t,e,n,r,i,o){var s=zc(t),l=zc(e),c=s?Hc:Rc(t),d=l?Hc:Rc(e);c=c==Fc?Ki:c,d=d==Fc?Ki:d;var u=c==Ki,f=d==Ki,h=c==d;if(h&&jc(t)){if(!jc(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Os),s||Dx(t)?Bx(t,e,n,r,i,o):Ax(t,e,c,n,r,i,o);if(!(n&_x)){var p=u&&Wc.call(t,"__wrapped__"),m=f&&Wc.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Os),i(g,y,n,r,o)}}return h?(o||(o=new Os),Vx(t,e,n,r,i,o)):!1}var Px=Ix,Rx=Px,Uc=Jr;function qc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Uc(t)&&!Uc(e)?t!==t&&e!==e:Rx(t,e,n,r,qc,i)}var zx=qc,jx=zx;function Fx(t,e){return jx(t,e)}var Hx=Fx;const Kc=qr(Hx),Wx={},Ux={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},qx=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function Kx(t,e){return a.openBlock(),a.createElementBlock("svg",Ux,qx)}const Yx=ae(Wx,[["render",Kx]]),Jx={key:0,class:"leading-none"},Gx={key:1},Zx={class:"flex flex-col max-h-80 overflow-y-auto"},Xx={key:0,class:"p-3"},Qx={key:1},ew={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},tw=["onClick"],nw={class:"select-none flex w-full items-center justify-between"},Yc=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(!1),o=a.ref(r.options);a.watch(()=>r.options,()=>{var k;(k=r.options)!=null&&k.length&&(o.value=[...r.options])},{immediate:!0,deep:!0});const s=n,l=a.ref(),c=a.ref();function d(k){var O,C;if(r.multiple){if(k){let B=r.modelValue||[];B.indexOf(k)>=0?B.splice(B.indexOf(k),1):B.push(k),s("update:modelValue",B),p(B),((O=r.modelValue)==null?void 0:O.length)===((C=r.options)==null?void 0:C.length)?i.value=!0:i.value=!1}}else s("update:modelValue",k),p(k),l.value=null,c.value.hide()}async function u(k){var O,C;s("update:modelValue",k),p(k),await a.nextTick(),((O=r.modelValue)==null?void 0:O.length)===((C=r.options)==null?void 0:C.length)&&(i.value=!0)}function f(k){s("update:modelValue",k),i.value=!1,p(k)}function h(){i.value=!1,r.multiple?(s("update:modelValue",[]),p([])):(s("update:modelValue",null),p(null))}const p=fc(function(k){s("change",k)},r.debounce),m=a.computed(()=>{var k,O,C,B;if(r.multiple)if(r.maxDisplay){let I=(O=o.value)==null?void 0:O.filter(T=>{var L;return((L=r.modelValue)==null?void 0:L.indexOf(T.value))>=0}).map(T=>T.label),_=I==null?void 0:I.slice(0,r.maxDisplay);return(I==null?void 0:I.length)-(_==null?void 0:_.length)>0?(_==null?void 0:_.join(", "))+` (+${(I==null?void 0:I.length)-_.length})`:_==null?void 0:_.join(", ")}else return(k=o.value)==null?void 0:k.filter(I=>{var _;return((_=r.modelValue)==null?void 0:_.indexOf(I.value))>=0}).map(I=>I.label).join(", ");else return((B=(C=o.value)==null?void 0:C.find(I=>I.value===r.modelValue))==null?void 0:B.label)||r.modelValue});function g(k){var O;try{return r.multiple?r.modelValue!==null&&((O=r.modelValue)==null?void 0:O.some(C=>Kc(C,k))):r.modelValue!==null&&Kc(k,r.modelValue)}catch(C){return console.log(C),!1}}const y={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},b=a.computed(()=>{var k,O;return((k=r.modelValue)==null?void 0:k.length)===((O=r.options)==null?void 0:O.length)}),v=a.computed(()=>{var k;if(r.filterable&&!r.remoteMethod&&((k=l.value)!=null&&k.trim().length)){const O=l.value.trim().toLowerCase();return r.options.filter(C=>{var B;return(B=C.label)==null?void 0:B.toLowerCase().includes(O)})}return r.options});function M(){r.remoteMethod&&r.remoteMethod(l.value)}return e({allSelected:i,isAllSelected:b}),(k,O)=>(a.openBlock(),a.createBlock(En,{custom:"",ref_key:"myPopover",ref:c,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:C})=>[a.createVNode(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var B,I,_,T,L,H;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((B=t.modelValue)==null?void 0:B.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Jx,[b.value&&((I=t.allSelectedText)!=null&&I.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((_=t.options)==null?void 0:_.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(m.value),1)],64))])):!t.multiple&&((T=t.options)!=null&&T.find(Y=>Y.value===null))?(a.openBlock(),a.createElementBlock("span",Gx,a.toDisplayString((H=(L=t.options)==null?void 0:L.find(Y=>Y.value===null))==null?void 0:H.label),1)):a.renderSlot(k.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(h,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(Yx,{key:1,class:"h-5 w-5 -mr-[2px]"})):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var C;return[a.createElementVNode("div",Zx,[t.filterable?(a.openBlock(),a.createElementBlock("div",Xx,[a.createVNode(Xc,{slim:"",placeholder:"Search...",clearable:"",modelValue:l.value,"onUpdate:modelValue":[O[0]||(O[0]=B=>l.value=B),M]},null,8,["modelValue"])])):a.createCommentVNode("",!0),!t.options&&((C=t.options)==null?void 0:C.length)==0?(a.openBlock(),a.createElementBlock("span",Qx,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",ew,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:O[1]||(O[1]=B=>{var I;return u((I=v.value)==null?void 0:I.filter(_=>_.value).map(_=>_.value))})},"Select all"),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:O[2]||(O[2]=B=>f([]))},"Select none")])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(v.value,B=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!g(B.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||B.value,[`${y[a.unref(ne).theme]}`]:!0}]),onClick:I=>B.disabled?null:d(B.value)},[a.createElementVNode("div",nw,[a.createElementVNode("span",{class:a.normalizeClass(["",{"opacity-25":B.disabled}])},a.toDisplayString(B.label||B.value),3),t.multiple&&g(B.value)?(a.openBlock(),a.createBlock(rc,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,tw)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Jc=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),rw={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},iw={class:""},ow=["value","disabled","rows","placeholder"],Gc=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(null),o=a.ref(!1);a.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&a.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function l(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",rw,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",iw,[d.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:a.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:l,placeholder:t.placeholder},null,46,ow)],64))}}),sw=["placeholder"],Zc={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,sw),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},lw={},aw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},cw=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function dw(t,e){return a.openBlock(),a.createElementBlock("svg",aw,cw)}const uw=ae(lw,[["render",dw]]),fw={},hw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},pw=[a.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),a.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),a.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function mw(t,e){return a.openBlock(),a.createElementBlock("svg",hw,pw)}const gw=ae(fw,[["render",mw]]),yw={},bw={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},kw=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function xw(t,e){return a.openBlock(),a.createElementBlock("svg",bw,kw)}const ww=ae(yw,[["render",xw]]),vw={class:"flex items-center gap-2"},Cw={key:0},Sw={class:""},Ew=["innerHTML"],Ow={class:"flex justify-end"},Mw=["name","value","checked"],Tw={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},$w={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},Nw={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},Bw={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Xc=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:hs()),l=gm(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var T;if(o.rules&&typeof o.rules=="string"){let L=(T=o.rules)==null?void 0:T.split("|");return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}else if(!o.rules){let L=[];return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}return"required"});function p(T){let L=T&&T.target?T.target.value:T;v(L)}const m=n;function g(T){T===!0||T===!1?m("update:modelValue",!T):m("update:modelValue",T)}function y(T){let L=T&&T.target?T.target.value:T;m("update:modelValue",L),m("onChange",L)}function b(){m("update:modelValue",null),m("onChange",null),m("onClear")}const v=fc(function(T){m("update:modelValue",T),m("onChange",T)},o.debounce),M=a.ref(null),k=a.ref();function O(){var T,L;o.textarea?(T=k.value)==null||T.focus():(L=M.value)==null||L.$el.focus()}function C(){return M.value.meta.valid}const B=a.ref(),I=a.computed(()=>B.value.allSelected),_=a.computed(()=>B.value.isAllSelected);return e({focus:O,isValid:C,allSelected:I,isAllSelected:_}),(T,L)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[a.createElementVNode("div",vw,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Cw,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Sw,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,Ew)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ow,[a.renderSlot(T.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:M,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:H})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:L[0]||(L[0]=Y=>t.disabled?void 0:g(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(ne).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(rc,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(T.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:M,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:H})=>[a.createElementVNode("div",{onClick:L[2]||(L[2]=()=>{t.disabled||y(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:L[1]||(L[1]=(...Y)=>T.onChange&&T.onChange(...Y)),checked:t.radioValue==t.modelValue},null,40,Mw),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(vn),{key:3,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>{var Y;return[a.createVNode(Yc,{ref_key:"myChoiceList",ref:B,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((Y=h.value)==null?void 0:Y.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(vn),{key:4,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>[a.createVNode(Zc,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(vn),{key:5,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>[a.createVNode(Jc,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(ne).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[T.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[a.createElementVNode("div",Tw,[a.renderSlot(T.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var H;return[a.createVNode(Gc,{ref_key:"myTextarea",ref:k,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((H=h.value)==null?void 0:H.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:M,autocomplete:"off",style:{"z-index":"1"},class:a.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-gray-700",{"pl-4":!T.$slots.prepend&&!t.naked,"pl-8":T.$slots.prepend&&!t.naked,"pl-6":T.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(b,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(b,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),T.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",$w,[a.createElementVNode("div",Nw,[a.renderSlot(T.$slots,"append",{},()=>[a.withDirectives(a.createVNode(uw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(gw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",Bw,[a.createVNode(a.unref(mm),{name:s.value},{default:a.withCtx(H=>[a.createTextVNode(a.toDisplayString(H.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),T.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(T.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),Aw=["innerHTML"],Qc=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();hs();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await tc(e.value,n.value,{placement:i.placement,middleware:[ec(),Qa(),Xa(i.offset),yg({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[a.createElementVNode("span",{innerHTML:t.text},null,8,Aw),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),Vw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},Dw={class:""},_w={key:2,class:"flex items-center justify-end py-4 px-6"},Lw=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(ne).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",Vw,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(ne).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",Dw,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",_w,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),Iw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},Pw={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},Rw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(ne).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",Iw,[a.createElementVNode("div",Pw,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])]),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),zw=a.createElementVNode("div",{class:""},null,-1),jw=a.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),Fw=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(ne).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createVNode(Qc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[zw]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[jw],64)):a.createCommentVNode("",!0)],2))}}),Hw={class:"leading-none"},Ww=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(ne).theme]]:!0}])},[a.createElementVNode("span",Hw,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Uw=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),qw=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),Kw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Yw=[qw(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Jw=ae(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",Kw,Yw)):(a.openBlock(),a.createBlock(Jn,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Gw={class:"text-base font-medium select-none"},Gr=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(ne).theme]]:!t.active&&!t.disabled,[n[a.unref(ne).theme]]:t.active&&!t.disabled,[r[a.unref(ne).theme]]:t.disabled}])},[a.createElementVNode("span",Gw,[a.renderSlot(i.$slots,"default")])],2))}}),Zw={},Xw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Qw=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function ev(t,e){return a.openBlock(),a.createElementBlock("svg",Xw,Qw)}const ed=ae(Zw,[["render",ev]]),tv={},nv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},rv=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function iv(t,e){return a.openBlock(),a.createElementBlock("svg",nv,rv)}const td=ae(tv,[["render",iv]]),ov={},sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},lv=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function av(t,e){return a.openBlock(),a.createElementBlock("svg",sv,lv)}const nd=ae(ov,[["render",av]]),cv={},dv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},uv=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function fv(t,e){return a.openBlock(),a.createElementBlock("svg",dv,uv)}const rd=ae(cv,[["render",fv]]),hv={class:"wpic-pagination flex justify-between"},pv={key:0,class:"flex items-center"},mv={class:"font-medium"},gv=a.createElementVNode("span",{class:"px-1"},"to",-1),yv={class:"font-medium"},bv=a.createElementVNode("span",{class:"px-1"},"of",-1),kv={class:"font-medium"},xv={class:"pl-1"},wv={key:1,class:"flex flex-wrap gap-2"},vv=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const r=t,i=a.computed(()=>r.perPageOptions.map(h=>({value:Number(h),label:`${h} per page`}))),o=n,s=a.computed(()=>Math.ceil(r.total/r.perPage)),l=a.computed(()=>{const h=s.value;if(!h||h===1)return[1];const p=r.currentPage,m=1;let g=Math.max(2,p-m),y=Math.min(h-1,p+m);p<=m+2&&(g=2,y=Math.min(2*m+2,h-1)),p>=h-m-1&&(g=Math.max(2,h-2*m-1),y=h-1);const b=[];for(let v=g;v<=y;v++)b.push(v);return g>2&&b.unshift("..."),y<h-1&&b.push("..."),[1,...b,h]});function c(h){h>=1&&h<=s.value&&o("update:currentPage",h)}function d(){return r.perPage*(r.currentPage-1)+1}function u(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}async function f(h){o("update:perPage",h),o("update:currentPage",1)}return e({getStart:d,getEnd:u}),(h,p)=>{const m=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",hv,[t.info?(a.openBlock(),a.createElementBlock("div",pv,[t.total>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",mv,a.toDisplayString(d()),1),gv,a.createElementVNode("span",yv,a.toDisplayString(u()),1),t.total?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[bv,a.createElementVNode("span",kv,a.toDisplayString(t.total),1),a.createElementVNode("span",xv,"result"+a.toDisplayString(t.total>1?"s":""),1)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",wv,[a.createVNode(Gr,{onClick:p[0]||(p[0]=g=>c(1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(ed,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[1]||(p[1]=g=>c(t.currentPage-1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(td,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,g=>(a.openBlock(),a.createBlock(Gr,{key:`page_${g}`,onClick:y=>c(g),active:g===t.currentPage,disabled:s.value==0||!s.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(g),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Gr,{onClick:p[2]||(p[2]=g=>c(t.currentPage+1)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(rd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[3]||(p[3]=g=>c(s.value)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(nd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(m,{key:0,modelValue:t.perPage,"onUpdate:modelValue":f,options:i.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),id=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return a.h("td",e.attrs,n)};id.props=["column","item","rowIndex"];const Yi=id,Cv={},Sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Ev=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function Ov(t,e){return a.openBlock(),a.createElementBlock("svg",Sv,Ev)}const Mv=ae(Cv,[["render",Ov]]),Tv={class:"font-semibold"},od={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",Tv,[t.checkable?(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},$v={},Nv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},Bv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function Av(t,e){return a.openBlock(),a.createElementBlock("svg",Nv,Bv)}const Vv=ae($v,[["render",Av]]),Dv={},_v={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Lv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function Iv(t,e){return a.openBlock(),a.createElementBlock("svg",_v,Lv)}const Pv=ae(Dv,[["render",Iv]]),Rv={class:"wpic-table"},zv={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},jv={class:"flex items-center gap-2"},Fv={class:"flex items-center gap-2"},Hv={class:"w-full rounded-lg"},Wv={key:0,class:"w-16"},Uv=["width"],qv=["width"],Kv={class:"flex justify-center items-center h-full"},Yv=["onClick"],Jv={class:"rounded-b-lg relative"},Gv={key:0},Zv=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],Xv={class:"flex justify-center items-center h-full"},Qv={key:1},e5={key:0,class:"text-center text-gray-400 py-3"},t5=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;a.onMounted(()=>{b()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),g=a.ref([]),y=a.computed(()=>r.columnToggleable?m.value.filter(H=>g.value.includes(H.field)||!H.selectable):m.value.filter(H=>H.visible||!H.selectable));function b(){const H=(N,x)=>{let A={};for(let V in N){if(typeof N[V].default=="boolean"&&x[V]!==void 0){A[V]=x[V]!==!1;continue}if(x[V]!==void 0){A[V]=x[V];continue}if(typeof N[V].default=="function"){A[V]=N[V].default();continue}A[V]=N[V].default}return A};let Y=[];(p.default&&p.default()||[]).forEach(N=>{var x,A;((x=N.type)==null?void 0:x.name)==="WpicTableColumn"?Y.push(N):(A=N.children)!=null&&A.length&&N.children.forEach(V=>{var K;((K=V.type)==null?void 0:K.name)==="WpicTableColumn"&&Y.push(V)})}),m.value=Y.map(N=>{let x=N.children,A=N.props||{},{field:V,label:K,help:Q,width:$,minWidth:F,maxWidth:D,sortable:ee,selectable:q,render:P,type:X,align:he,visible:le,noPadding:pe}=H(N.type.props,A);return V||(V=L(K)),q&&le&&g.value.push(V),{label:K,help:Q,width:$,minWidth:F,maxWidth:D,type:X,align:he,sortable:ee,selectable:q,field:V,render:P,children:x,visible:le,noPadding:pe}})}function v(H){var W,N;let Y=(W=r.sortOptions)==null?void 0:W.sortDirection;((N=r.sortOptions)==null?void 0:N.sortBy)===H&&(Y=Y==="asc"?"desc":"asc"),f("changeSort",{sortDirection:Y,sortBy:H})}a.watch(()=>p.default,H=>{b()},{deep:!0});const M=a.reactive({});function k({index:H,item:Y}){M[H]?M[H]=null:(M[H]=!0,f("expandRow",{index:H,item:Y}))}const O=a.ref([]);function C(H){const Y=T(H,r.itemId);O.value.includes(Y)?(O.value.splice(O.value.indexOf(Y),1),B.value=!1):O.value.push(Y)}const B=a.ref(!1);function I(){if(B.value=!B.value,O.value=[],B.value)for(let H of r.data){let Y=T(H,r.itemId);O.value.push(Y)}}function _(){B.value=!1,O.value=[]}e({buildColumns:b,selectedRows:O,selectedColumns:g,resetSelectedRows:_});function T(H,Y){return Y.split(".").reduce((W,N)=>W?W[N]:void 0,H)}function L(H){return!H||typeof H!="string"?"":H.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(H,Y)=>{const W=a.resolveComponent("wpic-choice-list"),N=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",Rv,[H.$slots.header||H.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",zv,[a.createElementVNode("div",jv,[a.renderSlot(H.$slots,"header")]),a.createElementVNode("div",Fv,[a.renderSlot(H.$slots,"actions"),a.createVNode(W,{multiple:"",modelValue:g.value,"onUpdate:modelValue":Y[0]||(Y[0]=x=>g.value=x),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(x=>x.selectable).map(x=>({label:x.label,value:x.field}))},{default:a.withCtx(()=>[a.createVNode(Pr,{medium:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(Pv,{class:"w-5 h-5 mr-2"}),a.createTextVNode(" Columns ")]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",Hv,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",Wv)):a.createCommentVNode("",!0),y.value.find(x=>x.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(x=>x.type=="expand").minWidth}px`}),width:y.value.find(x=>x.type=="expand").width,class:"w-16"},null,12,Uv)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(x=>x.type!="expand"),(x,A)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${x.minWidth}px`,maxWidth:`${x.maxWidth}px`}),width:x.width,key:A},null,12,qv))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},[a.createElementVNode("div",Kv,[a.createVNode(N,{slim:"","hide-error":"",checkbox:"",modelValue:B.value,"onUpdate:modelValue":I},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(x=>x.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(x=>x.type!="expand"),(x,A)=>{var V,K;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(ne).theme]}`]:!0,"sticky top-0 left-0":A===0}]),style:a.normalizeStyle({maxWidth:`${x.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{x.sortable&&v(x.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":x.sortable&&x.field,"justify-center":x.align=="center","justify-end":x.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":x.align=="right"}])},a.toDisplayString(x.label),3),x.sortable&&x.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":x.field!=((V=t.sortOptions)==null?void 0:V.sortBy)}])},[a.createVNode(Mv,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((K=t.sortOptions)==null?void 0:K.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,Yv)],6)}),256))])],2)),a.createElementVNode("tbody",Jv,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(ne).theme]]])},[a.createVNode(Jn,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",Gv,Zv))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(od,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(x,A)=>{var V,K,Q,$,F;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${A}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":A%2==0,"is-even":A%2!=0,[s[a.unref(ne).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}])},[a.createElementVNode("div",Xv,[a.createVNode(N,{slim:"","hide-error":"",checkbox:"",modelValue:O.value.includes(T(x,t.itemId)),checkboxValue:T(x,t.itemId),"onUpdate:modelValue":D=>C(x)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(D=>D.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Pr,{small:"",square:"",onClick:D=>k({item:x,index:A})},{default:a.withCtx(()=>[M[A]?(a.openBlock(),a.createBlock(ww,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(Vv,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(D=>D.type!="expand"),(D,ee)=>{var q,P;return a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":ee===0,[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!D.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":A===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(X=>X.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":A===((P=t.data)==null?void 0:P.length)-1&&!t.totalItem&&!y.value.find(X=>X.type=="expand")&&!t.noRadius,"text-center justify-center":D.align=="center","text-right justify-end":D.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${D.maxWidth}px`}),id:`${A}_${ee}`,column:D,item:x,rowIndex:A,key:ee},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(D=>D.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(ne).theme]]:!t.stripe,[l[a.unref(ne).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(Yi,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(ne).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((V=y.value.find(D=>D.type=="expand"))!=null&&V.noPadding),"p-0":(K=y.value.find(D=>D.type=="expand"))==null?void 0:K.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":A===((Q=t.data)==null?void 0:Q.length)-1&&!t.totalItem,"first:rounded-bl-lg":A===(($=t.data)==null?void 0:$.length)-1&&!t.totalItem,"text-center":y.value.find(D=>D.type=="expand").align=="center","text-right":y.value.find(D=>D.type=="expand").align=="right"}]),column:y.value.find(D=>D.type=="expand"),rowIndex:A,colspan:(F=y.value)==null?void 0:F.length,item:x},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,M[A]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",Qv,[a.createVNode(od,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",e5," No Data ")):a.createCommentVNode("",!0)],2)])}}}),n5={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new De(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new De(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function sd(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=sd(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ld(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=ld(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class z{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new z(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new z(r,i)}cutByIndex(e,n){return e==n?z.empty:e==0&&n==this.content.length?this:new z(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new z(i,o)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return sd(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ld(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ji(0,e);if(e==this.size)return Ji(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ji(r+1,s):Ji(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new z(n||e,r)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const Ms={index:0,offset:0};function Ji(t,e){return Ms.index=t,Ms.offset=e,Ms}function Gi(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Gi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Gi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ye=class aa{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return aa.none;if(e instanceof aa)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ye.none=[];class Zi extends Error{}class J{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cd(this.content,e+this.openStart,n);return r&&new J(r,this.openStart,this.openEnd)}removeBetween(e,n){return new J(ad(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return J.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new J(z.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new J(e,r,i)}}J.empty=new J(z.empty,0,0);function ad(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ad(o.content,e-i-1,n-i-1)))}function cd(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=cd(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function r5(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return dd(t,e,n,0)}function dd(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=dd(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return $n(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=i5(n,t);return $n(o,fd(t,s,l,e,r))}else return $n(o,Xi(t,e,r))}function ud(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return ud(r,e.node(n)),r}function Tn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Zr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Tn(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Tn(i.child(l),r);e&&e.depth==n&&e.textOffset&&Tn(e.nodeBefore,r)}function $n(t,e){return t.type.checkContent(e),t.copy(e)}function fd(t,e,n,r,i){let o=t.depth>i&&Ts(t,e,i+1),s=r.depth>i&&Ts(n,r,i+1),l=[];return Zr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(ud(o,s),Tn($n(o,fd(t,e,n,r,i+1)),l)):(o&&Tn($n(o,Xi(t,e,i+1)),l),Zr(e,n,i,l),s&&Tn($n(s,Xi(n,r,i+1)),l)),Zr(r,null,i,l),new z(l)}function Xi(t,e,n){let r=[];if(Zr(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);Tn($n(i,Xi(t,e,n+1)),r)}return Zr(e,null,n,r),new z(r)}function i5(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(z.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Qi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Xr(n,r,o)}static resolveCached(e,n){let r=hd.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else hd.set(e,r=new o5);let i=r.elts[r.i]=Xr.resolve(e,n);return r.i=(r.i+1)%s5,i}}class o5{constructor(){this.elts=[],this.i=0}}const s5=12,hd=new WeakMap;class Qi{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const l5=Object.create(null);let Qt=class ca{constructor(e,n,r,i=ye.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Gi(this.attrs,n||e.defaultAttrs||l5)&&ye.sameSet(this.marks,r||ye.none)}copy(e=null){return e==this.content?this:new ca(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ca(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return J.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new J(d,i.depth-s,o.depth-s)}replace(e,n,r){return r5(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Xr.resolveCached(this,e)}resolveNoCache(e){return Xr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),pd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=z.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=z.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Qt.prototype.text=void 0;class eo extends Qt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new eo(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function pd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new a5(e,n);if(r.next==null)return Nn.empty;let i=md(r);r.next&&r.err("Unexpected trailing text");let o=m5(p5(i));return g5(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return z.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
5
|
+
*/function Te(t){return typeof t=="function"}function fa(t){return t==null}const Jt=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Wo(t){return Number(t)>=0}function gp(t){const e=parseFloat(t);return isNaN(e)?t:e}function yp(t){return typeof t=="object"&&t!==null}function bp(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function ha(t){if(!yp(t)||bp(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ar(t,e){return Object.keys(e).forEach(n=>{if(ha(e[n])&&ha(t[n])){t[n]||(t[n]={}),Ar(t[n],e[n]);return}t[n]=e[n]}),t}function Vr(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Wo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const pa={};function yt(t,e){xp(t,e),pa[t]=e}function kp(t){return pa[t]}function xp(t,e){if(!Te(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function ma(t,e,n){typeof n.value=="object"&&(n.value=ge(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ge(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ge(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,l){i.set(ge(l),ge(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ge(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)ma(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||ma(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Dr=Symbol("vee-validate-form"),ga=Symbol("vee-validate-field-instance"),Mi=Symbol("Default empty value"),wp=typeof window<"u";function Uo(t){return Te(t)&&!!t.__locatorRef}function bt(t){return!!t&&Te(t.parse)&&t.__type==="VVTypedSchema"}function Ti(t){return!!t&&Te(t.validate)}function _r(t){return t==="checkbox"||t==="radio"}function vp(t){return Jt(t)||Array.isArray(t)}function Cp(t){return Array.isArray(t)?t.length===0:Jt(t)&&Object.keys(t).length===0}function $i(t){return/^\[.+\]$/i.test(t)}function Sp(t){return ya(t)&&t.multiple}function ya(t){return t.tagName==="SELECT"}function Ep(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function Op(t,e){return!Ep(t,e)&&e.type!=="file"&&!_r(e.type)}function ba(t){return qo(t)&&t.target&&"submit"in t.target}function qo(t){return t?!!(typeof Event<"u"&&Te(Event)&&t instanceof Event||t&&t.srcElement):!1}function ka(t,e){return e in t&&t[e]!==Mi}function je(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!je(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!je(r[1],e.get(r[0])))return!1;return!0}if(xa(t)&&xa(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!je(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function xa(t){return wp?t instanceof File:!1}function Ko(t){return $i(t)?t.replace(/\[|\]/gi,""):t}function qe(t,e,n){return t?$i(e)?t[Ko(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>vp(i)&&o in i?i[o]:n,t):n}function Lt(t,e,n){if($i(e)){t[Ko(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||fa(i[r[o]]))&&(i[r[o]]=Wo(r[o+1])?[]:{}),i=i[r[o]]}}function Yo(t,e){if(Array.isArray(t)&&Wo(e)){t.splice(Number(e),1);return}Jt(t)&&delete t[e]}function wa(t,e){if($i(e)){delete t[Ko(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){Yo(r,n[o]);break}if(!(n[o]in r)||fa(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>qe(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Cp(i[o])){if(o===0){Yo(t,n[0]);continue}Yo(i[o-1],n[o-1])}}function Ke(t){return Object.keys(t)}function Jo(t,e=void 0){const n=a.getCurrentInstance();return(n==null?void 0:n.provides[t])||a.inject(t,e)}function va(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>je(o,e));return i>=0?r.splice(i,1):r.push(e),r}return je(t,e)?n:e}function Mp(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function Ca(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function Tp(t,e){return Jt(e)&&e.number?gp(t):t}function Go(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Zo(t){return Array.isArray(t)?t:t?[t]:[]}function Ni(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function $p(t){let e=null,n=[];return function(...r){const i=a.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Xo(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function Qo(t){if(Sa(t))return t._value}function Sa(t){return"_value"in t}function Np(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Bi(t){if(!qo(t))return t;const e=t.target;if(_r(e.type)&&Sa(e))return Qo(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Sp(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Qo);if(ya(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Qo(n):e.value}return Np(e)}function Ea(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Jt(t)&&t._$$isNormalized?t:Jt(t)?Object.keys(t).reduce((n,r)=>{const i=Bp(t[r]);return t[r]!==!1&&(n[r]=Oa(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Ap(r);return i.name&&(n[i.name]=Oa(i.params)),n},e):e}function Bp(t){return t===!0?[]:Array.isArray(t)||Jt(t)?t:[t]}function Oa(t){const e=n=>typeof n=="string"&&n[0]==="@"?Vp(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const Ap=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Vp(t){const e=n=>qe(n,t)||n[t];return e.__locatorRef=t,e}function Dp(t){return Array.isArray(t)?t.filter(Uo):Ke(t).filter(e=>Uo(t[e])).map(e=>t[e])}let _p=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const wn=()=>_p;async function Ma(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await Lp(i,t)).errors;return{errors:s,valid:!s.length}}async function Lp(t,e){if(bt(t.rules)||Ti(t.rules))return Pp(e,t.rules);if(Te(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},l=Array.isArray(t.rules)?t.rules:[t.rules],c=l.length,d=[];for(let u=0;u<c;u++){const f=l[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:$a(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Ea(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const l=i[s],c=await Rp(n,e,{name:l,params:n.rules[l]});if(c.error&&(r.push(c.error),t.bails))return{errors:r}}return{errors:r}}function Ip(t){return!!t&&t.name==="ValidationError"}function Ta(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Ip(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,l)=>{const c=l.path||"";return s[c]||(s[c]={errors:[],path:c}),s[c].errors.push(...l.errors),s},{});return{errors:Object.values(o)}}}}}async function Pp(t,e){const r=await(bt(e)?e:Ta(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function Rp(t,e,n){const r=kp(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=zp(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:$a(o)}}function $a(t){const e=wn().generateMessage;return e?e(t):"Field is invalid"}function zp(t,e){const n=r=>Uo(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function jp(t,e){const r=await(bt(t)?t:Ta(t)).parse(ge(e)),i={},o={};for(const s of r.errors){const l=s.errors,c=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[c]={valid:!l.length,errors:l},l.length&&(o[c]=l[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function Fp(t,e,n){const i=Ke(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Ma(qe(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),l={},c={};for(const d of s)l[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,c[d.path]=d.errors[0]);return{valid:o,results:l,errors:c}}let Na=0;function Hp(t,e){const{value:n,initialValue:r,setInitialValue:i}=Wp(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:c,setErrors:d}=Kp(),u=Na>=Number.MAX_SAFE_INTEGER?0:++Na,f=qp(n,r,c,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:c,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=a.computed(()=>o.errors);function l(c){var d,u,f;"value"in c&&(n.value=c.value),"errors"in c&&((d=e.form)===null||d===void 0||d.setFieldError(a.unref(t),c.errors)),"touched"in c&&((u=e.form)===null||u===void 0||u.setFieldTouched(a.unref(t),(f=c.touched)!==null&&f!==void 0?f:!1)),"initialValue"in c&&i(c.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:l}}function Wp(t,e,n){const r=a.ref(a.unref(e));function i(){return n?qe(n.initialValues.value,a.unref(t),a.unref(r)):a.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(a.unref(t),d,!0)}const s=a.computed(i);if(!n)return{value:a.ref(i()),initialValue:s,setInitialValue:o};const l=Up(e,n,s,t);return n.stageInitialValue(a.unref(t),l,!0),{value:a.computed({get(){return qe(n.values,a.unref(t))},set(d){n.setFieldValue(a.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function Up(t,e,n,r){return a.isRef(t)?a.unref(t):t!==void 0?t:qe(e.values,a.unref(r),a.unref(n))}function qp(t,e,n,r){const i=a.computed(()=>{var s,l,c;return(c=(l=(s=a.toValue(r))===null||s===void 0?void 0:s.describe)===null||l===void 0?void 0:l.call(s).required)!==null&&c!==void 0?c:!1}),o=a.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!a.unref(n).length,initialValue:a.computed(()=>a.unref(e)),dirty:a.computed(()=>!je(a.unref(t),a.unref(e)))});return a.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function Kp(){const t=a.ref([]);return{errors:t,setErrors:e=>{t.value=Zo(e)}}}function Ba(t){process.env.NODE_ENV!=="production"&&mp({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},Gp)}const Lr={},Ir={};let It;const Kn=Mp(()=>{setTimeout(async()=>{await a.nextTick(),It==null||It.sendInspectorState(Yn),It==null||It.sendInspectorTree(Yn)},100)},100);function Yp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Lr[t.formId]=Object.assign({},t),Lr[t.formId]._vm=e,a.onUnmounted(()=>{delete Lr[t.formId],Kn()}),Kn()}function Jp(t){const e=a.getCurrentInstance();if(!It){const n=e==null?void 0:e.appContext.app;if(!n)return;Ba(n)}Ir[t.id]=Object.assign({},t),Ir[t.id]._vm=e,a.onUnmounted(()=>{delete Ir[t.id],Kn()}),Kn()}const Yn="vee-validate-inspector",Ye={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ce=null;function Gp(t){It=t,t.addInspector({id:Yn,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){await Ce.field.validate();return}if(Ce.type==="form"){await Ce.form.validate();return}Ce.type==="pathState"&&await Ce.form.validateField(Ce.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){Ce.field.resetField();return}Ce.type==="form"&&Ce.form.resetForm(),Ce.type==="pathState"&&Ce.form.resetField(Ce.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Yn)return;const n=Object.values(Lr),r=Object.values(Ir);e.rootNodes=[...n.map(Zp),...r.map(i=>Qp(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Yn||n.currentTab!==`custom-inspector:${Yn}`)return;const{form:r,field:i,state:o,type:s}=em(e.nodeId);if(r&&s==="form"){e.state=tm(r),Ce={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Va(o),Ce={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Va({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),Ce={field:i,type:"field"};return}Ce=null})}function Zp(t){const{textColor:e,bgColor:n}=Da(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{Lt(r,a.unref(s.path),Xp(s,t))});function i(s,l=[]){const c=[...l].pop();return"id"in s?Object.assign(Object.assign({},s),{label:c||s.label}):Jt(s)?{id:`${l.join(".")}`,label:c||"",children:Object.keys(s).map(d=>i(s[d],[...l,d]))}:Array.isArray(s)?{id:`${l.join(".")}`,label:`${c}[]`,children:s.map((d,u)=>i(d,[...l,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:es(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:Ye.white,backgroundColor:Ye.unknown}]}}function Xp(t,e){return{id:es(e,t),label:a.unref(t.path),tags:Aa(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Qp(t,e){return{id:es(e,t),label:a.unref(t.name),tags:Aa(!1,1,t.type,t.meta.valid,e)}}function Aa(t,e,n,r,i){const{textColor:o,bgColor:s}=Da(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:Ye.black,backgroundColor:Ye.gray},n==="checkbox"?{label:"Checkbox",textColor:Ye.white,backgroundColor:Ye.blue}:void 0,n==="radio"?{label:"Radio",textColor:Ye.white,backgroundColor:Ye.purple}:void 0,t?{label:"Multiple",textColor:Ye.black,backgroundColor:Ye.orange}:void 0].filter(Boolean)}function es(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:a.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function em(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Lr[e.f];if(!n&&e.ff){const i=Ir[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Va(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function tm(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:Ke(e.value).reduce((l,c)=>{var d;const u=(d=e.value[c])===null||d===void 0?void 0:d[0];return u&&(l[c]=u),l},{})}]}}function Da(t){return{bgColor:t?Ye.success:Ye.error,textColor:t?Ye.black:Ye.white}}function nm(t,e,n){return _r(n==null?void 0:n.type)?im(t,e,n):_a(t,e,n)}function _a(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:l,label:c,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=rm(n),g=f?Jo(Dr):void 0,y=m||g,b=a.computed(()=>Vr(a.toValue(t))),v=a.computed(()=>{if(a.toValue(y==null?void 0:y.schema))return;const X=a.unref(e);return Ti(X)||bt(X)||Te(X)||Array.isArray(X)?X:Ea(X)}),M=!Te(v.value)&&bt(a.toValue(e)),{id:k,value:O,initialValue:C,meta:B,setState:I,errors:_,flags:T}=Hp(b,{modelValue:r,form:y,bails:o,label:c,type:s,validate:v.value?x:void 0,schema:M?e:void 0}),L=a.computed(()=>_.value[0]);p&&om({value:O,prop:p,handleChange:A,shouldValidate:()=>d&&!T.pendingReset});const H=(P,X=!1)=>{B.touched=!0,X&&W()};async function Y(P){var X,he;if(y!=null&&y.validateSchema){const{results:le}=await y.validateSchema(P);return(X=le[a.toValue(b)])!==null&&X!==void 0?X:{valid:!0,errors:[]}}return v.value?Ma(O.value,v.value,{name:a.toValue(b),label:a.toValue(c),values:(he=y==null?void 0:y.values)!==null&&he!==void 0?he:{},bails:o}):{valid:!0,errors:[]}}const W=Go(async()=>(B.pending=!0,B.validated=!0,Y("validated-only")),P=>(T.pendingUnmount[ee.id]||(I({errors:P.errors}),B.pending=!1,B.valid=P.valid),P)),N=Go(async()=>Y("silent"),P=>(B.valid=P.valid,P));function x(P){return(P==null?void 0:P.mode)==="silent"?N():W()}function A(P,X=!0){const he=Bi(P);$(he,X)}a.onMounted(()=>{if(i)return W();(!y||!y.validateSchema)&&N()});function V(P){B.touched=P}function K(P){var X;const he=P&&"value"in P?P.value:C.value;I({value:ge(he),initialValue:ge(he),touched:(X=P==null?void 0:P.touched)!==null&&X!==void 0?X:!1,errors:(P==null?void 0:P.errors)||[]}),B.pending=!1,B.validated=!1,N()}const Q=a.getCurrentInstance();function $(P,X=!0){O.value=Q&&p?Tp(P,Q.props.modelModifiers):P,(X?W:N)()}function F(P){I({errors:Array.isArray(P)?P:[P]})}const D=a.computed({get(){return O.value},set(P){$(P,d)}}),ee={id:k,name:b,label:c,value:D,meta:B,errors:_,errorMessage:L,type:s,checkedValue:l,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:K,handleReset:()=>K(),validate:x,handleChange:A,handleBlur:H,setState:I,setTouched:V,setErrors:F,setValue:$};if(a.provide(ga,ee),a.isRef(e)&&typeof a.unref(e)!="function"&&a.watch(e,(P,X)=>{je(P,X)||(B.validated?W():N())},{deep:!0}),process.env.NODE_ENV!=="production"&&(ee._vm=a.getCurrentInstance(),a.watch(()=>Object.assign(Object.assign({errors:_.value},B),{value:O.value}),Kn,{deep:!0}),y||Jp(ee)),!y)return ee;const q=a.computed(()=>{const P=v.value;return!P||Te(P)||Ti(P)||bt(P)||Array.isArray(P)?{}:Object.keys(P).reduce((X,he)=>{const le=Dp(P[he]).map(pe=>pe.__locatorRef).reduce((pe,be)=>{const Me=qe(y.values,be)||y.values[be];return Me!==void 0&&(pe[be]=Me),pe},{});return Object.assign(X,le),X},{})});return a.watch(q,(P,X)=>{if(!Object.keys(P).length)return;!je(P,X)&&(B.validated?W():N())}),a.onBeforeUnmount(()=>{var P;const X=(P=a.toValue(ee.keepValueOnUnmount))!==null&&P!==void 0?P:a.toValue(y.keepValuesOnUnmount),he=a.toValue(b);if(X||!y||T.pendingUnmount[ee.id]){y==null||y.removePathState(he,k);return}T.pendingUnmount[ee.id]=!0;const le=y.getPathState(he);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(ee.id):(le==null?void 0:le.id)===ee.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const be=le.value.findIndex(Me=>je(Me,a.toValue(ee.checkedValue)));if(be>-1){const Me=[...le.value];Me.splice(be,1),y.setFieldValue(he,Me)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(ee.id),1)}else y.unsetPathValue(a.toValue(b));y.removePathState(he,k)}}),ee}function rm(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?ts(a.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,l=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:l})}function im(t,e,n){const r=n!=null&&n.standalone?void 0:Jo(Dr),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(l){const c=l.handleChange,d=a.computed(()=>{const f=a.toValue(l.value),h=a.toValue(i);return Array.isArray(f)?f.findIndex(p=>je(p,h))>=0:je(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&l.validate();return}const g=a.toValue(t),y=r==null?void 0:r.getPathState(g),b=Bi(f);let v=(m=a.toValue(i))!==null&&m!==void 0?m:b;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?v=va(qe(r.values,g)||[],v,void 0):(n==null?void 0:n.type)==="checkbox"&&(v=va(a.toValue(l.value),v,a.toValue(o))),c(v,h)}return Object.assign(Object.assign({},l),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(_a(t,e,n))}function om({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=a.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(a.watch(e,l=>{je(l,ts(i,o))||i.emit(s,l)}),a.watch(()=>ts(i,o),l=>{if(l===Mi&&e.value===void 0)return;const c=l===Mi?void 0:l;je(c,e.value)||n(c,r())}))}function ts(t,e){if(t)return t.props[e]}const sm=a.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>wn().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Mi},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=a.toRef(t,"rules"),r=a.toRef(t,"name"),i=a.toRef(t,"label"),o=a.toRef(t,"uncheckedValue"),s=a.toRef(t,"keepValue"),{errors:l,value:c,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:b,setErrors:v}=nm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:am(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),M=function(_,T=!0){f(_,T)},k=a.computed(()=>{const{validateOnInput:I,validateOnChange:_,validateOnBlur:T,validateOnModelUpdate:L}=lm(t);function H(x){h(x,T),Te(e.attrs.onBlur)&&e.attrs.onBlur(x)}function Y(x){M(x,I),Te(e.attrs.onInput)&&e.attrs.onInput(x)}function W(x){M(x,_),Te(e.attrs.onChange)&&e.attrs.onChange(x)}const N={name:t.name,onBlur:H,onInput:Y,onChange:W};return N["onUpdate:modelValue"]=x=>M(x,L),N}),O=a.computed(()=>{const I=Object.assign({},k.value);_r(e.attrs.type)&&b&&(I.checked=b.value);const _=La(t,e);return Op(_,e.attrs)&&(I.value=c.value),I}),C=a.computed(()=>Object.assign(Object.assign({},k.value),{modelValue:c.value}));function B(){return{field:O.value,componentField:C.value,value:c.value,meta:y,errors:l.value,errorMessage:d.value,validate:u,resetField:m,handleChange:M,handleInput:I=>M(I,!1),handleReset:g,handleBlur:k.value.onBlur,setTouched:p,setErrors:v}}return e.expose({value:c,meta:y,errors:l,errorMessage:d,setErrors:v,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const I=a.resolveDynamicComponent(La(t,e)),_=Xo(I,e,B);return I?a.h(I,Object.assign(Object.assign({},e.attrs),O.value),_):_}}});function La(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function lm(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:l,validateOnModelUpdate:c}=wn();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:l,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:c}}function am(t,e){return _r(e.attrs.type)?ka(t,"modelValue")?t.modelValue:void 0:ka(t,"modelValue")?t.modelValue:e.attrs.value}const vn=sm;let cm=0;const Ai=["bails","fieldsCount","id","multiple","type","validate"];function Ia(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},a.toValue(e)),r=a.unref(t==null?void 0:t.validationSchema);return r&&bt(r)&&Te(r.cast)?ge(r.cast(n)||{}):ge(n)}function dm(t){var e;const n=cm++;let r=0;const i=a.ref(!1),o=a.ref(!1),s=a.ref(0),l=[],c=a.reactive(Ia(t)),d=a.ref([]),u=a.ref({}),f=a.ref({}),h=$p(()=>{f.value=d.value.reduce((E,S)=>(E[Vr(a.toValue(S.path))]=S,E),{})});function p(E,S){const R=x(E);if(!R){typeof E=="string"&&(u.value[Vr(E)]=Zo(S));return}if(typeof E=="string"){const G=Vr(E);u.value[G]&&delete u.value[G]}R.errors=Zo(S),R.valid=!R.errors.length}function m(E){Ke(E).forEach(S=>{p(S,E[S])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=a.computed(()=>{const E=d.value.reduce((S,R)=>(R.errors.length&&(S[R.path]=R.errors),S),{});return Object.assign(Object.assign({},u.value),E)}),y=a.computed(()=>Ke(g.value).reduce((E,S)=>{const R=g.value[S];return R!=null&&R.length&&(E[S]=R[0]),E},{})),b=a.computed(()=>d.value.reduce((E,S)=>(E[S.path]={name:S.path||"",label:S.label||""},E),{})),v=a.computed(()=>d.value.reduce((E,S)=>{var R;return E[S.path]=(R=S.bails)!==null&&R!==void 0?R:!0,E},{})),M=Object.assign({},(t==null?void 0:t.initialErrors)||{}),k=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:O,originalInitialValues:C,setInitialValues:B}=fm(d,c,t),I=um(d,c,C,y),_=a.computed(()=>d.value.reduce((E,S)=>{const R=qe(c,S.path);return Lt(E,S.path,R),E},{})),T=t==null?void 0:t.validationSchema;function L(E,S){var R,G;const oe=a.computed(()=>qe(O.value,a.toValue(E))),w=f.value[a.toValue(E)],U=(S==null?void 0:S.type)==="checkbox"||(S==null?void 0:S.type)==="radio";if(w&&U){w.multiple=!0;const Ue=r++;return Array.isArray(w.id)?w.id.push(Ue):w.id=[w.id,Ue],w.fieldsCount++,w.__flags.pendingUnmount[Ue]=!1,w}const Z=a.computed(()=>qe(c,a.toValue(E))),ie=a.toValue(E),se=V.findIndex(Ue=>Ue===ie);se!==-1&&V.splice(se,1);const de=a.computed(()=>{var Ue,st,Un,xn;const _t=a.toValue(T);if(bt(_t))return(st=(Ue=_t.describe)===null||Ue===void 0?void 0:Ue.call(_t,a.toValue(E)).required)!==null&&st!==void 0?st:!1;const Oi=a.toValue(S==null?void 0:S.schema);return bt(Oi)&&(xn=(Un=Oi.describe)===null||Un===void 0?void 0:Un.call(Oi).required)!==null&&xn!==void 0?xn:!1}),me=r++,ve=a.reactive({id:me,path:E,touched:!1,pending:!1,valid:!0,validated:!!(!((R=M[ie])===null||R===void 0)&&R.length),required:de,initialValue:oe,errors:a.shallowRef([]),bails:(G=S==null?void 0:S.bails)!==null&&G!==void 0?G:!1,label:S==null?void 0:S.label,type:(S==null?void 0:S.type)||"default",value:Z,multiple:!1,__flags:{pendingUnmount:{[me]:!1},pendingReset:!1},fieldsCount:1,validate:S==null?void 0:S.validate,dirty:a.computed(()=>!je(a.unref(Z),a.unref(oe)))});return d.value.push(ve),f.value[ie]=ve,h(),y.value[ie]&&!M[ie]&&a.nextTick(()=>{mt(ie,{mode:"silent"})}),a.isRef(E)&&a.watch(E,Ue=>{h();const st=ge(Z.value);f.value[Ue]=ve,a.nextTick(()=>{Lt(c,Ue,st)})}),ve}const H=Ca(Dt,5),Y=Ca(Dt,5),W=Go(async E=>await(E==="silent"?H():Y()),(E,[S])=>{const R=Ke(P.errorBag.value),oe=[...new Set([...Ke(E.results),...d.value.map(w=>w.path),...R])].sort().reduce((w,U)=>{var Z;const ie=U,se=x(ie)||A(ie),de=((Z=E.results[ie])===null||Z===void 0?void 0:Z.errors)||[],me=a.toValue(se==null?void 0:se.path)||ie,ve=hm({errors:de,valid:!de.length},w.results[me]);return w.results[me]=ve,ve.valid||(w.errors[me]=ve.errors[0]),se&&u.value[me]&&delete u.value[me],se?(se.valid=ve.valid,S==="silent"||S==="validated-only"&&!se.validated||p(se,ve.errors),w):(p(me,de),w)},{valid:E.valid,results:{},errors:{}});return E.values&&(oe.values=E.values),Ke(oe.results).forEach(w=>{var U;const Z=x(w);Z&&S!=="silent"&&(S==="validated-only"&&!Z.validated||p(Z,(U=oe.results[w])===null||U===void 0?void 0:U.errors))}),oe});function N(E){d.value.forEach(E)}function x(E){const S=typeof E=="string"?Vr(E):E;return typeof S=="string"?f.value[S]:S}function A(E){return d.value.filter(R=>E.startsWith(R.path)).reduce((R,G)=>R?G.path.length>R.path.length?G:R:G,void 0)}let V=[],K;function Q(E){return V.push(E),K||(K=a.nextTick(()=>{[...V].sort().reverse().forEach(R=>{wa(c,R)}),V=[],K=null})),K}function $(E){return function(R,G){return function(w){return w instanceof Event&&(w.preventDefault(),w.stopPropagation()),N(U=>U.touched=!0),i.value=!0,s.value++,vt().then(U=>{const Z=ge(c);if(U.valid&&typeof R=="function"){const ie=ge(_.value);let se=E?ie:Z;return U.values&&(se=U.values),R(se,{evt:w,controlledValues:ie,setErrors:m,setFieldError:p,setTouched:yn,setFieldTouched:be,setValues:le,setFieldValue:X,resetForm:qt,resetField:bn})}!U.valid&&typeof G=="function"&&G({values:Z,evt:w,errors:U.errors,results:U.results})}).then(U=>(i.value=!1,U),U=>{throw i.value=!1,U})}}}const D=$(!1);D.withControlled=$(!0);function ee(E,S){const R=d.value.findIndex(oe=>oe.path===E&&(Array.isArray(oe.id)?oe.id.includes(S):oe.id===S)),G=d.value[R];if(!(R===-1||!G)){if(a.nextTick(()=>{mt(E,{mode:"silent",warn:!1})}),G.multiple&&G.fieldsCount&&G.fieldsCount--,Array.isArray(G.id)){const oe=G.id.indexOf(S);oe>=0&&G.id.splice(oe,1),delete G.__flags.pendingUnmount[S]}(!G.multiple||G.fieldsCount<=0)&&(d.value.splice(R,1),gt(E),h(),delete f.value[E])}}function q(E){Ke(f.value).forEach(S=>{S.startsWith(E)&&delete f.value[S]}),d.value=d.value.filter(S=>!S.path.startsWith(E)),a.nextTick(()=>{h()})}const P={formId:n,values:c,controlledValues:_,errorBag:g,errors:y,schema:T,submitCount:s,meta:I,isSubmitting:i,isValidating:o,fieldArrays:l,keepValuesOnUnmount:k,validateSchema:a.unref(T)?W:void 0,validate:vt,setFieldError:p,validateField:mt,setFieldValue:X,setValues:le,setErrors:m,setFieldTouched:be,setTouched:yn,resetForm:qt,resetField:bn,handleSubmit:D,useFieldModel:$r,defineInputBinds:Nr,defineComponentBinds:Br,defineField:kn,stageInitialValue:Vt,unsetInitialValue:gt,setFieldInitialValue:Kt,createPathState:L,getPathState:x,unsetPathValue:Q,removePathState:ee,initialValues:O,getAllPathStates:()=>d.value,destroyPath:q,isFieldTouched:Me,isFieldDirty:pt,isFieldValid:Tr};function X(E,S,R=!0){const G=ge(S),oe=typeof E=="string"?E:E.path;x(oe)||L(oe),Lt(c,oe,G),R&&mt(oe)}function he(E,S=!0){Ke(c).forEach(R=>{delete c[R]}),Ke(E).forEach(R=>{X(R,E[R],!1)}),S&&vt()}function le(E,S=!0){Ar(c,E),l.forEach(R=>R&&R.reset()),S&&vt()}function pe(E,S){const R=x(a.toValue(E))||L(E);return a.computed({get(){return R.value},set(G){var oe;const w=a.toValue(E);X(w,G,(oe=a.toValue(S))!==null&&oe!==void 0?oe:!1)}})}function be(E,S){const R=x(E);R&&(R.touched=S)}function Me(E){const S=x(E);return S?S.touched:d.value.filter(R=>R.path.startsWith(E)).some(R=>R.touched)}function pt(E){const S=x(E);return S?S.dirty:d.value.filter(R=>R.path.startsWith(E)).some(R=>R.dirty)}function Tr(E){const S=x(E);return S?S.valid:d.value.filter(R=>R.path.startsWith(E)).every(R=>R.valid)}function yn(E){if(typeof E=="boolean"){N(S=>{S.touched=E});return}Ke(E).forEach(S=>{be(S,!!E[S])})}function bn(E,S){var R;const G=S&&"value"in S?S.value:qe(O.value,E),oe=x(E);oe&&(oe.__flags.pendingReset=!0),Kt(E,ge(G),!0),X(E,G,!1),be(E,(R=S==null?void 0:S.touched)!==null&&R!==void 0?R:!1),p(E,(S==null?void 0:S.errors)||[]),a.nextTick(()=>{oe&&(oe.__flags.pendingReset=!1)})}function qt(E,S){let R=ge(E!=null&&E.values?E.values:C.value);R=S!=null&&S.force?R:Ar(C.value,R),R=bt(T)&&Te(T.cast)?T.cast(R):R,B(R),N(G=>{var oe;G.__flags.pendingReset=!0,G.validated=!1,G.touched=((oe=E==null?void 0:E.touched)===null||oe===void 0?void 0:oe[G.path])||!1,X(G.path,qe(R,G.path),!1),p(G.path,void 0)}),S!=null&&S.force?he(R,!1):le(R,!1),m((E==null?void 0:E.errors)||{}),s.value=(E==null?void 0:E.submitCount)||0,a.nextTick(()=>{vt({mode:"silent"}),N(G=>{G.__flags.pendingReset=!1})})}async function vt(E){const S=(E==null?void 0:E.mode)||"force";if(S==="force"&&N(w=>w.validated=!0),P.validateSchema)return P.validateSchema(S);o.value=!0;const R=await Promise.all(d.value.map(w=>w.validate?w.validate(E).then(U=>({key:w.path,valid:U.valid,errors:U.errors})):Promise.resolve({key:w.path,valid:!0,errors:[]})));o.value=!1;const G={},oe={};for(const w of R)G[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(oe[w.key]=w.errors[0]);return{valid:R.every(w=>w.valid),results:G,errors:oe}}async function mt(E,S){var R;const G=x(E);if(G&&(S==null?void 0:S.mode)!=="silent"&&(G.validated=!0),T){const{results:w}=await W((S==null?void 0:S.mode)||"validated-only");return w[E]||{errors:[],valid:!0}}return G!=null&&G.validate?G.validate(S):(!G&&((R=S==null?void 0:S.warn)!==null&&R!==void 0?R:!0)&&process.env.NODE_ENV!=="production"&&a.warn(`field with path ${E} was not found`),Promise.resolve({errors:[],valid:!0}))}function gt(E){wa(O.value,E)}function Vt(E,S,R=!1){Kt(E,S),Lt(c,E,S),R&&!(t!=null&&t.initialValues)&&Lt(C.value,E,ge(S))}function Kt(E,S,R=!1){Lt(O.value,E,ge(S)),R&&Lt(C.value,E,ge(S))}async function Dt(){const E=a.unref(T);if(!E)return{valid:!0,results:{},errors:{}};o.value=!0;const S=Ti(E)||bt(E)?await jp(E,c):await Fp(E,c,{names:b.value,bailsMap:v.value});return o.value=!1,S}const Wn=D((E,{evt:S})=>{ba(S)&&S.target.submit()});a.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&yn(t.initialTouched),t!=null&&t.validateOnMount){vt();return}P.validateSchema&&P.validateSchema("silent")}),a.isRef(T)&&a.watch(T,()=>{var E;(E=P.validateSchema)===null||E===void 0||E.call(P,"validated-only")}),a.provide(Dr,P),process.env.NODE_ENV!=="production"&&(Yp(P),a.watch(()=>Object.assign(Object.assign({errors:g.value},I.value),{values:c,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Kn,{deep:!0}));function kn(E,S){const R=Te(S)||S==null?void 0:S.label,G=x(a.toValue(E))||L(E,{label:R}),oe=()=>Te(S)?S(Ni(G,Ai)):S||{};function w(){var de;G.touched=!0,((de=oe().validateOnBlur)!==null&&de!==void 0?de:wn().validateOnBlur)&&mt(G.path)}function U(){var de;((de=oe().validateOnInput)!==null&&de!==void 0?de:wn().validateOnInput)&&a.nextTick(()=>{mt(G.path)})}function Z(){var de;((de=oe().validateOnChange)!==null&&de!==void 0?de:wn().validateOnChange)&&a.nextTick(()=>{mt(G.path)})}const ie=a.computed(()=>{const de={onChange:Z,onInput:U,onBlur:w};return Te(S)?Object.assign(Object.assign({},de),S(Ni(G,Ai)).props||{}):S!=null&&S.props?Object.assign(Object.assign({},de),S.props(Ni(G,Ai))):de});return[pe(E,()=>{var de,me,ve;return(ve=(de=oe().validateOnModelUpdate)!==null&&de!==void 0?de:(me=wn())===null||me===void 0?void 0:me.validateOnModelUpdate)!==null&&ve!==void 0?ve:!0}),ie]}function $r(E){return Array.isArray(E)?E.map(S=>pe(S,!0)):pe(E)}function Nr(E,S){const[R,G]=kn(E,S);function oe(){G.value.onBlur()}function w(Z){const ie=Bi(Z);X(a.toValue(E),ie,!1),G.value.onInput()}function U(Z){const ie=Bi(Z);X(a.toValue(E),ie,!1),G.value.onChange()}return a.computed(()=>Object.assign(Object.assign({},G.value),{onBlur:oe,onInput:w,onChange:U,value:R.value}))}function Br(E,S){const[R,G]=kn(E,S),oe=x(a.toValue(E));function w(U){R.value=U}return a.computed(()=>{const U=Te(S)?S(Ni(oe,Ai)):S||{};return Object.assign({[U.model||"modelValue"]:R.value,[`onUpdate:${U.model||"modelValue"}`]:w},G.value)})}return Object.assign(Object.assign({},P),{values:a.readonly(c),handleReset:()=>qt(),submitForm:Wn})}function um(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=a.computed(()=>!je(e,a.unref(n)));function s(){const c=t.value;return Ke(i).reduce((d,u)=>{const f=i[u];return d[u]=c[f](h=>h[u]),d},{})}const l=a.reactive(s());return a.watchEffect(()=>{const c=s();l.touched=c.touched,l.valid=c.valid,l.pending=c.pending}),a.computed(()=>Object.assign(Object.assign({initialValues:a.unref(n)},l),{valid:l.valid&&!Ke(r.value).length,dirty:o.value}))}function fm(t,e,n){const r=Ia(n),i=a.ref(r),o=a.ref(ge(r));function s(l,c=!1){i.value=Ar(ge(i.value)||{},ge(l)),o.value=Ar(ge(o.value)||{},ge(l)),c&&t.value.forEach(d=>{if(d.touched)return;const f=qe(i.value,d.path);Lt(e,d.path,ge(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function hm(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const pm=a.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=a.toRef(t,"validationSchema"),r=a.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:l,isSubmitting:c,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:b,setFieldError:v,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetField:B}=dm({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),I=y((x,{evt:A})=>{ba(A)&&A.target.submit()},t.onInvalidSubmit),_=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):I;function T(x){qo(x)&&x.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function L(x,A){return y(typeof x=="function"&&!A?x:A,t.onInvalidSubmit)(x)}function H(){return ge(s)}function Y(){return ge(l.value)}function W(){return ge(i.value)}function N(){return{meta:l.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:c.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:L,handleReset:m,submitForm:I,setErrors:b,setFieldError:v,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetForm:g,resetField:B,getValues:H,getMeta:Y,getErrors:W}}return e.expose({setFieldError:v,setErrors:b,setFieldValue:M,setValues:k,setFieldTouched:O,setTouched:C,resetForm:g,validate:h,validateField:p,resetField:B,getValues:H,getMeta:Y,getErrors:W,values:s,meta:l,errors:i}),function(){const A=t.as==="form"?t.as:t.as?a.resolveDynamicComponent(t.as):null,V=Xo(A,e,N);if(!A)return V;const K=A==="form"?{novalidate:!0}:{};return a.h(A,Object.assign(Object.assign(Object.assign({},K),e.attrs),{onSubmit:_,onReset:T}),V)}}}),mm=a.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=a.inject(Dr,void 0),r=a.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?a.resolveDynamicComponent(t.as):t.as,s=Xo(o,e,i),l=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?a.h(o||"span",l,r.value):a.h(o,l,s)}}});function gm(t){const e=Jo(Dr),n=t?void 0:a.inject(ga);return a.computed(()=>t?e==null?void 0:e.errors.value[a.toValue(t)]:n==null?void 0:n.errorMessage.value)}yt("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),yt("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),yt("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),yt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),yt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),yt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),yt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),yt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),yt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),yt("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),yt("number",t=>parseFloat(t)?!0:"This field must be a number");const ae=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},ym={},bm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},km=[a.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function xm(t,e){return a.openBlock(),a.createElementBlock("svg",bm,km)}const wm=ae(ym,[["render",xm]]),vm={},Cm={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Sm=[a.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function Em(t,e){return a.openBlock(),a.createElementBlock("svg",Cm,Sm)}const Om=ae(vm,[["render",Em]]),Mm={class:"relative"},Jn=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",Mm,[a.createVNode(wm,{class:"absolute opacity-25"}),a.createVNode(Om,{class:a.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let ne={theme:"wpic-tools",popoverTarget:"body"};const Tm=["is","type","disabled"],$m={key:0,class:"absolute inset-0 flex justify-center items-center"},Nm={class:"rounded-lg py-1 min-w-48 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},Bm=["onClick"],Pr=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,hideDisabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object],actions:{}},setup(t){const e=t,n=a.ref(null),r=a.ref(null),i=a.ref(!1),o=a.computed(()=>e.to?"router-link":"div"),s=b=>{r.value&&!r.value.contains(b.target)&&n.value&&!n.value.contains(b.target)&&(i.value=!1)};a.onMounted(()=>{document.addEventListener("click",s)}),a.onUnmounted(()=>{document.removeEventListener("click",s)});const l={pmi:"has-[.medium]:h-10 has-[.medium]:text-sm has-[.small]:h-8 has-[.small]:text-xs h-12","wpic-tools":"rounded-md has-[.medium]:h-8 has-[.medium]:text-sm has-[.small]:h-6 has-[.small]:text-xs h-10"},c={pmi:"","wpic-tools":"border-none ring-1 ring-black/5 dark:ring-white/10 bg-transparent text-iron-700 disabled:text-iron-700/50 enabled:hover:bg-iron-900/5 enabled:active:bg-iron-200 enabled:active:shadow-inner dark:enabled:border-iron-900 dark:disabled:border-iron-900 dark:text-iron-200 dark:enabled:hover:bg-iron-900 dark:enabled:active:bg-iron-930 dark:disabled:text-iron-400/50"},d={pmi:"","wpic-tools":"bg-transparent text-red-600 disabled:text-red-600/50 enabled:hover:bg-red-500/5 enabled:active:bg-red-100 enabled:active:shadow-inner dark:text-red-400 dark:enabled:hover:bg-red-500/10 dark:enabled:active:bg-red-500/25 dark:disabled:text-red-500/50"},u={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-wpic-600 text-white disabled:text-white/50 border-none shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-wpic-500 enabled:active:text-white/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:bg-wpic-700 dark:enabled:active:shadow-inner dark:enabled:hover:bg-wpic-600"},f={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"border-none! bg-linear-to-b bg-iron-100 text-iron-800 disabled:text-iron-800/50 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:active:shadow-inner enabled:hover:bg-iron-200 enabled:active:bg-iron-300 enabled:active:text-iron-800/80 dark:enabled:active:text-iron-200/80 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] dark:text-iron-200 dark:bg-iron-900 dark:disabled:text-iron-200/50 dark:enabled:active:shadow-inner dark:enabled:hover:bg-iron-800 dark:enabled:active:bg-iron-700"},h={pmi:"","wpic-tools":"border-none! text-white bg-linear-to-b bg-red-500 disabled:text-red-600/50 border-red-500 enabled:hover:bg-red-400 shadow-[0_1px_0_0_--theme(--color-white/30%)_inset,0_-1px_1px_0_--theme(--color-black/5%)_inset] enabled:hover:border-red-600 enabled:active:shadow-inner enabled:active:text-white/80 enabled:active:bg-red-700 enabled:active:border-red-700 dark:bg-red-400/70 dark:border-red-400/70"},p={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":" text-gray-950 disabled:text-gray-950/50 border-none ring-1 ring-black/5 shadow-xs enabled:hover:bg-gray-50 enabled:active:text-gray-950/60 bg-white dark:bg-transparent dark:ring-1 dark:ring-gray-800 dark:text-white dark:disabled:text-white/50 dark:shadow-[0_1px_0_0_--theme(--color-white/5%)_inset,0_0_0_1px_--theme(--color-white/2%)_inset] enabled:active:shadow-inner dark:hover:bg-white/10 dark:enabled:active:text-white/80"},m={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},g={pmi:"text-red-600 hover:text-red-500 hover:underline","wpic-tools":"text-red-600 disabled:text-red-600/50 hover:text-red-500 dark:text-red-400 dark:hover:text-red-500 hover:underline"},y={pmi:"hover:text-violet-800 hover:underline","wpic-tools":"dark:text-gray-200 hover:text-lime-800 hover:underline"};return(b,v)=>{var M;return a.openBlock(),a.createElementBlock("button",{ref_key:"reference",ref:n,is:o.value,type:t.type,disabled:t.disabled,onClick:v[0]||(v[0]=k=>{var O;return(O=t.actions)!=null&&O.length?i.value=!i.value:null}),class:a.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled&&!t.hideDisabled,"":t.outline&&!t.plain,"ring-0!":!t.outline,[`${l[a.unref(ne).theme]}`]:!0,[`${u[a.unref(ne).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${f[a.unref(ne).theme]}`]:t.secondary,[`${p[a.unref(ne).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${m[a.unref(ne).theme]}`]:t.primary&&t.plain,[`${y[a.unref(ne).theme]}`]:!t.primary&&!t.destructive&&t.plain,[`${c[a.unref(ne).theme]}`]:t.colorless,[`${h[a.unref(ne).theme]}`]:t.destructive&&!t.plain&&!t.colorless,[`${g[a.unref(ne).theme]}`]:t.destructive&&t.plain,[`${d[a.unref(ne).theme]}`]:t.destructive&&t.colorless,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"h-auto":t.plain,"rounded-sm":!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-hidden relative inline-flex justify-center items-center"])},[t.loading?(a.openBlock(),a.createElementBlock("div",$m,[a.createVNode(Jn,{class:"w-6 h-6"})])):a.createCommentVNode("",!0),(a.openBlock(),a.createBlock(a.resolveDynamicComponent(o.value),{to:t.to,class:a.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{medium:t.medium,small:t.small,"opacity-0":t.loading,"px-2":!!(t.small&&!t.plain),"px-3":!!(t.medium&&!t.plain),"px-4":!t.small&&!t.medium&&!t.plain,"px-0! aspect-square":t.square}])},{default:a.withCtx(()=>[a.renderSlot(b.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(t.label),1)])]),_:3},8,["to","class"])),(M=t.actions)!=null&&M.length&&i.value?(a.openBlock(),a.createElementBlock("div",{key:1,ref_key:"floating",ref:r,class:"absolute z-30 top-12 left-0"},[a.createElementVNode("div",Nm,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.actions,k=>(a.openBlock(),a.createElementBlock("div",{onClick:k.value,class:"font-normal h-10 flex items-center px-4 hover:bg-gray-100 dark:hover:bg-white/5"},a.toDisplayString(k.label),9,Bm))),256))])],512)):a.createCommentVNode("",!0)],10,Tm)}}}),Am=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-gray-300"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[a.unref(ne).theme]]])},[a.renderSlot(n.$slots,"default")],2))}}),Vm={name:"WpicInputGroup"},Dm={class:"wpic-input-group flex w-full"};function _m(t,e,n,r,i,o){return a.openBlock(),a.createElementBlock("div",Dm,[a.renderSlot(t.$slots,"default")])}const Lm=ae(Vm,[["render",_m]]),Im=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=a.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(l,c)=>(a.openBlock(),a.createBlock(a.unref(pm),{ref_key:"myForm",ref:n},{default:a.withCtx(({values:d,meta:u,errors:f})=>[a.renderSlot(l.$slots,"default")]),_:3},512))}}),Rr=Math.min,Gn=Math.max,Vi=Math.round,Gt=t=>({x:t,y:t}),Pm={left:"right",right:"left",bottom:"top",top:"bottom"},Rm={start:"end",end:"start"};function ns(t,e,n){return Gn(t,Rr(e,n))}function zr(t,e){return typeof t=="function"?t(e):t}function Cn(t){return t.split("-")[0]}function jr(t){return t.split("-")[1]}function Pa(t){return t==="x"?"y":"x"}function rs(t){return t==="y"?"height":"width"}function Di(t){return["top","bottom"].includes(Cn(t))?"y":"x"}function is(t){return Pa(Di(t))}function zm(t,e,n){n===void 0&&(n=!1);const r=jr(t),i=is(t),o=rs(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=_i(s)),[s,_i(s)]}function jm(t){const e=_i(t);return[ss(t),e,ss(e)]}function ss(t){return t.replace(/start|end/g,e=>Rm[e])}function Fm(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function Hm(t,e,n,r){const i=jr(t);let o=Fm(Cn(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(ss)))),o}function _i(t){return t.replace(/left|right|bottom|top/g,e=>Pm[e])}function Wm(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ra(t){return typeof t!="number"?Wm(t):{top:t,right:t,bottom:t,left:t}}function Li(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function za(t,e,n){let{reference:r,floating:i}=t;const o=Di(e),s=is(e),l=rs(s),c=Cn(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(jr(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const Um=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,l=o.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=za(d,r,c),h=r,p={},m=0;for(let g=0;g<l.length;g++){const{name:y,fn:b}=l[g],{x:v,y:M,data:k,reset:O}=await b({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=v??u,f=M??f,p={...p,[y]:{...p[y],...k}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(d=O.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:u,y:f}=za(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function ja(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=zr(e,t),m=Ra(p),y=l[h?f==="floating"?"reference":"floating":f],b=Li(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l.floating)),k=await(o.isElement==null?void 0:o.isElement(M))?await(o.getScale==null?void 0:o.getScale(M))||{x:1,y:1}:{x:1,y:1},O=Li(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:M,strategy:c}):v);return{top:(b.top-O.top+m.top)/k.y,bottom:(O.bottom-b.bottom+m.bottom)/k.y,left:(b.left-O.left+m.left)/k.x,right:(O.right-b.right+m.right)/k.x}}const qm=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=zr(t,e)||{};if(d==null)return{};const f=Ra(u),h={x:n,y:r},p=is(i),m=rs(p),g=await s.getDimensions(d),y=p==="y",b=y?"top":"left",v=y?"bottom":"right",M=y?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-h[p]-o.floating[m],O=h[p]-o.reference[p],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let B=C?C[M]:0;(!B||!await(s.isElement==null?void 0:s.isElement(C)))&&(B=l.floating[M]||o.floating[m]);const I=k/2-O/2,_=B/2-g[m]/2-1,T=Rr(f[b],_),L=Rr(f[v],_),H=T,Y=B-g[m]-L,W=B/2-g[m]/2+I,N=ns(H,W,Y),x=!c.arrow&&jr(i)!=null&&W!==N&&o.reference[m]/2-(W<H?T:L)-g[m]/2<0,A=x?W<H?W-H:W-Y:0;return{[p]:h[p]+A,data:{[p]:N,centerOffset:W-N-A,...x&&{alignmentOffset:A}},reset:x}}}),Km=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=zr(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Cn(i),v=Cn(l)===l,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),k=h||(v||!g?[_i(l)]:jm(l));!h&&m!=="none"&&k.push(...Hm(l,g,m,M));const O=[l,...k],C=await ja(e,y),B=[];let I=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&B.push(C[b]),f){const H=zm(i,s,M);B.push(C[H[0]],C[H[1]])}if(I=[...I,{placement:i,overflows:B}],!B.every(H=>H<=0)){var _,T;const H=(((_=o.flip)==null?void 0:_.index)||0)+1,Y=O[H];if(Y)return{data:{index:H,overflows:I},reset:{placement:Y}};let W=(T=I.filter(N=>N.overflows[0]<=0).sort((N,x)=>N.overflows[1]-x.overflows[1])[0])==null?void 0:T.placement;if(!W)switch(p){case"bestFit":{var L;const N=(L=I.map(x=>[x.placement,x.overflows.filter(A=>A>0).reduce((A,V)=>A+V,0)]).sort((x,A)=>x[1]-A[1])[0])==null?void 0:L[0];N&&(W=N);break}case"initialPlacement":W=l;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function Ym(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Cn(n),l=jr(n),c=Di(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&c?-1:1,f=zr(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Jm=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:l}=e,c=await Ym(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:o+c.y,data:{...c,placement:s}}}}},Gm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...c}=zr(t,e),d={x:n,y:r},u=await ja(e,c),f=Di(Cn(i)),h=Pa(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+u[y],M=p-u[b];p=ns(v,p,M)}if(s){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",v=m+u[y],M=m-u[b];m=ns(v,m,M)}const g=l.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function Sn(t){return ls(t)?(t.nodeName||"").toLowerCase():"#document"}function Qe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Zt(t){var e;return(e=(ls(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ls(t){return t instanceof Node||t instanceof Qe(t).Node}function Ct(t){return t instanceof Element||t instanceof Qe(t).Element}function St(t){return t instanceof HTMLElement||t instanceof Qe(t).HTMLElement}function Fa(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qe(t).ShadowRoot}function Fr(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=kt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Zm(t){return["table","td","th"].includes(Sn(t))}function as(t){const e=cs(),n=kt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Xm(t){let e=Xt(t);for(;St(e)&&!Zn(e);){if(as(e))return e;e=Xt(e)}return null}function cs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(t){return["html","body","#document"].includes(Sn(t))}function kt(t){return Qe(t).getComputedStyle(t)}function Ii(t){return Ct(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Xt(t){if(Sn(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Fa(t)&&t.host||Zt(t);return Fa(e)?e.host:e}function Ha(t){const e=Xt(t);return Zn(e)?t.ownerDocument?t.ownerDocument.body:t.body:St(e)&&Fr(e)?e:Ha(e)}function ds(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Ha(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Qe(i);return o?e.concat(s,s.visualViewport||[],Fr(i)?i:[],s.frameElement&&n?ds(s.frameElement):[]):e.concat(i,ds(i,[],n))}function Wa(t){const e=kt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=St(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,l=Vi(n)!==o||Vi(r)!==s;return l&&(n=o,r=s),{width:n,height:r,$:l}}function Ua(t){return Ct(t)?t:t.contextElement}function Xn(t){const e=Ua(t);if(!St(e))return Gt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Wa(e);let s=(o?Vi(n.width):n.width)/r,l=(o?Vi(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Qm=Gt(0);function qa(t){const e=Qe(t);return!cs()||!e.visualViewport?Qm:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function eg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Qe(t)?!1:e}function Hr(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Ua(t);let s=Gt(1);e&&(r?Ct(r)&&(s=Xn(r)):s=Xn(t));const l=eg(o,n,r)?qa(o):Gt(0);let c=(i.left+l.x)/s.x,d=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=Qe(o),p=r&&Ct(r)?Qe(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Xn(g),b=g.getBoundingClientRect(),v=kt(g),M=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,k=b.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=M,d+=k,m=Qe(g),g=m.frameElement}}return Li({width:u,height:f,x:c,y:d})}const tg=[":popover-open",":modal"];function us(t){return tg.some(e=>{try{return t.matches(e)}catch{return!1}})}function ng(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Zt(r),l=e?us(e.floating):!1;if(r===s||l&&o)return n;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=St(r);if((f||!f&&!o)&&((Sn(r)!=="body"||Fr(s))&&(c=Ii(r)),St(r))){const h=Hr(r);d=Xn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x,y:n.y*d.y-c.scrollTop*d.y+u.y}}function rg(t){return Array.from(t.getClientRects())}function Ka(t){return Hr(Zt(t)).left+Ii(t).scrollLeft}function ig(t){const e=Zt(t),n=Ii(t),r=t.ownerDocument.body,i=Gn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Gn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ka(t);const l=-n.scrollTop;return kt(r).direction==="rtl"&&(s+=Gn(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function og(t,e){const n=Qe(t),r=Zt(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,l=0,c=0;if(i){o=i.width,s=i.height;const d=cs();(!d||d&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:o,height:s,x:l,y:c}}function sg(t,e){const n=Hr(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=St(t)?Xn(t):Gt(1),s=t.clientWidth*o.x,l=t.clientHeight*o.y,c=i*o.x,d=r*o.y;return{width:s,height:l,x:c,y:d}}function Ya(t,e,n){let r;if(e==="viewport")r=og(t,n);else if(e==="document")r=ig(Zt(t));else if(Ct(e))r=sg(e,n);else{const i=qa(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Li(r)}function Ja(t,e){const n=Xt(t);return n===e||!Ct(n)||Zn(n)?!1:kt(n).position==="fixed"||Ja(n,e)}function lg(t,e){const n=e.get(t);if(n)return n;let r=ds(t,[],!1).filter(l=>Ct(l)&&Sn(l)!=="body"),i=null;const o=kt(t).position==="fixed";let s=o?Xt(t):t;for(;Ct(s)&&!Zn(s);){const l=kt(s),c=as(s);!c&&l.position==="fixed"&&(i=null),(o?!c&&!i:!c&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fr(s)&&!c&&Ja(t,s))?r=r.filter(u=>u!==s):i=l,s=Xt(s)}return e.set(t,r),r}function ag(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?us(e)?[]:lg(e,this._c):[].concat(n),r],l=s[0],c=s.reduce((d,u)=>{const f=Ya(e,u,i);return d.top=Gn(f.top,d.top),d.right=Rr(f.right,d.right),d.bottom=Rr(f.bottom,d.bottom),d.left=Gn(f.left,d.left),d},Ya(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function cg(t){const{width:e,height:n}=Wa(t);return{width:e,height:n}}function dg(t,e,n){const r=St(e),i=Zt(e),o=n==="fixed",s=Hr(t,!0,o,e);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);if(r||!r&&!o)if((Sn(e)!=="body"||Fr(i))&&(l=Ii(e)),r){const f=Hr(e,!0,o,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else i&&(c.x=Ka(i));const d=s.left+l.scrollLeft-c.x,u=s.top+l.scrollTop-c.y;return{x:d,y:u,width:s.width,height:s.height}}function fs(t){return kt(t).position==="static"}function Ga(t,e){return!St(t)||kt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Za(t,e){const n=Qe(t);if(us(t))return n;if(!St(t)){let i=Xt(t);for(;i&&!Zn(i);){if(Ct(i)&&!fs(i))return i;i=Xt(i)}return n}let r=Ga(t,e);for(;r&&Zm(r)&&fs(r);)r=Ga(r,e);return r&&Zn(r)&&fs(r)&&!as(r)?n:r||Xm(t)||n}const ug=async function(t){const e=this.getOffsetParent||Za,n=this.getDimensions,r=await n(t.floating);return{reference:dg(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fg(t){return kt(t).direction==="rtl"}const hg={convertOffsetParentRelativeRectToViewportRelativeRect:ng,getDocumentElement:Zt,getClippingRect:ag,getOffsetParent:Za,getElementRects:ug,getClientRects:rg,getDimensions:cg,getScale:Xn,isElement:Ct,isRTL:fg},Xa=Jm,Qa=Gm,ec=Km,pg=qm,tc=(t,e,n)=>{const r=new Map,i={platform:hg,...n},o={...i.platform,_c:r};return Um(t,e,{...i,platform:o})};function mg(t){return t!=null&&typeof t=="object"&&"$el"in t}function gg(t){if(mg(t)){const e=t.$el;return ls(e)&&Sn(e)==="#comment"?null:e}return t}function yg(t){return{name:"arrow",options:t,fn(e){const n=gg(a.unref(t.element));return n==null?{}:pg({element:n,padding:t.padding}).fn(e)}}}const bg={},kg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},xg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function wg(t,e){return a.openBlock(),a.createElementBlock("svg",kg,xg)}const Wr=ae(bg,[["render",wg]]);let Pi;const vg=new Uint8Array(16);function Cg(){if(!Pi&&(Pi=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pi))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pi(vg)}const Ve=[];for(let t=0;t<256;++t)Ve.push((t+256).toString(16).slice(1));function Sg(t,e=0){return Ve[t[e+0]]+Ve[t[e+1]]+Ve[t[e+2]]+Ve[t[e+3]]+"-"+Ve[t[e+4]]+Ve[t[e+5]]+"-"+Ve[t[e+6]]+Ve[t[e+7]]+"-"+Ve[t[e+8]]+Ve[t[e+9]]+"-"+Ve[t[e+10]]+Ve[t[e+11]]+Ve[t[e+12]]+Ve[t[e+13]]+Ve[t[e+14]]+Ve[t[e+15]]}const nc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hs(t,e,n){if(nc.randomUUID&&!t)return nc.randomUUID();t=t||{};const r=t.random||(t.rng||Cg)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Sg(r)}let Eg={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""},sortByKey(t,e,n="asc"){return[...t].sort((r,i)=>{let o=r[e],s=i[e];const l=!isNaN(Date.parse(o))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(o),c=!isNaN(Date.parse(s))&&/^\d{4}-\d{2}-\d{2}(T.*)?$/.test(s);if(l&&c)o=new Date(o).getTime(),s=new Date(s).getTime();else{const d=parseFloat(o),u=parseFloat(s),f=!isNaN(d)&&typeof o!="boolean",h=!isNaN(u)&&typeof s!="boolean";f&&h?(o=d,s=u):(o=String(o).toLowerCase(),s=String(s).toLowerCase())}return n==="asc"?o>s?1:o<s?-1:0:o<s?1:o>s?-1:0})}};const En=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean,noCloseClasses:{type:Array,default:()=>[]}},emits:["show","hide"],setup(t,{expose:e,emit:n}){const r=hs(),i=n,o=t,s={pmi:"md:absolute md:block bg-white shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"block absolute mt-2 bg-white border border-gray-300 dark:bg-gray-930 dark:border-gray-920 shadow-md"},l=a.ref(null),c=a.ref(null),d=a.ref(!0);function u(){o.disabled||(d.value=!1,p()),i("show"),document.dispatchEvent(new CustomEvent("submenu-open",{detail:{uuid:r}}))}function f(b){if(d.value)u();else{if(o.noCloseClasses.some(v=>b.target.closest(`.${v}`)))return;h()}}function h(){i("hide"),document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,d.value=!0}async function p(){const b=await tc(l.value,c.value,{placement:o.placement,middleware:[ec(),Qa(),Xa(o.offset)]});c.value.style.left=`${b.x}px`,c.value.style.top=`${b.y}px`}const m=b=>{c.value&&!c.value.contains(b.target)&&l.value&&!l.value.contains(b.target)&&h()};a.onMounted(()=>{document.addEventListener("click",m),document.addEventListener("submenu-open",b=>{b.detail.uuid!==r&&h()})}),a.onUnmounted(()=>{document.removeEventListener("click",m),document.removeEventListener("submenu-open",h)});function g(){o.hover&&u()}function y(){o.hover&&h()}return e({hide:h}),(b,v)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[(a.openBlock(),a.createElementBlock("div",{class:"flex-1",key:`reference_${a.unref(r)}`,ref_key:"reference",ref:l,onMouseenter:g,onMouseleave:y,onClick:v[0]||(v[0]=a.withModifiers(M=>f(M),["stop"]))},[a.renderSlot(b.$slots,"default",{isHidden:d.value})],32)),(a.openBlock(),a.createBlock(a.Teleport,{to:a.unref(ne).popoverTarget},[(a.openBlock(),a.createElementBlock("div",{key:`floating_${a.unref(r)}`,ref_key:"floating",ref:c,style:a.normalizeStyle({maxWidth:t.maxWidth}),class:a.normalizeClass(["z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:d.value,[`${s[a.unref(ne).theme]}`]:!d.value,"rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[a.renderSlot(b.$slots,"content")],6))],8,["to"]))],64))}}),Og={},Mg={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Tg=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function $g(t,e){return a.openBlock(),a.createElementBlock("svg",Mg,Tg)}const rc=ae(Og,[["render",$g]]),Ng={},Bg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},Ag=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function Vg(t,e){return a.openBlock(),a.createElementBlock("svg",Bg,Ag)}const ps=ae(Ng,[["render",Vg]]),Dg={key:0,class:"mb-2 wpic-form-label text-base text-gray-500 dark:text-gray-500 flex items-center justify-between"},_g={class:"flex items-center gap-2"},Lg={key:0},Ig={class:""},Pg={class:"flex justify-end"},Rg={key:0,class:"absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center justify-center text-center"},zg={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none overflow-hidden"},jg={key:1,class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},Ur=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean,required:Boolean,hideRequired:Boolean,material:Boolean,naked:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 bg-white border-gray-300 focus:border-lime-400 focus-within:border-lime-400 dark:bg-gray-930 dark:border-gray-920 dark:hover:bg-gray-920 dark:text-gray-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-gray-200! text-gray-400! dark:text-gray-800! bg-gray-50! dark:border-gray-900! dark:bg-gray-940!"},i=e;function o(){i("onClear")}return(s,l)=>(a.openBlock(),a.createElementBlock("div",null,[t.label?(a.openBlock(),a.createElementBlock("div",Dg,[a.createElementVNode("div",_g,[a.createElementVNode("span",null,a.toDisplayString(t.label),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Lg,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Ig,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(t.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Pg,[a.renderSlot(s.$slots,"more")])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-input overflow-auto leading-none flex relative items-center",{"border rounded-sm pr-3":!t.naked,"!pl-0 pr-1 !bg-transparent":t.naked,"border-b":t.material,"pl-4":!s.$slots.prepend,"pl-8":s.$slots.prepend,[`${n[a.unref(ne).theme]}`]:!0,"h-8 text-sm":t.small,"h-10":!t.large&&!t.small,"h-12":t.large,[`${r[a.unref(ne).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"border-red-600! focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(a.openBlock(),a.createElementBlock("div",Rg,[a.createElementVNode("div",zg,[a.renderSlot(s.$slots,"prepend")])])):a.createCommentVNode("",!0),a.renderSlot(s.$slots,"default"),t.loading?(a.openBlock(),a.createElementBlock("div",jg,[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable?(a.openBlock(),a.createElementBlock("div",{key:2,onClick:a.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-2 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0)],2)]))}});var On=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Fg(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ri=Fg,Hg=typeof On=="object"&&On&&On.Object===Object&&On,ic=Hg,Wg=ic,Ug=typeof self=="object"&&self&&self.Object===Object&&self,qg=Wg||Ug||Function("return this")(),Et=qg,Kg=Et,Yg=function(){return Kg.Date.now()},Jg=Yg,Gg=/\s/;function Zg(t){for(var e=t.length;e--&&Gg.test(t.charAt(e)););return e}var Xg=Zg,Qg=Xg,e0=/^\s+/;function t0(t){return t&&t.slice(0,Qg(t)+1).replace(e0,"")}var n0=t0,r0=Et,i0=r0.Symbol,ms=i0,oc=ms,sc=Object.prototype,o0=sc.hasOwnProperty,s0=sc.toString,Kr=oc?oc.toStringTag:void 0;function l0(t){var e=o0.call(t,Kr),n=t[Kr];try{t[Kr]=void 0;var r=!0}catch{}var i=s0.call(t);return r&&(e?t[Kr]=n:delete t[Kr]),i}var a0=l0,c0=Object.prototype,d0=c0.toString;function u0(t){return d0.call(t)}var f0=u0,lc=ms,h0=a0,p0=f0,m0="[object Null]",g0="[object Undefined]",ac=lc?lc.toStringTag:void 0;function y0(t){return t==null?t===void 0?g0:m0:ac&&ac in Object(t)?h0(t):p0(t)}var Yr=y0;function b0(t){return t!=null&&typeof t=="object"}var Jr=b0,k0=Yr,x0=Jr,w0="[object Symbol]";function v0(t){return typeof t=="symbol"||x0(t)&&k0(t)==w0}var C0=v0,S0=n0,cc=Ri,E0=C0,dc=NaN,O0=/^[-+]0x[0-9a-f]+$/i,M0=/^0b[01]+$/i,T0=/^0o[0-7]+$/i,$0=parseInt;function N0(t){if(typeof t=="number")return t;if(E0(t))return dc;if(cc(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cc(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=S0(t);var n=M0.test(t);return n||T0.test(t)?$0(t.slice(2),n?2:8):O0.test(t)?dc:+t}var B0=N0,A0=Ri,gs=Jg,uc=B0,V0="Expected a function",D0=Math.max,_0=Math.min;function L0(t,e,n){var r,i,o,s,l,c,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(V0);e=uc(e)||0,A0(n)&&(u=!!n.leading,f="maxWait"in n,o=f?D0(uc(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(C){var B=r,I=i;return r=i=void 0,d=C,s=t.apply(I,B),s}function m(C){return d=C,l=setTimeout(b,e),u?p(C):s}function g(C){var B=C-c,I=C-d,_=e-B;return f?_0(_,o-I):_}function y(C){var B=C-c,I=C-d;return c===void 0||B>=e||B<0||f&&I>=o}function b(){var C=gs();if(y(C))return v(C);l=setTimeout(b,g(C))}function v(C){return l=void 0,h&&r?p(C):(r=i=void 0,s)}function M(){l!==void 0&&clearTimeout(l),d=0,r=c=i=l=void 0}function k(){return l===void 0?s:v(gs())}function O(){var C=gs(),B=y(C);if(r=arguments,i=this,c=C,B){if(l===void 0)return m(c);if(f)return clearTimeout(l),l=setTimeout(b,e),p(c)}return l===void 0&&(l=setTimeout(b,e)),s}return O.cancel=M,O.flush=k,O}var I0=L0;const fc=qr(I0);function P0(){this.__data__=[],this.size=0}var R0=P0;function z0(t,e){return t===e||t!==t&&e!==e}var hc=z0,j0=hc;function F0(t,e){for(var n=t.length;n--;)if(j0(t[n][0],e))return n;return-1}var zi=F0,H0=zi,W0=Array.prototype,U0=W0.splice;function q0(t){var e=this.__data__,n=H0(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():U0.call(e,n,1),--this.size,!0}var K0=q0,Y0=zi;function J0(t){var e=this.__data__,n=Y0(e,t);return n<0?void 0:e[n][1]}var G0=J0,Z0=zi;function X0(t){return Z0(this.__data__,t)>-1}var Q0=X0,ey=zi;function ty(t,e){var n=this.__data__,r=ey(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var ny=ty,ry=R0,iy=K0,oy=G0,sy=Q0,ly=ny;function Qn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qn.prototype.clear=ry,Qn.prototype.delete=iy,Qn.prototype.get=oy,Qn.prototype.has=sy,Qn.prototype.set=ly;var ji=Qn,ay=ji;function cy(){this.__data__=new ay,this.size=0}var dy=cy;function uy(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var fy=uy;function hy(t){return this.__data__.get(t)}var py=hy;function my(t){return this.__data__.has(t)}var gy=my,yy=Yr,by=Ri,ky="[object AsyncFunction]",xy="[object Function]",wy="[object GeneratorFunction]",vy="[object Proxy]";function Cy(t){if(!by(t))return!1;var e=yy(t);return e==xy||e==wy||e==ky||e==vy}var pc=Cy,Sy=Et,Ey=Sy["__core-js_shared__"],Oy=Ey,ys=Oy,mc=function(){var t=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function My(t){return!!mc&&mc in t}var Ty=My,$y=Function.prototype,Ny=$y.toString;function By(t){if(t!=null){try{return Ny.call(t)}catch{}try{return t+""}catch{}}return""}var gc=By,Ay=pc,Vy=Ty,Dy=Ri,_y=gc,Ly=/[\\^$.*+?()[\]{}|]/g,Iy=/^\[object .+?Constructor\]$/,Py=Function.prototype,Ry=Object.prototype,zy=Py.toString,jy=Ry.hasOwnProperty,Fy=RegExp("^"+zy.call(jy).replace(Ly,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Hy(t){if(!Dy(t)||Vy(t))return!1;var e=Ay(t)?Fy:Iy;return e.test(_y(t))}var Wy=Hy;function Uy(t,e){return t==null?void 0:t[e]}var qy=Uy,Ky=Wy,Yy=qy;function Jy(t,e){var n=Yy(t,e);return Ky(n)?n:void 0}var er=Jy,Gy=er,Zy=Et,Xy=Gy(Zy,"Map"),bs=Xy,Qy=er,e1=Qy(Object,"create"),Fi=e1,yc=Fi;function t1(){this.__data__=yc?yc(null):{},this.size=0}var n1=t1;function r1(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var i1=r1,o1=Fi,s1="__lodash_hash_undefined__",l1=Object.prototype,a1=l1.hasOwnProperty;function c1(t){var e=this.__data__;if(o1){var n=e[t];return n===s1?void 0:n}return a1.call(e,t)?e[t]:void 0}var d1=c1,u1=Fi,f1=Object.prototype,h1=f1.hasOwnProperty;function p1(t){var e=this.__data__;return u1?e[t]!==void 0:h1.call(e,t)}var m1=p1,g1=Fi,y1="__lodash_hash_undefined__";function b1(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=g1&&e===void 0?y1:e,this}var k1=b1,x1=n1,w1=i1,v1=d1,C1=m1,S1=k1;function tr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}tr.prototype.clear=x1,tr.prototype.delete=w1,tr.prototype.get=v1,tr.prototype.has=C1,tr.prototype.set=S1;var E1=tr,bc=E1,O1=ji,M1=bs;function T1(){this.size=0,this.__data__={hash:new bc,map:new(M1||O1),string:new bc}}var $1=T1;function N1(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var B1=N1,A1=B1;function V1(t,e){var n=t.__data__;return A1(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Hi=V1,D1=Hi;function _1(t){var e=D1(this,t).delete(t);return this.size-=e?1:0,e}var L1=_1,I1=Hi;function P1(t){return I1(this,t).get(t)}var R1=P1,z1=Hi;function j1(t){return z1(this,t).has(t)}var F1=j1,H1=Hi;function W1(t,e){var n=H1(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var U1=W1,q1=$1,K1=L1,Y1=R1,J1=F1,G1=U1;function nr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}nr.prototype.clear=q1,nr.prototype.delete=K1,nr.prototype.get=Y1,nr.prototype.has=J1,nr.prototype.set=G1;var kc=nr,Z1=ji,X1=bs,Q1=kc,eb=200;function tb(t,e){var n=this.__data__;if(n instanceof Z1){var r=n.__data__;if(!X1||r.length<eb-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Q1(r)}return n.set(t,e),this.size=n.size,this}var nb=tb,rb=ji,ib=dy,ob=fy,sb=py,lb=gy,ab=nb;function rr(t){var e=this.__data__=new rb(t);this.size=e.size}rr.prototype.clear=ib,rr.prototype.delete=ob,rr.prototype.get=sb,rr.prototype.has=lb,rr.prototype.set=ab;var cb=rr,db="__lodash_hash_undefined__";function ub(t){return this.__data__.set(t,db),this}var fb=ub;function hb(t){return this.__data__.has(t)}var pb=hb,mb=kc,gb=fb,yb=pb;function Wi(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new mb;++e<n;)this.add(t[e])}Wi.prototype.add=Wi.prototype.push=gb,Wi.prototype.has=yb;var bb=Wi;function kb(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var xb=kb;function wb(t,e){return t.has(e)}var vb=wb,Cb=bb,Sb=xb,Eb=vb,Ob=1,Mb=2;function Tb(t,e,n,r,i,o){var s=n&Ob,l=t.length,c=e.length;if(l!=c&&!(s&&c>l))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&Mb?new Cb:void 0;for(o.set(t,e),o.set(e,t);++f<l;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!Sb(e,function(b,v){if(!Eb(p,v)&&(m===b||i(m,b,n,r,o)))return p.push(v)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var xc=Tb,$b=Et,Nb=$b.Uint8Array,Bb=Nb;function Ab(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Vb=Ab;function Db(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var _b=Db,wc=ms,vc=Bb,Lb=hc,Ib=xc,Pb=Vb,Rb=_b,zb=1,jb=2,Fb="[object Boolean]",Hb="[object Date]",Wb="[object Error]",Ub="[object Map]",qb="[object Number]",Kb="[object RegExp]",Yb="[object Set]",Jb="[object String]",Gb="[object Symbol]",Zb="[object ArrayBuffer]",Xb="[object DataView]",Cc=wc?wc.prototype:void 0,ks=Cc?Cc.valueOf:void 0;function Qb(t,e,n,r,i,o,s){switch(n){case Xb:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Zb:return!(t.byteLength!=e.byteLength||!o(new vc(t),new vc(e)));case Fb:case Hb:case qb:return Lb(+t,+e);case Wb:return t.name==e.name&&t.message==e.message;case Kb:case Jb:return t==e+"";case Ub:var l=Pb;case Yb:var c=r&zb;if(l||(l=Rb),t.size!=e.size&&!c)return!1;var d=s.get(t);if(d)return d==e;r|=jb,s.set(t,e);var u=Ib(l(t),l(e),r,i,o,s);return s.delete(t),u;case Gb:if(ks)return ks.call(t)==ks.call(e)}return!1}var e2=Qb;function t2(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var n2=t2,r2=Array.isArray,xs=r2,i2=n2,o2=xs;function s2(t,e,n){var r=e(t);return o2(t)?r:i2(r,n(t))}var l2=s2;function a2(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var c2=a2;function d2(){return[]}var u2=d2,f2=c2,h2=u2,p2=Object.prototype,m2=p2.propertyIsEnumerable,Sc=Object.getOwnPropertySymbols,g2=Sc?function(t){return t==null?[]:(t=Object(t),f2(Sc(t),function(e){return m2.call(t,e)}))}:h2,y2=g2;function b2(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var k2=b2,x2=Yr,w2=Jr,v2="[object Arguments]";function C2(t){return w2(t)&&x2(t)==v2}var S2=C2,Ec=S2,E2=Jr,Oc=Object.prototype,O2=Oc.hasOwnProperty,M2=Oc.propertyIsEnumerable,T2=Ec(function(){return arguments}())?Ec:function(t){return E2(t)&&O2.call(t,"callee")&&!M2.call(t,"callee")},$2=T2,Ui={exports:{}};function N2(){return!1}var B2=N2;Ui.exports,function(t,e){var n=Et,r=B2,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,l=s?n.Buffer:void 0,c=l?l.isBuffer:void 0,d=c||r;t.exports=d}(Ui,Ui.exports);var Mc=Ui.exports,A2=9007199254740991,V2=/^(?:0|[1-9]\d*)$/;function D2(t,e){var n=typeof t;return e=e??A2,!!e&&(n=="number"||n!="symbol"&&V2.test(t))&&t>-1&&t%1==0&&t<e}var _2=D2,L2=9007199254740991;function I2(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=L2}var Tc=I2,P2=Yr,R2=Tc,z2=Jr,j2="[object Arguments]",F2="[object Array]",H2="[object Boolean]",W2="[object Date]",U2="[object Error]",q2="[object Function]",K2="[object Map]",Y2="[object Number]",J2="[object Object]",G2="[object RegExp]",Z2="[object Set]",X2="[object String]",Q2="[object WeakMap]",ek="[object ArrayBuffer]",tk="[object DataView]",nk="[object Float32Array]",rk="[object Float64Array]",ik="[object Int8Array]",ok="[object Int16Array]",sk="[object Int32Array]",lk="[object Uint8Array]",ak="[object Uint8ClampedArray]",ck="[object Uint16Array]",dk="[object Uint32Array]",ke={};ke[nk]=ke[rk]=ke[ik]=ke[ok]=ke[sk]=ke[lk]=ke[ak]=ke[ck]=ke[dk]=!0,ke[j2]=ke[F2]=ke[ek]=ke[H2]=ke[tk]=ke[W2]=ke[U2]=ke[q2]=ke[K2]=ke[Y2]=ke[J2]=ke[G2]=ke[Z2]=ke[X2]=ke[Q2]=!1;function uk(t){return z2(t)&&R2(t.length)&&!!ke[P2(t)]}var fk=uk;function hk(t){return function(e){return t(e)}}var pk=hk,qi={exports:{}};qi.exports,function(t,e){var n=ic,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,l=function(){try{var c=i&&i.require&&i.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();t.exports=l}(qi,qi.exports);var mk=qi.exports,gk=fk,yk=pk,$c=mk,Nc=$c&&$c.isTypedArray,bk=Nc?yk(Nc):gk,Bc=bk,kk=k2,xk=$2,wk=xs,vk=Mc,Ck=_2,Sk=Bc,Ek=Object.prototype,Ok=Ek.hasOwnProperty;function Mk(t,e){var n=wk(t),r=!n&&xk(t),i=!n&&!r&&vk(t),o=!n&&!r&&!i&&Sk(t),s=n||r||i||o,l=s?kk(t.length,String):[],c=l.length;for(var d in t)(e||Ok.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ck(d,c)))&&l.push(d);return l}var Tk=Mk,$k=Object.prototype;function Nk(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||$k;return t===n}var Bk=Nk;function Ak(t,e){return function(n){return t(e(n))}}var Vk=Ak,Dk=Vk,_k=Dk(Object.keys,Object),Lk=_k,Ik=Bk,Pk=Lk,Rk=Object.prototype,zk=Rk.hasOwnProperty;function jk(t){if(!Ik(t))return Pk(t);var e=[];for(var n in Object(t))zk.call(t,n)&&n!="constructor"&&e.push(n);return e}var Fk=jk,Hk=pc,Wk=Tc;function Uk(t){return t!=null&&Wk(t.length)&&!Hk(t)}var qk=Uk,Kk=Tk,Yk=Fk,Jk=qk;function Gk(t){return Jk(t)?Kk(t):Yk(t)}var Zk=Gk,Xk=l2,Qk=y2,ex=Zk;function tx(t){return Xk(t,ex,Qk)}var nx=tx,Ac=nx,rx=1,ix=Object.prototype,ox=ix.hasOwnProperty;function sx(t,e,n,r,i,o){var s=n&rx,l=Ac(t),c=l.length,d=Ac(e),u=d.length;if(c!=u&&!s)return!1;for(var f=c;f--;){var h=l[f];if(!(s?h in e:ox.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<c;){h=l[f];var b=t[h],v=e[h];if(r)var M=s?r(v,b,h,e,t,o):r(b,v,h,t,e,o);if(!(M===void 0?b===v||i(b,v,n,r,o):M)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var k=t.constructor,O=e.constructor;k!=O&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof O=="function"&&O instanceof O)&&(g=!1)}return o.delete(t),o.delete(e),g}var lx=sx,ax=er,cx=Et,dx=ax(cx,"DataView"),ux=dx,fx=er,hx=Et,px=fx(hx,"Promise"),mx=px,gx=er,yx=Et,bx=gx(yx,"Set"),kx=bx,xx=er,wx=Et,vx=xx(wx,"WeakMap"),Cx=vx,ws=ux,vs=bs,Cs=mx,Ss=kx,Es=Cx,Vc=Yr,ir=gc,Dc="[object Map]",Sx="[object Object]",_c="[object Promise]",Lc="[object Set]",Ic="[object WeakMap]",Pc="[object DataView]",Ex=ir(ws),Ox=ir(vs),Mx=ir(Cs),Tx=ir(Ss),$x=ir(Es),Mn=Vc;(ws&&Mn(new ws(new ArrayBuffer(1)))!=Pc||vs&&Mn(new vs)!=Dc||Cs&&Mn(Cs.resolve())!=_c||Ss&&Mn(new Ss)!=Lc||Es&&Mn(new Es)!=Ic)&&(Mn=function(t){var e=Vc(t),n=e==Sx?t.constructor:void 0,r=n?ir(n):"";if(r)switch(r){case Ex:return Pc;case Ox:return Dc;case Mx:return _c;case Tx:return Lc;case $x:return Ic}return e});var Nx=Mn,Os=cb,Bx=xc,Ax=e2,Vx=lx,Rc=Nx,zc=xs,jc=Mc,Dx=Bc,_x=1,Fc="[object Arguments]",Hc="[object Array]",Ki="[object Object]",Lx=Object.prototype,Wc=Lx.hasOwnProperty;function Ix(t,e,n,r,i,o){var s=zc(t),l=zc(e),c=s?Hc:Rc(t),d=l?Hc:Rc(e);c=c==Fc?Ki:c,d=d==Fc?Ki:d;var u=c==Ki,f=d==Ki,h=c==d;if(h&&jc(t)){if(!jc(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Os),s||Dx(t)?Bx(t,e,n,r,i,o):Ax(t,e,c,n,r,i,o);if(!(n&_x)){var p=u&&Wc.call(t,"__wrapped__"),m=f&&Wc.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Os),i(g,y,n,r,o)}}return h?(o||(o=new Os),Vx(t,e,n,r,i,o)):!1}var Px=Ix,Rx=Px,Uc=Jr;function qc(t,e,n,r,i){return t===e?!0:t==null||e==null||!Uc(t)&&!Uc(e)?t!==t&&e!==e:Rx(t,e,n,r,qc,i)}var zx=qc,jx=zx;function Fx(t,e){return jx(t,e)}var Hx=Fx;const Kc=qr(Hx),Wx={},Ux={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},qx=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"},null,-1)];function Kx(t,e){return a.openBlock(),a.createElementBlock("svg",Ux,qx)}const Yx=ae(Wx,[["render",Kx]]),Jx={key:0,class:"leading-none"},Gx={key:1},Zx={class:"flex flex-col max-h-80 overflow-y-auto"},Xx={key:0,class:"p-3 sticky top-0 z-[1] bg-white dark:bg-gray-930"},Qx={key:1},ew={key:0,class:"z-0 px-4 py-2 flex items-center justify-between text-sm gap-6 dark:text-gray-400"},tw=["onClick"],nw={class:"select-none flex w-full items-center justify-between"},Yc=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0},loading:Boolean,material:Boolean,naked:Boolean,hideChevron:Boolean},emits:["blur-sm","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(!1),o=a.ref(r.options);a.watch(()=>r.options,()=>{var k;(k=r.options)!=null&&k.length&&(o.value=[...r.options])},{immediate:!0,deep:!0});const s=n,l=a.ref(),c=a.ref();function d(k){var O,C;if(r.multiple){if(k){let B=r.modelValue||[];B.indexOf(k)>=0?B.splice(B.indexOf(k),1):B.push(k),s("update:modelValue",B),p(B),((O=r.modelValue)==null?void 0:O.length)===((C=r.options)==null?void 0:C.length)?i.value=!0:i.value=!1}}else s("update:modelValue",k),p(k),l.value=null,c.value.hide()}async function u(k){var O,C;s("update:modelValue",k),p(k),await a.nextTick(),((O=r.modelValue)==null?void 0:O.length)===((C=r.options)==null?void 0:C.length)&&(i.value=!0)}function f(k){s("update:modelValue",k),i.value=!1,p(k)}function h(){i.value=!1,r.multiple?(s("update:modelValue",[]),p([])):(s("update:modelValue",null),p(null))}const p=fc(function(k){s("change",k)},r.debounce),m=a.computed(()=>{var k,O,C,B;if(r.multiple)if(r.maxDisplay){let I=(O=o.value)==null?void 0:O.filter(T=>{var L;return((L=r.modelValue)==null?void 0:L.indexOf(T.value))>=0}).map(T=>T.label),_=I==null?void 0:I.slice(0,r.maxDisplay);return(I==null?void 0:I.length)-(_==null?void 0:_.length)>0?(_==null?void 0:_.join(", "))+` (+${(I==null?void 0:I.length)-_.length})`:_==null?void 0:_.join(", ")}else return(k=o.value)==null?void 0:k.filter(I=>{var _;return((_=r.modelValue)==null?void 0:_.indexOf(I.value))>=0}).map(I=>I.label).join(", ");else return((B=(C=o.value)==null?void 0:C.find(I=>I.value===r.modelValue))==null?void 0:B.label)||r.modelValue});function g(k){var O;try{return r.multiple?r.modelValue!==null&&((O=r.modelValue)==null?void 0:O.some(C=>Kc(C,k))):r.modelValue!==null&&Kc(k,r.modelValue)}catch(C){return console.log(C),!1}}const y={pmi:"group-[.is-selected]:bg-violet-50 hover:group-[.is-selected]:bg-violet-100","wpic-tools":"hover:bg-gray-50 group-[.is-selected]:text-gray-800 group-[.is-selected]:font-semibold text-gray-600 dark:hover:bg-white/5 dark:text-gray-400 dark:group-[.is-selected]:text-white"},b=a.computed(()=>{var k,O;return((k=r.modelValue)==null?void 0:k.length)===((O=r.options)==null?void 0:O.length)}),v=a.computed(()=>{var k;if(r.filterable&&!r.remoteMethod&&((k=l.value)!=null&&k.trim().length)){const O=l.value.trim().toLowerCase();return r.options.filter(C=>{var B;return(B=C.label)==null?void 0:B.toLowerCase().includes(O)})}return r.options});function M(){r.remoteMethod&&r.remoteMethod(l.value)}return e({allSelected:i,isAllSelected:b}),(k,O)=>(a.openBlock(),a.createBlock(En,{custom:"",ref_key:"myPopover",ref:c,label:t.label,disabled:t.disabled},{default:a.withCtx(({isHidden:C})=>[a.createVNode(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>{var B,I,_,T,L,H;return[a.createElementVNode("span",{class:a.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((B=t.modelValue)==null?void 0:B.length)>0)&&!t.hideSelect?(a.openBlock(),a.createElementBlock("span",Jx,[b.value&&((I=t.allSelectedText)!=null&&I.length)?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createTextVNode(a.toDisplayString(t.allSelectedText)+" ("+a.toDisplayString((_=t.options)==null?void 0:_.length)+")",1)],64)):(a.openBlock(),a.createElementBlock(a.Fragment,{key:1},[a.createTextVNode(a.toDisplayString(m.value),1)],64))])):!t.multiple&&((T=t.options)!=null&&T.find(Y=>Y.value===null))?(a.openBlock(),a.createElementBlock("span",Gx,a.toDisplayString((H=(L=t.options)==null?void 0:L.find(Y=>Y.value===null))==null?void 0:H.label),1)):a.renderSlot(k.$slots,"default",{key:2},()=>[a.createTextVNode(a.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:a.withModifiers(h,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0),!t.hideChevron&&!t.loading?(a.openBlock(),a.createBlock(Yx,{key:1,class:"h-5 w-5 -mr-[2px]"})):a.createCommentVNode("",!0)]}),_:3},8,["material","naked","disabled","small","invalid","loading"])]),content:a.withCtx(()=>{var C;return[a.createElementVNode("div",Zx,[t.filterable?(a.openBlock(),a.createElementBlock("div",Xx,[a.createVNode(Xc,{slim:"",placeholder:"Search...",clearable:"",modelValue:l.value,"onUpdate:modelValue":[O[0]||(O[0]=B=>l.value=B),M]},null,8,["modelValue"])])):a.createCommentVNode("",!0),!t.options&&((C=t.options)==null?void 0:C.length)==0?(a.openBlock(),a.createElementBlock("span",Qx,"No data.")):(a.openBlock(),a.createElementBlock(a.Fragment,{key:2},[t.multiple&&t.batchSelect?(a.openBlock(),a.createElementBlock("div",ew,[a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:O[1]||(O[1]=B=>{var I;return u((I=v.value)==null?void 0:I.filter(_=>_.value).map(_=>_.value))})},"Select all"),a.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:O[2]||(O[2]=B=>f([]))},"Select none")])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(v.value,B=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["group",{"is-selected":!!g(B.value)}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||B.value,[`${y[a.unref(ne).theme]}`]:!0}]),onClick:I=>B.disabled?null:d(B.value)},[a.createElementVNode("div",nw,[a.createElementVNode("span",{class:a.normalizeClass(["",{"opacity-25":B.disabled}])},a.toDisplayString(B.label||B.value),3),t.multiple&&g(B.value)?(a.openBlock(),a.createBlock(rc,{key:0,class:"w-4 h-4"})):a.createCommentVNode("",!0)])],10,tw)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),Jc=Object.assign({name:"WpicToggleSwitch"},{props:{modelValue:Boolean,label:String,disabled:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(){n.disabled||r("update:modelValue",!n.modelValue)}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["inline-flex items-center gap-3 select-none",{"opacity-50":t.disabled,"cursor-pointer":!t.disabled}]),onClick:i},[a.createElementVNode("div",{class:a.normalizeClass(["w-11 h-6 rounded-full shadow-inner flex items-center transition-all duration-100",{"bg-lime-500 dark:bg-lime-600":t.modelValue,"bg-gray-300 dark:bg-gray-800":!t.modelValue}])},[a.createElementVNode("div",{class:a.normalizeClass(["w-5 h-5 rounded-full bg-white dark:bg-gray-500 shadow-md transition-all duration-100 transform",{"translate-x-[calc(100%+3px)] dark:!bg-gray-200":t.modelValue,"translate-x-px":!t.modelValue}])},null,2)],2),a.createElementVNode("span",{class:a.normalizeClass({"text-gray-500":!t.modelValue,"text-gray-700 dark:text-gray-300":t.modelValue})},a.toDisplayString(t.label),3)],2))}}),rw={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},iw={class:""},ow=["value","disabled","rows","placeholder"],Gc=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=a.ref(null),o=a.ref(!1);a.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&a.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function l(d){s("update:modelValue",d==null?void 0:d.target.value)}function c(){i.value.focus()}return e({focus:c}),(d,u)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[t.label?(a.openBlock(),a.createElementBlock("div",rw,[a.createTextVNode(a.toDisplayString(t.label)+" ",1),a.createElementVNode("div",iw,[d.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(d.info),1)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])])):a.createCommentVNode("",!0),a.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:a.normalizeClass(["relative appearance-none outline-hidden flex w-full h-full rounded-sm px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus-visible:border-none placeholder:opacity-30 dark:text-gray-400",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:a.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:l,placeholder:t.placeholder},null,46,ow)],64))}}),sw=["placeholder"],Zc={__name:"ColorPicker",props:{modelValue:String,defaultColor:{type:String},loading:Boolean,material:Boolean,naked:Boolean,isInvalid:Boolean,placeholder:String,disabled:Boolean,small:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=a.ref(n.modelValue||n.defaultColor),o=()=>{r("update:modelValue",i.value)};return a.watch(()=>n.modelValue,s=>{s!==i.value&&(i.value=s)}),(s,l)=>(a.openBlock(),a.createBlock(Ur,{material:t.material,naked:t.naked,disabled:t.disabled,small:t.small,invalid:t.isInvalid,loading:t.loading},{default:a.withCtx(()=>[a.withDirectives(a.createElementVNode("input",{type:"color","onUpdate:modelValue":l[0]||(l[0]=c=>i.value=c),onInput:o,class:"w-6 h-6 !rounded-md cursor-pointer outline-hidden appearance-none"},null,544),[[a.vModelText,i.value]]),a.withDirectives(a.createElementVNode("input",{type:"text","onUpdate:modelValue":l[1]||(l[1]=c=>i.value=c),onInput:o,class:"w-full p-2 outline-hidden appearance-none",placeholder:t.placeholder},null,40,sw),[[a.vModelText,i.value]])]),_:1},8,["material","naked","disabled","small","invalid","loading"]))}},lw={},aw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},cw=[a.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),a.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function dw(t,e){return a.openBlock(),a.createElementBlock("svg",aw,cw)}const uw=ae(lw,[["render",dw]]),fw={},hw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},pw=[a.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),a.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),a.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function mw(t,e){return a.openBlock(),a.createElementBlock("svg",hw,pw)}const gw=ae(fw,[["render",mw]]),yw={},bw={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},kw=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function xw(t,e){return a.openBlock(),a.createElementBlock("svg",bw,kw)}const ww=ae(yw,[["render",xw]]),vw={class:"flex items-center gap-2"},Cw={key:0},Sw={class:""},Ew=["innerHTML"],Ow={class:"flex justify-end"},Mw=["name","value","checked"],Tw={class:"flex items-center justify-center text-center opacity-50 w-4 h-4 leading-none"},$w={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},Nw={class:"min-w-5 h-5 leading-tight cursor-pointer dark:text-gray-400"},Bw={key:7,class:"text-red-700 dark:text-red-400/90 mt-1 text-base"},Xc=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String,hideRequired:Boolean,material:Boolean,naked:Boolean,toggleSwitch:Boolean,color:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-gray-800 disabled:text-gray-400 disabled:border-gray-200 bg-white border-gray-300 dark:bg-gray-930 dark:border-gray-920 focus-within:border-lime-400 dark:focus-within:bg-gray-920 disabled:bg-gray-50"},i={pmi:"rounded-xs group-[.is-active]:border-zinc-400 group-[.is-selected]:bg-violet-800 group-[.is-selected]:border-violet-800 group-[.is-selected]:text-white group-[.is-disabled]:bg-opacity-50 group-[.is-disabled]:border-opacity-50 group-[.is-disabled]:text-opacity-75","wpic-tools":"rounded-sm group-[.is-active]:border-gray-300 dark:group-[.is-active]:bg-gray-950 dark:group-[.is-active]:border-gray-800 group-[.is-selected]:bg-lime-600 group-[.is-selected]:border-lime-600 group-[.is-selected]:text-white dark:group-[.is-disabled]:border-gray-800/50 group-[.is-disabled]:!text-gray-300 group-[.is-disabled]:!border-gray-100 group-[.is-disabled]:!bg-gray-100 dark:group-[.is-disabled]:!border-gray-900 dark:group-[.is-disabled]:!text-gray-700 dark:group-[.is-disabled]:!bg-gray-900"},o=t,s=a.computed(()=>o.name?o.name:hs()),l=gm(s.value),c=a.computed(()=>{if(o.label)return o.label;if(o.name&&o.labelName)return`${o.name}#${o.labelName}`}),d=a.ref(!0),u=a.computed(()=>(o.type=="password"||o.password)&&d.value?"password":o.type);function f(){d.value=!d.value}const h=a.computed(()=>{var T;if(o.rules&&typeof o.rules=="string"){let L=(T=o.rules)==null?void 0:T.split("|");return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}else if(!o.rules){let L=[];return o.required&&L.push("required"),o.email&&L.push("email"),L.join("|")}return"required"});function p(T){let L=T&&T.target?T.target.value:T;v(L)}const m=n;function g(T){T===!0||T===!1?m("update:modelValue",!T):m("update:modelValue",T)}function y(T){let L=T&&T.target?T.target.value:T;m("update:modelValue",L),m("onChange",L)}function b(){m("update:modelValue",null),m("onChange",null),m("onClear")}const v=fc(function(T){m("update:modelValue",T),m("onChange",T)},o.debounce),M=a.ref(null),k=a.ref();function O(){var T,L;o.textarea?(T=k.value)==null||T.focus():(L=M.value)==null||L.$el.focus()}function C(){return M.value.meta.valid}const B=a.ref(),I=a.computed(()=>B.value.allSelected),_=a.computed(()=>B.value.isAllSelected);return e({focus:O,isValid:C,allSelected:I,isAllSelected:_}),(T,L)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[c.value&&!t.checkbox&&!t.radio&&!t.toggleSwitch?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass([{"text-sm":t.small,"text-base":!t.small},"mb-2 wpic-form-label text-gray-500 dark:text-gray-500 flex items-center justify-between"])},[a.createElementVNode("div",vw,[a.createElementVNode("span",null,a.toDisplayString(c.value),1),t.required&&!t.hideRequired?(a.openBlock(),a.createElementBlock("span",Cw,"*")):a.createCommentVNode("",!0),a.createElementVNode("div",Sw,[t.info?(a.openBlock(),a.createBlock(En,{key:0,hover:""},{content:a.withCtx(()=>[a.createElementVNode("div",{class:"whitespace-break-spaces",innerHTML:t.info},null,8,Ew)]),default:a.withCtx(()=>[a.createVNode(ps,{class:"w-4 h-4 text-zinc-600"})]),_:1})):a.createCommentVNode("",!0)])]),a.createElementVNode("div",Ow,[a.renderSlot(T.$slots,"more")])],2)):a.createCommentVNode("",!0),t.checkbox?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:M,name:s.value,rules:h.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:a.withCtx(({field:H})=>[a.createElementVNode("div",{class:a.normalizeClass(["inline-flex group items-center gap-2",{"is-disabled":t.disabled,"is-active":!t.disabled&&!t.modelValue,"is-selected":t.modelValue===!0}]),onClick:L[0]||(L[0]=Y=>t.disabled?void 0:g(t.modelValue))},[a.createElementVNode("div",{class:a.normalizeClass(["w-4 h-4 border dark:border-gray-800 cursor-pointer",{[`${i[a.unref(ne).theme]}`]:!0}])},[t.modelValue===!0?(a.openBlock(),a.createBlock(rc,{key:0})):a.createCommentVNode("",!0)],2),a.createElementVNode("span",{class:a.normalizeClass(["text-base cursor-pointer select-none text-gray-600 dark:text-gray-500",{"!text-gray-500/50 dark:text-gray-700/50":t.disabled}])},[a.renderSlot(T.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(c.value),1)])],2)],2)]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:M,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:a.withCtx(({field:H})=>[a.createElementVNode("div",{onClick:L[2]||(L[2]=()=>{t.disabled||y(t.radioValue)}),class:a.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[a.createElementVNode("span",{class:a.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):a.createCommentVNode("",!0)],2),a.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:L[1]||(L[1]=(...Y)=>T.onChange&&T.onChange(...Y)),checked:t.radioValue==t.modelValue},null,40,Mw),c.value?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["text-base",{"opacity-50":t.disabled}])},a.toDisplayString(c.value),3)):a.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(a.openBlock(),a.createBlock(a.unref(vn),{key:3,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>{var Y;return[a.createVNode(Yc,{ref_key:"myChoiceList",ref:B,modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((Y=h.value)==null?void 0:Y.indexOf("required"))>=0,label:c.value,placeholder:t.placeholder,loading:t.loading,material:t.material,naked:t.naked},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder","loading","material","naked"])]}),_:1},8,["modelValue","rules","name"])):t.color?(a.openBlock(),a.createBlock(a.unref(vn),{key:4,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>[a.createVNode(Zc,{placeholder:t.placeholder,modelValue:t.modelValue,"onUpdate:modelValue":y},null,8,["placeholder","modelValue"])]),_:1},8,["modelValue","rules","name"])):t.toggleSwitch?(a.openBlock(),a.createBlock(a.unref(vn),{key:5,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(({field:H})=>[a.createVNode(Jc,{modelValue:t.modelValue,"onUpdate:modelValue":y,label:c.value,disabled:t.disabled},null,8,["modelValue","label","disabled"])]),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createElementBlock("div",{key:6,class:a.normalizeClass(["wpic-input flex relative",{"rounded-sm border":!t.naked,"border-b":t.material,"!bg-transparent":t.naked,[`${r[a.unref(ne).theme]}`]:!0,"bg-transparent!":t.transparent,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-gray-200! bg-gray-50! dark:bg-gray-940! dark:border-gray-900! text-gray-400 dark:text-gray-800":t.disabled,"border-red-600! focus-within:outline-red-600 dark:border-red-400/70!":a.unref(l)}])},[T.$slots.prepend?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["absolute dark:text-gray-400 left-0 ml-0 w-9 h-full flex items-center text-center",{"justify-center":!t.naked}])},[a.createElementVNode("div",Tw,[a.renderSlot(T.$slots,"prepend")])],2)):a.createCommentVNode("",!0),t.textarea?(a.openBlock(),a.createBlock(a.unref(vn),{key:1,ref_key:"myInput",ref:M,modelValue:t.modelValue,rules:h.value,name:s.value},{default:a.withCtx(()=>{var H;return[a.createVNode(Gc,{ref_key:"myTextarea",ref:k,modelValue:t.modelValue,"onUpdate:modelValue":p,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&a.unref(l)),required:t.required||((H=h.value)==null?void 0:H.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(a.openBlock(),a.createBlock(a.unref(vn),{key:2,ref_key:"myInput",ref:M,autocomplete:"off",style:{"z-index":"1"},class:a.normalizeClass(["flex w-full h-full rounded-sm pr-4 bg-transparent outline-hidden appearance-none dark:text-gray-400 dark:placeholder:text-gray-700",{"pl-4":!T.$slots.prepend&&!t.naked,"pl-8":T.$slots.prepend&&!t.naked,"pl-6":T.$slots.prepend&&t.naked,"py-2":t.textarea,"text-sm":t.small,"cursor-not-allowed dark:placeholder:text-gray-800!":t.disabled}]),type:u.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:p,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!a.unref(l),rules:h.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(a.openBlock(),a.createElementBlock("div",{key:3,onClick:a.withModifiers(b,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Jn,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(a.openBlock(),a.createElementBlock("div",{key:4,onClick:a.withModifiers(b,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-5 h-5 opacity-50"})])):a.createCommentVNode("",!0),T.$slots.append||t.password||t.type=="password"?(a.openBlock(),a.createElementBlock("div",$w,[a.createElementVNode("div",Nw,[a.renderSlot(T.$slots,"append",{},()=>[a.withDirectives(a.createVNode(uw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,d.value]]),a.withDirectives(a.createVNode(gw,{class:"text-zinc-600 select-none",onClick:f},null,512),[[a.vShow,!d.value]])])])])):a.createCommentVNode("",!0)],2)),t.error&&a.unref(l)?(a.openBlock(),a.createElementBlock("div",Bw,[a.createVNode(a.unref(mm),{name:s.value},{default:a.withCtx(H=>[a.createTextVNode(a.toDisplayString(H.message),1)]),_:1},8,["name"])])):a.createCommentVNode("",!0),T.$slots.help||t.help?(a.openBlock(),a.createElementBlock("div",{key:8,class:a.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[a.renderSlot(T.$slots,"help",{},()=>[a.createTextVNode(a.toDisplayString(t.help),1)])],2)):a.createCommentVNode("",!0)],2))}}),Aw=["innerHTML"],Qc=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},full:Boolean,text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=a.ref(),n=a.ref(),r=a.ref();hs();const i=t;function o(){i.text&&(n.value.style.display="block",l())}function s(){n.value.style.display=""}async function l(){var h,p;await a.nextTick();const c=await tc(e.value,n.value,{placement:i.placement,middleware:[ec(),Qa(),Xa(i.offset),yg({element:r.value})]});n.value.style.left=`${c.x}px`,n.value.style.top=`${c.y}px`;const{x:d,y:u}=c.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(c,d)=>(a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("span",{ref_key:"button",ref:e,class:a.normalizeClass({"w-full h-full":t.full}),"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[a.renderSlot(c.$slots,"default")],34),a.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 dark:border-gray-900 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[a.createElementVNode("span",{innerHTML:t.text},null,8,Aw),a.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),Vw={key:1,class:"flex justify-between items-baseline pt-4 px-6"},Dw={class:""},_w={key:2,class:"flex items-center justify-end py-4 px-6"},Lw=Object.assign({name:"WpicCard"},{props:{title:String,inline:Boolean,loading:Boolean},setup(t){const e={pmi:"bg-white dark:bg-zinc-800/50 shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"bg-white border border-gray-200 dark:bg-gray-940 dark:border-gray-920"},n={pmi:"font-bold","wpic-tools":"font-medium dark:text-gray-300"};return(r,i)=>{const o=a.resolveComponent("wpic-loading-panel");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["rounded-lg wpic-card relative",{[e[a.unref(ne).theme]]:!0,"wpic-card-inline":t.inline,"has-header":t.title||r.$slots.actions||r.$slots.title}])},[t.loading?(a.openBlock(),a.createBlock(o,{key:0,class:"absolute top-0 left-0 z-10",wave:""})):a.createCommentVNode("",!0),t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",Vw,[t.title||r.$slots.title||r.$slots.actions?(a.openBlock(),a.createElementBlock("div",{key:0,class:a.normalizeClass(["text-lg 2xl:text-xl flex items-center",[n[a.unref(ne).theme]]])},[a.renderSlot(r.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])],2)):a.createCommentVNode("",!0),a.createElementVNode("div",Dw,[a.renderSlot(r.$slots,"actions")])])):a.createCommentVNode("",!0),a.renderSlot(r.$slots,"default"),r.$slots.buttons?(a.openBlock(),a.createElementBlock("div",_w,[a.renderSlot(r.$slots,"buttons")])):a.createCommentVNode("",!0)],2)}}}),Iw={key:0,class:"pb-3 flex justify-betweeen h-12 items-center"},Pw={class:"flex-1 text-lg dark:text-gray-300 font-semibold flex items-center"},Rw=Object.assign({name:"WpicCardSection"},{props:{title:String,sub:Boolean,expand:Boolean},setup(t){const e={pmi:"mx-6","wpic-tools":"px-6"};return(n,r)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border-b relative dark:border-gray-900 dark:text-gray-300 last:border-0 pb-6",{[`${e[a.unref(ne).theme]}`]:!0,"pt-3":!(t.title&&n.$slots.actions&&n.$slots.title),"pt-6":!t.title&&!n.$slots.actions&&!n.$slots.title,"bg-gray-50 dark:bg-gray-930 last:rounded-b-lg":t.sub,"p-0! m-0!":t.expand}])},[t.title||n.$slots.title||n.$slots.actions?(a.openBlock(),a.createElementBlock("div",Iw,[a.createElementVNode("div",Pw,[a.renderSlot(n.$slots,"title",{},()=>[a.createTextVNode(a.toDisplayString(t.title),1)])]),a.renderSlot(n.$slots,"actions")])):a.createCommentVNode("",!0),a.renderSlot(n.$slots,"default")],2))}}),zw=a.createElementVNode("div",{class:""},null,-1),jw=a.createStaticVNode('<div class="-mt-2"><div class="absolute left-1/4 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-1/2 h-8 border-r border-gray-100 dark:border-gray-900"></div><div class="absolute left-3/4 h-8 border-r border-gray-100 dark:border-gray-900"></div></div><div class="mt-7 text-gray-500 dark:text-gray-600"><div class="absolute left-0 text-xs">0%</div><div class="absolute left-1/4 -translate-x-1/4 text-xs">25%</div><div class="absolute left-1/2 -translate-x-1/2 text-xs">50%</div><div class="absolute right-1/4 translate-x-3/4 text-xs">75%</div><div class="absolute right-0 text-xs">100%</div></div>',2),Fw=Object.assign({name:"WpicProgressBar"},{props:{percent:Number,value:Number,indicators:Boolean,background:{type:String,default:null},max:{type:Number,default:100},text:String},setup(t){const e=t,n=a.computed(()=>e.percent?e.percent:100/e.max*e.value),r={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-gray-100 rounded-xs h-4 dark:bg-gray-900"},i={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-xs dark:bg-lime-700"};return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["relative flex",{"mb-4":t.indicators}])},[a.createElementVNode("div",{class:a.normalizeClass(["flex w-full relative",r[a.unref(ne).theme]]),style:{"z-index":"1"}},[n.value>0?(a.openBlock(),a.createElementBlock("div",{key:0,style:a.normalizeStyle({width:`${n.value}%`}),class:a.normalizeClass(["flex h-full",{[`${t.background}`]:!0,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createVNode(Qc,{full:"",text:`${n.value}%${t.text?t.text:""}`},{default:a.withCtx(()=>[zw]),_:1},8,["text"])],6)):a.createCommentVNode("",!0)],2),t.indicators?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[jw],64)):a.createCommentVNode("",!0)],2))}}),Hw={class:"leading-none"},Ww=Object.assign({name:"WpicTag"},{props:{clearable:Boolean,small:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-none bg-gray-200 text-gray-700 text-sm dark:text-gray-400 dark:bg-gray-810"},r=e;function i(){r("clear")}return(o,s)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["wpic-tag select-none border inline-flex rounded-sm h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-1":t.clearable,[n[a.unref(ne).theme]]:!0}])},[a.createElementVNode("span",Hw,[a.renderSlot(o.$slots,"default")]),t.clearable?(a.openBlock(),a.createElementBlock("span",{key:0,onClick:i,class:"ml-2 mt-px cursor-pointer opacity-75 hover:opacity-100"},[a.createVNode(Wr,{class:"w-4 h-4"})])):a.createCommentVNode("",!0)],2))}}),Uw=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass({"w-full":t.full})},[a.createElementVNode("div",{class:a.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[a.renderSlot(e.$slots,"default")],2)],2))}}),qw=t=>(a.pushScopeId("data-v-947735f2"),t=t(),a.popScopeId(),t),Kw={key:1,class:"w-full min-h-10 h-full rounded-lg bg-gray-100 dark:bg-gray-940 relative overflow-hidden"},Yw=[qw(()=>a.createElementVNode("div",{class:"absolute top-0 left-0 h-full w-full shimmer dark:dark-shimmer"},null,-1))],Jw=ae(Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""},wave:{type:Boolean,default:!1}},setup(t){return(e,n)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["w-full h-full flex items-center justify-center",{"py-3":!t.wave}])},[t.wave?(a.openBlock(),a.createElementBlock("div",Kw,Yw)):(a.openBlock(),a.createBlock(Jn,{key:0,color:t.color,class:"w-10 h-10"},null,8,["color"]))],2))}}),[["__scopeId","data-v-947735f2"]]),Gw={class:"text-base font-medium select-none"},Gr=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean,disabled:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"dark:text-gray-400 hover:text-lime-600 dark:border-gray-900"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white dark:bg-lime-700 dark:border-lime-700"},r={pmi:"text-zinc-300","wpic-tools":"text-gray-300 dark:text-gray-700 dark:border-gray-900"};return(i,o)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["border rounded-sm flex items-center justify-center w-10 h-10 cursor-pointer",{[e[a.unref(ne).theme]]:!t.active&&!t.disabled,[n[a.unref(ne).theme]]:t.active&&!t.disabled,[r[a.unref(ne).theme]]:t.disabled}])},[a.createElementVNode("span",Gw,[a.renderSlot(i.$slots,"default")])],2))}}),Zw={},Xw={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Qw=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function ev(t,e){return a.openBlock(),a.createElementBlock("svg",Xw,Qw)}const ed=ae(Zw,[["render",ev]]),tv={},nv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},rv=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function iv(t,e){return a.openBlock(),a.createElementBlock("svg",nv,rv)}const td=ae(tv,[["render",iv]]),ov={},sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},lv=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function av(t,e){return a.openBlock(),a.createElementBlock("svg",sv,lv)}const nd=ae(ov,[["render",av]]),cv={},dv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},uv=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function fv(t,e){return a.openBlock(),a.createElementBlock("svg",dv,uv)}const rd=ae(cv,[["render",fv]]),hv={class:"wpic-pagination flex justify-between"},pv={key:0,class:"flex items-center"},mv={class:"font-medium"},gv=a.createElementVNode("span",{class:"px-1"},"to",-1),yv={class:"font-medium"},bv=a.createElementVNode("span",{class:"px-1"},"of",-1),kv={class:"font-medium"},xv={class:"pl-1"},wv={key:1,class:"flex flex-wrap gap-2"},vv=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:{type:Boolean,default:!1},total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1},perPageOptions:{type:Array,default:()=>[10,20,50,100,200]}},emits:["update:perPage","update:currentPage","update:perPage"],setup(t,{expose:e,emit:n}){const r=t,i=a.computed(()=>r.perPageOptions.map(h=>({value:Number(h),label:`${h} per page`}))),o=n,s=a.computed(()=>Math.ceil(r.total/r.perPage)),l=a.computed(()=>{const h=s.value;if(!h||h===1)return[1];const p=r.currentPage,m=1;let g=Math.max(2,p-m),y=Math.min(h-1,p+m);p<=m+2&&(g=2,y=Math.min(2*m+2,h-1)),p>=h-m-1&&(g=Math.max(2,h-2*m-1),y=h-1);const b=[];for(let v=g;v<=y;v++)b.push(v);return g>2&&b.unshift("..."),y<h-1&&b.push("..."),[1,...b,h]});function c(h){h>=1&&h<=s.value&&o("update:currentPage",h)}function d(){return r.perPage*(r.currentPage-1)+1}function u(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}async function f(h){o("update:perPage",h),o("update:currentPage",1)}return e({getStart:d,getEnd:u}),(h,p)=>{const m=a.resolveComponent("wpic-choice-list");return a.openBlock(),a.createElementBlock("div",hv,[t.info?(a.openBlock(),a.createElementBlock("div",pv,[t.total>0?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("span",mv,a.toDisplayString(d()),1),gv,a.createElementVNode("span",yv,a.toDisplayString(u()),1),t.total?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[bv,a.createElementVNode("span",kv,a.toDisplayString(t.total),1),a.createElementVNode("span",xv,"result"+a.toDisplayString(t.total>1?"s":""),1)],64)):a.createCommentVNode("",!0)],64)):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0),t.pages?(a.openBlock(),a.createElementBlock("div",wv,[a.createVNode(Gr,{onClick:p[0]||(p[0]=g=>c(1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(ed,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[1]||(p[1]=g=>c(t.currentPage-1)),disabled:t.currentPage===1||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(td,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,g=>(a.openBlock(),a.createBlock(Gr,{key:`page_${g}`,onClick:y=>c(g),active:g===t.currentPage,disabled:s.value==0||!s.value},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(g),1)]),_:2},1032,["onClick","active","disabled"]))),128)),a.createVNode(Gr,{onClick:p[2]||(p[2]=g=>c(t.currentPage+1)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(rd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),a.createVNode(Gr,{onClick:p[3]||(p[3]=g=>c(s.value)),disabled:t.currentPage===s.value||s.value==0||!s.value},{default:a.withCtx(()=>[a.createVNode(nd,{class:"w-5 h-5 select-none"})]),_:1},8,["disabled"]),t.perPages?(a.openBlock(),a.createBlock(m,{key:0,modelValue:t.perPage,"onUpdate:modelValue":f,options:i.value},null,8,["modelValue","options"])):a.createCommentVNode("",!0)])):a.createCommentVNode("",!0)])}}}),id=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return a.h("td",e.attrs,n)};id.props=["column","item","rowIndex"];const Yi=id,Cv={},Sv={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Ev=[a.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function Ov(t,e){return a.openBlock(),a.createElementBlock("svg",Sv,Ev)}const Mv=ae(Cv,[["render",Ov]]),Tv={class:"font-semibold"},od={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String,checkable:Boolean},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-gray-50 border-gray-200 dark:text-gray-300 dark:border-gray-900 dark:bg-gray-810/45"};return(n,r)=>(a.openBlock(),a.createElementBlock("tr",Tv,[t.checkable?(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":!0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer"}]),id:"total_0",column:{},key:"tr_total_0"},null,8,["class"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.columns,(i,o)=>(a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[a.unref(ne).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":t.position==="footer","first:rounded-bl-lg":t.position==="footer","text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},$v={},Nv={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},Bv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function Av(t,e){return a.openBlock(),a.createElementBlock("svg",Nv,Bv)}const Vv=ae($v,[["render",Av]]),Dv={},_v={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Lv=[a.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z"},null,-1)];function Iv(t,e){return a.openBlock(),a.createElementBlock("svg",_v,Lv)}const Pv=ae(Dv,[["render",Iv]]),Rv={class:"wpic-table"},zv={key:0,class:"px-2 py-1 flex justify-between border-b dark:border-gray-900"},jv={class:"flex items-center gap-2"},Fv={class:"flex items-center gap-2"},Hv={class:"w-full rounded-lg"},Wv={key:0,class:"w-16"},Uv=["width"],qv=["width"],Kv={class:"flex justify-center items-center h-full"},Yv=["onClick"],Jv={class:"rounded-b-lg relative"},Gv={key:0},Zv=[a.createElementVNode("td",{class:"text-center py-3"}," ",-1)],Xv={class:"flex justify-center items-center h-full"},Qv={key:1},e5={key:0,class:"text-center text-gray-400 py-3"},t5=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"},small:Boolean,noRadius:Boolean,stickyHeader:Boolean,columnToggleable:Boolean,checkable:Boolean,itemId:{type:String,default:"id"}},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-gray-300 dark:border-gray-700"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-gray-100 text-gray-600 border-gray-200 dark:bg-gray-930 dark:border-gray-900 dark:text-gray-500"},s={pmi:"","wpic-tools":"dark:border-gray-900"},l={pmi:"","wpic-tools":""},c={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white text-gray-500 !font-normal border-gray-200 dark:bg-gray-940 dark:border-gray-920 dark:text-gray-400"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-gray-50 border-gray-200 dark:group-[.is-odd]:bg-gray-940 dark:group-[.is-even]:bg-gray-930"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-gray-900/10"},f=n;a.onMounted(()=>{b()});const h=a.getCurrentInstance();a.provide("wtable",h==null?void 0:h.proxy);const p=a.useSlots(),m=a.ref([]),g=a.ref([]),y=a.computed(()=>r.columnToggleable?m.value.filter(H=>g.value.includes(H.field)||!H.selectable):m.value.filter(H=>H.visible||!H.selectable));function b(){const H=(N,x)=>{let A={};for(let V in N){if(typeof N[V].default=="boolean"&&x[V]!==void 0){A[V]=x[V]!==!1;continue}if(x[V]!==void 0){A[V]=x[V];continue}if(typeof N[V].default=="function"){A[V]=N[V].default();continue}A[V]=N[V].default}return A};let Y=[];(p.default&&p.default()||[]).forEach(N=>{var x,A;((x=N.type)==null?void 0:x.name)==="WpicTableColumn"?Y.push(N):(A=N.children)!=null&&A.length&&N.children.forEach(V=>{var K;((K=V.type)==null?void 0:K.name)==="WpicTableColumn"&&Y.push(V)})}),m.value=Y.map(N=>{let x=N.children,A=N.props||{},{field:V,label:K,help:Q,width:$,minWidth:F,maxWidth:D,sortable:ee,selectable:q,render:P,type:X,align:he,visible:le,noPadding:pe}=H(N.type.props,A);return V||(V=L(K)),q&&le&&g.value.push(V),{label:K,help:Q,width:$,minWidth:F,maxWidth:D,type:X,align:he,sortable:ee,selectable:q,field:V,render:P,children:x,visible:le,noPadding:pe}})}function v(H){var W,N;let Y=(W=r.sortOptions)==null?void 0:W.sortDirection;((N=r.sortOptions)==null?void 0:N.sortBy)===H&&(Y=Y==="asc"?"desc":"asc"),f("changeSort",{sortDirection:Y,sortBy:H})}a.watch(()=>p.default,H=>{b()},{deep:!0});const M=a.reactive({});function k({index:H,item:Y}){M[H]?M[H]=null:(M[H]=!0,f("expandRow",{index:H,item:Y}))}const O=a.ref([]);function C(H){const Y=T(H,r.itemId);O.value.includes(Y)?(O.value.splice(O.value.indexOf(Y),1),B.value=!1):O.value.push(Y)}const B=a.ref(!1);function I(){if(B.value=!B.value,O.value=[],B.value)for(let H of r.data){let Y=T(H,r.itemId);O.value.push(Y)}}function _(){B.value=!1,O.value=[]}e({buildColumns:b,selectedRows:O,selectedColumns:g,resetSelectedRows:_});function T(H,Y){return Y.split(".").reduce((W,N)=>W?W[N]:void 0,H)}function L(H){return!H||typeof H!="string"?"":H.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}return(H,Y)=>{const W=a.resolveComponent("wpic-choice-list"),N=a.resolveComponent("wpic-form-field");return a.openBlock(),a.createElementBlock("div",Rv,[H.$slots.header||H.$slots.actions||t.columnToggleable?(a.openBlock(),a.createElementBlock("div",zv,[a.createElementVNode("div",jv,[a.renderSlot(H.$slots,"header")]),a.createElementVNode("div",Fv,[a.renderSlot(H.$slots,"actions"),a.createVNode(W,{multiple:"",modelValue:g.value,"onUpdate:modelValue":Y[0]||(Y[0]=x=>g.value=x),"hide-select":"","hide-chevron":"",naked:"",options:m.value.filter(x=>x.selectable).map(x=>({label:x.label,value:x.field}))},{default:a.withCtx(()=>[a.createVNode(Pr,{medium:"",colorless:"",class:"ml-px"},{default:a.withCtx(()=>[a.createVNode(Pv,{class:"w-5 h-5 mr-2"}),a.createTextVNode(" Columns ")]),_:1})]),_:1},8,["modelValue","options"])])])):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["wpic-table-content relative w-full rounded-lg overflow-hidden-",{"no-radius rounded-none":t.noRadius||t.columnToggleable,border:t.border,[`${i[a.unref(ne).theme]}`]:!0}])},[a.createElementVNode("div",{class:a.normalizeClass(["",{"overflow-y-auto":!t.stickyHeader}])},[a.createElementVNode("table",Hv,[a.createElementVNode("colgroup",null,[t.checkable?(a.openBlock(),a.createElementBlock("col",Wv)):a.createCommentVNode("",!0),y.value.find(x=>x.type=="expand")?(a.openBlock(),a.createElementBlock("col",{key:1,style:a.normalizeStyle({minWidth:`${y.value.find(x=>x.type=="expand").minWidth}px`}),width:y.value.find(x=>x.type=="expand").width,class:"w-16"},null,12,Uv)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(x=>x.type!="expand"),(x,A)=>(a.openBlock(),a.createElementBlock("col",{style:a.normalizeStyle({minWidth:`${x.minWidth}px`,maxWidth:`${x.maxWidth}px`}),width:x.width,key:A},null,12,qv))),128))]),t.hideHeaders?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("thead",{key:0,class:a.normalizeClass(["rounded-t-lg",{"sticky top-0 z-10":t.stickyHeader}])},[a.createElementVNode("tr",null,[t.checkable?(a.openBlock(),a.createElementBlock("th",{key:0,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},[a.createElementVNode("div",Kv,[a.createVNode(N,{slim:"","hide-error":"",checkbox:"",modelValue:B.value,"onUpdate:modelValue":I},null,8,["modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(x=>x.type=="expand")?(a.openBlock(),a.createElementBlock("th",{key:1,class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[a.unref(ne).theme]}`]])},null,2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(x=>x.type!="expand"),(x,A)=>{var V,K;return a.openBlock(),a.createElementBlock("th",{class:a.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[a.unref(ne).theme]}`]:!0,"sticky top-0 left-0":A===0}]),style:a.normalizeStyle({maxWidth:`${x.maxWidth}px`})},[a.createElementVNode("div",{onClick:()=>{x.sortable&&v(x.field)},class:a.normalizeClass(["flex items-center lg:text-base rounded-lg",{"py-3":!t.small,"py-1 text-sm":t.small,"cursor-pointer":x.sortable&&x.field,"justify-center":x.align=="center","justify-end":x.align=="right"}])},[a.createElementVNode("span",{class:a.normalizeClass(["select-none font-medium text-sm",{"text-right":x.align=="right"}])},a.toDisplayString(x.label),3),x.sortable&&x.field?(a.openBlock(),a.createElementBlock("span",{key:0,class:a.normalizeClass(["ml-1",{"opacity-25":x.field!=((V=t.sortOptions)==null?void 0:V.sortBy)}])},[a.createVNode(Mv,{class:a.normalizeClass(["w-4 h-4",{"rotate-180":((K=t.sortOptions)==null?void 0:K.sortDirection)==="asc"}])},null,8,["class"])],2)):a.createCommentVNode("",!0)],10,Yv)],6)}),256))])],2)),a.createElementVNode("tbody",Jv,[t.loading?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:a.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[a.unref(ne).theme]]])},[a.createVNode(Jn,{class:"w-6 h-6"})],2),t.data.length?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("tr",Gv,Zv))],64)):a.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(a.openBlock(),a.createBlock(od,{key:1,checkable:t.checkable,position:"header",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(t.data,(x,A)=>{var V,K,Q,$,F;return a.openBlock(),a.createElementBlock(a.Fragment,{key:`tr_${A}`},[a.createElementVNode("tr",{class:a.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":A%2==0,"is-even":A%2!=0,[s[a.unref(ne).theme]]:!0}])},[t.checkable?(a.openBlock(),a.createElementBlock("td",{key:0,class:a.normalizeClass([{[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}])},[a.createElementVNode("div",Xv,[a.createVNode(N,{slim:"","hide-error":"",checkbox:"",modelValue:O.value.includes(T(x,t.itemId)),checkboxValue:T(x,t.itemId),"onUpdate:modelValue":D=>C(x)},null,8,["modelValue","checkboxValue","onUpdate:modelValue"])])],2)):a.createCommentVNode("",!0),y.value.find(D=>D.type=="expand")?(a.openBlock(),a.createElementBlock("td",{key:1,class:a.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top",[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-gray-920"])},[a.createVNode(Pr,{small:"",square:"",onClick:D=>k({item:x,index:A})},{default:a.withCtx(()=>[M[A]?(a.openBlock(),a.createBlock(ww,{key:0,class:"w-4 h-4"})):(a.openBlock(),a.createBlock(Vv,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):a.createCommentVNode("",!0),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(y.value.filter(D=>D.type!="expand"),(D,ee)=>{var q,P;return a.openBlock(),a.createBlock(Yi,{class:a.normalizeClass(["lg:text-base h-full table-cell",{"text-sm lg:text-sm py-1!":t.small,"sticky left-0 shadow-sm":ee===0,[`${c[a.unref(ne).theme]}`]:!0,[`${d[a.unref(ne).theme]}`]:t.stripe,"py-3 first:pl-6 pr-6":!D.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":A===((q=t.data)==null?void 0:q.length)-1&&!t.totalItem&&!y.value.find(X=>X.type=="expand")&&!t.noRadius,"first:rounded-bl-lg":A===((P=t.data)==null?void 0:P.length)-1&&!t.totalItem&&!y.value.find(X=>X.type=="expand")&&!t.noRadius,"text-center justify-center":D.align=="center","text-right justify-end":D.align=="right","align-top py-5":t.valign=="top"}]),style:a.normalizeStyle({maxWidth:`${D.maxWidth}px`}),id:`${A}_${ee}`,column:D,item:x,rowIndex:A,key:ee},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),y.value.find(D=>D.type=="expand")?a.withDirectives((a.openBlock(),a.createElementBlock("tr",{key:0,class:a.normalizeClass([{[s[a.unref(ne).theme]]:!t.stripe,[l[a.unref(ne).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[a.createVNode(Yi,{class:a.normalizeClass(["lg:text-base bg-gray-50! dark:bg-gray-940!",{[`${c[a.unref(ne).theme]}`]:!0,"py-3 first:pl-6 pr-6":!((V=y.value.find(D=>D.type=="expand"))!=null&&V.noPadding),"p-0":(K=y.value.find(D=>D.type=="expand"))==null?void 0:K.noPadding,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":A===((Q=t.data)==null?void 0:Q.length)-1&&!t.totalItem,"first:rounded-bl-lg":A===(($=t.data)==null?void 0:$.length)-1&&!t.totalItem,"text-center":y.value.find(D=>D.type=="expand").align=="center","text-right":y.value.find(D=>D.type=="expand").align=="right"}]),column:y.value.find(D=>D.type=="expand"),rowIndex:A,colspan:(F=y.value)==null?void 0:F.length,item:x},null,8,["class","column","rowIndex","colspan","item"])],2)),[[a.vShow,M[A]]]):a.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(a.openBlock(),a.createElementBlock("tfoot",Qv,[a.createVNode(od,{checkable:t.checkable,position:"footer",columns:y.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["checkable","columns","noXPadding","totalItem"])])):a.createCommentVNode("",!0)])],2),!t.loading&&!t.data.length?(a.openBlock(),a.createElementBlock("div",e5," No Data ")):a.createCommentVNode("",!0)],2)])}}}),n5={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0},noPadding:{type:Boolean,default:!1}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function De(t){this.content=t}De.prototype={constructor:De,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new De(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new De(n)},addToStart:function(t,e){return new De([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new De(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new De(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=De.from(t),t.size?new De(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=De.from(t),t.size?new De(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=De.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},De.from=function(t){if(t instanceof De)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new De(e)};function sd(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=sd(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ld(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),l=e.child(--o),c=s.nodeSize;if(s==l){n-=c,r-=c;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let d=0,u=Math.min(s.text.length,l.text.length);for(;d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||l.content.size){let d=ld(s.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class z{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,l=0;l<n;s++){let c=this.content[s],d=l+c.nodeSize;if(d>e&&r(c,i+l,o||null,s)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),r,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new z(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let l=this.content[o],c=s+l.nodeSize;c>e&&((s<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=c}return new z(r,i)}cutByIndex(e,n){return e==n?z.empty:e==0&&n==this.content.length?this:new z(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new z(i,o)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return sd(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return ld(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ji(0,e);if(e==this.size)return Ji(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?Ji(r+1,s):Ji(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return z.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new z(n||e,r)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const Ms={index:0,offset:0};function Ji(t,e){return Ms.index=t,Ms.offset=e,Ms}function Gi(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Gi(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Gi(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ye=class aa{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Gi(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return aa.none;if(e instanceof aa)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ye.none=[];class Zi extends Error{}class J{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=cd(this.content,e+this.openStart,n);return r&&new J(r,this.openStart,this.openEnd)}removeBetween(e,n){return new J(ad(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return J.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new J(z.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new J(e,r,i)}}J.empty=new J(z.empty,0,0);function ad(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:l}=t.findIndex(n);if(i==e||o.isText){if(l!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(ad(o.content,e-i-1,n-i-1)))}function cd(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=cd(s.content,e-o-1,n);return l&&t.replaceChild(i,s.copy(l))}function r5(t,e,n){if(n.openStart>t.depth)throw new Zi("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Zi("Inconsistent open depths");return dd(t,e,n,0)}function dd(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=dd(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,l=s.content;return $n(s,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:s,end:l}=i5(n,t);return $n(o,fd(t,s,l,e,r))}else return $n(o,Xi(t,e,r))}function ud(t,e){if(!e.type.compatibleContent(t.type))throw new Zi("Cannot join "+e.type.name+" onto "+t.type.name)}function Ts(t,e,n){let r=t.node(n);return ud(r,e.node(n)),r}function Tn(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Zr(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Tn(t.nodeAfter,r),o++));for(let l=o;l<s;l++)Tn(i.child(l),r);e&&e.depth==n&&e.textOffset&&Tn(e.nodeBefore,r)}function $n(t,e){return t.type.checkContent(e),t.copy(e)}function fd(t,e,n,r,i){let o=t.depth>i&&Ts(t,e,i+1),s=r.depth>i&&Ts(n,r,i+1),l=[];return Zr(null,t,i,l),o&&s&&e.index(i)==n.index(i)?(ud(o,s),Tn($n(o,fd(t,e,n,r,i+1)),l)):(o&&Tn($n(o,Xi(t,e,i+1)),l),Zr(e,n,i,l),s&&Tn($n(s,Xi(n,r,i+1)),l)),Zr(r,null,i,l),new z(l)}function Xi(t,e,n){let r=[];if(Zr(null,t,n,r),t.depth>n){let i=Ts(t,e,n+1);Tn($n(i,Xi(t,e,n+1)),r)}return Zr(e,null,n,r),new z(r)}function i5(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(z.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Xr{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let l=r;r=i,i=l}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Qi(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:l,offset:c}=s.content.findIndex(o),d=o-c;if(r.push(s,l,i+c),!d||(s=s.child(l),s.isText))break;o=d-1,i+=c+1}return new Xr(n,r,o)}static resolveCached(e,n){let r=hd.get(e);if(r)for(let o=0;o<r.elts.length;o++){let s=r.elts[o];if(s.pos==n)return s}else hd.set(e,r=new o5);let i=r.elts[r.i]=Xr.resolve(e,n);return r.i=(r.i+1)%s5,i}}class o5{constructor(){this.elts=[],this.i=0}}const s5=12,hd=new WeakMap;class Qi{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const l5=Object.create(null);let Qt=class ca{constructor(e,n,r,i=ye.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Gi(this.attrs,n||e.defaultAttrs||l5)&&ye.sameSet(this.marks,r||ye.none)}copy(e=null){return e==this.content?this:new ca(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ca(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return J.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),l=i.start(s),d=i.node(s).content.cut(i.pos-l,o.pos-l);return new J(d,i.depth-s,o.depth-s)}replace(e,n,r){return r5(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Xr.resolveCached(this,e)}resolveNoCache(e){return Xr.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),pd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=z.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=z.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Qt.prototype.text=void 0;class eo extends Qt{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):pd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new eo(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new eo(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function pd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Nn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new a5(e,n);if(r.next==null)return Nn.empty;let i=md(r);r.next&&r.err("Unexpected trailing text");let o=m5(p5(i));return g5(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,l){let c=s.matchFragment(e,r);if(c&&(!n||c.validEnd))return z.from(l.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,l.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let l=i;l.type;l=l.via)s.push(l.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:l,next:c}=o.next[s];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
6
6
|
`)}}Nn.empty=new Nn(!0);class a5{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function md(t){let e=[];do e.push(c5(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function c5(t){let e=[];do e.push(d5(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function d5(t){let e=h5(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=u5(t,e);else break;return e}function gd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function u5(t,e){let n=gd(t),r=n;return t.eat(",")&&(t.next!="}"?r=gd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function f5(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function h5(t){if(t.eat("(")){let e=md(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=f5(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function p5(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,l,c){let d={term:c,to:l};return e[s].push(d),d}function i(s,l){s.forEach(c=>c.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((c,d)=>c.concat(o(d,l)),[]);if(s.type=="seq")for(let c=0;;c++){let d=o(s.exprs[c],l);if(c==s.exprs.length-1)return d;i(d,l=n())}else if(s.type=="star"){let c=n();return r(l,c),i(o(s.expr,c),c),[r(c)]}else if(s.type=="plus"){let c=n();return i(o(s.expr,l),c),i(o(s.expr,c),c),[r(c)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let c=l;for(let d=0;d<s.min;d++){let u=n();i(o(s.expr,c),u),c=u}if(s.max==-1)i(o(s.expr,c),c);else for(let d=s.min;d<s.max;d++){let u=n();r(c,u),i(o(s.expr,c),u),c=u}return[r(c)]}else{if(s.type=="name")return[r(l,void 0,s.value)];throw new Error("Unknown expr type")}}}}function yd(t,e){return e-t}function bd(t,e){let n=[];return r(e),n.sort(yd);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:l,to:c}=o[s];!l&&n.indexOf(c)==-1&&r(c)}}}function m5(t){let e=Object.create(null);return n(bd(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<i.length;u++)i[u][0]==l&&(d=i[u][1]);bd(t,c).forEach(u=>{d||i.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Nn(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let l=i[s][1].sort(yd);o.next.push({type:i[s][0],next:e[l.join(",")]||n(l)})}return o}}function g5(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];s.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function kd(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function xd(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function wd(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function vd(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new b5(t,r,e[r]);return n}let Cd=class lp{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=vd(e,r.attrs),this.defaultAttrs=kd(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Nn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:xd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Qt(this,this.computeAttrs(e),z.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=z.from(n),this.checkContent(n),new Qt(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=z.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(z.empty,!0);return o?new Qt(this,e,n.append(o),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){wd(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ye.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new lp(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function y5(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class b5{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?y5(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class to{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=vd(e,i.attrs),this.excluded=null;let o=kd(this.attrs);this.instance=o?new ye(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,xd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new to(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){wd(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Sd{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=De.from(e.nodes),n.marks=De.from(e.marks||{}),this.nodes=Cd.compile(this.spec.nodes,this),this.marks=to.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Nn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?Ed(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:Ed(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Cd){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new eo(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Qt.fromJSON(this,e)}markFromJSON(e){return ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Ed(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=c)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function k5(t){return t.tag!=null}function x5(t){return t.style!=null}class en{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(k5(i))this.tags.push(i);else if(x5(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new $d(this,n,!1);return r.addAll(e,ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new $d(this,n,!0);return r.addAll(e,ye.none,n.from,n.to),J.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(C5(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(!(l.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(s.getAttrs){let c=s.getAttrs(n);if(c===!1)continue;s.attrs=c||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let l=n[s];if((l.priority==null?50:l.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Nd(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new en(e,en.schemaRules(e)))}}const Od={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},w5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Md={ol:!0,ul:!0},Qr=1,$s=2,no=4;function Td(t,e,n){return e!=null?(e?Qr:0)|(e==="full"?$s:0):t&&t.whitespace=="pre"?Qr|$s:n&-5}class ro{constructor(e,n,r,i,o,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=ye.none,this.match=o||(s&no?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(z.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qr)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=z.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Od.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class $d{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=Td(null,n.preserveWhitespace,0)|(r?no:0);i?o=new ro(i.type,i.attrs,ye.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new ro(null,null,ye.none,!0,null,s):o=new ro(e.schema.topNodeType,null,ye.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&$s?"full":this.localPreserveWS||(i.options&Qr)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
7
7
|
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Md.hasOwnProperty(s)&&this.parser.normalizeLists&&v5(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(c?c.ignore:w5.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(Od.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),d=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let f=c&&c.skip?n:this.readStyles(e,n);f&&this.addAll(e,f),d&&this.sync(o),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
8
8
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],s=r.getPropertyValue(o);if(s)for(let l=void 0;;){let c=this.parser.matchStyle(o,s,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(e,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(s,n.attrs||null,r,n.preserveWhitespace);c&&(o=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}o&&this.sync(l)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ye.none;for(let s of r.concat(e.marks))(i.type?i.type.allowsMarkType(s.type):Bd(s.type,e.type))&&(o=s.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let l=Td(e,o,s.options);s.options&no&&s.content.length==0&&(l|=no);let c=ye.none;return r=r.filter(d=>(s.type?s.type.allowsMarkType(d.type):Bd(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new ro(e,n,c,i,null,l)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Qr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=o;c--)if(s(l-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function v5(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Md.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function C5(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Nd(t){let e={};for(let n in t)e[n]=t[n];return e}function Bd(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=l=>{o.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class Bn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Ns(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let l=0,c=0;for(;l<o.length&&c<s.marks.length;){let d=s.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<o.length;)i=o.pop()[1];for(;c<s.marks.length;){let d=s.marks[c++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=io(Ns(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&io(Ns(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return io(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Ad(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Ad(e.marks)}}function Ad(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ns(t){return t.document||window.document}const Vd=new WeakMap;function S5(t){let e=Vd.get(t);return e===void 0&&Vd.set(t,e=E5(t)),e}function E5(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function io(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=S5(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,c=n?t.createElementNS(n,i):t.createElement(i),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let f in d)if(d[f]!=null){let h=f.indexOf(" ");h>0?c.setAttributeNS(f.slice(0,h),f.slice(h+1),d[f]):c.setAttribute(f,d[f])}}for(let f=u;f<e.length;f++){let h=e[f];if(h===0){if(f<e.length-1||f>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:p,contentDOM:m}=io(t,h,n,r);if(c.appendChild(p),m){if(l)throw new RangeError("Multiple content holes");l=m}}}return{dom:c,contentDOM:l}}const Dd=65535,_d=Math.pow(2,16);function O5(t,e){return t+e*_d}function Ld(t){return t&Dd}function M5(t){return(t-(t&Dd))/_d}const Id=1,Pd=2,oo=4,Rd=8;class Bs{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Rd)>0}get deletedBefore(){return(this.delInfo&(Id|oo))>0}get deletedAfter(){return(this.delInfo&(Pd|oo))>0}get deletedAcross(){return(this.delInfo&oo)>0}}class et{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&et.empty)return et.empty}recover(e){let n=0,r=Ld(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+M5(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+o],u=this.ranges[l+s],f=c+d;if(e<=f){let h=d?e==c?-1:e==f?1:n:n,p=c+i+(h<0?0:u);if(r)return p;let m=e==(n<0?c:f)?null:O5(l/3,e-c),g=e==c?Pd:e==f?Id:oo;return(n<0?e!=c:e!=f)&&(g|=Rd),new Bs(p,g,m)}i+=u-d}return r?e+i:new Bs(e+i,0,null)}touches(e,n){let r=0,i=Ld(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[l+o],u=c+d;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),c=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(l,l+d,c,c+u),o+=u-d}}invert(){return new et(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?et.empty:new et(e<0?[0,-e,0]:[0,0,e])}}et.empty=new et([]);class or{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new or(this.maps,this.mirror,e,n)}copy(){return new or(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new or;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],l=s.mapResult(e,n);if(l.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(l.recover);continue}}i|=l.delInfo,e=l.pos}return r?e:new Bs(e,i,null)}}const As=Object.create(null);class Pe{getMap(){return et.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=As[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in As)throw new RangeError("Duplicate use of step JSON ID "+e);return As[e]=n,n.prototype.jsonID=e,n}}class Se{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Se(e,null)}static fail(e){return new Se(null,e)}static fromReplace(e,n,r,i){try{return Se.ok(e.replace(n,r,i))}catch(o){if(o instanceof Zi)return Se.fail(o.message);throw o}}}function Vs(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(Vs(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return z.fromArray(r)}class tn extends Pe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new J(Vs(n.content,(s,l)=>!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,o)}invert(){return new Ot(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new tn(n.pos,r.pos,this.mark)}merge(e){return e instanceof tn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new tn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new tn(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("addMark",tn);class Ot extends Pe{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new J(Vs(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Se.fromReplace(e,this.from,this.to,r)}invert(){return new tn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ot(n.pos,r.pos,this.mark)}merge(e){return e instanceof Ot&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ot(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ot(n.from,n.to,e.markFromJSON(n.mark))}}Pe.jsonID("removeMark",Ot);class nn extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new J(z.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new nn(this.pos,n.marks[i]);return new nn(this.pos,this.mark)}}return new sr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new nn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new nn(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("addNodeMark",nn);class sr extends Pe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Se.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Se.fromReplace(e,this.pos,this.pos+1,new J(z.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new nn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new sr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new sr(n.pos,e.markFromJSON(n.mark))}}Pe.jsonID("removeNodeMark",sr);class $e extends Pe{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Ds(e,this.from,this.to)?Se.fail("Structure replace would overwrite content"):Se.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new et([this.from,this.to-this.from,this.slice.size])}invert(e){return new $e(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new $e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof $e)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?J.empty:new J(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new $e(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?J.empty:new J(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new $e(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new $e(n.from,n.to,J.fromJSON(e,n.slice),!!n.structure)}}Pe.jsonID("replace",$e);class Ne extends Pe{constructor(e,n,r,i,o,s,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(Ds(e,this.from,this.gapFrom)||Ds(e,this.gapTo,this.to)))return Se.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Se.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Se.fromReplace(e,this.from,this.to,r):Se.fail("Content does not fit in gap")}getMap(){return new et([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ne(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ne(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ne(n.from,n.to,n.gapFrom,n.gapTo,J.fromJSON(e,n.slice),n.insert,!!n.structure)}}Pe.jsonID("replaceAround",Ne);function Ds(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function T5(t,e,n,r){let i=[],o=[],s,l;t.doc.nodesBetween(e,n,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+c.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new Ot(h,p,f[g])));l&&l.to==h?l.to=p:o.push(l=new tn(h,p,r))}}),i.forEach(c=>t.step(c)),o.forEach(c=>t.step(c))}function $5(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,l)=>{if(!s.isInline)return;o++;let c=null;if(r instanceof to){let d=s.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(c=[r]):c=s.marks;if(c&&c.length){let d=Math.min(l+s.nodeSize,n);for(let u=0;u<c.length;u++){let f=c[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(l,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Ot(s.from,s.to,s.style)))}function _s(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],l=e+1;for(let c=0;c<o.childCount;c++){let d=o.child(c),u=l+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new $e(l,u,J.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Ot(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new J(z.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new $e(l+h.index,l+h.index+h[0].length,m))}}l=u}if(!r.validEnd){let c=r.fillBefore(z.empty,!0);t.replace(l,l,new J(c,0,0))}for(let c=s.length-1;c>=0;c--)t.step(s[c])}function N5(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function lr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!N5(i,o,s))break}return null}function B5(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),l=i.after(o+1),c=s,d=l,u=z.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=z.from(r.node(m).copy(u)),f++):c--;let h=z.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=z.from(i.node(m).copy(h)),p++):d++;t.step(new Ne(c,d,s,l,new J(u.append(h),f,p),u.size-f,!0))}function Ls(t,e,n=null,r=t){let i=A5(t,e),o=i&&V5(r,e);return o?i.map(zd).concat({type:e,attrs:n}).concat(o.map(zd)):null}function zd(t){return{type:t,attrs:null}}function A5(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function V5(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let c=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:s}function D5(t,e,n){let r=z.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=z.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ne(i,o,i,o,new J(r,0,0),n.length,!0))}function _5(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,l)=>{let c=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,c)&&L5(t.doc,t.mapping.slice(o).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?d=!1:!p&&m&&(d=!0)}d===!1&&Fd(t,s,l,o),_s(t,t.mapping.slice(o).map(l,1),r,void 0,d===null);let u=t.mapping.slice(o),f=u.map(l,1),h=u.map(l+s.nodeSize,1);return t.step(new Ne(f,h,f+1,h-1,new J(z.from(r.create(c,null,s.marks)),0,0),1,!0)),d===!0&&jd(t,s,l,o),!1}})}function jd(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let c=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Fd(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|