@oruga-ui/oruga-next
Version:
UI components for Vue.js and CSS framework agnostic
11 lines • 279 kB
JavaScript
(function(q,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(q=typeof globalThis<"u"?globalThis:q||self,e(q.Oruga={},q.Vue))})(this,function(q,e){"use strict";/*! Oruga v0.11.4 | MIT License | github.com/oruga-ui/oruga */function Vl(a){return a<0?-1:a>0?1:0}const Zt=Math.sign||Vl,ye=(a,o)=>(a%o+o)%o,Be=a=>(a<10?"0":"")+a;function ht(a,o,l){return Math.max(o,Math.min(l,a))}const ge=a=>!!a&&typeof a=="object"&&!Array.isArray(a),we=a=>!!a&&a instanceof Date&&!isNaN(a.getTime()),le=a=>a!==null&&typeof a<"u",oe=a=>le(a)&&a!=="false"&&a!==!1,Re=a=>le(a)?a:"",Ml=(a,o)=>le(a)?a:o,Le=(a,o="px")=>le(a)?isNaN(a)?String(a):String(a)+o:void 0;function ea(a,o,l,t=!1,s=!1){return l&&typeof l=="function"?(s?a:[...a]).sort((c,f)=>l(c,f,t)):(s?a:[...a]).sort((c,f)=>{let i=ge(c)?fe(c,o):c,d=ge(f)?fe(f,o):f;return typeof i=="boolean"&&typeof d=="boolean"?t?i>d?1:-1:i>d?-1:1:!i&&i!==0?1:!d&&d!==0?-1:i===d?0:(i=typeof i=="string"?i.toUpperCase():i,d=typeof d=="string"?d.toUpperCase():d,t?i>d?1:-1:i>d?-1:1)})}function Ue(a,o){if(!a&&o||a&&!o)return!1;if(a===o)return!0;if(ge(a)&&ge(o)){const l=Object.keys(a),t=Object.keys(o);if(l.length!==t.length)return!1;for(const s of l){const c=a[s],f=o[s];if(!Ue(c,f))return!1}return!0}return Array.isArray(a)&&Array.isArray(o)?!(a.length!==o.length||!a.every((l,t)=>Ue(l,o[t]))):!1}function zl(a){return typeof HTMLElement=="object"?a instanceof HTMLElement:a&&typeof a=="object"&&a!==null&&a.nodeType===1&&typeof a.nodeName=="string"}function at(a,o,l=!1){return!ge(a)||!ge(o)?o:l?yt(a,o):Object.assign(a,o)}function yt(a,o){return!ge(a)||!ge(o)?o:(Object.getOwnPropertyNames(o).forEach(l=>{const t=a[l],s=o[l];Array.isArray(t)&&Array.isArray(s)?a[l]=t.concat(s):ge(t)&&ge(s)?a[l]=yt(Object.assign({},t),s):a[l]=s}),a)}function lt(a,o,l){if(!a)return"";const t=o?fe(a,o):a,s=typeof l=="function"?l(t,a):t;return String(s||"")}function fe(a,o,l){if(!a||typeof a!="object"||typeof o!="string")return l;const t=o.split(".").reduce((s,c)=>typeof s<"u"?s[c]:void 0,a);return typeof t<"u"?t:l}function Bt(a,o,l){if(typeof o!="string")return;const t=o.split(".");if(t.length===1){a[t[0]]=l;return}const s=t[0];return typeof a[s]>"u"&&(a[s]={}),Bt(a[s],t.slice(1).join("."),l)}function $l(a){typeof a.remove<"u"?a.remove():typeof a.parentNode<"u"&&a.parentNode!==null&&a.parentNode.removeChild(a)}function ta(a){return a&&a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function aa(a){return a&&a.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function wt(a){return!!(!a||a.type===e.Comment||a.type===e.Text&&!a.children.trim()||a.type===e.Fragment&&wt(a.children))}const ze={Android:()=>typeof window<"u"&&!!window.navigator.userAgent.match(/Android/i),BlackBerry:()=>typeof window<"u"&&!!window.navigator.userAgent.match(/BlackBerry/i),iOS:()=>typeof window<"u"&&!!window.navigator.userAgent.match(/iPhone|iPad|iPod/i),Opera:()=>typeof window<"u"&&!!window.navigator.userAgent.match(/Opera Mini/i),Windows:()=>typeof window<"u"&&!!window.navigator.userAgent.match(/IEMobile/i),any:()=>ze.Android()||ze.BlackBerry()||ze.iOS()||ze.Opera()||ze.Windows()},la=e.ref({});function El(a,o){la.value[a]=o}function oa(){return la.value}let St;const na=a=>{St=a},Fl=(a,o)=>{a.use(o)},se=(a,o)=>{a.component(o.name,o)},Ye=(a,o,l)=>{na(a);const t=oa();El(o,l),a._context.provides&&a._context.provides.oruga||a.provide("oruga",t),a.config.globalProperties.$oruga||(a.config.globalProperties.$oruga=t)},re=typeof window<"u",sa=typeof window>"u",Ge=e.ref({iconPack:"mdi",useHtml5Validation:!0,statusIcon:!0,transformClasses:void 0,mobileBreakpoint:"1023px",teleportTarget:()=>re?document.body:"body"}),ia=a=>{Ge.value=a},ot=()=>Object.assign({},e.toRaw(Ge.value));function Se(a,o){return fe(Ge.value,a,o)}const n=(a,o)=>fe(Ge.value,a,o),ra={getOption:Se,getOptions:ot,setOption:(a,o)=>{Bt(Ge.value,a,o)},setOptions(a){ia(at(ot(),a,!0))}},ca={install(a,o){na(a),ia(at(ot(),o,!0))}},Il={sizes:{default:"mdi-24px",small:"",medium:"mdi-36px",large:"mdi-48px"},iconPrefix:"mdi-"},We=()=>{const o=Se("iconComponent")?"":"fa-";return{sizes:{default:"",small:"sm",medium:"lg",large:"xl"},iconPrefix:o,internalIcons:{check:"check",information:"info-circle",alert:"exclamation-triangle","alert-circle":"exclamation-circle","arrow-up":"arrow-up","chevron-right":"angle-right","chevron-left":"angle-left","chevron-down":"angle-down","chevron-up":"angle-up",eye:"eye","eye-off":"eye-slash","caret-down":"caret-down","caret-up":"caret-up","close-circle":"times-circle",close:"times",loading:"circle-notch","emoticon-sad":"frown"}}},Nl=()=>{let a={mdi:Il,fa:We(),fas:We(),far:We(),fad:We(),fab:We(),fal:We()};const o=Se("customIconPacks");return o&&(a=at(a,o,!0)),a};function pe(a){const o=e.toValue(a);return o?.$el??o}function da(a){const o=e.toValue(a);return typeof o=="string"?document.querySelector(o):pe(o)}const me=a=>{const o=e.toValue(a);return o?o.flatMap(l=>Object.keys(l).filter(t=>t&&l[t]).flatMap(t=>t.split(" "))):[]};function v(...a){const o=Array.isArray(a.at(-1))?void 0:a.at(-1),l=Array.isArray(a.at(-1))?a:a.slice(0,-1),t=e.getCurrentInstance();if(!t)throw new Error("defineClasses must be called within a component setup function.");if(!e.getCurrentScope()&&!o?.scope)throw new Error("defineClasses must be called within a current active effect scope.");const s=o?.scope||e.effectScope();e.getCurrentScope()&&e.onScopeDispose(()=>{s&&s.stop()});const c=e.ref([]);return c.value=l.map((f,i)=>{const d=f[0],u=f[1],b=f[2],m=f[3];function E(){const g=Tl(t,d,u,e.toValue(b)||void 0),h=!le(m)||e.toValue(m);return{[g]:h}}return s.run(()=>{e.watch([()=>t.proxy?.$props[d],()=>o?.props?o?.props[d]:null],()=>{const g=E();c.value[i]=g}),le(b)&&e.isRef(b)&&e.watch(b,(g,h)=>{if(g===h)return;const C=E();c.value[i]=C}),le(m)&&e.isRef(m)&&e.watch(m,(g,h)=>{if(g===h)return;const C=c.value[i];Object.keys(C).forEach(y=>C[y]=g),c.value[i]=C})}),E()}),c}function Tl(a,o,l,t=""){const s=vt(a),c=a.proxy?.$options.configField;if(!c)throw new Error("component must define the 'configField' option.");const f=s.override===!0?{}:ot();let i=fe(f,`${c}.${o}.class`)||fe(f,`${c}.${o}`),d=fe(s,o);if(Array.isArray(d)&&(d=d.join(" ")),typeof d=="function"){const C=vt(a);d=d(t,C)}else d=ua(d??"",t);if(Array.isArray(i)&&(i=i.join(" ")),typeof i=="function"){const C=vt(a);i=i(t,C)}else i=ua(i??"",t);l.includes("{*}")?l=l.replace(/\{\*\}/g,Re(t)):l=l+Re(t);const u=s.override||fe(f,"override",!1),b=fe(f,`${c}.override`,u);let E=`${fe(f,`${c}.${o}.override`,b)?"":l} ${Re(i)} ${Re(d)}`.trim().replace(/\s\s+/g," ");const g=fe(f,"transformClasses"),h=fe(f,`${c}.transformClasses`);return h?E=h(E):g&&(E=g(E)),E}function ua(a,o){return Re(a).split(" ").filter(l=>l.length>0).map(l=>l+Re(o)).join(" ")}const vt=a=>{let o=a.proxy?.$props||{};return o=Object.keys(o).filter(l=>l.endsWith("Props")).map(l=>o[l]).reduce((l,t)=>({...l,...t}),o),o};function Ne(a,o,l,t){let s;const c=()=>{if(!a)return;const d=pe(a),u=ge(t)?{...t}:t;setTimeout(()=>{d.addEventListener(o,l,u),s=()=>{d.removeEventListener(o,l,u)}})};let f;typeof t?.trigger<"u"&&(f=e.watch(t.trigger,d=>{d?c():typeof s=="function"&&s()},{flush:"post"})),t?.immediate?c():e.getCurrentScope()&&e.onMounted(()=>{(typeof t?.trigger>"u"||t.trigger.value)&&c()});const i=()=>{typeof f=="function"&&f(),typeof s=="function"&&s()};return e.getCurrentScope()&&e.onScopeDispose(i),i}function $e(a){const o=e.ref(!1),l=e.ref(),t=e.getCurrentInstance();if(!t)throw new Error("useMatchMedia must be called within a component setup function.");const s=t.props,c=t.proxy?.$options.configField;if(!c)throw new Error("component must define the 'configField' option.");let f=s.mobileBreakpoint;if(!f){const d=Se("mobileBreakpoint",a);f=Se(`${c}.mobileBreakpoint`,d)}if(!f)return{isMobile:o};l.value=re?window.matchMedia(`(max-width: ${f})`):void 0,l.value?(o.value=l.value.matches,Ne(l.value,"change",i)):o.value=!1;function i(d){o.value=d.matches}return{isMobile:o}}const pa=Symbol("FielData");function Ol(a){e.provide(pa,a)}function be(){const a=e.inject(pa,e.computed(()=>{})),o=e.computed(()=>{if(!(Array.isArray(a?.value?.message)&&!a?.value?.message.length||!Array.isArray(a?.value?.message)&&!a?.value?.message))return a?.value.message}),l=e.computed(()=>{if(a?.value?.variant){if(typeof a.value.variant=="string")return a.value.variant;if(Array.isArray(a.value.variant)){for(const c in a.value.variant)if(a.value.variant[c])return c}}}),t=Se("statusVariantIcon",{success:"check",danger:"alert-circle",info:"information",warning:"alert"}),s=e.computed(()=>!l.value||!t?"":t[l.value]||"");return{parentField:a,statusVariant:l,statusVariantIcon:s,statusMessage:o}}const Al=sa?[]:[HTMLButtonElement,HTMLFieldSetElement,HTMLInputElement,HTMLObjectElement,HTMLOutputElement,HTMLSelectElement,HTMLTextAreaElement];function fa(a){return Al.some(o=>a instanceof o)?a:null}const Rl=["disabled","required","pattern","maxlength","minlength","max","min","step"];function ve(a,o,l){const{parentField:t}=be(),s=e.computed(()=>{const y=pe(a);if(!y)return;if(y.getAttribute("data-oruga-input"))return y;const $=y.querySelector("[data-oruga-input]");if(!$){console.warn("useInputHandler: Underlaying Oruga input component not found");return}return $}),c=e.computed(()=>{const y=s.value;return y||console.warn("useInputHandler: inputRef contains no element"),y}),f=e.ref(!1);function i(){e.nextTick(()=>{c.value&&c.value.focus()})}function d(){e.nextTick(()=>{c.value&&c.value.click()})}function u(y){f.value=!1,t?.value&&t.value.setFocus(!1),o("blur",y||new Event("blur")),g()}function b(y){f.value=!0,t?.value&&t.value.setFocus(!0),o("focus",y||new Event("focus"))}const m=e.ref(!0);function E(y,$){e.nextTick(()=>{t?.value&&(t.value.props.variant||t.value.setVariant(y),t.value.props.message||t.value.setMessage($))})}function g(){l.useHtml5Validation&&c.value&&(c.value.validity.valid?(E(null,null),m.value=!0):(h(),m.value=!1))}function h(){const y="danger",$=c.value?.validationMessage;E(y,$)}function C(y){g();const $=fa(y.target);if($&&t?.value&&l.useHtml5Validation){y.preventDefault();let z=!1;if($.form!=null){const P=$.form.elements;for(let Y=0;Y<P.length;++Y){const F=fa(P.item(Y));if(F?.willValidate&&!F.validity.valid){z=$===F;break}}}if(z){const P=t.value.$el,Y=Se("invalidHandler");if(Y instanceof Function)Y($,P??void 0);else{const F=P?.scrollIntoView!=null;$.focus({preventScroll:F}),F&&P&&P.scrollIntoView({block:"nearest"})}}}o("invalid",y)}if(!sa){const y=e.ref(null);e.watchEffect(()=>{if(y.value,!(l.useHtml5Validation??!0))return;const P=s.value;if(!le(P))return;const Y=l.customValidity??"";typeof Y=="string"?P.setCustomValidity(Y):P.setCustomValidity(Y(l.modelValue,P.validity)),m.value||g()}),e.watch([s,()=>l.useHtml5Validation??!0],(P,Y)=>{const F=P[0],I=P[1],N=Y[0],D=Y[1];F!==N?N?.setCustomValidity(""):D&&!I&&F?.setCustomValidity("")});const $=()=>{e.triggerRef(y)};let z=null;e.watch([s,m,()=>l.useHtml5Validation??!0,()=>l.customValidity],(P,Y)=>{const F=P[0],I=P[1],N=P[2],D=P[3]instanceof Function,V=Y[0],w=le(F)&&N&&(!I||D);if((!w||F!==V)&&z!=null&&(z.takeRecords().length>0&&$(),z.disconnect(),z=null),w&&le(F)&&(z==null||F!==V)){z==null&&(z=new MutationObserver($)),z.observe(F,{attributeFilter:Rl});let O=F;for(;O=O.parentNode;)O instanceof HTMLFieldSetElement&&z.observe(O,{attributeFilter:["disabled"]})}})}return{input:c,isFocused:f,isValid:m,setFocus:i,doClick:d,onFocus:b,onBlur:u,onInvalid:C,checkHtml5Validity:g}}function Qe(a,o,l){let t;return(...s)=>{const c=()=>{t=void 0,l||a.apply(this,s)},f=l&&!t;t&&clearTimeout(t),t=setTimeout(c,o),f&&a.apply(this,s)}}function Pe(a=0){let o=a;function l(){return String(o++)}return{nextSequence:l,sequence:o}}function Ee(a){const o=e.getCurrentInstance();if(!o)throw new Error("useProviderChild must be called within a component setup function.");const l=o.proxy?.$options.configField,t=a?.key||l,s=e.ref([]);if(a?.rootRef){const d=Qe(u=>{const b=pe(a.rootRef);if(!b)return;const m=u.map(h=>`[data-id="${t}-${h.identifier}"]`).join(",");if(!m)return;const E=b.querySelectorAll(m),g=Array.from(E).map(h=>h.getAttribute("data-id")?.replace(`${t}-`,""));u.forEach(h=>h.index=g.indexOf(`${h.identifier}`)),u.sort((h,C)=>h.index-C.index)},500);e.watch(s,d)}const{nextSequence:c}=Pe(1);function f(d){const u=s.value.length,b=c(),m={index:u,data:d,identifier:b};return s.value=[...s.value,m],m}function i(d){s.value=s.value.filter(u=>u!==d)}return e.provide("$o-"+t,{registerItem:f,unregisterItem:i,data:a?.data}),{childItems:s}}function Fe(a){a=Object.assign({needParent:!0,register:!0},a);const o=e.getCurrentInstance();if(!o)throw new Error("useProviderChild must be called within a component setup function.");const l=o.proxy?.$options.configField,t=a?.key||l,s=e.inject("$o-"+t,void 0);if(a.needParent&&!s)throw new Error(`You should wrap ${o.proxy?.$options.name} in a ${t} component`);const c=e.ref();return s&&a.register&&(c.value=s.registerItem(a?.data)),e.onUnmounted(()=>{s&&c.value&&s.unregisterItem(c.value)}),{parent:s?.data||e.ref(),item:c}}function Je(a,o,l){if(!window)return()=>{};const t=Object.assign({ignore:[]},l),s=Array.isArray(a)?a:[a],c=d=>s.some(u=>{if(typeof u=="string")return Array.from(window.document.querySelectorAll(u)).some(b=>b===d.target||d.composedPath().includes(b));{const b=pe(u);return b&&(d.target===b||d.composedPath().includes(b))}});function f(d){c(d)||o(d)}return Ne(window,"click",f,t)}function De(a,o){return a?Array.isArray(a)?a.map(l=>{if(typeof l=="string"||typeof l=="number")return{label:String(l),value:String(l),key:o()};if(typeof l=="object"){if("options"in l){const t=De(l.options,o);return{...l,options:t,key:o()}}else if("value"in l)return{...l,key:o()}}return l}):Object.keys(a).map(l=>({label:a[l],value:l,key:o()})):[]}function qe(a){return a&&typeof a=="object"&&Array.isArray(a.options)}function Pt(a,o){return Array.isArray(a)?a.some(t=>qe(t))?[...a]:[{options:a,key:o}]:[]}function Ll(a){return Array.isArray(e.toValue(a))?e.toValue(a).reduce((o,l)=>(o.push(...l.options),o),[]):[]}function Dt(a,o){e.toValue(a).forEach((l,t)=>{qe(l)?(Dt(l.options,o),l.hidden=l.options.every(s=>s.hidden)):l.hidden=o(l,t)})}function ma(a){return Array.isArray(e.toValue(a))?e.toValue(a).every(o=>qe(o)?ma(o.options):!ga(o)):!0}function nt(a,o){if(Array.isArray(e.toValue(a))){for(const l of e.toValue(a))if(!(typeof l!="object"&&l)){if(qe(l)){const t=nt(l.options,o);if(t!==void 0)return t}else if(Ue(e.toValue(o),l.value))return l}}}function ga(a){return!e.toValue(a).hidden&&!e.toValue(a).attrs?.disabled}function st(a){const o=v(["scrollClipClass","o-scroll-clip"]),l=v(["scrollKeepClass","o-scroll-keep"]),t=e.computed(()=>me(e.toValue(a)?o.value:l.value)),s=e.ref();e.onBeforeUnmount(()=>c(!1));function c(f){re&&t.value&&(s.value=s.value?s.value:document.documentElement.scrollTop,f?document.body.classList.add(...t.value):document.body.classList.remove(...t.value),e.toValue(a)||(f?document.body.style.top=`-${s.value}px`:(document.documentElement.scrollTop=s.value,document.body.style.top="",s.value=void 0)))}return c}function ba(a,o){if(!e.getCurrentScope())throw new Error("The 'useScrollEvents' composable should be used inside a current EffectScope.");const l=Qe(t,o.debounce??100);re&&Ne(a,"scroll",l,{passive:!0});function t(){const s=pe(a);if(!s)return;o.onScroll&&o.onScroll();const c=s.offsetTop;s.clientHeight!==s.scrollHeight&&(Math.ceil(s.scrollTop+s.clientHeight+c)>=s.scrollHeight?o.onScrollEnd&&o.onScrollEnd():s.scrollTop<=c&&o.onScrollStart&&o.onScrollStart())}return l}function Ca(a){if(a.style.position==="fixed"||!a)return document.documentElement;let o=!1,l=a.parentElement;for(;!o&&le(l)&&l!==document.documentElement;){const{overflow:t,overflowY:s}=getComputedStyle(l),{scrollHeight:c,clientHeight:f}=l;if(o=/(auto|scroll)/.test(`${t}${s}`)&&c>f,o)break;l=l.parentElement}return l}function Hl(a,o){const l=pe(a),t=pe(o),{offsetHeight:s,offsetTop:c}=t,{offsetHeight:f,scrollTop:i}=l,d=c<i,u=c+s>i+f;d?l.scrollTo(0,c):u&&l.scrollTo(0,c-f+s)}function it(){const a=Se("teleportTarget","body");return e.toValue(a)}function Kl(a){return e.toValue(a).querySelectorAll(`a[href]:not([tabindex="-1"]),
area[href],
input:not([disabled]):not([type="hidden"]),
select:not([disabled]),
textarea:not([disabled]),
button:not([disabled]),
iframe,
object,
embed,
*[tabindex]:not([tabindex="-1"]):not([disabled]),
*[contenteditable]`)}function Vt(){let a=null;function o(c,f){f?(c.focus({preventScroll:!0}),typeof a=="function"&&c.addEventListener("keydown",a)):typeof a=="function"&&c.removeEventListener("keydown",a)}return{vTrapFocus:{mounted:(c,{value:f})=>{a=i=>{const d=i.target;if(!d)return;const u=Kl(c);if(!u?.length){i.preventDefault();return}const b=u[0],m=u[u.length-1];d===b&&i.shiftKey&&i.key==="Tab"?(i.preventDefault(),m.focus()):d===m&&!i.shiftKey&&i.key==="Tab"&&(i.preventDefault(),b.focus())},f&&o(c,f)},beforeUnmount:c=>{o(c,!1),a=null},updated:(c,{value:f,oldValue:i})=>{f!==i&&o(c,f)}}}}const Ul=["tabindex","role"],ie=e.defineComponent({isOruga:!0,name:"OIcon",configField:"icon",__name:"Icon",props:{override:{type:Boolean,default:void 0},icon:{default:void 0},component:{default:()=>n("iconComponent")},pack:{default:()=>n("iconPack","mdi")},variant:{default:()=>n("icon.variant")},size:{default:()=>n("icon.size")},customSize:{default:void 0},customClass:{default:void 0},clickable:{type:Boolean,default:!1},spin:{type:Boolean,default:!1},rotation:{default:void 0},rootClass:{},sizeClass:{},variantClass:{},clickableClass:{},spinClass:{}},emits:["click"],setup(a,{emit:o}){const l=a,t=o,s=Se("environment"),c=e.computed(()=>{const C={};return l.rotation&&(C.transform=`rotate(${l.rotation}deg)`),C}),f=Nl(),i=e.computed(()=>f[l.pack]),d=e.computed(()=>i.value?.iconPrefix??""),u=e.computed(()=>{if(i.value?.sizes){if(l.size&&i.value.sizes[l.size]!==void 0)return i.value.sizes[l.size];if(i.value.sizes.default)return i.value.sizes.default}return null}),b=e.computed(()=>l.customSize||u.value),m=e.computed(()=>`${d.value}${E(l.icon??"")}`);function E(C){return s!="docs"?C:i.value?.internalIcons&&i.value?.internalIcons[C]?i.value.internalIcons[C]:C}function g(C){l.clickable&&(C.preventDefault(),t("click",C))}const h=v(["rootClass","o-icon"],["clickableClass","o-icon--clickable",null,e.computed(()=>l.clickable)],["spinClass","o-icon--spin",null,e.computed(()=>l.spin)],["sizeClass","o-icon--",e.computed(()=>l.size),e.computed(()=>!!l.size)],["variantClass","o-icon--",e.computed(()=>l.variant),e.computed(()=>!!l.variant)]);return(C,y)=>(e.openBlock(),e.createElementBlock("span",{"data-oruga":"icon",class:e.normalizeClass(e.unref(h)),style:e.normalizeStyle(c.value),tabindex:C.clickable?0:void 0,role:C.clickable?"button":void 0,onClick:g,onKeydown:[e.withKeys(g,["enter"]),e.withKeys(g,["space"])]},[C.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.component),{key:0,icon:[C.pack,m.value],size:b.value,class:e.normalizeClass([C.customClass])},null,8,["icon","size","class"])):(e.openBlock(),e.createElementBlock("i",{key:1,class:e.normalizeClass([C.pack,m.value,b.value,C.customClass])},null,2))],46,Ul))}}),Yl=["id","type","data-oruga-input","maxlength","autocomplete","placeholder","disabled"],Wl=["id","maxlength","placeholder","disabled"],He=e.defineComponent({isOruga:!0,name:"OInput",configField:"input",inheritAttrs:!1,__name:"Input",props:e.mergeModels({override:{type:Boolean,default:void 0},modelValue:{default:void 0},number:{},type:{default:"text"},size:{default:()=>n("input.size")},variant:{default:()=>n("input.variant")},placeholder:{default:void 0},expanded:{type:Boolean,default:()=>n("input.expanded",!1)},rounded:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},passwordReveal:{type:Boolean,default:!1},maxlength:{default:void 0},counter:{type:Boolean,default:()=>n("input.counter",!1)},autosize:{type:Boolean,default:!1},iconPack:{default:()=>n("input.iconPack")},icon:{default:()=>n("input.icon")},iconClickable:{type:Boolean,default:!1},iconRight:{default:()=>n("input.iconRight")},iconRightClickable:{type:Boolean,default:!1},iconRightVariant:{default:void 0},clearable:{type:Boolean,default:()=>n("input.clearable",!1)},clearIcon:{default:()=>n("input.clearIcon","close-circle")},statusIcon:{type:Boolean,default:()=>n("statusIcon",!0)},debounce:{default:()=>n("autocomplete.debounce",400)},autocomplete:{default:()=>n("input.autocomplete","off")},id:{default:()=>e.useId()},useHtml5Validation:{type:Boolean,default:()=>n("useHtml5Validation",!0)},customValidity:{type:[String,Function],default:""},rootClass:{},sizeClass:{},variantClass:{},expandedClass:{},roundedClass:{},disabledClass:{},textareaClass:{},hasIconRightClass:{},inputClass:{},iconLeftSpaceClass:{},iconRightSpaceClass:{},placeholderClass:{},iconLeftClass:{},iconRightClass:{},counterClass:{}},{modelValue:{default:void 0},modelModifiers:{}}),emits:e.mergeModels(["update:model-value","input","focus","blur","invalid","icon-click","icon-right-click"],["update:modelValue"]),setup(a,{expose:o,emit:l}){const t=a,s=l,c=e.useTemplateRef("inputElement"),{checkHtml5Validity:f,onBlur:i,onFocus:d,onInvalid:u,setFocus:b,isValid:m,isFocused:E}=ve(c,s,t),{parentField:g,statusVariant:h,statusVariantIcon:C}=be(),y=e.useModel(a,"modelValue",{get:R=>le(R)?String(R):"",set:R=>le(R)?oe(t.number)?Number(R):String(R):R});t.id&&g?.value?.setInputId(t.id);const $=e.computed(()=>typeof y.value=="string"||typeof y.value=="number"?String(y.value).length:0);e.onMounted(()=>{e.watch(()=>y.value,R=>{g?.value&&g.value.setFilled(!!R),t.autosize&&P(),m.value||f()},{immediate:!0,flush:"post"})});const z=e.ref("auto");function P(){z.value="auto",e.nextTick(()=>{if(t.type!=="textarea"||!c.value)return;const R=c.value.scrollHeight;z.value=R+"px"})}const Y=e.computed(()=>t.type==="textarea"&&t.autosize?{resize:"none",height:z.value,overflow:"hidden"}:{});let F;e.watch(()=>t.debounce,R=>F=Qe(I,R||0),{immediate:!0});function I(R){s("input",y.value,R)}const N=e.computed(()=>!le(y.value)||y.value===""),D=e.computed(()=>!!(t.passwordReveal||t.statusIcon&&C.value||t.clearable&&y.value&&t.clearIcon||t.iconRight)),V=e.computed(()=>t.passwordReveal?K.value:t.clearable&&y.value&&t.clearIcon?t.clearIcon:t.iconRight?t.iconRight:C.value),w=e.computed(()=>t.passwordReveal||t.iconRight?t.iconRightVariant||t.variant:h.value);function O(R){s("icon-click",R),e.nextTick(()=>b())}function A(R){t.passwordReveal?U():t.clearable&&(y.value=oe(t.number)?0:""),t.iconRightClickable&&(s("icon-right-click",R),e.nextTick(()=>b()))}const Q=e.ref(!1),G=e.computed(()=>t.passwordReveal?Q.value?"text":"password":t.type),K=e.computed(()=>Q.value?"eye-off":"eye");function U(){Q.value=!Q.value,e.nextTick(()=>b())}const k=e.useAttrs(),r=e.computed(()=>({...g?.value?.inputAttrs,...k})),S=v(["rootClass","o-input"],["sizeClass","o-input--",e.computed(()=>t.size),e.computed(()=>!!t.size)],["variantClass","o-input--",e.computed(()=>h.value||t.variant),e.computed(()=>!!h.value||!!t.variant)],["expandedClass","o-input--expanded",null,e.computed(()=>t.expanded)],["disabledClass","o-input--disabled",null,e.computed(()=>t.disabled)],["roundedClass","o-input--rounded",null,e.computed(()=>t.rounded)],["hasIconRightClass","o-input--icon-right",null,D],["textareaClass","o-input--textarea",null,e.computed(()=>t.type==="textarea")]),M=v(["inputClass","o-input__input"],["iconLeftSpaceClass","o-input__input--iconspace-left",null,e.computed(()=>!!t.icon)],["iconRightSpaceClass","o-input__input--iconspace-right",null,D],["placeholderClass","o-input__input--placeholder",null,N]),_=v(["iconLeftClass","o-input__icon-left"]),W=v(["iconRightClass","o-input__icon-right"]),L=v(["counterClass","o-input__counter"]);return o({checkHtml5Validity:f,focus:b,value:y}),(R,X)=>(e.openBlock(),e.createElementBlock("div",{"data-oruga":"input",class:e.normalizeClass(e.unref(S))},[R.icon?(e.openBlock(),e.createBlock(ie,{key:0,class:e.normalizeClass(e.unref(_)),clickable:R.iconClickable,icon:R.icon,pack:R.iconPack,size:R.size,onClick:O},null,8,["class","clickable","icon","pack","size"])):e.createCommentVNode("",!0),R.type!=="textarea"?e.withDirectives((e.openBlock(),e.createElementBlock("input",e.mergeProps({key:1},r.value,{id:R.id,ref:"inputElement","onUpdate:modelValue":X[0]||(X[0]=ae=>y.value=ae),type:G.value,"data-oruga-input":G.value,class:e.unref(M),maxlength:R.maxlength,autocomplete:R.autocomplete,placeholder:R.placeholder,disabled:R.disabled,onBlur:X[1]||(X[1]=(...ae)=>e.unref(i)&&e.unref(i)(...ae)),onFocus:X[2]||(X[2]=(...ae)=>e.unref(d)&&e.unref(d)(...ae)),onInvalid:X[3]||(X[3]=(...ae)=>e.unref(u)&&e.unref(u)(...ae)),onInput:X[4]||(X[4]=(...ae)=>e.unref(F)&&e.unref(F)(...ae))}),null,16,Yl)),[[e.vModelDynamic,y.value]]):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",e.mergeProps({key:2},r.value,{id:R.id,ref:"inputElement","onUpdate:modelValue":X[5]||(X[5]=ae=>y.value=ae),"data-oruga-input":"textarea",class:e.unref(M),maxlength:R.maxlength,style:Y.value,placeholder:R.placeholder,disabled:R.disabled,onBlur:X[6]||(X[6]=(...ae)=>e.unref(i)&&e.unref(i)(...ae)),onFocus:X[7]||(X[7]=(...ae)=>e.unref(d)&&e.unref(d)(...ae)),onInvalid:X[8]||(X[8]=(...ae)=>e.unref(u)&&e.unref(u)(...ae)),onInput:X[9]||(X[9]=(...ae)=>e.unref(F)&&e.unref(F)(...ae))}),null,16,Wl)),[[e.vModelText,y.value]]),D.value?(e.openBlock(),e.createBlock(ie,{key:3,class:e.normalizeClass(e.unref(W)),icon:V.value,pack:R.iconPack,size:R.size,variant:w.value,clickable:R.passwordReveal||R.clearable||R.iconRightClickable,onClick:A},null,8,["class","icon","pack","size","variant","clickable"])):e.createCommentVNode("",!0),R.maxlength&&R.counter&&e.unref(E)&&R.type!=="number"?(e.openBlock(),e.createElementBlock("small",{key:4,class:e.normalizeClass(e.unref(L))},e.toDisplayString($.value)+" / "+e.toDisplayString(R.maxlength),3)):e.createCommentVNode("",!0)],2))}}),Ve=e.defineComponent({isOruga:!0,name:"ODropdownItem",configField:"dropdown",__name:"DropdownItem",props:{override:{type:Boolean,default:void 0},value:{default:void 0},label:{default:void 0},disabled:{type:Boolean,default:!1},clickable:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1},tag:{default:()=>n("dropdown.itemTag","div")},itemClass:{},itemSelectedClass:{},itemFocusedClass:{},itemClickableClass:{},itemDisabledClass:{}},emits:["click"],setup(a,{emit:o}){const l=a,t=o,s=l.value??e.useId(),c=e.useTemplateRef("rootElement"),f=e.computed(()=>({...l,$el:c.value,value:s,selectItem:E})),{parent:i,item:d}=Fe({data:f}),u=e.computed(()=>!i.value.disabled&&!l.disabled&&l.clickable),b=e.computed(()=>le(i.value.selected)?i.value.multiple&&Array.isArray(i.value.selected)?i.value.selected.some(C=>Ue(s,C)):Ue(s,i.value.selected):!1),m=e.computed(()=>d.value.identifier===i.value.focsuedIdentifier);function E(C){u.value&&(i.value.selectItem(d.value,C),t("click",s,C))}function g(){i.value.focusItem(d.value)}const h=v(["itemClass","o-dropdown__item"],["itemDisabledClass","o-dropdown__item--disabled",null,e.computed(()=>i.value.disabled||l.disabled)],["itemSelectedClass","o-dropdown__item--active",null,b],["itemClickableClass","o-dropdown__item--clickable",null,u],["itemFocusedClass","o-dropdown__item--focused",null,m]);return(C,y)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.tag),{id:`${e.unref(i).menuId}-${e.unref(d).identifier}`,ref:"rootElement","data-oruga":"dropdown-item","data-id":`dropdown-${e.unref(d).identifier}`,class:e.normalizeClass(e.unref(h)),role:e.unref(i).selectable?"option":"menuitem",tabindex:"-1","aria-selected":e.unref(i).selectable?b.value:void 0,"aria-disabled":C.disabled,onClick:E,onMouseenter:g,onKeydown:[e.withKeys(E,["enter"]),e.withKeys(E,["space"])]},{default:e.withCtx(()=>[e.renderSlot(C.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(C.label),1)])]),_:3},40,["id","data-id","class","role","aria-selected","aria-disabled"]))}}),ka=e.defineComponent({inheritAttrs:!1,__name:"PositionWrapper",props:{teleport:{type:[Boolean,String,Object],required:!0},trigger:{type:Object,default:void 0},position:{type:String,validator:a=>["auto","top","bottom","left","right","top-right","top-left","bottom-left","bottom-right"].includes(a),required:!0},defaultPosition:{type:String,validator:a=>["top","bottom","left","right"].includes(a),default:"top"},disabled:{type:Boolean,default:!1},disablePositioning:{type:Boolean,default:!0}},emits:["update:position"],setup(a,{emit:o}){const l={top:"bottom",bottom:"top",right:"left",left:"right"},t=a,s=o,c=e.computed(()=>typeof t.teleport=="boolean"?{to:it(),disabled:!t.teleport}:{to:t.teleport,disabled:!1}),f=e.ref();function i($){return f.value=$,e.nextTick(()=>{g(),m()}),$}const d=t.position,u=e.ref();let b;re&&window.ResizeObserver&&(b=new window.ResizeObserver(g)),e.watch(()=>t.disabled,()=>{t.disabled?E():m()},{immediate:!0,flush:"post"}),e.watch([()=>!!t.trigger,()=>t.disablePositioning,()=>t.disabled],()=>g(),{immediate:!0,flush:"post"}),e.onBeforeUnmount(()=>E());function m(){re&&!u.value&&f.value&&(u.value=Ca(pe(f)),u.value&&u.value!==document.documentElement?(u.value.addEventListener("scroll",g,{passive:!0}),window.ResizeObserver&&b&&b.observe(u.value)):(document.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g)))}function E(){re&&(window.ResizeObserver&&b&&b.disconnect(),window.removeEventListener("resize",g),document.removeEventListener("scroll",g),u.value=void 0)}function g(){if(t.disabled)return;let $=t.position;if(d==="auto"&&($=h(),$!=t.position&&s("update:position",$)),!t.teleport)return;const z=pe(f),P=pe(t.trigger);if(z&&P){const Y=P.getBoundingClientRect();let F=Y.top+window.scrollY,I=Y.left+window.scrollX;$.includes("bottom")?F+=P.clientHeight:$.includes("top")&&(F-=z.clientHeight),$==="left"?I-=z.clientWidth:$==="right"?I+=P.clientWidth:$.includes("-right")&&(I+=P.clientWidth-z.clientWidth),($==="top"||$==="bottom")&&(I+=P.clientWidth/2),($==="left"||$==="right")&&(F+=P.clientHeight/2),t.disablePositioning?(z.style.position="relative",z.style.top=`${F}px`,z.style.left=`${I}px`):(z.style.position="",z.style.top="",z.style.left="")}}function h(){let $=t.defaultPosition;if(!t.trigger||!f.value||!u.value)return $;const z=new DOMRect(u.value.offsetLeft,u.value.offsetTop,u.value.clientWidth,u.value.clientHeight),P=pe(f).getBoundingClientRect(),Y=pe(t.trigger).getBoundingClientRect(),F=y(Y),I=y(P),N=Q=>{const G=F[Q],K=I[l[Q]];return new DOMRect(P.x+(G.x-K.x),P.y+(G.y-K.y),P.width,P.height)},D=l[t.defaultPosition],V=t.defaultPosition==="top"||t.defaultPosition==="bottom"?"left":"top",w=l[V],O=[t.defaultPosition,D,V,w];let A=0;for(const Q of O){const G=C(z,N(Q));G>A&&(A=G,$=Q)}return $}function C($,z){const P=Math.max($.left,z.left),Y=Math.min($.right,z.right),F=Math.max($.top,z.top),I=Math.min($.bottom,z.bottom);return Math.max(Y-P,0)*Math.max(I-F,0)}const y=$=>({top:{x:($.left+$.right)*.5,y:$.top},bottom:{x:($.left+$.right)*.5,y:$.bottom},left:{x:$.left,y:($.top+$.bottom)*.5},right:{x:$.right,y:($.top+$.bottom)*.5}});return($,z)=>(e.openBlock(),e.createBlock(e.Teleport,{to:c.value.to,disabled:c.value.disabled},[c.value.disabled?e.renderSlot($.$slots,"default",{key:0,setContent:i}):(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1},$.$attrs,{style:{position:"absolute",left:"0px",top:"0px"}}),[e.renderSlot($.$slots,"default",{setContent:i})],16))],8,["to","disabled"]))}}),ql={key:1},rt=e.defineComponent({isOruga:!0,name:"ODropdown",configField:"dropdown",__name:"Dropdown",props:e.mergeModels({override:{type:Boolean,default:void 0},modelValue:{default:void 0},multiple:{},options:{default:void 0},active:{type:Boolean,default:!1},label:{default:void 0},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},checkScroll:{type:Boolean,default:()=>n("dropdown.checkScroll",!1)},maxHeight:{default:()=>n("dropdown.maxHeight",200)},position:{default:()=>n("dropdown.position","bottom-left")},animation:{default:()=>n("dropdown.animation","fade")},expanded:{type:Boolean,default:!1},menuId:{default:()=>e.useId()},menuTag:{default:()=>n("dropdown.menuTag","div")},triggerTag:{default:()=>n("dropdown.triggerTag","div")},triggers:{default:()=>n("dropdown.triggers",["click"])},delay:{default:void 0},keepOpen:{type:Boolean,default:()=>n("dropdown.keepOpen",!1)},keepFirst:{type:Boolean,default:()=>n("dropdown.keepFirst",!1)},closeOnOutside:{type:Boolean,default:()=>n("dropdown.closeOnOutside",!0)},closeOnScroll:{type:Boolean,default:()=>n("dropdown.closeOnScroll",!1)},selectOnFocus:{type:Boolean,default:()=>n("dropdown.selectOnFocus",!1)},selectOnClose:{type:Boolean,default:()=>n("dropdown.selectOnClose",!1)},mobileModal:{type:Boolean,default:()=>n("dropdown.mobileModal",!0)},desktopModal:{type:Boolean,default:()=>n("dropdown.desktopModal",!1)},mobileBreakpoint:{default:()=>n("dropdown.mobileBreakpoint")},teleport:{type:[Boolean,String,Object],default:()=>n("dropdown.teleport",!1)},clipScroll:{type:Boolean,default:()=>n("dropdown.clipScroll",!1)},labelledby:{},ariaLabel:{},rootClass:{},mobileClass:{},modalClass:{},teleportClass:{},inlineClass:{},disabledClass:{},expandedClass:{},positionClass:{},activeClass:{},hoverableClass:{},triggerClass:{},menuClass:{},menuPositionClass:{},menuActiveClass:{},overlayClass:{},scrollClipClass:{},scrollKeepClass:{}},{modelValue:{default:void 0},modelModifiers:{},active:{type:Boolean,default:!1},activeModifiers:{}}),emits:e.mergeModels(["update:model-value","update:active","select","change","open","close","scroll-start","scroll-end"],["update:modelValue","update:active"]),setup(a,{expose:o,emit:l}){const t=a,s=l,c=e.ref(),f=e.ref(),i=e.computed(()=>({disabled:t.disabled,multiple:oe(t.multiple),selectable:t.selectable,menuId:t.menuId,selected:g.value,focsuedIdentifier:S.value?.identifier,selectItem:r,focusItem:M})),{childItems:d}=Ee({rootRef:f,data:i}),{nextSequence:u}=Pe(),b=e.computed(()=>{const B=De(t.options,u);return Pt(B,u())}),m=e.computed(()=>d.value.some(Ce)),{parentField:E}=be(),g=e.useModel(a,"modelValue"),h=e.useModel(a,"active"),C=t.labelledby??E.value?.labelId,y=e.ref(t.position);e.watch(()=>t.position,B=>y.value=B);const{isMobile:$}=$e(t.mobileBreakpoint),z=re&&ze.any(),P=e.computed(()=>!t.inline&&($.value&&t.mobileModal||!$.value&&t.desktopModal)),Y=e.computed(()=>({maxHeight:t.scrollable?Le(t.maxHeight):null,overflow:t.scrollable?"auto":null})),F=e.computed(()=>t.triggers.includes("hover")),I=st(t.clipScroll);re&&t.scrollable&&t.checkScroll&&ba(f,{onScrollEnd:()=>s("scroll-end"),onScrollStart:()=>s("scroll-start")}),re&&t.closeOnOutside&&Je([f,c],N,{trigger:h,passive:!0}),re&&t.closeOnScroll&&Ne(window,"scroll",D,{passive:!0}),e.watch(h,B=>{B&&!t.inline&&t.keepFirst&&!S.value&&_(1),P.value&&I(B)},{flush:"post"}),e.watch(d,()=>{h.value&&!t.inline&&t.keepFirst&&(S.value=void 0,_(1))},{deep:!0,flush:"post"});function N(B){!h.value||t.inline||t.closeOnOutside&&k("outside",B)}function D(B){!h.value||t.inline||t.closeOnScroll&&k("scroll",B)}function V(B){z&&F.value&&G("click",B),t.triggers.includes("click")&&G("click",B)}function w(B){t.triggers.includes("contextmenu")&&(B.preventDefault(),U("contextmenu",B))}function O(B){t.triggers.includes("focus")&&U("focus",B)}function A(B){z||t.triggers.includes("hover")&&U("hover",B)}function Q(B){z||t.triggers.includes("hover")&&k("outside",B)}function G(B,H){t.disabled||(h.value?k(B,H):U(B,H))}let K;function U(B,H){t.disabled||h.value||(t.delay?K=setTimeout(()=>{h.value=!0,s("open",B,H),K=void 0},t.delay):(e.nextTick(()=>h.value=!0),s("open",B,H)))}function k(B,H){h.value&&(s("close",B,H),t.selectOnClose&&S.value?.data?.value&&r(S.value),h.value=!1,S.value=void 0,K&&clearTimeout(K))}function r(B,H){const Z=B.data.value;s("select",Z),t.selectable&&(oe(t.multiple)?(g.value&&Array.isArray(g.value)?g.value.includes(Z)?g.value=g.value.filter(te=>te!==Z):g.value=[...g.value,Z]:g.value=[Z],e.nextTick(()=>s("change",g.value))):g.value!==Z&&(g.value=Z,e.nextTick(()=>s("change",g.value)))),c.value?.focus(),!(t.keepOpen||!h.value||!H)&&k("content",H)}const S=e.ref();function M(B){S.value=B}function _(B){if(!m.value)return;const H=ce(S.value?.index||0,B);W(H)}function W(B){t.selectOnFocus&&B.data?.value&&r(B,new Event("focus"));const H=pe(f),Z=pe(B.data?.$el);!H||!Z||(S.value=B,Hl(H,Z))}function L(B){if(!h.value)return U("keydown",B);_(-1)}function R(B){if(!h.value)return U("keydown",B);_(1)}function X(B){h.value&&S.value&&(W(S.value),S.value.data?.selectItem(B))}function ae(B){if(U("keydown",B),!m.value)return;const H=ce(0,1);W(H)}function ue(B){if(U("keydown",B),!m.value)return;const H=ce(d.value.length-1,-1);W(H)}function Te(B){k("escape",B)}function ce(B,H){let Z=ye(S.value?.index==B?B+H:B,d.value.length);for(;Z!==S.value?.index&&!Ce(d.value[Z]);Z=ye(Z+H,d.value.length));return d.value[Z]}function Ce(B){return!B.data?.disabled&&!B.data?.hidden&&!!B.data?.clickable}const ke=v(["rootClass","o-dropdown"],["disabledClass","o-dropdown--disabled",null,e.computed(()=>t.disabled)],["expandedClass","o-dropdown--expanded",null,e.computed(()=>t.expanded)],["inlineClass","o-dropdown--inline",null,e.computed(()=>t.inline)],["mobileClass","o-dropdown--mobile",null,$],["modalClass","o-dropdown--modal",null,P],["hoverableClass","o-dropdown--hoverable",null,F],["positionClass","o-dropdown--position-",y,e.computed(()=>!!y.value)],["activeClass","o-dropdown--active",null,e.computed(()=>h.value||t.inline)]),he=v(["triggerClass","o-dropdown__trigger"]),Me=v(["teleportClass","o-dropdown--teleport",null,e.computed(()=>!!t.teleport)]),J=v(["overlayClass","o-dropdown__overlay"]),x=v(["menuClass","o-dropdown__menu"],["menuPositionClass","o-dropdown__menu--",y,e.computed(()=>!!y.value)],["menuActiveClass","o-dropdown__menu--active",null,e.computed(()=>h.value||t.inline)]);return o({$trigger:c,$content:f,value:g}),(B,H)=>(e.openBlock(),e.createElementBlock("div",{"data-oruga":"dropdown",class:e.normalizeClass(e.unref(ke)),onMouseleave:Q,onFocusout:Q},[B.inline?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.triggerTag),{key:0,ref_key:"triggerRef",ref:c,class:e.normalizeClass(e.unref(he)),role:B.selectable?"combobox":void 0,tabindex:B.disabled?-1:null,"aria-haspopup":B.selectable?"listbox":"menu","aria-expanded":B.selectable?h.value:void 0,"aria-activedescendant":S.value?`${B.menuId}-${S.value.identifier}`:void 0,"aria-disabled":B.disabled,"aria-controls":B.menuId,"aria-labelledby":B.selectable?e.unref(C):void 0,"aria-label":B.selectable?B.ariaLabel:void 0,onClick:V,onContextmenu:w,onMouseenter:A,onFocusCapture:O,onKeydown:[e.withKeys(Te,["tab"]),e.withKeys(Te,["escape"]),e.withKeys(X,["enter"]),e.withKeys(X,["space"]),e.withKeys(e.withModifiers(L,["prevent"]),["up"]),e.withKeys(e.withModifiers(R,["prevent"]),["down"]),e.withKeys(e.withModifiers(ae,["prevent"]),["home"]),e.withKeys(e.withModifiers(ue,["prevent"]),["end"])]},{default:e.withCtx(()=>[e.renderSlot(B.$slots,"trigger",{active:h.value,value:a.modelValue,toggle:V},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])]),_:3},40,["class","role","tabindex","aria-haspopup","aria-expanded","aria-activedescendant","aria-disabled","aria-controls","aria-labelledby","aria-label","onKeydown"])),e.createVNode(ka,{position:y.value,"onUpdate:position":H[6]||(H[6]=Z=>y.value=Z),teleport:B.teleport,class:e.normalizeClass([...e.unref(ke),...e.unref(Me)]),trigger:c.value,disabled:!h.value,"default-position":"bottom","disable-positioning":!P.value},{default:e.withCtx(({setContent:Z})=>[P.value?(e.openBlock(),e.createBlock(e.Transition,{key:0,name:B.animation},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(e.unref(J)),tabindex:"-1",onClick:N},null,2),[[e.vShow,h.value]])]),_:1},8,["name"])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{name:B.animation},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.menuTag),{id:B.menuId,ref:te=>f.value=Z(te),tabindex:B.inline?0:-1,class:e.normalizeClass(e.unref(x)),style:e.normalizeStyle(Y.value),role:B.selectable?"listbox":"menu","aria-labelledby":e.unref(C),"aria-label":B.ariaLabel,"aria-hidden":!B.selectable&&!B.inline?B.disabled||!h.value:void 0,"aria-multiselectable":B.selectable?e.unref(oe)(B.multiple):void 0,onKeydown:[H[0]||(H[0]=e.withKeys(e.withModifiers(te=>B.inline&&X(te),["prevent"]),["enter"])),H[1]||(H[1]=e.withKeys(e.withModifiers(te=>B.inline&&X(te),["prevent"]),["space"])),H[2]||(H[2]=e.withKeys(e.withModifiers(te=>B.inline&&L(te),["prevent"]),["up"])),H[3]||(H[3]=e.withKeys(e.withModifiers(te=>B.inline&&R(te),["prevent"]),["down"])),H[4]||(H[4]=e.withKeys(e.withModifiers(te=>B.inline&&ae(te),["prevent"]),["home"])),H[5]||(H[5]=e.withKeys(e.withModifiers(te=>B.inline&&ue(te),["prevent"]),["end"]))]},{default:e.withCtx(()=>[e.renderSlot(B.$slots,"default",{active:h.value,focusedIndex:S.value?.index,toggle:G},()=>[e.renderSlot(B.$slots,"before"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(te,_t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[te.label?e.withDirectives((e.openBlock(),e.createBlock(Ve,e.mergeProps({key:0,ref_for:!0},te.attrs,{key:te.key,value:te.value,hidden:te.hidden,role:"presentation",clickable:!1}),{default:e.withCtx(()=>[B.$slots.group?e.renderSlot(B.$slots,"group",{key:0,group:te.label,index:_t}):(e.openBlock(),e.createElementBlock("span",ql,e.toDisplayString(te.label),1))]),_:2},1040,["value","hidden"])),[[e.vShow,!te.hidden]]):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.options,Oe=>e.withDirectives((e.openBlock(),e.createBlock(Ve,e.mergeProps({ref_for:!0},Oe.attrs,{key:Oe.key,value:Oe.value,hidden:Oe.hidden}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Oe.label),1)]),_:2},1040,["value","hidden"])),[[e.vShow,!Oe.hidden]])),128))],64))),256)),e.renderSlot(B.$slots,"after")])]),_:2},1064,["id","tabindex","class","style","role","aria-labelledby","aria-label","aria-hidden","aria-multiselectable"])),[[e.vShow,!B.disabled&&h.value||B.inline]])]),_:2},1032,["name"])]),_:3},8,["position","teleport","class","trigger","disabled","disable-positioning"])],34))}}),xl={key:1},jl={key:1},Mt=e.defineComponent({isOruga:!0,name:"OAutocomplete",configField:"autocomplete",inheritAttrs:!1,__name:"Autocomplete",props:e.mergeModels({override:{type:Boolean,default:void 0},modelValue:{default:void 0},input:{default:""},active:{type:Boolean,default:!1},options:{default:void 0},backendFiltering:{type:Boolean,default:()=>n("autocomplete.backendFiltering",!1)},filter:{type:Function,default:void 0},type:{default:"text"},menuTag:{default:()=>n("autocomplete.menuTag","div")},itemTag:{default:()=>n("autocomplete.itemTag","div")},size:{default:()=>n("autocomplete.size")},position:{default:()=>n("autocomplete.position","auto")},placeholder:{default:void 0},expanded:{type:Boolean,default:()=>n("autocomplete.expanded",!1)},rounded:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},maxlength:{default:void 0},debounce:{default:()=>n("autocomplete.debounce",400)},keepFirst:{type:Boolean,default:()=>n("autocomplete.keepFirst",!1)},keepOpen:{type:Boolean,default:()=>n("autocomplete.keepOpen",!1)},clearOnSelect:{type:Boolean,default:()=>n("autocomplete.clearOnSelect",!1)},openOnFocus:{type:Boolean,default:()=>n("autocomplete.openOnFocus",!1)},selectOnClose:{type:Boolean,default:!1},selectableHeader:{type:Boolean,default:!1},selectableFooter:{type:Boolean,default:!1},maxHeight:{default:()=>n("autocomplete.maxHeight")},checkScroll:{type:Boolean,default:()=>n("autocomplete.checkScroll",!1)},iconPack:{default:()=>n("autocomplete.iconPack")},icon:{default:()=>n("autocomplete.icon")},iconClickable:{type:Boolean,default:!1},iconRight:{default:()=>n("autocomplete.iconRight")},iconRightClickable:{type:Boolean,default:!1},iconRightVariant:{default:void 0},clearable:{type:Boolean,default:()=>n("autocomplete.clearable",!1)},clearIcon:{default:()=>n("autocomplete.clearIcon","close-circle")},statusIcon:{type:Boolean,default:()=>n("statusIcon",!0)},mobileModal:{type:Boolean,default:()=>n("autocomplete.mobileModal",!1)},desktopModal:{type:Boolean,default:()=>n("dropdown.desktopModal",!1)},animation:{default:()=>n("autocomplete.animation","fade")},autocomplete:{default:()=>n("autocomplete.autocomplete","off")},useHtml5Validation:{type:Boolean,default:()=>n("useHtml5Validation",!0)},customValidity:{type:[String,Function],default:void 0},teleport:{type:[Boolean,String,Object],default:()=>n("autocomplete.teleport",!1)},rootClass:{},itemClass:{},itemGroupTitleClass:{},itemEmptyClass:{},itemHeaderClass:{},itemFooterClass:{},inputClasses:{default:()=>n("autocomplete.inputClasses",{})}},{active:{type:Boolean,default:!1},activeModifiers:{},modelValue:{default:void 0},modelModifiers:{},input:{default:""},inputModifiers:{}}),emits:e.mergeModels(["update:model-value","update:input","update:active","input","select","select-header","select-footer","focus","blur","invalid","icon-click","icon-right-click","scroll-start","scroll-end"],["update:active","update:modelValue","update:input"]),setup(a,{expose:o,emit:l}){const t=a,s=l,c=e.useSlots(),f=e.useTemplateRef("inputComponent"),{checkHtml5Validity:i,onInvalid:d,onFocus:u,onBlur:b,isFocused:m,setFocus:E}=ve(f,s,t),{parentField:g}=be(),h=e.useModel(a,"active"),C=e.useModel(a,"modelValue"),y=e.useModel(a,"input"),$=e.useId(),{nextSequence:z}=Pe(),P=e.computed(()=>{const W=De(t.options,z);return Pt(W,z())});t.backendFiltering||e.watchEffect(()=>{Dt(P,W=>Y(W,y)),e.triggerRef(P)});function Y(W,L){return typeof t.filter=="function"?t.filter(W.value,e.toValue(L)):!String(W.label).toLowerCase().includes(e.toValue(L)?.toLowerCase())}const F=e.computed(()=>ma(P));e.watch(F,W=>{m.value&&(h.value=!W||!!c.empty)});const I=e.ref();e.watch(y,W=>{const L=nt(P,C);L&&L.label!==W&&(C.value=void 0,I.value=void 0),F.value&&!c.empty&&(h.value=!1)},{flush:"post"}),e.watch(C,W=>{if(!W)return;const L=nt(P,W);L&&(y.value=t.clearOnSelect?"":L.label,i(),I.value=L.value)},{immediate:!0});function N(W){let L;W===0?s("select-header"):W===1?s("select-footer"):W&&(L=Ll(P).find(X=>X.value===W)),C.value=L?.value,s("select",L?.value),t.keepOpen?E():h.value=!1}function D(W,L){m.value&&(!h.value&&W&&(!F.value||c.empty)?h.value=!0:h.value&&!W&&!t.keepOpen&&(h.value=!1)),s("input",W,L),i()}function V(W){t.openOnFocus&&(t.options?.length||c.header||c.footer)&&(h.value=!0),u(W)}function w(W){b(W)}const O=e.computed(()=>t.clearable&&y.value&&t.clearIcon?t.clearIcon:t.iconRight),A=e.computed(()=>t.clearable?!0:t.iconRightClickable);function Q(W){t.clearable?y.value="":s("icon-right-click",W)}const G=e.useAttrs(),K=e.computed(()=>({...g?.value?.inputAttrs,...G,...t.inputClasses})),U=v(["rootClass","o-autocomplete"]),k=v(["itemClass","o-autocomplete__item"]),r=v(["itemEmptyClass","o-autocomplete__item--empty"]),S=v(["itemGroupTitleClass","o-autocomplete__item-group-title"]),M=v(["itemHeaderClass","o-autocomplete__item-header"]),_=v(["itemFooterClass","o-autocomplete__item-footer"]);return o({checkHtml5Validity:i,focus:E,value:y}),(W,L)=>(e.openBlock(),e.createBlock(rt,{modelValue:I.value,"onUpdate:modelValue":L[2]||(L[2]=R=>I.value=R),active:h.value,"onUpdate:active":L[3]||(L[3]=R=>h.value=R),"data-oruga":"autocomplete",class:e.normalizeClass(e.unref(U)),"menu-id":e.unref($),"menu-tag":W.menuTag,triggers:[],scrollable:"",selectable:"","keep-open":W.keepOpen,"keep-first":W.keepFirst,"check-scroll":W.checkScroll,"select-on-close":W.selectOnClose,disabled:W.disabled,"desktop-modal":W.desktopModal,"mobile-modal":W.mobileModal,"max-height":W.maxHeight,animation:W.animation,position:W.position,teleport:W.teleport,expanded:W.expanded,onSelect:N,onScrollStart:L[4]||(L[4]=R=>s("scroll-start")),onScrollEnd:L[5]||(L[5]=R=>s("scroll-end"))},{trigger:e.withCtx(()=>[e.createVNode(He,e.mergeProps({ref:"inputComponent"},K.value,{modelValue:y.value,"onUpdate:modelValue":L[0]||(L[0]=R=>y.value=R),type:W.type,size:W.size,rounded:W.rounded,icon:W.icon,"icon-right":O.value,"icon-right-clickable":A.value,"icon-pack":W.iconPack,placeholder:W.placeholder,maxlength:W.maxlength,autocomplete:W.autocomplete,expanded:W.expanded,disabled:W.disabled,"status-icon":W.statusIcon,debounce:W.debounce,"aria-autocomplete":W.keepFirst?"both":"list","aria-controls":e.unref($),enterkeyhint:"enter","use-html5-validation":!1,onInput:D,onFocus:V,onBlur:w,onInvalid:e.unref(d),onIconClick:L[1]||(L[1]=R=>s("icon-click",R)),onIconRightClick:Q}),null,16,["modelValue","type","size","rounded","icon","icon-right","icon-right-clickable","icon-pack","placeholder","maxlength","autocomplete","expanded","disabled","status-icon","debounce","aria-autocomplete","aria-controls","onInvalid"])]),default:e.withCtx(()=>[W.$slots.header?(e.openBlock(),e.createBlock(Ve,{key:0,tag:W.itemTag,value:0,clickable:W.selectableHeader,class:e.normalizeClass([...e.unref(k),...e.unref(M)])},{default:e.withCtx(()=>[e.renderSlot(W.$slots,"header")]),_:3},8,["tag","value","clickable","class"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(R,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[R.label?e.withDirectives((e.openBlock(),e.createBlock(Ve,e.mergeProps({key:R.key},{ref_for:!0},R.attrs,{hidden:R.hidden,value:R.value,tag:W.itemTag,role:"presentation",clickable:!1,class:[...e.unref(k),...e.unref(S)]}),{default:e.withCtx(()=>[W.$slots.group?e.renderSlot(W.$slots,"group",{key:0,group:R.label,index:X}):(e.openBlock(),e.createElementBlock("span",xl,e.toDisplayString(R.label),1))]),_:2},1040,["hidden","value","tag","class"])),[[e.vShow,!R.hidden]]):e