wave-ui
Version:
A UI framework for Vue.js 3 (and 2) with only the bright side. :sunny:
1 lines • 228 kB
JavaScript
"use strict";var Q=Object.defineProperty;var O=e=>{throw TypeError(e)};var Z=(e,l,i)=>l in e?Q(e,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[l]=i;var V=(e,l,i)=>Z(e,typeof l!="symbol"?l+"":l,i),M=(e,l,i)=>l.has(e)||O("Cannot "+i);var E=(e,l,i)=>(M(e,l,"read from private field"),i?i.call(e):l.get(e)),z=(e,l,i)=>l.has(e)?O("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(e):l.set(e,i),L=(e,l,i,s)=>(M(e,l,"write to private field"),s?s.call(e,i):l.set(e,i),i);const t=require("vue"),ee=t.reactive({on:"#app",breakpoints:{xs:600,sm:900,md:1200,lg:1700,xl:9999},css:{colorShades:!0,colorShadeCssVariables:!1,breakpointSpaces:!1,breakpointLayoutClasses:!0,grid:12},colors:{light:{primary:"#234781",secondary:"#d3ebff",info:"#3d9ff5",warning:"#f80",success:"#54b946",error:"#f65555"},dark:{primary:"#89b6d2",secondary:"#375b6a",info:"#3d9ff5",warning:"#f80",success:"#54b946",error:"#f65555"}},theme:"light",icons:[],iconsLigature:!1,notificationManager:{align:"right",transition:"default"},presets:{}}),X=(e,l=ee)=>{if(!Object.keys(l).length)l=Object.assign(l,e);else for(const i in e){const s=e[i];typeof s=="object"&&typeof l[i]=="object"?X(e[i],l[i]):l[i]=s}return l},_=e=>console.warn(`Wave UI: ${e}`),B=e=>console.error(`Wave UI: ${e}`),te=e=>{["light","dark"].forEach(l=>{var s,n,o;const i=e.colors[l];i.shades={};for(const a in i){if(a==="shades")continue;const r=i[a],d={label:a,color:(o=(n=((s=i[a])==null?void 0:s.color)??i[a])==null?void 0:n.replace)==null?void 0:o.call(n,"#","")},c=d.color;if(c){c.length===3&&(d.color=c[0]+""+c[0]+c[1]+c[1]+c[2]+c[2]);for(let u=1;u<=6;u++){const m=ne(`#${d.color}`,u*((r==null?void 0:r.lightIncrement)??16)+((r==null?void 0:r.lightOffset)??0)),h=ae(`#${d.color}`,u*((r==null?void 0:r.darkIncrement)??12.4)+((r==null?void 0:r.darkOffset)??0));i.shades[`${d.label}-light${u}`]=m,i.shades[`${d.label}-dark${u}`]=h}}}})},D=(e,l)=>{const i={...l.reduce((s,n)=>{s[n.label]=n.color;const o=(n.shades||[]).reduce((a,r)=>(a[r.label]=r.color,a),{});return{...s,...o}},{...e,...e.shades})};return delete i.shades,i};function x(e,l,i){return Math.min(Math.max(e,l),i)}function T(e){const l=e.toString(16);return l.length===1&&`0${l}`||l.length===2&&l||B(`expected value from 0~255, got: ${e}`)||""}function le(e){return/^#[0-9a-f]{6}([0-9a-f]{2})?$/i.test(e)}function ie(e){return/^#[0-9a-f]{3}([0-9a-f])?$/i.test(e)}function oe(e){return`#${e.substring(1).split("").map(l=>`${l}${l}`).join("")}`}function se(e){return le(e)&&e||ie(e)&&oe(e)||B(`expected color hex string, got '${e}'`)||""}function A(e){const l=se(e),i=parseInt(l.substring(1,3),16),s=parseInt(l.substring(3,5),16),n=parseInt(l.substring(5,7),16),o=l.length===9?parseInt(l.substring(7,9),16)/255:1;return{red:i,green:s,blue:n,alpha:o,hasAlpha:l.length===9}}function F(e,l,i,s){return`#${T(e)}${T(l)}${T(i)}${s?T(Math.floor(s*255)):""}`}function Y(e,l,i=50){const s=A(e),n=A(l),o=x(i,0,100)/100,a=2*o-1,r=s.alpha-n.alpha,d=((a*r===-1?a:(a+r)/(1+a*r))+1)/2,c=1-d,u=x(Math.round(s.red*d+n.red*c),0,255),m=x(Math.round(s.green*d+n.green*c),0,255),h=x(Math.round(s.blue*d+n.blue*c),0,255),f=s.alpha*o+n.alpha*(1-o);return s.hasAlpha||n.hasAlpha||f!==1?F(u,m,h,f):F(u,m,h)}function ne(e,l=15){return Y("#ffffff",e,l)}function ae(e,l=12.4){return Y("#000000",e,l)}const W=[{label:"pink",color:"#e91e63",shades:[{label:"pink-light6",color:"#fdebf1"},{label:"pink-light5",color:"#faccdc"},{label:"pink-light4",color:"#f7adc6"},{label:"pink-light3",color:"#f48eb1"},{label:"pink-light2",color:"#f16f9b"},{label:"pink-light1",color:"#ee5085"},{label:"pink-dark1",color:"#d31555"},{label:"pink-dark2",color:"#b6124a"},{label:"pink-dark3",color:"#990f3e"},{label:"pink-dark4",color:"#7c0c32"},{label:"pink-dark5",color:"#600927"},{label:"pink-dark6",color:"#43071b"}]},{label:"purple",color:"#a741b9",shades:[{label:"purple-light6",color:"#f9f2fa"},{label:"purple-light5",color:"#eed9f2"},{label:"purple-light4",color:"#e3c1e9"},{label:"purple-light3",color:"#d8a8e1"},{label:"purple-light2",color:"#cd90d8"},{label:"purple-light1",color:"#c277cf"},{label:"purple-dark1",color:"#9239a2"},{label:"purple-dark2",color:"#7d318a"},{label:"purple-dark3",color:"#682873"},{label:"purple-dark4",color:"#53205b"},{label:"purple-dark5",color:"#3d1844"},{label:"purple-dark6",color:"#28102d"}]},{label:"deep-purple",color:"#673ab7",shades:[{label:"deep-purple-light6",color:"#f1edf9"},{label:"deep-purple-light5",color:"#daceef"},{label:"deep-purple-light4",color:"#c2afe6"},{label:"deep-purple-light3",color:"#ab90dc"},{label:"deep-purple-light2",color:"#9471d2"},{label:"deep-purple-light1",color:"#7c52c8"},{label:"deep-purple-dark1",color:"#5b33a1"},{label:"deep-purple-dark2",color:"#4e2c8b"},{label:"deep-purple-dark3",color:"#422575"},{label:"deep-purple-dark4",color:"#351e5f"},{label:"deep-purple-dark5",color:"#291749"},{label:"deep-purple-dark6",color:"#1c1033"}]},{label:"indigo",color:"#3f51b5",shades:[{label:"indigo-light6",color:"#eff1fa"},{label:"indigo-light5",color:"#d1d6ef"},{label:"indigo-light4",color:"#b3bae4"},{label:"indigo-light3",color:"#949fda"},{label:"indigo-light2",color:"#7684cf"},{label:"indigo-light1",color:"#5869c5"},{label:"indigo-dark1",color:"#37479f"},{label:"indigo-dark2",color:"#303e8a"},{label:"indigo-dark3",color:"#283474"},{label:"indigo-dark4",color:"#212a5f"},{label:"indigo-dark5",color:"#192149"},{label:"indigo-dark6",color:"#121734"}]},{label:"blue",color:"#2196f3",shades:[{label:"blue-light6",color:"#e6f3fe"},{label:"blue-light5",color:"#c6e4fc"},{label:"blue-light4",color:"#a5d4fa"},{label:"blue-light3",color:"#84c5f8"},{label:"blue-light2",color:"#63b5f7"},{label:"blue-light1",color:"#42a6f5"},{label:"blue-dark1",color:"#0c85e5"},{label:"blue-dark2",color:"#0b72c4"},{label:"blue-dark3",color:"#095fa3"},{label:"blue-dark4",color:"#074c82"},{label:"blue-dark5",color:"#053961"},{label:"blue-dark6",color:"#032540"}]},{label:"light-blue",color:"#03a9f4",shades:[{label:"light-blue-light6",color:"#e7f7ff"},{label:"light-blue-light5",color:"#c0ebfe"},{label:"light-blue-light4",color:"#98defe"},{label:"light-blue-light3",color:"#71d2fd"},{label:"light-blue-light2",color:"#4ac5fd"},{label:"light-blue-light1",color:"#22b9fc"},{label:"light-blue-dark1",color:"#0393d5"},{label:"light-blue-dark2",color:"#027eb6"},{label:"light-blue-dark3",color:"#026896"},{label:"light-blue-dark4",color:"#015277"},{label:"light-blue-dark5",color:"#013d58"},{label:"light-blue-dark6",color:"#012739"}]},{label:"cyan",color:"#04cbe5",shades:[{label:"cyan-light6",color:"#e9fcff"},{label:"cyan-light5",color:"#baf6fe"},{label:"cyan-light4",color:"#8bf0fd"},{label:"cyan-light3",color:"#5ceafc"},{label:"cyan-light2",color:"#2ce3fb"},{label:"cyan-light1",color:"#04d8f4"},{label:"cyan-dark1",color:"#04b2c8"},{label:"cyan-dark2",color:"#0398ac"},{label:"cyan-dark3",color:"#037f8f"},{label:"cyan-dark4",color:"#026673"},{label:"cyan-dark5",color:"#024c56"},{label:"cyan-dark6",color:"#01333a"}]},{label:"teal",color:"#1db3a8",shades:[{label:"teal-light6",color:"#e2faf9"},{label:"teal-light5",color:"#b8f3ef"},{label:"teal-light4",color:"#8eede6"},{label:"teal-light3",color:"#64e6dc"},{label:"teal-light2",color:"#39dfd3"},{label:"teal-light1",color:"#20c7bb"},{label:"teal-dark1",color:"#199b92"},{label:"teal-dark2",color:"#15847c"},{label:"teal-dark3",color:"#116c65"},{label:"teal-dark4",color:"#0e544f"},{label:"teal-dark5",color:"#0a3c39"},{label:"teal-dark6",color:"#062523"}]},{label:"green",color:"#4caf50",shades:[{label:"green-light6",color:"#edf7ed"},{label:"green-light5",color:"#d2ebd3"},{label:"green-light4",color:"#b7e0b8"},{label:"green-light3",color:"#9bd49e"},{label:"green-light2",color:"#80c883"},{label:"green-light1",color:"#65bc69"},{label:"green-dark1",color:"#439b47"},{label:"green-dark2",color:"#3a863d"},{label:"green-dark3",color:"#327234"},{label:"green-dark4",color:"#295e2b"},{label:"green-dark5",color:"#204a22"},{label:"green-dark6",color:"#173518"}]},{label:"light-green",color:"#90d73f",shades:[{label:"light-green-light6",color:"#f4fbec"},{label:"light-green-light5",color:"#e5f6d3"},{label:"light-green-light4",color:"#d7f1b9"},{label:"light-green-light3",color:"#c8eba0"},{label:"light-green-light2",color:"#b9e687"},{label:"light-green-light1",color:"#abe16d"},{label:"light-green-dark1",color:"#80cc2a"},{label:"light-green-dark2",color:"#70b225"},{label:"light-green-dark3",color:"#609820"},{label:"light-green-dark4",color:"#4f7d1a"},{label:"light-green-dark5",color:"#3f6315"},{label:"light-green-dark6",color:"#2e490f"}]},{label:"lime",color:"#cee029",shades:[{label:"lime-light6",color:"#fafce9"},{label:"lime-light5",color:"#f4f8ce"},{label:"lime-light4",color:"#edf4b2"},{label:"lime-light3",color:"#e7f097"},{label:"lime-light2",color:"#e1ec7b"},{label:"lime-light1",color:"#dae85f"},{label:"lime-dark1",color:"#bbcc1e"},{label:"lime-dark2",color:"#a1b01a"},{label:"lime-dark3",color:"#889516"},{label:"lime-dark4",color:"#6f7912"},{label:"lime-dark5",color:"#565d0e"},{label:"lime-dark6",color:"#3c420a"}]},{label:"yellow",color:"#ffe70f",shades:[{label:"yellow-light6",color:"#fffce0"},{label:"yellow-light5",color:"#fff9c4"},{label:"yellow-light4",color:"#fff6a8"},{label:"yellow-light3",color:"#fff38c"},{label:"yellow-light2",color:"#fff170"},{label:"yellow-light1",color:"#ffee54"},{label:"yellow-dark1",color:"#eed700"},{label:"yellow-dark2",color:"#cfba00"},{label:"yellow-dark3",color:"#af9e00"},{label:"yellow-dark4",color:"#908100"},{label:"yellow-dark5",color:"#706500"},{label:"yellow-dark6",color:"#504800"}]},{label:"amber",color:"#ffc107",shades:[{label:"amber-light6",color:"#fffaed"},{label:"amber-light5",color:"#fff1c6"},{label:"amber-light4",color:"#ffe7a0"},{label:"amber-light3",color:"#ffde7a"},{label:"amber-light2",color:"#ffd454"},{label:"amber-light1",color:"#ffcb2d"},{label:"amber-dark1",color:"#e6ad00"},{label:"amber-dark2",color:"#c79500"},{label:"amber-dark3",color:"#a77d00"},{label:"amber-dark4",color:"#886600"},{label:"amber-dark5",color:"#684e00"},{label:"amber-dark6",color:"#483600"}]},{label:"orange",color:"#ff9800",shades:[{label:"orange-light6",color:"#fff5e6"},{label:"orange-light5",color:"#ffe5bf"},{label:"orange-light4",color:"#ffd699"},{label:"orange-light3",color:"#ffc673"},{label:"orange-light2",color:"#ffb74d"},{label:"orange-light1",color:"#ffa726"},{label:"orange-dark1",color:"#df8500"},{label:"orange-dark2",color:"#c07200"},{label:"orange-dark3",color:"#a05f00"},{label:"orange-dark4",color:"#814d00"},{label:"orange-dark5",color:"#613a00"},{label:"orange-dark6",color:"#412700"}]},{label:"deep-orange",color:"#ff6825",shades:[{label:"deep-orange-light6",color:"#fff0e9"},{label:"deep-orange-light5",color:"#ffd9c8"},{label:"deep-orange-light4",color:"#ffc2a8"},{label:"deep-orange-light3",color:"#ffac87"},{label:"deep-orange-light2",color:"#ff9566"},{label:"deep-orange-light1",color:"#ff7f46"},{label:"deep-orange-dark1",color:"#ff5205"},{label:"deep-orange-dark2",color:"#e54600"},{label:"deep-orange-dark3",color:"#c53d00"},{label:"deep-orange-dark4",color:"#a63300"},{label:"deep-orange-dark5",color:"#862900"},{label:"deep-orange-dark6",color:"#661f00"}]},{label:"red",color:"#fa3317",shades:[{label:"red-light6",color:"#fee3df"},{label:"red-light5",color:"#fec6be"},{label:"red-light4",color:"#fdaa9e"},{label:"red-light3",color:"#fc8d7d"},{label:"red-light2",color:"#fc705d"},{label:"red-light1",color:"#fb543c"},{label:"red-dark1",color:"#ec2205"},{label:"red-dark2",color:"#cd1d04"},{label:"red-dark3",color:"#ae1904"},{label:"red-dark4",color:"#8f1403"},{label:"red-dark5",color:"#701002"},{label:"red-dark6",color:"#520c02"}]},{label:"brown",color:"#845848",shades:[{label:"brown-light6",color:"#f2eae7"},{label:"brown-light5",color:"#e2d1ca"},{label:"brown-light4",color:"#d2b7ad"},{label:"brown-light3",color:"#c39e90"},{label:"brown-light2",color:"#b38473"},{label:"brown-light1",color:"#a16b58"},{label:"brown-dark1",color:"#744d3f"},{label:"brown-dark2",color:"#634236"},{label:"brown-dark3",color:"#53372d"},{label:"brown-dark4",color:"#422c24"},{label:"brown-dark5",color:"#32211b"},{label:"brown-dark6",color:"#211612"}]},{label:"blue-grey",color:"#6c8693",shades:[{label:"blue-grey-light6",color:"#f0f3f4"},{label:"blue-grey-light5",color:"#dae1e4"},{label:"blue-grey-light4",color:"#c4cfd4"},{label:"blue-grey-light3",color:"#aebcc4"},{label:"blue-grey-light2",color:"#98aab3"},{label:"blue-grey-light1",color:"#8298a3"},{label:"blue-grey-dark1",color:"#5f7581"},{label:"blue-grey-dark2",color:"#51656f"},{label:"blue-grey-dark3",color:"#44545c"},{label:"blue-grey-dark4",color:"#36444a"},{label:"blue-grey-dark5",color:"#293338"},{label:"blue-grey-dark6",color:"#1c2226"}]},{label:"grey",color:"#848484",shades:[{label:"grey-light6",color:"#f7f7f7"},{label:"grey-light5",color:"#e4e4e4"},{label:"grey-light4",color:"#d1d1d1"},{label:"grey-light3",color:"#bdbdbd"},{label:"grey-light2",color:"#aaaaaa"},{label:"grey-light1",color:"#979797"},{label:"grey-dark1",color:"#747474"},{label:"grey-dark2",color:"#646464"},{label:"grey-dark3",color:"#555555"},{label:"grey-dark4",color:"#454545"},{label:"grey-dark5",color:"#353535"},{label:"grey-dark6",color:"#252525"}]},{label:"black",color:"#000"},{label:"white",color:"#fff"},{label:"transparent",color:"transparent"},{label:"inherit",color:"inherit"}],$={cssScope:".w-app",baseIncrement:4};let R={keys:[],values:[]},K=null;const re=(e,l)=>{var f;let i="";const s={},{info:n,warning:o,success:a,error:r,shades:d,...c}=e,{cssScope:u}=$;for(const g in c)i+=`${u} .${g}--bg{background-color:var(--w-${g}-color)}${u} .${g}{color:var(--w-${g}-color)}`;for(const g in d)i+=`${u} .${g}--bg{background-color:${d[g]}}${u} .${g}{color:${d[g]}}`;const m={...c,info:n,warning:o,success:a,error:r};for(const g in m)s[g]=((f=m[g])==null?void 0:f.color)??m[g];if(l)for(const g in d)s[g]=d[g];let h="";return Object.entries(s).forEach(([g,y])=>{h+=`--w-${g}-color: ${y};`}),`:root{${h}}${i}`},de=(e,l)=>{let i="";const{cssScope:s}=$;return e.forEach(({min:n,label:o})=>{if(o==="xs")for(let a=0;a<l;a++)i+=`${s} .${o}${l-a}{width:${parseFloat(((l-a)*100/l).toFixed(4))}%;}`;else{i+=`@media(min-width:${n}px){`;for(let a=0;a<l;a++)i+=`${s} .${o}${l-a}{width:${parseFloat(((l-a)*100/l).toFixed(4))}%;}`;i+="}"}}),i},ce=e=>{let l="";const{cssScope:i,baseIncrement:s}=$,n=["show{display:block}","hide{display:none}","d-flex{display:flex}","d-iflex{display:inline-flex}","d-block{display:block}","d-iblock{display:inline-block}","text-left{text-align:left}","text-center{text-align:center}","text-right{text-align:right}","text-nowrap{white-space:nowrap}","row{flex-direction:row}","column{flex-direction:column}","column-reverse{flex-direction:column-reverse}","grow{flex-grow:1;flex-basis:auto}","no-grow{flex-grow:0}","shrink{flex-shrink:1;margin-left:auto;margin-right:auto}","no-shrink{flex-shrink:0}","wrap{flex-wrap: wrap}","no-wrap{flex-wrap: nowrap}","fill-width{width:100%}","fill-height{height:100%}","basis-zero{flex-basis:0}","align-start{align-items:flex-start}","align-center{align-items:center}","align-end{align-items:flex-end}","align-self-start{align-self:flex-start}","align-self-center{align-self:center}","align-self-end{align-self:flex-end}","align-self-stretch{align-self:stretch}","justify-start{justify-content:flex-start}","justify-center{justify-content:center}","justify-end{justify-content:flex-end}","justify-space-between{justify-content:space-between}","justify-space-around{justify-content:space-around}","justify-space-evenly{justify-content:space-evenly}"],o=Array(12).fill();return e.forEach(({label:a,min:r})=>{a!=="xs"&&(l+=`@media(min-width:${r}px){`+n.map(d=>`${i} .${a}u-${d}`).join("")+o.map((d,c)=>`.w-grid.${a}u-columns${c+1}{grid-template-columns:repeat(${c+1},1fr);}`).join("")+o.map((d,c)=>`.w-flex.${a}u-gap${c+1},.w-grid.${a}u-gap${c+1}{gap:${(c+1)*s}px;}`).join("")+`.w-flex.${a}u-gap0,.w-flex.${a}u-gap0{gap:0}}`)}),e.forEach(({label:a,min:r,max:d})=>{l+=`@media (min-width:${r}px) and (max-width:${d}px){`+n.map(c=>`${i} .${a}-${c}`).join("")+o.map((c,u)=>`.w-grid.${a}-columns${u+1}{grid-template-columns:repeat(${u+1},1fr);}`).join("")+o.map((c,u)=>`.w-flex.${a}-gap${u+1},.w-grid.${a}-gap${u+1}{gap:${(u+1)*s}px;}`).join("")+`.w-flex.${a}-gap0,.w-flex.${a}-gap0{gap:0}}`}),e.forEach(({label:a,max:r})=>{a!=="xl"&&(l+=`@media (max-width:${r}px){`+n.map(d=>`${i} .${a}d-${d}`).join("")+o.map((d,c)=>`.w-grid.${a}d-columns${c+1}{grid-template-columns:repeat(${c+1},1fr);}`).join("")+o.map((d,c)=>`.w-flex.${a}d-gap${c+1},.w-grid.${a}d-gap${c+1}{gap:${(c+1)*s}px;}`).join("")+`.w-flex.${a}d-gap0,.w-flex.${a}d-gap0{gap:0}}`)}),l},H=e=>{const l=window.innerWidth,i=R.values.slice(0);i.push(l),i.sort((n,o)=>n-o);const s=R.keys[i.indexOf(l)]||"xl";s!==K&&(K=s,e.breakpoint={name:s,xs:s==="xs",sm:s==="sm",md:s==="md",lg:s==="lg",xl:s==="xl",width:l}),e.breakpoint.width=window.innerWidth},he=e=>{const{config:l}=e;if(R={keys:Object.keys(l.breakpoints),values:Object.values(l.breakpoints)},!document.getElementById("wave-ui-styles")){const i=document.createElement("style");i.id="wave-ui-styles",i.innerHTML=me(l);const s=document.head.querySelectorAll('style,link[rel="stylesheet"]')[0];s?s.before(i):document.head.appendChild(i)}H(e),window.addEventListener("resize",()=>H(e))},ue=(e,l,i)=>{if(!document.getElementById("wave-ui-colors")){const s=document.createElement("style");s.id="wave-ui-colors",s.innerHTML=re(e,l);const n=document.head.querySelectorAll('style,link[rel="stylesheet"]')[0];n?n.before(s):document.head.appendChild(s)}},me=e=>{const l=Object.entries(e.breakpoints),i=l.map(([o,a],r)=>{const[,d=0]=l[r-1]||[];return{label:o,min:d?d+1:0,max:a}}),s=getComputedStyle(document.documentElement);$.cssScope=s.getPropertyValue("--w-css-scope"),$.baseIncrement=parseInt(s.getPropertyValue("--w-base-increment"));let n="";return n+=de(i,e.css.grid),e.css.breakpointLayoutClasses&&(n+=ce(i)),n},pe=["innerHTML"];function ge(e,l,i,s,n,o){const a=t.resolveComponent("w-alert");return t.openBlock(),t.createBlock(t.Teleport,{to:".w-app"},[t.createVNode(t.TransitionGroup,{class:t.normalizeClass(["w-notification-manager",{"w-notification-manager--left":o.conf.align==="left"}]),tag:"div",name:o.transition,appear:""},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.notifications,r=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[r._value?(t.openBlock(),t.createBlock(a,t.mergeProps({class:"white--bg",key:r._uid,modelValue:r._value,"onUpdate:modelValue":d=>r._value=d,onClose:r.dismiss,ref_for:!0},o.notifProps(r)),{default:t.withCtx(()=>[t.createElementVNode("div",{innerHTML:r.message},null,8,pe)]),_:2},1040,["modelValue","onUpdate:modelValue","onClose"])):t.createCommentVNode("",!0)],64))),256))]),_:1},8,["class","name"])])}const p=(e,l)=>{const i=e.__vccOpts||e;for(const[s,n]of l)i[s]=n;return i},fe={name:"w-notification-manager",computed:{conf(){return this.$waveui.config.notificationManager},notifications(){var e;return(e=this.$waveui._notificationManager)==null?void 0:e.notifications},transition(){return this.conf.transition?this.conf.transition.replace("default",`slide-${this.conf.align==="left"?"right":"left"}`):""}},methods:{notifProps(e){const{_value:l,_uid:i,message:s,timeout:n,...o}=e;return o.dismiss&&(o.dismiss=!0),o}}},be=p(fe,[["render",ge]]);var v;const k=class k{constructor(){V(this,"notifications");V(this,"_uid");V(this,"_notificationDefaults");if(E(k,v))return E(k,v);this.notifications=[],this._uid=0,this._notificationDefaults={_uid:0,_value:!0,message:"",timeout:4e3,dismiss:!0},L(k,v,this)}notify(...l){let i={...this._notificationDefaults,_uid:this._uid++};if(typeof l[0]=="object")i={...i,...l[0]};else{const[s,n,o]=l;i={...i,message:s||"",[n===void 0?"info":n]:!0,timeout:o||o===0?parseFloat(o):4e3}}i.dismiss&&(i.dismiss=()=>this.dismiss(i._uid)),this.notifications.push(i),~~i.timeout&&setTimeout(()=>this.dismiss(i._uid),i.timeout)}dismiss(l){this.notifications=this.notifications.filter(i=>i._uid!==l)}};v=new WeakMap,z(k,v);let P=k;const ye=(e,l,i)=>{const s=document.createElement("div");e.appendChild(s);const n=t.createApp(t.defineComponent({...be,inject:["$waveui"]})).provide("$waveui",i);for(const o in l){const a=l[o];n.component(a.name,{...a,inject:["$waveui"]})}n.mount(s),s.remove()};let j=!1;const we=e=>{const l=window.matchMedia("(prefers-color-scheme: dark)");e.preferredTheme=l.matches?"dark":"light",e.switchTheme(e.preferredTheme),l.addEventListener("change",i=>{e.preferredTheme=i.matches?"dark":"light",e.switchTheme(e.preferredTheme)})},ke=(e,l)=>{var i,s;for(const n in l)if((i=e.props)!=null&&i[n])e.props[n].default=l[n];else{let o=!1;if(Array.isArray(e.mixins)&&e.mixins.length){for(const a of e.mixins)if((s=a==null?void 0:a.props)!=null&&s[n]){a.props[n].default=l[n],o=!0;break}o||_(`Attempting to set a preset on a prop that doesn't exist: \`${e.name}.${n}\`.`);continue}}};var I;const C=class C{constructor(l,i={}){V(this,"$waveui",{breakpoint:{name:"",xs:!1,sm:!1,md:!1,lg:!1,xl:!1,width:null},config:{},colors:{},preferredTheme:null,theme:null,_notificationManager:null,notify(...l){this._notificationManager.notify(...l)},switchTheme(l,i=!1){var n,o;this.theme=l,document.documentElement.setAttribute("data-theme",l),(o=(n=document.head.querySelector("#wave-ui-colors"))==null?void 0:n.remove)==null||o.call(n);const s=this.config.colors[this.theme];ue(s,this.config.css.colorShadeCssVariables),this.colors=D(s,W)}});if(E(C,I))return;if(this.$waveui._notificationManager=new P,i.theme||(i.theme="light"),i.colors){const a={...i.colors};i.colors.light||(i.colors.light=a),i.colors.dark||(i.colors.dark=a),i.colors={light:i.colors.light,dark:i.colors.dark}}let{components:s,...n}=i;n=this.$waveui.config=X(n),n.css.colorShades&&te(n);const o=t.reactive(this.$waveui);l.config.globalProperties.$waveui=o,l.provide("$waveui",o),n.theme!=="auto"&&(this.$waveui.colors=D(n.colors[n.theme],W))}static install(l,i={}){var n;l.directive("focus",{mounted:o=>setTimeout(()=>o.focus(),0)}),l.directive("scroll",{mounted:(o,a)=>{const r=d=>{a.value(d,o)&&window.removeEventListener("scroll",r)};window.addEventListener("scroll",r)}});const{components:s={}}=i||{};for(const o in s){const a=s[o];(n=i.presets)!=null&&n[a.name]&&ke(a,i.presets[a.name]),l.component(a.name,a)}l.mixin({beforeMount(){if(!j){j=!0;const o=t.inject("$waveui"),{config:a}=o,r=document.querySelector(a.on)||document.body;r.classList.add("w-app"),a.theme==="auto"?we(o):o.switchTheme(a.theme,!0),he(o),ye(r,s,o),l._context.mixins.find(d=>d.mounted&&delete d.mounted)}}}),new C(l,i),L(C,I,!0)}};I=new WeakMap,z(C,I,!1);let S=C;const b=(e={})=>(typeof e=="string"?e={[e]:!0}:Array.isArray(e)&&(e={[e.join(" ")]:!0}),e),Ce=["aria-expanded"],Be=["tabindex"],ve=["innerHTML"],Se=["innerHTML"];function Ve(e,l,i,s,n,o){const a=t.resolveComponent("w-button"),r=t.resolveComponent("w-transition-expand");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["w-accordion__item",o.itemClasses]),"aria-expanded":o.accordionItem._expanded?"true":"false"},[t.createElementVNode("div",{class:t.normalizeClass(["w-accordion__item-title",o.titleClasses]),onClick:l[4]||(l[4]=d=>!o.accordionItem._disabled&&o.toggleItem(o.accordionItem,d)),onFocus:l[5]||(l[5]=d=>e.$emit("focus",o.accordionItem)),onKeypress:l[6]||(l[6]=t.withKeys(d=>!o.accordionItem._disabled&&o.toggleItem(o.accordionItem,d),["enter"])),tabindex:!o.accordionItem._disabled&&0},[o.options.expandIcon&&!o.options.expandIconRight?(t.openBlock(),t.createBlock(a,{key:0,class:t.normalizeClass(["w-accordion__expand-icon",{"w-accordion__expand-icon--expanded":o.accordionItem._expanded,"w-accordion__expand-icon--rotate90":o.options.expandIconRotate90}]),icon:o.accordionItem._expanded&&o.options.collapseIcon||o.options.expandIcon,"icon-props":o.options.expandIconProps,disabled:o.accordionItem._disabled||null,tabindex:-1,text:"",onKeypress:l[0]||(l[0]=t.withModifiers(()=>{},["stop"])),onClick:l[1]||(l[1]=t.withModifiers(d=>!o.accordionItem._disabled&&o.toggleItem(o.accordionItem,d),["stop"]))},null,8,["icon","icon-props","disabled","class"])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"title",{item:o.getOriginalItem(o.accordionItem),expanded:o.accordionItem._expanded,index:o.accordionItem._index+1},()=>[t.createElementVNode("div",{class:"grow",innerHTML:o.accordionItem[o.options.itemTitleKey]},null,8,ve)]),o.options.expandIcon&&o.options.expandIconRight?(t.openBlock(),t.createBlock(a,{key:1,class:t.normalizeClass(["w-accordion__expand-icon",{"w-accordion__expand-icon--expanded":o.accordionItem._expanded,"w-accordion__expand-icon--rotate90":o.options.expandIconRotate90}]),icon:o.accordionItem._expanded&&o.options.collapseIcon||o.options.expandIcon,text:"",onKeypress:l[2]||(l[2]=t.withModifiers(()=>{},["stop"])),onClick:l[3]||(l[3]=t.withModifiers(d=>!o.accordionItem._disabled&&o.toggleItem(o.accordionItem,d),["stop"]))},null,8,["icon","class"])):t.createCommentVNode("",!0)],42,Be),t.createVNode(r,{y:"",onAfterLeave:l[7]||(l[7]=d=>o.onEndOfCollapse(o.accordionItem)),duration:o.options.duration},{default:t.withCtx(()=>[o.accordionItem._expanded?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["w-accordion__item-content",o.contentClasses])},[t.renderSlot(e.$slots,"content",{item:o.getOriginalItem(o.accordionItem),expanded:o.accordionItem._expanded,index:o.accordionItem._index+1},()=>[t.createElementVNode("div",{innerHTML:o.accordionItem[o.options.itemContentKey]},null,8,Se)])],2)):t.createCommentVNode("",!0)]),_:3},8,["duration"])],10,Ce)}const _e={name:"w-accordion-item",props:{title:{type:String},content:{type:String},expanded:{type:Boolean},disabled:{type:Boolean}},inject:["options","titleClasses","contentClasses","onItemToggle","onEndOfCollapse","getOriginalItem","getAccordionItem","registerItem","unregisterItem"],emits:["focus"],computed:{accordionItem:{get(){return this.getAccordionItem(this._.uid)},set(){}},itemClasses(){return{"w-accordion__item--expanded":this.accordionItem._expanded,"w-accordion__item--disabled":this.accordionItem._disabled,[this.accordionItem[this.options.itemColorKey]]:this.accordionItem[this.options.itemColorKey]}}},methods:{toggleItem(e,l){e._expanded=!e._expanded,this.onItemToggle(e),l.target.blur(),setTimeout(()=>l.target.focus(),300)}},created(){this.registerItem({_cuid:this._.uid,_index:0,_expanded:this.expanded,_disabled:this.disabled,title:this.title,content:this.content})},beforeUnmount(){this.unregisterItem(this._.uid)}},G=p(_e,[["render",Ve]]);function $e(e,l,i,s,n,o){const a=t.resolveComponent("w-accordion-item");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["w-accordion",o.accordionClasses])},[o.accordionItemsProvided?t.renderSlot(e.$slots,"default",{key:0}):(i.items||[]).length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(i.items.length?i.items:e.accordionItems,(r,d)=>(t.openBlock(),t.createBlock(a,{key:d,class:t.normalizeClass(o.itemClasses),title:r.title,content:r.content,expanded:r.expanded||r._expanded,disabled:r.disabled||r._disabled,onFocus:l[0]||(l[0]=c=>e.$emit("focus",c))},{title:t.withCtx(({item:c,expanded:u,index:m})=>[e.$slots[`item-title.${c.id||m}`]?t.renderSlot(e.$slots,`item-title.${c.id||m}`,{key:0,item:c,expanded:u,index:m}):t.renderSlot(e.$slots,"item-title",{key:1,item:c,expanded:u,index:m})]),content:t.withCtx(({item:c,expanded:u,index:m})=>[e.$slots[`item-content.${c.id||m}`]?t.renderSlot(e.$slots,`item-content.${c.id||m}`,{key:0,item:c,expanded:u,index:m}):t.renderSlot(e.$slots,"item-content",{key:1,item:c,expanded:u,index:m})]),_:2},1032,["class","title","content","expanded","disabled"]))),128)):t.createCommentVNode("",!0)],2)}const Ie={name:"w-accordion",props:{modelValue:{type:Array},color:{type:String},bgColor:{type:String},items:{type:[Array,Number]},itemColorKey:{type:String,default:"color"},itemTitleKey:{type:String,default:"title"},itemContentKey:{type:String,default:"content"},itemClass:{type:[String,Array,Object]},titleClass:{type:[String,Array,Object]},contentClass:{type:[String,Array,Object]},expandIcon:{type:[String,Boolean],default:"wi-triangle-down"},expandIconRight:{type:Boolean},expandIconRotate90:{type:Boolean},expandIconProps:{type:Object,default:()=>({})},expandSingle:{type:Boolean},collapseIcon:{type:String},shadow:{type:Boolean},duration:{type:Number,default:250},dark:{type:Boolean},light:{type:Boolean}},components:{WAccordionItem:G},emits:["input","update:modelValue","focus","item-expand","item-collapsed"],provide(){return{titleClasses:this.titleClasses,contentClasses:this.contentClasses,onItemToggle:this.onItemToggle,onEndOfCollapse:this.onEndOfCollapse,getOriginalItem:this.getOriginalItem,options:this.$props,registerItem:this.registerItem,unregisterItem:this.unregisterItem,getAccordionItem:this.getAccordionItem}},data:()=>({accordionItems:[]}),computed:{accordionItemsById(){return this.accordionItems.reduce((e,l)=>(e[l._cuid]=l,e),{})},accordionItemsProvided(){var e,l,i;return(i=(l=(e=this.$slots).default)==null?void 0:l.call(e))==null?void 0:i.some(s=>{var n;return(n=s==null?void 0:s.type)==null?void 0:n.name})},accordionClasses(){return{[this.color]:this.color,[`${this.bgColor}--bg`]:this.bgColor,"w-accordion--dark":this.dark,"w-accordion--light":this.light,"w-accordion--shadow":this.shadow,"w-accordion--no-icon":!this.expandIcon&&!this.collapseIcon,"w-accordion--icon-right":this.expandIcon&&this.expandIconRight,"w-accordion--rotate-icon":this.expandIcon&&!this.collapseIcon}},itemClasses(){return b(this.itemClass)},titleClasses(){return b(this.titleClass)},contentClasses(){return b(this.contentClass)}},methods:{getAccordionItem(e){return this.accordionItemsById[e]},onItemToggle(e){this.expandSingle&&this.accordionItems.forEach(i=>i._index!==e._index&&(i._expanded=!1));const l=this.accordionItems.map(i=>i._expanded||!1);this.$emit("update:modelValue",l),this.$emit("input",l),this.$emit("item-expand",{item:e,expanded:e._expanded})},onEndOfCollapse(e){this.$emit("item-collapsed",{item:e,expanded:e._expanded})},getOriginalItem(e){var l;return((l=this.items)==null?void 0:l[e._index])||e},registerItem(e){var l,i;e._index=this.accordionItems.length,e=Object.assign(e,(l=this.items)==null?void 0:l[e._index]),e._expanded=((i=this.modelValue)==null?void 0:i[e._index])??!1,e._disabled=!!e._disabled,this.accordionItems.push(e)},unregisterItem(e){var i;const l=(i=this.getAccordionItem(e))==null?void 0:i._index;l!==void 0&&this.accordionItems.splice(l,1)}},created(){isNaN(this.items)||B("Since version 3.17.3, the w-accordion `items` prop can no longer be a Number.\n Please use the w-accordion-item component instead for advanced custom rendering.\n https://antoniandre.github.io/wave-ui/w-accordion#w-accordion-item")},unmounted(){this.accordionItems=[]},watch:{modelValue(e){if(this.expandSingle){const l=e.findIndex(i=>!!i);l>-1&&(e=e.fill(!1,l+1))}e.forEach((l,i)=>(this.accordionItems[i]||{})._expanded=l)}}},Ee=p(Ie,[["render",$e]]),xe={class:"w-alert__content"};function Te(e,l,i,s,n,o){const a=t.resolveComponent("w-icon"),r=t.resolveComponent("w-button");return n.show?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["w-alert",o.classes])},[o.type||i.icon||i.dismiss?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o.type||i.icon?(t.openBlock(),t.createBlock(a,{key:0,class:"w-alert__icon"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.type?o.typeIcon:i.icon),1)]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",xe,[t.renderSlot(e.$slots,"default")]),i.dismiss?(t.openBlock(),t.createBlock(r,{key:1,class:"w-alert__dismiss",onClick:l[0]||(l[0]=d=>{e.$emit("update:modelValue",n.show=!1),e.$emit("input",!1),e.$emit("close",!1)}),icon:"wi-cross",color:"inherit",sm:"",text:""})):t.createCommentVNode("",!0)],64)):t.renderSlot(e.$slots,"default",{key:1})],2)):t.createCommentVNode("",!0)}const Ne={name:"w-alert",props:{modelValue:{default:!0},color:{type:String},bgColor:{type:String},shadow:{type:Boolean},tile:{type:Boolean},round:{type:Boolean},icon:{type:String},iconOutside:{type:Boolean},plain:{type:Boolean},dismiss:{type:Boolean},bold:{type:Boolean},success:{type:Boolean},info:{type:Boolean},warning:{type:Boolean},error:{type:Boolean},xs:{type:Boolean},sm:{type:Boolean},md:{type:Boolean},lg:{type:Boolean},xl:{type:Boolean},border:{type:Boolean},borderLeft:{type:Boolean},borderRight:{type:Boolean},borderTop:{type:Boolean},borderBottom:{type:Boolean},outline:{type:Boolean}},emits:["input","update:modelValue","close"],data(){return{show:this.modelValue}},computed:{typeIcon(){return this.type==="success"&&"wi-check-circle"||this.type==="warning"&&"wi-warning-circle"||this.type==="error"&&"wi-cross-circle"||this.type==="info"&&"wi-info-circle"},type(){return this.success&&"success"||this.info&&"info"||this.warning&&"warning"||this.error&&"error"||null},presetSize(){return this.xs&&"xs"||this.sm&&"sm"||this.md&&"md"||this.lg&&"lg"||this.xl&&"xl"||null},hasSingleBorder(){return this.borderLeft||this.borderRight||this.borderTop||this.borderBottom},classes(){const e=this.bgColor||this.plain&&this.type,l=this.color||!this.plain&&this.type||!e&&"primary";return{[`${e}--bg w-alert--bg`]:e,[l]:l,[`size--${this.presetSize}`]:this.presetSize,[`w-alert--${this.type}`]:this.type,"w-alert--has-icon":this.type||this.icon||this.dismiss,"w-alert--icon-outside":this.iconOutside,"w-alert--plain":this.type&&this.plain,"w-alert--outline":this.outline,"w-alert--tile":this.tile,"w-alert--round":this.round,"w-alert--one-border":this.hasSingleBorder||this.iconOutside,"w-alert--border-left":this.borderLeft||this.iconOutside,"w-alert--border-right":this.borderRight,"w-alert--border-top":this.borderTop,"w-alert--border-bottom":this.borderBottom,"w-alert--border":this.border&&!this.hasSingleBorder,"w-alert--shadow":this.shadow,"w-alert--bold":this.bold}}},watch:{modelValue(e){this.show=e}}},ze=p(Ne,[["render",Te]]),Le={class:"w-autocomplete__selection"},Re=["innerHTML"],Pe=["innerHTML"],Oe=["value"],Me=["onClick"],De=["innerHTML"],Ae=["innerHTML"];function Fe(e,l,i,s,n,o){const a=t.resolveComponent("w-button"),r=t.resolveComponent("w-transition-slide-fade");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["w-autocomplete",o.classes]),onClick:l[5]||(l[5]=(...d)=>o.onClick&&o.onClick(...d)),style:t.normalizeStyle(e.$attrs.style)},[e.selection.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(e.selection,(d,c)=>(t.openBlock(),t.createElementBlock("div",Le,[t.renderSlot(e.$slots,"selection",{item:d,unselect:u=>o.unselectItem(u)},()=>[t.createElementVNode("span",{innerHTML:d[i.itemLabelKey]},null,8,Re),t.createVNode(a,{onClick:t.withModifiers(u=>o.unselectItem(c),["stop"]),icon:"wi-cross",xs:"",text:"",color:"currentColor"},null,8,["onClick"])])]))),256)):t.createCommentVNode("",!0),!e.selection.length&&!e.keywords&&i.placeholder?(t.openBlock(),t.createElementBlock("div",{key:1,class:"w-autocomplete__placeholder",innerHTML:i.placeholder},null,8,Pe)):t.createCommentVNode("",!0),t.createElementVNode("input",t.mergeProps({class:"w-autocomplete__input",ref:"input",value:e.keywords},t.toHandlers(o.inputEventListeners,!0),o.inputAttrs),null,16,Oe),t.createVNode(r,null,{default:t.withCtx(()=>[e.menuOpen?(t.openBlock(),t.createElementBlock("ul",{key:0,class:"w-autocomplete__menu",ref:"menu",onMousedown:l[1]||(l[1]=d=>e.menuIsBeingClicked=!0),onMouseup:l[2]||(l[2]=(...d)=>o.setEndOfMenuClick&&o.setEndOfMenuClick(...d)),onTouchstart:l[3]||(l[3]=d=>e.menuIsBeingClicked=!0),onTouchend:l[4]||(l[4]=(...d)=>o.setEndOfMenuClick&&o.setEndOfMenuClick(...d))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.filteredItems,(d,c)=>(t.openBlock(),t.createElementBlock("li",{key:c,onClick:t.withModifiers(u=>(o.selectItem(d),e.$emit("item-click",d)),["stop"]),class:t.normalizeClass({highlighted:e.highlightedItem===d.uid})},[t.renderSlot(e.$slots,"item",{item:d,highlighted:e.highlightedItem===d.uid},()=>[t.createElementVNode("span",{innerHTML:d[i.itemLabelKey]},null,8,De)])],10,Me))),128)),o.filteredItems.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",{key:0,class:t.normalizeClass(["w-autocomplete__no-match",{"w-autocomplete__no-match--default":!e.$slots.noMatch}])},[t.renderSlot(e.$slots,"no-match",{},()=>[t.createElementVNode("div",{class:"caption",innerHTML:i.noMatch??"No match."},null,8,Ae)])],2)),e.$slots["extra-item"]?(t.openBlock(),t.createElementBlock("li",{key:1,class:t.normalizeClass(["w-autocomplete__extra-item",{highlighted:e.highlightedItem==="extra-item"}]),onClick:l[0]||(l[0]=(...d)=>o.selectExtraItem&&o.selectExtraItem(...d))},[t.renderSlot(e.$slots,"extra-item")],2)):t.createCommentVNode("",!0)],544)):t.createCommentVNode("",!0)]),_:3})],6)}const We={name:"w-autocomplete",inheritAttrs:!1,props:{items:{type:Array,required:!0},modelValue:{type:[String,Number,Array]},placeholder:{type:String},openOnKeydown:{type:Boolean},multiple:{type:Boolean},allowDuplicates:{type:Boolean},noMatch:{type:String},itemValueKey:{type:String,default:"value"},itemLabelKey:{type:String,default:"label"},itemSearchableKey:{type:String,default:"searchable"}},emits:["update:modelValue","input","focus","blur","keydown","item-click","item-select","extra-item-select"],data:()=>({keywords:"",selection:[],menuOpen:!1,highlightedItem:null,menuIsBeingClicked:!1}),computed:{normalizedKeywords(){return this.normalize(this.keywords)},optimizedItemsForSearch(){return this.items.map((e,l)=>({...e,uid:l,searchable:this.normalize(e[this.itemSearchableKey]||"")}))},filteredItems(){let e=this.optimizedItemsForSearch;const l=i=>!this.selection.find(s=>s.uid===i.uid);return this.keywords?e=e.filter(i=>i.searchable.includes(this.normalizedKeywords)?this.multiple&&!this.allowDuplicates?l(i):!0:!1):this.multiple&&!this.allowDuplicates&&(e=e.filter(l)),e},highlightedItemIndex(){return this.highlightedItem===null?-1:this.highlightedItem==="extra-item"?this.filteredItems.length:this.filteredItems.findIndex(e=>e.uid===this.highlightedItem)},wrapperAttrs(){const{style:e,class:l}=this.$attrs;return{style:e,class:l}},inputAttrs(){const{style:e,class:l,...i}=this.$attrs;return i},inputEventListeners(){return{input:e=>{this.keywords=e.target.value},focus:e=>{this.menuIsBeingClicked||(this.onFocus(e),this.$emit("focus",e))},blur:e=>{this.menuIsBeingClicked||this.$emit("blur",e)},keydown:e=>{this.onKeydown(e),this.$emit("keydown",e)},drop:this.onDrop,compositionstart:this.onCompositionStart,compositionupdate:this.onCompositionUpdate}},classes(){return{"w-autocomplete--open":this.menuOpen,"w-autocomplete--filled":this.selection.length,"w-autocomplete--has-keywords":this.keywords,"w-autocomplete--empty":!this.selection.length&&!this.keywords,[this.$attrs.class]:!!this.$attrs.class}}},methods:{normalize(e){return e.toLowerCase().normalize("NFKD").replace(new RegExp("\\p{Diacritic}","gu"),"").replace(/œ/g,"oe")},selectItem(e){this.multiple||(this.selection=[]),this.selection.push(e),this.highlightedItem=e.uid,this.keywords="";const l=this.multiple?this.selection.map(i=>i[this.itemValueKey]):e[this.itemValueKey];this.$emit("item-select",e),this.$emit("update:modelValue",l),this.$emit("input",l),this.$refs.input.focus(),this.multiple||this.closeMenu()},unselectItem(e){this.selection.splice(e??this.selection.length-1,1),this.highlightedItem=null,this.$emit("update:modelValue",null),this.$emit("input",null),this.$refs.input.focus()},selectExtraItem(){this.keywords="",this.$emit("extra-item-select"),this.closeMenu()},setEndOfMenuClick(){setTimeout(()=>this.menuIsBeingClicked=!1,100)},onClick(){this.openOnKeydown||this.openMenu(),this.$refs.input.focus()},onFocus(){this.openOnKeydown||this.openMenu()},onKeydown(e){var i;const l=this.filteredItems.length+(this.$slots["extra-item"]?1:0);if((!this.openOnKeydown||(this.keywords||e.key.length===1)&&!this.menuOpen)&&this.openMenu(),e.keyCode===9)this.closeMenu();else if(e.keyCode===8&&(!this.keywords||!e.target.selectionStart&&!e.target.selectionEnd))this.unselectItem();else if(e.keyCode===13)e.preventDefault(),this.highlightedItem==="extra-item"?this.selectExtraItem():this.highlightedItemIndex>=0&&this.selectItem(this.filteredItems[this.highlightedItemIndex]);else if([38,40].includes(e.keyCode)){e.preventDefault();let s=this.highlightedItemIndex;s===-1?s=e.keyCode===38?l-1:0:s=(s+(e.keyCode===38?-1:1)+l)%l,this.$slots["extra-item"]&&s===l-1?this.highlightedItem="extra-item":this.highlightedItem=((i=this.filteredItems[s])==null?void 0:i.uid)||0;const n=this.$refs.menu;if(n)if(this.$slots["extra-item"]&&s===l-1)n.scrollTop=n.scrollHeight;else{const{offsetHeight:o,offsetTop:a}=n.childNodes[s]||{};n.scrollTop+n.offsetHeight-o<a?n.scrollTop=a-n.offsetHeight+o:n.scrollTop>a&&(n.scrollTop=a)}}else!this.multiple&&this.selection.length&&e.key.length===1&&e.preventDefault()},onDrop(e){!this.multiple&&this.selection.length&&e.preventDefault()},onCompositionStart(e){!this.multiple&&this.selection.length&&e.target.setAttribute("readonly",!0)},onCompositionUpdate(e){!this.multiple&&this.selection.length&&setTimeout(()=>e.target.removeAttribute("readonly"),200)},openMenu(){this.menuOpen||(this.menuOpen=!0,document.addEventListener("click",this.onDocumentClick))},closeMenu(){this.menuOpen=!1,document.removeEventListener("click",this.onDocumentClick)},onDocumentClick(e){!this.$el.contains(e.target)&&!this.$el.isSameNode(e.target)&&this.closeMenu()}},created(){this.modelValue&&(Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]).forEach(l=>{this.selection.push(this.optimizedItemsForSearch.find(i=>i[this.itemValueKey]===+l))})},beforeUnmount(){document.removeEventListener("click",this.onDocumentClick)},watch:{modelValue(e){this.selection=[],e&&(Array.isArray(e)?e:[e]).forEach(i=>{this.selection.push(this.optimizedItemsForSearch.find(s=>s[this.itemValueKey]===+i))})}}},Ke=p(We,[["render",Fe]]),He={class:"w-app"};function je(e,l,i,s,n,o){return t.openBlock(),t.createElementBlock("div",He,[t.renderSlot(e.$slots,"default")])}const Ue={name:"w-app",props:{block:{type:Boolean},row:{type:Boolean},alignCenter:{type:Boolean},alignEnd:{type:Boolean},justifyCenter:{type:Boolean},justifyEnd:{type:Boolean},justifySpaceBetween:{type:Boolean},justifySpaceAround:{type:Boolean},justifySpaceEvenly:{type:Boolean},textCenter:{type:Boolean},textRight:{type:Boolean}}},qe=p(Ue,[["render",je]]),Xe={class:"w-badge-wrap"};function Ye(e,l,i,s,n,o){return t.openBlock(),t.createElementBlock("div",Xe,[t.renderSlot(e.$slots,"default"),t.createVNode(t.Transition,{name:`${i.transition}`},{default:t.withCtx(()=>[i.modelValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["w-badge",o.classes]),style:t.normalizeStyle(o.styles),"aria-atomic":"true","aria-label":"Badge","aria-live":"polite",role:"status"},[i.dot?t.createCommentVNode("",!0):t.renderSlot(e.$slots,"badge",{key:0},()=>[t.createTextVNode(t.toDisplayString(i.modelValue===!0?"":i.modelValue||""),1)])],6)):t.createCommentVNode("",!0)]),_:3},8,["name"])])}const Ge={name:"w-badge",props:{modelValue:{default:!0},xs:{type:Boolean},sm:{type:Boolean},md:{type:Boolean},lg:{type:Boolean},xl:{type:Boolean},top:{type:Boolean},left:{type:Boolean},right:{type:Boolean},bottom:{type:Boolean},overlap:{type:Boolean},inline:{type:Boolean},color:{type:String},size:{type:[Number,String]},bgColor:{type:String,default:"primary"},badgeClass:{type:String},outline:{type:Boolean},shadow:{type:Boolean},dot:{type:Boolean},round:{type:Boolean},transition:{type:String,default:"fade"},dark:{type:Boolean},light:{type:Boolean}},emits:[],computed:{forcedSize(){return this.size&&(isNaN(this.size)?this.size:`${this.size}px`)},presetSize(){return this.xs&&"xs"||this.sm&&"sm"||this.md&&"md"||this.lg&&"lg"||this.xl&&"xl"||"md"},position(){return[this.top&&"top"||this.bottom&&"bottom"||"top",this.left&&"left"||this.right&&"right"||"right"]},classes(){const e=this.$slots.badge&&this.$slots.badge().map(l=>l.children).join("");return{[this.color]:this.color,[`${this.bgColor}--bg`]:this.bgColor,[this.badgeClass]:this.badgeClass||null,"w-badge--round":this.round||(e||this.modelValue+""||"").length<2,"w-badge--dark":this.dark,"w-badge--light":this.light,"w-badge--outline":this.outline,"w-badge--inline":this.inline,"w-badge--shadow":this.shadow,"w-badge--overlap":this.overlap,"w-badge--dot":this.dot,[`size--${this.presetSize}`]:this.presetSize&&!this.forcedSize,[`w-badge--${this.position.join(" w-badge--")}`]:!0}},styles(){return this.forcedSize&&`font-size: ${this.forcedSize}`}}},Je=p(Ge,[["render",Ye]]),Qe=["innerHTML"];function Ze(e,l,i,s,n,o){const a=t.resolveComponent("w-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["w-breadcrumbs",o.classes])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.items,(r,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[d&&e.$slots.separator?(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["w-breadcrumbs__separator",i.separatorColor]),key:`${d}a`},[t.renderSlot(e.$slots,"separator",{index:d})],2)):d?(t.openBlock(),t.createBlock(a,{class:t.normalizeClass(["w-breadcrumbs__separator",i.separatorColor]),key:`${d}b`},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.icon),1)]),_:2},1032,["class"])):t.createCommentVNode("",!0),r[i.itemRouteKey]&&(d<i.items.length-1||i.linkLastItem)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[e.$slots.item?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.hasRouter?"router-link":"a"),{class:t.normalizeClass(["w-breadcrumbs__item",i.color||null]),key:`${d}c`,to:o.hasRouter&&r[i.itemRouteKey],href:r[i.itemRouteKey]},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"item",{item:r,index:d+1,isLast:d===i.items.length-1})]),_:2},1032,["to","href","class"])):(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.hasRouter?"router-link":"a"),{class:t.normalizeClass(["w-breadcrumbs__item",i.color||null]),key:`${d}d`,to:o.hasRouter&&r[i.itemRouteKey],href:r[i.itemRouteKey],innerHTML:r[i.itemLabelKey]},null,8,["to","href","innerHTML","class"]))],64)):e.$slots.item?t.renderSlot(e.$slots,"item",{key:`${d}e`,item:r,index:d+1,isLast:d===i.items.length-1}):(t.openBlock(),t.createElementBlock("span",{key:`${d}f`,innerHTML:r[i.itemLabelKey]},null,8,Qe))],64))),256))],2)}const et={name:"w-breadcrumbs",props:{items:{type:Array,required:!0},linkLastItem:{type:Boolean},color:{type:String},separatorColor:{type:String,default:"grey-light1"},icon:{type:String,default:"wi-chevron-right"},itemRouteKey:{type:String,default:"route"},itemLabelKey:{type:String,default:"label"},xs:{type:Boolean},sm:{type:Boolean},md:{type:Boolean},lg:{type:Boolean},xl:{type:Boolean}},emits:[],computed:{hasRouter(){return"$router"in this},size(){return this.xs&&"xs"||this.sm&&"sm"||this.lg&&"lg"||this.xl&&"xl"||"md"},classes(){return{[`size--${this.size}`]:!0}}}},tt=p(et,[["render",Ze]]),lt={key:0,class:"w-button__loader"};function it(e,l,i,s,n,o){const a=t.resolveComponent("w-icon");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(!i.disabled&&i.route?"a":"button"),t.mergeProps({class:["w-button",o.classes],type:!i.route&&i.type,href:!i.disabled&&i.route&&(o.externalLink?i.route:o.resolvedRoute)||null,disabled:!!i.disabled||null},o.attrs,{style:o.styles}),{default:t.withCtx(()=>[i.icon?(t.openBlock(),t.createBlock(a,t.normalizeProps(t.mergeProps({key:0},i.iconProps||{})),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.icon),1)]),_:1},16)):t.renderSlot(e.$slots,"default",{key:1}),t.createVNode(t.Transition,{name:"scale-fade"},{default:t.withCtx(()=>[i.loading?(t.openBlock(),t.createElementBlock("div",lt,[t.renderSlot(e.$slots,"loading",{},()=>[l[0]||(l[0]=t.createElementVNode("svg",{viewBox:"0 0 40 40"},[t.createElementVNode("circle",{cx:"20",cy:"20",r:"18",fill:"transparent",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round"})],-1))])])):t.createCommentVNode("",!0)]),_:3})]),_:3},16,["type","href","class","disabled","style"])}const ot={inheritAttrs:!1,props:{color:{type:String},bgColor:{type:String},dark:{type:Boolean},light:{type:Boolean},outline:{type:Boolean},text:{type:Boolean},round:{type:Boolean},shadow:{type:Boolean},tile:{type:Boolean},route:{type:[String,Object]},forceLink:{type:Boolean},type:{type:String,default:"button"},disabled:{type:Boolean},loading:{type:Boolean},icon:{type:String,default:null},iconProps:{type:Object,default:()=>({})},absolute:{type:Boolean},fixed:{type:Boolean},top:{type:Boolean},bottom:{type:Boolean},left:{type:Boolean},right:{type:Boolean},zIndex:{type:[Number,String]},width:{type:[Number,String]},height:{type:[Number,String]},xs:{type:Boolean},sm:{type:Boolean},md:{type:Boolean},lg:{type:Boolean},xl:{type:Boolean}},emits:[],computed:{hasRouter(){return"$router"in this},resolvedRoute(){return this.hasRouter?this.$router.resolve(this.route).href:this.route},attrs(){const e=this.route&&this.hasRouter&&!this.forceLink&&!this.externalLink,l=i=>{this.$attrs.onClick&&this.$attrs.onClick(i),this.$router.push(this.route),i.stopPropagation(),i.preventDefault()};return{...this.$attrs,onClick:!this.disabled&&!this.loading&&(e?l:this.$attrs.onClick)}},size(){return this.xs&&"xs"||this.sm&&"sm"||this.lg&&"lg"||this.xl&&"xl"||"md"},position(){return[this.top&&"top"||this.bottom&&"bottom"||"top",this.left&&"left"||this.right&&"right"||"right"]},externalLink(){return/^(https?:)?\/\/|mailto:|tel:/.test(this.route)},classes(){return{"primary--bg":!this.bgColor&&!this.color&&!(this.outline||this.text),primary:!this.bgColor&&!this.color&&!this.dark&&(this.outline||this.text),[this.color]:this.color,[`${this.bgColor}--bg`]:this.bgColor,"w-button--dark":this.dark,"w-button--light":this.light,"w-button--outline":this.outline,"w-button--text":this.text,"w-button--round":this.round,"w-button--tile":this.tile,"w-button--shadow":this.shadow,"w-button--loading":this.loading,"w-button--icon":this.icon,[`size--${this.size}`]:!0,"w-button