@ditojs/ui 3.2.6 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dito-ui.css +1 -1
- package/dist/dito-ui.es.js +1350 -3294
- package/dist/dito-ui.umd.js +1 -7
- package/package.json +15 -9
- package/src/components/DitoButton.vue +91 -16
- package/src/components/DitoCalendar.vue +318 -248
- package/src/components/DitoDatePicker.vue +36 -147
- package/src/components/DitoDateTimePicker.vue +75 -181
- package/src/components/DitoInput.vue +5 -3
- package/src/components/DitoMenuButton.vue +226 -0
- package/src/components/DitoPagination.vue +9 -3
- package/src/components/DitoPickerInput.vue +285 -0
- package/src/components/DitoSwitch.vue +4 -6
- package/src/components/DitoTimePanel.vue +264 -0
- package/src/components/DitoTimePicker.vue +47 -454
- package/src/components/DitoTrigger.vue +250 -89
- package/src/components/index.js +1 -0
- package/src/styles/components/_resize.scss +8 -0
- package/src/styles/mixins/_input.scss +6 -0
- package/src/utils/button.js +24 -0
- package/src/utils/date.js +18 -0
- package/src/utils/event.js +18 -9
- package/src/utils/index.js +1 -0
- package/src/utils/time.js +107 -0
package/dist/dito-ui.umd.js
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@ditojs/utils")):typeof define==`function`&&define.amd?define([`exports`,`@ditojs/utils`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`dito-ui`]={},e[`@ditojs/utils`]))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r=process.env.NODE_ENV===`production`?{}:Object.freeze({}),i=process.env.NODE_ENV===`production`?[]:Object.freeze([]),a=()=>{},o=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith(`onUpdate:`),c=Object.assign,l=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},u=Object.prototype.hasOwnProperty,d=(e,t)=>u.call(e,t),f=Array.isArray,p=e=>x(e)===`[object Map]`,m=e=>x(e)===`[object Set]`,h=e=>x(e)===`[object Date]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,ee=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,te=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ne=/-\w/g,re=te(e=>e.replace(ne,e=>e.slice(1).toUpperCase())),ie=te(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=te(e=>e?`on${ie(e)}`:``),oe=(e,t)=>!Object.is(e,t),se=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ce=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},le=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ue=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},de,fe=()=>de||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function pe(e){if(f(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function T(e){let t=``;if(_(e))t=e;else if(f(e))for(let n=0;n<e.length;n++){let r=T(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Se(e[i],t[i],n);return r}function ye(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Se(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function be(e,t,n){let r=p(e),i=p(t);if(r||i||(r=m(e),i=m(t),r||i))return r&&i?ye(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Se(e[r],t[r],n))return!1}return String(e)===String(t)}function xe(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Se(e,t,n){if(e===t)return!0;let r=h(e),i=h(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=f(e),i=f(t),r||i?r&&i?xe(e,t,n,ve):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:xe(e,t,n,be):String(e)===String(t))))}function Ce(e,t){return e.findIndex(e=>Se(e,t))}var we=e=>!!(e&&e.__v_isRef===!0),E=e=>_(e)?e:e==null?``:f(e)||y(e)&&(e.toString===b||!g(e.toString))?we(e)?E(e.value):JSON.stringify(e,Te,2):String(e),Te=(e,t)=>we(t)?Te(e,t.value):p(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ee(t,r)+` =>`]=n,e),{})}:m(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ee(e))}:v(t)?Ee(t):y(t)&&!f(t)&&!C(t)?String(t):t,Ee=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function De(e,...t){console.warn(`[Vue warn] ${e}`,...t)}var Oe;function ke(){return Oe}var D,Ae=new WeakSet,je=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Oe&&(Oe.active?Oe.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ae.has(this)&&(Ae.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Fe(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qe(this),Re(this);let e=D,t=O;D=this,O=!0;try{return this.fn()}finally{process.env.NODE_ENV!==`production`&&D!==this&&De(`Active effect was not restored correctly - this is likely a Vue internal bug.`),ze(this),D=e,O=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)He(e);this.deps=this.depsTail=void 0,qe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ae.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Be(this)&&this.run()}get dirty(){return Be(this)}},Me=0,Ne,Pe;function Fe(e,t=!1){if(e.flags|=8,t){e.next=Pe,Pe=e;return}e.next=Ne,Ne=e}function Ie(){Me++}function Le(){if(--Me>0)return;if(Pe){let e=Pe;for(Pe=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Ne;){let t=Ne;for(Ne=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Re(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ze(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),He(r),Ue(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Be(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ve(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ve(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Je)||(e.globalVersion=Je,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Be(e))))return;e.flags|=2;let t=e.dep,n=D,r=O;D=e,O=!0;try{Re(e);let n=e.fn(e._value);(t.version===0||oe(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{D=n,O=r,ze(e),e.flags&=-3}}function He(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),process.env.NODE_ENV!==`production`&&n.subsHead===e&&(n.subsHead=i),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)He(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ue(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var O=!0,We=[];function Ge(){We.push(O),O=!1}function Ke(){let e=We.pop();O=e===void 0||e}function qe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=D;D=void 0;try{t()}finally{D=e}}}var Je=0,Ye=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Xe=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,process.env.NODE_ENV!==`production`&&(this.subsHead=void 0)}track(e){if(!D||!O||D===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==D)t=this.activeLink=new Ye(D,this),D.deps?(t.prevDep=D.depsTail,D.depsTail.nextDep=t,D.depsTail=t):D.deps=D.depsTail=t,Ze(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=D.depsTail,t.nextDep=void 0,D.depsTail.nextDep=t,D.depsTail=t,D.deps===t&&(D.deps=e)}return process.env.NODE_ENV!==`production`&&D.onTrack&&D.onTrack(c({effect:D},e)),t}trigger(e){this.version++,Je++,this.notify(e)}notify(e){Ie();try{if(process.env.NODE_ENV!==`production`)for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(c({effect:t.sub},e));for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Le()}}};function Ze(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),process.env.NODE_ENV!==`production`&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}var Qe=new WeakMap,$e=Symbol(process.env.NODE_ENV===`production`?``:`Object iterate`),et=Symbol(process.env.NODE_ENV===`production`?``:`Map keys iterate`),tt=Symbol(process.env.NODE_ENV===`production`?``:`Array iterate`);function k(e,t,n){if(O&&D){let r=Qe.get(e);r||Qe.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new Xe),i.map=r,i.key=n),process.env.NODE_ENV===`production`?i.track():i.track({target:e,type:t,key:n})}}function nt(e,t,n,r,i,a){let o=Qe.get(e);if(!o){Je++;return}let s=o=>{o&&(process.env.NODE_ENV===`production`?o.trigger():o.trigger({target:e,type:t,key:n,newValue:r,oldValue:i,oldTarget:a}))};if(Ie(),t===`clear`)o.forEach(s);else{let i=f(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===tt||!v(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(tt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get($e)),p(e)&&s(o.get(et)));break;case`delete`:i||(s(o.get($e)),p(e)&&s(o.get(et)));break;case`set`:p(e)&&s(o.get($e))}}Le()}function rt(e){let t=N(e);return t===e||(k(t,`iterate`,tt),M(e))?t:j(e)?Bt(e)?t.map(e=>Ut(P(e))):t.map(Ut):t.map(P)}function it(e){return k(e=N(e),`iterate`,tt),e}function A(e,t){return j(e)?Ut(Bt(e)?P(t):t):P(t)}var at={__proto__:null,[Symbol.iterator](){return ot(this,Symbol.iterator,e=>A(this,e))},concat(...e){return rt(this).concat(...e.map(e=>f(e)?rt(e):e))},entries(){return ot(this,`entries`,e=>(e[1]=A(this,e[1]),e))},every(e,t){return ct(this,`every`,e,t,void 0,arguments)},filter(e,t){return ct(this,`filter`,e,t,e=>e.map(e=>A(this,e)),arguments)},find(e,t){return ct(this,`find`,e,t,e=>A(this,e),arguments)},findIndex(e,t){return ct(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return ct(this,`findLast`,e,t,e=>A(this,e),arguments)},findLastIndex(e,t){return ct(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return ct(this,`forEach`,e,t,void 0,arguments)},includes(...e){return ut(this,`includes`,e)},indexOf(...e){return ut(this,`indexOf`,e)},join(e){return rt(this).join(e)},lastIndexOf(...e){return ut(this,`lastIndexOf`,e)},map(e,t){return ct(this,`map`,e,t,void 0,arguments)},pop(){return dt(this,`pop`)},push(...e){return dt(this,`push`,e)},reduce(e,...t){return lt(this,`reduce`,e,t)},reduceRight(e,...t){return lt(this,`reduceRight`,e,t)},shift(){return dt(this,`shift`)},some(e,t){return ct(this,`some`,e,t,void 0,arguments)},splice(...e){return dt(this,`splice`,e)},toReversed(){return rt(this).toReversed()},toSorted(e){return rt(this).toSorted(e)},toSpliced(...e){return rt(this).toSpliced(...e)},unshift(...e){return dt(this,`unshift`,e)},values(){return ot(this,`values`,e=>A(this,e))}};function ot(e,t,n){let r=it(e),i=r[t]();return r!==e&&!M(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var st=Array.prototype;function ct(e,t,n,r,i,a){let o=it(e),s=o!==e&&!M(e),c=o[t];if(c!==st[t]){let t=c.apply(e,a);return s?P(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,A(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function lt(e,t,n,r){let i=it(e),a=i!==e&&!M(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=A(e,t)),n.call(this,t,A(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?A(e,c):c}function ut(e,t,n){let r=N(e);k(r,`iterate`,tt);let i=r[t](...n);return(i===-1||i===!1)&&Vt(n[0])?(n[0]=N(n[0]),r[t](...n)):i}function dt(e,t,n=[]){Ge(),Ie();let r=N(e)[t].apply(e,n);return Le(),Ke(),r}var ft=n(`__proto__,__v_isRef,__isVue`),pt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(v));function mt(e){v(e)||(e=String(e));let t=N(this);return k(t,`has`,e),t.hasOwnProperty(e)}var ht=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Pt:Nt:i?Mt:jt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=f(e);if(!r){let e;if(a&&(e=at[t]))return e;if(t===`hasOwnProperty`)return mt}let o=Reflect.get(e,t,F(e)?e:n);if((v(t)?pt.has(t):ft(t))||(r||k(e,`get`,t),i))return o;if(F(o)){let e=a&&w(t)?o:o.value;return r&&y(e)?Lt(e):e}return y(o)?r?Lt(o):It(o):o}},gt=class extends ht{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=f(e)&&w(t);if(!this._isShallow){let r=j(i);if(!M(n)&&!j(n)&&(i=N(i),n=N(n)),!a&&F(i)&&!F(n))return r?(process.env.NODE_ENV!==`production`&&De(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0):(i.value=n,!0)}let o=a?Number(t)<e.length:d(e,t),s=Reflect.set(e,t,n,F(e)?e:r);return e===N(r)&&s&&(o?oe(n,i)&&nt(e,`set`,t,n,i):nt(e,`add`,t,n)),s}deleteProperty(e,t){let n=d(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&nt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!v(t)||!pt.has(t))&&k(e,`has`,t),n}ownKeys(e){return k(e,`iterate`,f(e)?`length`:$e),Reflect.ownKeys(e)}},_t=class extends ht{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!==`production`&&De(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!==`production`&&De(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},vt=new gt,yt=new _t,bt=new _t(!0),xt=e=>e,St=e=>Reflect.getPrototypeOf(e);function Ct(e,t,n){return function(...r){let i=this.__v_raw,a=N(i),o=p(a),s=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?xt:t?Ut:P;return!t&&k(a,`iterate`,l?et:$e),c(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:s?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function wt(e){return function(...t){if(process.env.NODE_ENV!==`production`){let n=t[0]?`on key "${t[0]}" `:``;De(`${ie(e)} operation ${n}failed: target is readonly.`,N(this))}return e===`delete`?!1:e===`clear`?void 0:this}}function Tt(e,t){let n={get(n){let r=this.__v_raw,i=N(r),a=N(n);e||(oe(n,a)&&k(i,`get`,n),k(i,`get`,a));let{has:o}=St(i),s=t?xt:e?Ut:P;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&k(N(t),`iterate`,$e),t.size},has(t){let n=this.__v_raw,r=N(n),i=N(t);return e||(oe(t,i)&&k(r,`has`,t),k(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=N(a),s=t?xt:e?Ut:P;return!e&&k(o,`iterate`,$e),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return c(n,e?{add:wt(`add`),set:wt(`set`),delete:wt(`delete`),clear:wt(`clear`)}:{add(e){let n=N(this),r=St(n),i=N(e),a=!t&&!M(e)&&!j(e)?i:e;return r.has.call(n,a)||oe(e,a)&&r.has.call(n,e)||oe(i,a)&&r.has.call(n,i)||(n.add(a),nt(n,`add`,a,a)),this},set(e,n){!t&&!M(n)&&!j(n)&&(n=N(n));let r=N(this),{has:i,get:a}=St(r),o=i.call(r,e);o?process.env.NODE_ENV!==`production`&&At(r,i,e):(e=N(e),o=i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?oe(n,s)&&nt(r,`set`,e,n,s):nt(r,`add`,e,n),this},delete(e){let t=N(this),{has:n,get:r}=St(t),i=n.call(t,e);i?process.env.NODE_ENV!==`production`&&At(t,n,e):(e=N(e),i=n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&nt(t,`delete`,e,void 0,a),o},clear(){let e=N(this),t=e.size!==0,n=process.env.NODE_ENV===`production`?void 0:p(e)?new Map(e):new Set(e),r=e.clear();return t&&nt(e,`clear`,void 0,void 0,n),r}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Ct(r,e,t)}),n}function Et(e,t){let n=Tt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(d(n,r)&&r in t?n:t,r,i)}var Dt={get:Et(!1,!1)},Ot={get:Et(!0,!1)},kt={get:Et(!0,!0)};function At(e,t,n){let r=N(n);if(r!==n&&t.call(e,r)){let t=S(e);De(`Reactive ${t} contains both the raw and reactive versions of the same object${t===`Map`?` as keys`:``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var jt=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,Pt=new WeakMap;function Ft(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function It(e){return j(e)?e:zt(e,!1,vt,Dt,jt)}function Lt(e){return zt(e,!0,yt,Ot,Nt)}function Rt(e){return zt(e,!0,bt,kt,Pt)}function zt(e,t,n,r,i){if(!y(e))return process.env.NODE_ENV!==`production`&&De(`value cannot be made ${t?`readonly`:`reactive`}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Ft(S(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Bt(e){return j(e)?Bt(e.__v_raw):!!(e&&e.__v_isReactive)}function j(e){return!!(e&&e.__v_isReadonly)}function M(e){return!!(e&&e.__v_isShallow)}function Vt(e){return e?!!e.__v_raw:!1}function N(e){let t=e&&e.__v_raw;return t?N(t):e}function Ht(e){return!d(e,`__v_skip`)&&Object.isExtensible(e)&&ce(e,`__v_skip`,!0),e}var P=e=>y(e)?It(e):e,Ut=e=>y(e)?Lt(e):e;function F(e){return e?e.__v_isRef===!0:!1}function Wt(e){return F(e)?e.value:e}var Gt={get:(e,t,n)=>t===`__v_raw`?e:Wt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return F(i)&&!F(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Kt(e){return Bt(e)?e:new Proxy(e,Gt)}var qt={},Jt=new WeakMap,Yt=void 0;function Xt(e,t=!1,n=Yt){if(n){let t=Jt.get(n);t||Jt.set(n,t=[]),t.push(e)}else process.env.NODE_ENV!==`production`&&!t&&De(`onWatcherCleanup() was called when there was no active watcher to associate with.`)}function Zt(e,t,n=r){let{immediate:i,deep:o,once:s,scheduler:c,augmentJob:u,call:d}=n,p=e=>{(n.onWarn||De)(`Invalid watch source: `,e,`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`)},m=e=>o?e:M(e)||o===!1||o===0?Qt(e,1):Qt(e),h,_,v,y,ee=!1,b=!1;if(F(e)?(_=()=>e.value,ee=M(e)):Bt(e)?(_=()=>m(e),ee=!0):f(e)?(b=!0,ee=e.some(e=>Bt(e)||M(e)),_=()=>e.map(e=>{if(F(e))return e.value;if(Bt(e))return m(e);if(g(e))return d?d(e,2):e();process.env.NODE_ENV!==`production`&&p(e)})):g(e)?_=t?d?()=>d(e,2):e:()=>{if(v){Ge();try{v()}finally{Ke()}}let t=Yt;Yt=h;try{return d?d(e,3,[y]):e(y)}finally{Yt=t}}:(_=a,process.env.NODE_ENV!==`production`&&p(e)),t&&o){let e=_,t=o===!0?1/0:o;_=()=>Qt(e(),t)}let x=ke(),S=()=>{h.stop(),x&&x.active&&l(x.effects,h)};if(s&&t){let e=t;t=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(qt):qt,w=e=>{if(h.flags&1&&(h.dirty||e)){if(t){let n=h.run();if(e||o||ee||(b?n.some((e,t)=>oe(e,C[t])):oe(n,C))){v&&v();let e=Yt;Yt=h;try{let e=[n,C===qt?void 0:b&&C[0]===qt?[]:C,y];C=n,d?d(t,3,e):t(...e)}finally{Yt=e}}}else h.run()}};return u&&u(w),h=new je(_),h.scheduler=c?()=>c(w,!1):w,y=e=>Xt(e,!1,h),v=h.onStop=()=>{let e=Jt.get(h);if(e){if(d)d(e,4);else for(let t of e)t();Jt.delete(h)}},process.env.NODE_ENV!==`production`&&(h.onTrack=n.onTrack,h.onTrigger=n.onTrigger),t?i?w(!0):C=h.run():c?c(w.bind(null,!0),!0):h.run(),S.pause=h.pause.bind(h),S.resume=h.resume.bind(h),S.stop=S,S}function Qt(e,t=1/0,n){if(t<=0||!y(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,F(e))Qt(e.value,t,n);else if(f(e))for(let r=0;r<e.length;r++)Qt(e[r],t,n);else if(m(e)||p(e))e.forEach(e=>{Qt(e,t,n)});else if(C(e)){for(let r in e)Qt(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Qt(e[r],t,n)}return e}var $t=[];function en(e){$t.push(e)}function tn(){$t.pop()}var nn=!1;function I(e,...t){if(nn)return;nn=!0,Ge();let n=$t.length?$t[$t.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=rn();if(r)dn(r,n,11,[e+t.map(e=>e.toString?.call(e)??JSON.stringify(e)).join(``),n&&n.proxy,i.map(({vnode:e})=>`at <${ki(n,e.type)}>`).join(`
|
|
2
|
-
`),i]);else{let n=[`[Vue warn]: ${e}`,...t];i.length&&n.push(`
|
|
3
|
-
`,...an(i)),console.warn(...n)}Ke(),nn=!1}function rn(){let e=$t[$t.length-1];if(!e)return[];let t=[];for(;e;){let n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});let r=e.component&&e.component.parent;e=r&&r.vnode}return t}function an(e){let t=[];return e.forEach((e,n)=>{t.push(...n===0?[]:[`
|
|
4
|
-
`],...on(e))}),t}function on({vnode:e,recurseCount:t}){let n=t>0?`... (${t} recursive calls)`:``,r=e.component?e.component.parent==null:!1,i=` at <${ki(e.component,e.type,r)}`,a=`>`+n;return e.props?[i,...sn(e.props),a]:[i+a]}function sn(e){let t=[],n=Object.keys(e);return n.slice(0,3).forEach(n=>{t.push(...cn(n,e[n]))}),n.length>3&&t.push(` ...`),t}function cn(e,t,n){return _(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t==`number`||typeof t==`boolean`||t==null?n?t:[`${e}=${t}`]:F(t)?(t=cn(e,N(t.value),!0),n?t:[`${e}=Ref<`,t,`>`]):g(t)?[`${e}=fn${t.name?`<${t.name}>`:``}`]:(t=N(t),n?t:[`${e}=`,t])}function ln(e,t){process.env.NODE_ENV!==`production`&&e!==void 0&&(typeof e==`number`?isNaN(e)&&I(`${t} is NaN - the duration expression might be incorrect.`):I(`${t} is not a valid number - got ${JSON.stringify(e)}.`))}var un={sp:`serverPrefetch hook`,bc:`beforeCreate hook`,c:`created hook`,bm:`beforeMount hook`,m:`mounted hook`,bu:`beforeUpdate hook`,u:`updated`,bum:`beforeUnmount hook`,um:`unmounted hook`,a:`activated hook`,da:`deactivated hook`,ec:`errorCaptured hook`,rtc:`renderTracked hook`,rtg:`renderTriggered hook`,0:`setup function`,1:`render function`,2:`watcher getter`,3:`watcher callback`,4:`watcher cleanup function`,5:`native event handler`,6:`component event handler`,7:`vnode hook`,8:`directive hook`,9:`transition hook`,10:`app errorHandler`,11:`app warnHandler`,12:`ref function`,13:`async component loader`,14:`scheduler flush`,15:`component update`,16:`app unmount cleanup function`};function dn(e,t,n,r){try{return r?e(...r):e()}catch(e){pn(e,t,n)}}function fn(e,t,n,r){if(g(e)){let i=dn(e,t,n,r);return i&&ee(i)&&i.catch(e=>{pn(e,t,n)}),i}if(f(e)){let i=[];for(let a=0;a<e.length;a++)i.push(fn(e[a],t,n,r));return i}process.env.NODE_ENV!==`production`&&I(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function pn(e,t,n,i=!0){let a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||r;if(t){let r=t.parent,i=t.proxy,a=process.env.NODE_ENV===`production`?`https://vuejs.org/error-reference/#runtime-${n}`:un[n];for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,a)===!1)return}r=r.parent}if(o){Ge(),dn(o,null,10,[e,i,a]),Ke();return}}mn(e,n,a,i,s)}function mn(e,t,n,r=!0,i=!1){if(process.env.NODE_ENV!==`production`){let i=un[t];if(n&&en(n),I(`Unhandled error${i?` during execution of ${i}`:``}`),n&&tn(),r)throw e;console.error(e)}else if(i)throw e;else console.error(e)}var L=[],hn=-1,gn=[],_n=null,vn=0,yn=Promise.resolve(),bn=null,xn=100;function Sn(e){let t=bn||yn;return e?t.then(this?e.bind(this):e):t}function Cn(e){let t=hn+1,n=L.length;for(;t<n;){let r=t+n>>>1,i=L[r],a=On(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function wn(e){if(!(e.flags&1)){let t=On(e),n=L[L.length-1];!n||!(e.flags&2)&&t>=On(n)?L.push(e):L.splice(Cn(t),0,e),e.flags|=1,Tn()}}function Tn(){bn||=yn.then(kn)}function En(e){if(!f(e))_n&&e.id===-1?_n.splice(vn+1,0,e):e.flags&1||(gn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)gn.push(e[t]);Tn()}function Dn(e){if(gn.length){let t=[...new Set(gn)].sort((e,t)=>On(e)-On(t));if(gn.length=0,_n){for(let e=0;e<t.length;e++)_n.push(t[e]);return}for(_n=t,process.env.NODE_ENV!==`production`&&(e||=new Map),vn=0;vn<_n.length;vn++){let t=_n[vn];process.env.NODE_ENV!==`production`&&An(e,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}_n=null,vn=0}}var On=e=>e.id==null?e.flags&2?-1:1/0:e.id;function kn(e){process.env.NODE_ENV!==`production`&&(e||=new Map);let t=process.env.NODE_ENV===`production`?a:t=>An(e,t);try{for(hn=0;hn<L.length;hn++){let e=L[hn];if(e&&!(e.flags&8)){if(process.env.NODE_ENV!==`production`&&t(e))continue;e.flags&4&&(e.flags&=-2),dn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2)}}}finally{for(;hn<L.length;hn++){let e=L[hn];e&&(e.flags&=-2)}hn=-1,L.length=0,Dn(e),bn=null,(L.length||gn.length)&&kn(e)}}function An(e,t){let n=e.get(t)||0;if(n>xn){let e=t.i,n=e&&Oi(e.type);return pn(`Maximum recursive updates exceeded${n?` in component <${n}>`:``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return e.set(t,n+1),!1}var jn=!1,Mn=new Map;process.env.NODE_ENV!==`production`&&(fe().__VUE_HMR_RUNTIME__={createRecord:zn(Pn),rerender:zn(In),reload:zn(Ln)});var Nn=new Map;function Pn(e,t){return!Nn.has(e)&&(Nn.set(e,{initialDef:Fn(t),instances:new Set}),!0)}function Fn(e){return Ai(e)?e.__vccOpts:e}function In(e,t){let n=Nn.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(e=>{t&&(e.render=t,Fn(e.type).render=t),e.renderCache=[],jn=!0,e.job.flags&8||e.update(),jn=!1}))}function Ln(e,t){let n=Nn.get(e);if(!n)return;t=Fn(t),Rn(n.initialDef,t);let r=[...n.instances];for(let e=0;e<r.length;e++){let i=r[e],a=Fn(i.type),o=Mn.get(a);o||(a!==n.initialDef&&Rn(a,t),Mn.set(a,o=new Set)),o.add(i),i.appContext.propsCache.delete(i.type),i.appContext.emitsCache.delete(i.type),i.appContext.optionsCache.delete(i.type),i.ceReload?(o.add(i),i.ceReload(t.styles),o.delete(i)):i.parent?wn(()=>{i.job.flags&8||(jn=!0,i.parent.update(),jn=!1,o.delete(i))}):i.appContext.reload?i.appContext.reload():typeof window<`u`?window.location.reload():console.warn(`[HMR] Root or manually mounted instance modified. Full reload required.`),i.root.ce&&i!==i.root&&i.root.ce._removeChildStyle(a)}En(()=>{Mn.clear()})}function Rn(e,t){c(e,t);for(let n in e)n!==`__file`&&!(n in t)&&delete e[n]}function zn(e){return(t,n)=>{try{return e(t,n)}catch(e){console.error(e),console.warn(`[HMR] Something went wrong during Vue component hot-reload. Full reload required.`)}}}var Bn,Vn=[];function Hn(e,...t){Bn?Bn.emit(e,...t):Vn.push({event:e,args:t})}var Un=Wn(`component:updated`);function Wn(e){return t=>{Hn(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}var R=null,Gn=null;function Kn(e){let t=R;return R=e,Gn=e&&e.type.__scopeId||null,t}function z(e,t=R,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ei(-1);let i=Kn(t),a=Zr.length,o;try{o=e(...n)}finally{for(let e=Zr.length;e>a;e--)Qr();Kn(i),r._d&&ei(1)}return process.env.NODE_ENV!==`production`&&Un(t),o};return r._n=!0,r._c=!0,r._d=!0,r}function qn(e,t){if(R===null)return process.env.NODE_ENV!==`production`&&I(`withDirectives can only be used inside render functions.`),e;let n=Ti(R),i=e.dirs||=[];for(let e=0;e<t.length;e++){let[a,o,s,c=r]=t[e];a&&(g(a)&&(a={mounted:a,updated:a}),a.deep&&Qt(o),i.push({dir:a,instance:n,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function Jn(e,t,n=!1){let r=_i();if(r||Ur){let i=Ur?Ur._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&g(t)?t.call(r&&r.proxy):t;process.env.NODE_ENV!==`production`&&I(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!==`production`&&I(`inject() can only be used inside setup() or functional components.`)}var Yn=Symbol.for(`v-scx`),Xn=()=>{{let e=Jn(Yn);return e||process.env.NODE_ENV!==`production`&&I(`Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.`),e}};function Zn(e,t,n=r){let{immediate:i,deep:o,flush:s,once:l}=n;process.env.NODE_ENV!==`production`&&!t&&(i!==void 0&&I(`watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.`),o!==void 0&&I(`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`),l!==void 0&&I(`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`));let u=c({},n);process.env.NODE_ENV!==`production`&&(u.onWarn=I);let d=t&&i||!t&&s!==`post`,f;if(xi){if(s===`sync`){let e=Xn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=a,e.resume=a,e.pause=a,e}}let p=gi;u.call=(e,t,n)=>fn(e,p,t,n);let m=!1;s===`post`?u.scheduler=e=>{qr(e,p&&p.suspense)}:s!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():wn(e)}),u.augmentJob=e=>{t&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=Zt(e,t,u);return xi&&(f?f.push(h):d&&h()),h}function Qn(e,t,n){let r=this.proxy,i=_(e)?e.includes(`.`)?$n(r,e):()=>r[e]:e.bind(r,r),a;g(t)?a=t:(a=t.handler,n=t);let o=yi(this),s=Zn(i,a.bind(r),n);return o(),s}function $n(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var er=e=>e.__isTeleport,tr=Symbol(`_leaveCb`),nr=Symbol(`_enterCb`);function rr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return yr(()=>{e.isMounted=!0}),br(()=>{e.isUnmounting=!0}),e}var B=[Function,Array],ir={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:B,onEnter:B,onAfterEnter:B,onEnterCancelled:B,onBeforeLeave:B,onLeave:B,onAfterLeave:B,onLeaveCancelled:B,onBeforeAppear:B,onAppear:B,onAfterAppear:B,onAppearCancelled:B},ar=e=>{let t=e.subTree;return t.component?ar(t.component):t},or={name:`BaseTransition`,props:ir,setup(e,{slots:t}){let n=_i(),r=rr();return()=>{let i=t.default&&mr(t.default(),!0),a=i&&i.length?sr(i):n.subTree?Z():void 0;if(!a)return;let o=N(e),{mode:s}=o;if(process.env.NODE_ENV!==`production`&&s&&s!==`in-out`&&s!==`out-in`&&s!=="default"&&I(`invalid <transition> mode: ${s}`),r.isLeaving)return dr(a);let c=fr(a);if(!c)return dr(a);let l=ur(c,o,r,n,e=>l=e);c.type!==G&&pr(c,l);let u=n.subTree&&fr(n.subTree);if(u&&u.type!==G&&!ii(u,c)&&ar(n).type!==G){let e=ur(u,o,r,n);if(pr(u,e),s===`out-in`&&c.type!==G)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},dr(a);s===`in-out`&&c.type!==G?e.delayLeave=(e,t,n)=>{let i=lr(r,u);i[String(u.key)]=u,e[tr]=()=>{t(),e[tr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function sr(e){let t=e[0];if(e.length>1){let n=!1;for(let r of e)if(r.type!==G){if(process.env.NODE_ENV!==`production`&&n){I(`<transition> can only be used on a single element or component. Use <transition-group> for lists.`);break}if(t=r,n=!0,process.env.NODE_ENV===`production`)break}}return t}var cr=or;function lr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function ur(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:d,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:ee}=t,b=String(e.key),x=lr(n,e),S=(e,t)=>{e&&fn(e,r,9,t)},C=(e,t)=>{let n=t[1];S(e,t),f(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},w={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=_||c;else return}t[tr]&&t[tr](!0);let i=x[b];i&&ii(e,i)&&i.el[tr]&&i.el[tr](),S(r,[t])},enter(t){if(!jn&&x[b]===e)return;let r=l,i=u,o=d;if(!n.isMounted){if(a)r=v||l,i=y||u,o=ee||d;else return}let s=!1;t[nr]=e=>{s||(s=!0,S(e?o:i,[t]),w.delayedLeave&&w.delayedLeave(),t[nr]=void 0)};let c=t[nr].bind(null,!1);r?C(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[nr]&&t[nr](!0),n.isUnmounting)return r();S(p,[t]);let a=!1;t[tr]=n=>{a||(a=!0,r(),S(n?g:h,[t]),t[tr]=void 0,x[i]===e&&delete x[i])};let o=t[tr].bind(null,!1);x[i]=e,m?C(m,[t,o]):o()},clone(e){let a=ur(e,t,n,r,i);return i&&i(a),a}};return w}function dr(e){if(gr(e))return e=fi(e),e.children=null,e}function fr(e){if(!gr(e))return er(e.type)&&e.children?sr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&g(n.default))return n.default()}}function pr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;pr(er(n.type)&&fr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function mr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===W?(o.patchFlag&128&&i++,r=r.concat(mr(o.children,t,s))):(t||o.type!==G)&&r.push(s==null?o:fi(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}fe().requestIdleCallback,fe().cancelIdleCallback;var hr=e=>!!e.type.__asyncLoader,gr=e=>e.type.__isKeepAlive;function _r(e,t,n=gi,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ge();let i=yi(n),a=fn(t,n,e,r);return i(),Ke(),a};return r?i.unshift(a):i.push(a),a}process.env.NODE_ENV!==`production`&&I(`${ae(un[e].replace(/ hook$/,``))} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`)}var vr=e=>(t,n=gi)=>{(!xi||e===`sp`)&&_r(e,(...e)=>t(...e),n)},yr=vr(`m`),br=vr(`bum`),xr=`components`;function V(e,t){return Cr(xr,e,!0,t)||e}var Sr=Symbol.for(`v-ndc`);function Cr(e,t,n=!0,r=!1){let i=R||gi;if(i){let a=i.type;if(e===xr){let e=Oi(a,!1);if(e&&(e===t||e===re(t)||e===ie(re(t))))return a}let o=wr(i[e]||a[e],t)||wr(i.appContext[e],t);if(!o&&r)return a;if(process.env.NODE_ENV!==`production`&&n&&!o){let n=e===xr?`
|
|
5
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:``;I(`Failed to resolve ${e.slice(0,-1)}: ${t}${n}`)}return o}process.env.NODE_ENV!==`production`&&I(`resolve${ie(e.slice(0,-1))} can only be used in render() or setup().`)}function wr(e,t){return e&&(e[t]||e[re(t)]||e[ie(re(t))])}function Tr(e,t,n,r){let i,a=n&&n[r],o=f(e);if(o||_(e)){let n=o&&Bt(e),r=!1,s=!1;n&&(r=!M(e),s=j(e),e=it(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Ut(P(e[n])):P(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){if(process.env.NODE_ENV!==`production`&&(!Number.isInteger(e)||e<0))I(`The v-for range expects a positive integer value but got ${e}.`),i=[];else{i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}}else if(y(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function H(e,t,n,r,i,a){if(n??={},R.ce||R.parent&&hr(R.parent)&&R.parent.ce){let e=a!=null&&n.key==null?c({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),q(),ni(W,null,[X(`slot`,e,r&&r())],i?-2:64)}let o=e[t];process.env.NODE_ENV!==`production`&&o&&o.length>1&&(I(`SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`),o=()=>[]),o&&o._c&&(o._d=!1);let s=Zr.length;q();let l;try{let i=o&&Er(o(n)),s=n.key||a||i&&i.key;l=ni(W,{key:(s&&!v(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=Zr.length;e>s;e--)Qr();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+`-s`]),l}function Er(e){return e.some(e=>!ri(e)||!(e.type===G||e.type===W&&!Er(e.children)))?e:null}var Dr=e=>e?bi(e)?Ti(e):Dr(e.parent):null,Or=e=>{let t=!1;for(;;){if(e.patchFlag>0&&e.patchFlag&2048){let n=Wr(e.children);if(!n)return;e=n,t=!0;continue}let n=e.component;if(n&&n.subTree){e=n.subTree;continue}let r=e.suspense;if(r&&r.activeBranch){e=r.activeBranch;continue}return t?e.el:void 0}},kr=e=>{let t=e.subTree&&Or(e.subTree);return t===void 0?e.vnode.el:t},Ar=c(Object.create(null),{$:e=>e,$el:e=>process.env.NODE_ENV===`production`?e.vnode.el:kr(e),$data:e=>e.data,$props:e=>process.env.NODE_ENV===`production`?e.props:Rt(e.props),$attrs:e=>process.env.NODE_ENV===`production`?e.attrs:Rt(e.attrs),$slots:e=>process.env.NODE_ENV===`production`?e.slots:Rt(e.slots),$refs:e=>process.env.NODE_ENV===`production`?e.refs:Rt(e.refs),$parent:e=>Dr(e.parent),$root:e=>Dr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Pr(e),$forceUpdate:e=>e.f||=()=>{wn(e.update)},$nextTick:e=>e.n||=Sn.bind(e.proxy),$watch:e=>Qn.bind(e)});process.env.NODE_ENV;function jr(){return Mr(`useSlots`).slots}function Mr(e){let t=_i();return process.env.NODE_ENV!==`production`&&!t&&I(`${e}() called without active instance.`),t.setupContext||=wi(t)}function Nr(e){return f(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function Pr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>Fr(c,e,o,!0)),Fr(c,t,o)),y(t)&&a.set(t,c),c}function Fr(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&Fr(e,a,n,!0),i&&i.forEach(t=>Fr(e,t,n,!0));for(let i in t)if(r&&i===`expose`)process.env.NODE_ENV!==`production`&&I(`"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.`);else{let r=Ir[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var Ir={data:Lr,props:Vr,emits:Vr,methods:Br,computed:Br,beforeCreate:U,created:U,beforeMount:U,mounted:U,beforeUpdate:U,updated:U,beforeDestroy:U,beforeUnmount:U,destroyed:U,unmounted:U,activated:U,deactivated:U,errorCaptured:U,serverPrefetch:U,components:Br,directives:Br,watch:Hr,provide:Lr,inject:Rr};function Lr(e,t){return t?e?function(){return c(g(e)?e.call(this,this):e,g(t)?t.call(this,this):t)}:t:e}function Rr(e,t){return Br(zr(e),zr(t))}function zr(e){if(f(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function U(e,t){return e?[...new Set([].concat(e,t))]:t}function Br(e,t){return e?c(Object.create(null),e,t):t}function Vr(e,t){return e?f(e)&&f(t)?[...new Set([...e,...t])]:c(Object.create(null),Nr(e),Nr(t??{})):t}function Hr(e,t){if(!e)return t;if(!t)return e;let n=c(Object.create(null),e);for(let r in t)n[r]=U(e[r],t[r]);return n}var Ur=null;function Wr(e,t=!0){let n;for(let r=0;r<e.length;r++){let i=e[r];if(ri(i)){if(i.type!==G||i.children===`v-if`){if(n)return;if(n=i,process.env.NODE_ENV!==`production`&&t&&n.patchFlag>0&&n.patchFlag&2048)return Wr(n.children)}}else return}return n}var Gr={},Kr=e=>Object.getPrototypeOf(e)===Gr,qr=Yr,Jr=e=>e.__isSuspense;function Yr(e,t){t&&t.pendingBranch?f(e)?t.effects.push(...e):t.effects.push(e):En(e)}var W=Symbol.for(`v-fgt`),Xr=Symbol.for(`v-txt`),G=Symbol.for(`v-cmt`),Zr=[],K=null;function q(e=!1){Zr.push(K=e?null:[])}function Qr(){Zr.pop(),K=Zr[Zr.length-1]||null}var $r=1;function ei(e,t=!1){$r+=e,e<0&&K&&t&&(K.hasOnce=!0)}function ti(e){return e.dynamicChildren=$r>0?K||i:null,Qr(),$r>0&&K&&K.push(e),e}function J(e,t,n,r,i,a){return ti(Y(e,t,n,r,i,a,!0))}function ni(e,t,n,r,i){return ti(X(e,t,n,r,i,!0))}function ri(e){return e?e.__v_isVNode===!0:!1}function ii(e,t){if(process.env.NODE_ENV!==`production`&&t.shapeFlag&6&&e.component){let n=Mn.get(t.type);if(n&&n.has(e.component))return e.shapeFlag&=-257,t.shapeFlag&=-513,!1}return e.type===t.type&&e.key===t.key}var ai,oi=(...e)=>ui(...ai?ai(e,R):e),si=({key:e})=>e??null,ci=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:_(e)||F(e)||g(e)?{i:R,r:e,k:t,f:!!n}:e);function Y(e,t=null,n=null,r=0,i=null,a=e===W?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&si(t),ref:t&&ci(t),scopeId:Gn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:R};if(s?(hi(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=_(n)?8:16),process.env.NODE_ENV!==`production`&&c.key!==c.key&&I(`VNode created with invalid key (NaN). VNode type:`,c.type),process.env.NODE_ENV!==`production`&&t&&c.shapeFlag&1){let e=t.innerHTML==null?t.textContent==null?null:`textContent`:`innerHTML`;e&&li(c.children)&&I(`The \`${e}\` prop on <${c.type}> will override its children. Remove either the \`${e}\` prop or the children.`)}return $r>0&&!o&&K&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&K.push(c),c}function li(e){return _(e)?e!==``:f(e)?e.length>0:!1}var X=process.env.NODE_ENV===`production`?ui:oi;function ui(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Sr)&&(process.env.NODE_ENV!==`production`&&!e&&I(`Invalid vnode type when creating vnode: ${e}.`),e=G),ri(e)){let r=fi(e,t,!0);return n&&hi(r,n),$r>0&&!a&&K&&(r.shapeFlag&6?K[K.indexOf(e)]=r:K.push(r)),r.patchFlag=-2,r}if(Ai(e)&&(e=e.__vccOpts),t){t=di(t);let{class:e,style:n}=t;e&&!_(e)&&(t.class=T(e)),y(n)&&(Vt(n)&&!f(n)&&(n=c({},n)),t.style=pe(n))}let o=_(e)?1:Jr(e)?128:er(e)?64:y(e)?4:g(e)?2:0;return process.env.NODE_ENV!==`production`&&o&4&&Vt(e)&&(e=N(e),I("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
6
|
-
Component that was made reactive: `,e)),Y(e,t,n,r,i,o,a,!0)}function di(e){return e?Vt(e)||Kr(e)?c({},e):e:null}function fi(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Q(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&si(l),ref:t&&t.ref?n&&a?f(a)?a.concat(ci(t)):[a,ci(t)]:ci(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!==`production`&&o===-1&&f(s)?s.map(pi):s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==W?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&fi(e.ssContent),ssFallback:e.ssFallback&&fi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&pr(u,c.clone(u)),u}function pi(e){let t=fi(e);return f(e.children)&&(t.children=e.children.map(pi)),t}function mi(e=` `,t=0){return X(Xr,null,e,t)}function Z(e=``,t=!1){return t?(q(),ni(G,null,e)):X(G,null,e)}function hi(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(f(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),hi(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Kr(t)?t._ctx=R:r===3&&R&&(R.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(g(t)){if(r&65){hi(e,{default:t});return}t={default:t,_ctx:R},n=32}else t=String(t),r&64?(n=16,t=[mi(t)]):n=8;e.children=t,e.shapeFlag|=n}function Q(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=T([t.class,r.class]));else if(e===`style`)t.style=pe([t.style,r.style]);else if(o(e)){let n=t[e],i=r[e];i&&n!==i&&!(f(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!s(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}var gi=null,_i=()=>gi||R,vi;{let e=fe(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};vi=t(`__VUE_INSTANCE_SETTERS__`,e=>gi=e),t(`__VUE_SSR_SETTERS__`,e=>xi=e)}var yi=e=>{let t=gi;return vi(e),e.scope.on(),()=>{e.scope.off(),vi(t)}};function bi(e){return e.vnode.shapeFlag&4}var xi=!1,Si=process.env.NODE_ENV===`production`?{get(e,t){return k(e,`get`,``),e[t]}}:{get(e,t){return k(e,`get`,``),e[t]},set(){return I(`setupContext.attrs is readonly.`),!1},deleteProperty(){return I(`setupContext.attrs is readonly.`),!1}};function Ci(e){return new Proxy(e.slots,{get(t,n){return k(e,`get`,`$slots`),t[n]}})}function wi(e){let t=t=>{if(process.env.NODE_ENV!==`production`&&(e.exposed&&I(`expose() should be called only once per setup().`),t!=null)){let e=typeof t;e===`object`&&(f(t)?e=`array`:F(t)&&(e=`ref`)),e!==`object`&&I(`expose() should be passed a plain object, received ${e}.`)}e.exposed=t||{}};if(process.env.NODE_ENV!==`production`){let n,r;return Object.freeze({get attrs(){return n||=new Proxy(e.attrs,Si)},get slots(){return r||=Ci(e)},get emit(){return(t,...n)=>e.emit(t,...n)},expose:t})}return{attrs:new Proxy(e.attrs,Si),slots:e.slots,emit:e.emit,expose:t}}function Ti(e){return e.exposed?e.exposeProxy||=new Proxy(Kt(Ht(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ar)return Ar[n](e)},has(e,t){return t in e||t in Ar}}):e.proxy}var Ei=/(?:^|[-_])\w/g,Di=e=>e.replace(Ei,e=>e.toUpperCase()).replace(/[-_]/g,``);function Oi(e,t=!0){return g(e)?e.displayName||e.name:e.name||t&&e.__name}function ki(e,t,n=!1){let r=Oi(t);if(!r&&t.__file){let e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e){let n=e=>{for(let n in e)if(e[n]===t)return n};r=n(e.components)||e.parent&&n(e.parent.type.components)||n(e.appContext.components)}return r?Di(r):n?`App`:`Anonymous`}function Ai(e){return g(e)&&`__vccOpts`in e}function ji(e,t,n){try{ei(-1);let r=arguments.length;return r===2?y(t)&&!f(t)?ri(t)?X(e,null,[t]):X(e,t):X(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ri(n)&&(n=[n]),X(e,t,n))}finally{ei(1)}}function Mi(){if(process.env.NODE_ENV===`production`||typeof window>`u`)return;let e={style:`color:#3ba776`},t={style:`color:#1677ff`},n={style:`color:#f5222d`},i={style:`color:#eb2f96`},a={__vue_custom_formatter:!0,header(t){if(!y(t))return null;if(t.__isVue)return[`div`,e,`VueInstance`];if(F(t)){Ge();let n=t.value;return Ke(),[`div`,{},[`span`,e,p(t)],`<`,l(n),`>`]}return Bt(t)?[`div`,{},[`span`,e,M(t)?`ShallowReactive`:`Reactive`],`<`,l(t),`>${j(t)?` (readonly)`:``}`]:j(t)?[`div`,{},[`span`,e,M(t)?`ShallowReadonly`:`Readonly`],`<`,l(t),`>`]:null},hasBody(e){return e&&e.__isVue},body(e){if(e&&e.__isVue)return[`div`,{},...o(e.$)]}};function o(e){let t=[];e.type.props&&e.props&&t.push(s(`props`,N(e.props))),e.setupState!==r&&t.push(s(`setup`,e.setupState)),e.data!==r&&t.push(s(`data`,N(e.data)));let n=u(e,`computed`);n&&t.push(s(`computed`,n));let a=u(e,`inject`);return a&&t.push(s(`injected`,a)),t.push([`div`,{},[`span`,{style:i.style+`;opacity:0.66`},`$ (internal): `],[`object`,{object:e}]]),t}function s(e,t){return t=c({},t),Object.keys(t).length?[`div`,{style:`line-height:1.25em;margin-bottom:0.6em`},[`div`,{style:`color:#476582`},e],[`div`,{style:`padding-left:1.25em`},...Object.keys(t).map(e=>[`div`,{},[`span`,i,e+`: `],l(t[e],!1)])]]:[`span`,{}]}function l(e,r=!0){return typeof e==`number`?[`span`,t,e]:typeof e==`string`?[`span`,n,JSON.stringify(e)]:typeof e==`boolean`?[`span`,i,e]:y(e)?[`object`,{object:r?N(e):e}]:[`span`,n,String(e)]}function u(e,t){let n=e.type;if(g(n))return;let r={};for(let i in e.ctx)d(n,i,t)&&(r[i]=e.ctx[i]);return r}function d(e,t,n){let r=e[n];if(f(r)&&r.includes(t)||y(r)&&t in r||e.extends&&d(e.extends,t,n)||e.mixins&&e.mixins.some(e=>d(e,t,n)))return!0}function p(e){return M(e)?`ShallowRef`:e.effect?`ComputedRef`:`Ref`}window.devtoolsFormatters?window.devtoolsFormatters.push(a):window.devtoolsFormatters=[a]}var Ni=process.env.NODE_ENV===`production`?a:I;process.env.NODE_ENV,process.env.NODE_ENV,typeof window<`u`&&window.trustedTypes;var Pi=`transition`,Fi=`animation`,Ii=Symbol(`_vtc`),Li={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ri=c({},ir,Li),zi=(e=>(e.displayName=`Transition`,e.props=Ri,e))((e,{slots:t})=>ji(cr,Hi(e),t)),Bi=(e,t=[])=>{f(e)?e.forEach(e=>e(...t)):e&&e(...t)},Vi=e=>e?f(e)?e.some(e=>e.length>1):e.length>1:!1;function Hi(e){let t={};for(let n in e)n in Li||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=s,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=Ui(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:ee,onLeave:b,onLeaveCancelled:x,onBeforeAppear:S=v,onAppear:C=y,onAppearCancelled:w=ee}=t,te=(e,t,n,r)=>{e._enterCancelled=r,Ki(e,t?d:s),Ki(e,t?u:o),n&&n()},ne=(e,t)=>{e._isLeaving=!1,Ki(e,f),Ki(e,m),Ki(e,p),t&&t()},re=e=>(t,n)=>{let i=e?C:y,o=()=>te(t,e,n);Bi(i,[t,o]),qi(()=>{Ki(t,e?l:a),Gi(t,e?d:s),Vi(i)||Yi(t,r,g,o)})};return c(t,{onBeforeEnter(e){Bi(v,[e]),Gi(e,a),Gi(e,o)},onBeforeAppear(e){Bi(S,[e]),Gi(e,l),Gi(e,u)},onEnter:re(!1),onAppear:re(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ne(e,t);Gi(e,f),e._enterCancelled?(Gi(e,p),$i(e)):($i(e),Gi(e,p)),qi(()=>{e._isLeaving&&(Ki(e,f),Gi(e,m),Vi(b)||Yi(e,r,_,n))}),Bi(b,[e,n])},onEnterCancelled(e){te(e,!1,void 0,!0),Bi(ee,[e])},onAppearCancelled(e){te(e,!0,void 0,!0),Bi(w,[e])},onLeaveCancelled(e){ne(e),Bi(x,[e])}})}function Ui(e){if(e==null)return null;if(y(e))return[Wi(e.enter),Wi(e.leave)];{let t=Wi(e);return[t,t]}}function Wi(e){let t=ue(e);return process.env.NODE_ENV!==`production`&&ln(t,`<transition> explicit duration`),t}function Gi(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ii]||(e[Ii]=new Set)).add(t)}function Ki(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Ii];n&&(n.delete(t),n.size||(e[Ii]=void 0))}function qi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ji=0;function Yi(e,t,n,r){let i=e._endId=++Ji,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Xi(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Xi(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${Pi}Delay`),a=r(`${Pi}Duration`),o=Zi(i,a),s=r(`${Fi}Delay`),c=r(`${Fi}Duration`),l=Zi(s,c),u=null,d=0,f=0;t===Pi?o>0&&(u=Pi,d=o,f=a.length):t===Fi?l>0&&(u=Fi,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Pi:Fi:null,f=u?u===Pi?a.length:c.length:0);let p=u===Pi&&/\b(?:transform|all)(?:,|$)/.test(r(`${Pi}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Zi(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Qi(t)+Qi(e[n])))}function Qi(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function $i(e){return(e?e.ownerDocument:document).body.offsetHeight}var ea=Symbol(`_vod`),ta=Symbol(`_vsh`),na={name:`show`,beforeMount(e,{value:t},{transition:n}){e[ea]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):ra(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),ra(e,!0),r.enter(e)):r.leave(e,()=>{ra(e,!1)}):ra(e,t))},beforeUnmount(e,{value:t}){ra(e,t)}};function ra(e,t){e.style.display=t?e[ea]:`none`,e[ta]=!t}process.env.NODE_ENV;function ia(e,t,n,r){e.addEventListener(t,n,r)}var aa=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return f(t)?e=>se(t,e):t};function oa(e){e.target.composing=!0}function sa(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var $=Symbol(`_assign`),ca=Symbol(`_initialValue`);function la(e,t,n){return t&&(e=e.trim()),n&&(e=le(e)),e}var ua={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[ca]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[ca]=e.defaultValue.replace(/\r\n?/g,`
|
|
7
|
-
`))),e[$]=aa(i);let a=r||i.props&&i.props.type===`number`;ia(e,t?`change`:`input`,t=>{t.target.composing||e[$](la(e.value,n,a))}),(n||a)&&ia(e,`change`,()=>{e.value=la(e.value,n,a)}),t||(ia(e,`compositionstart`,oa),ia(e,`compositionend`,sa),ia(e,`change`,sa))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ca];delete e[ca],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[$](la(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[$]=aa(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?le(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},da={deep:!0,created(e,t,n){e[$]=aa(n),ia(e,`change`,()=>{let t=e._modelValue,n=_a(e),r=e.checked,i=e[$];if(f(t)){let e=Ce(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(m(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(va(e,r))})},mounted:fa,beforeUpdate(e,t,n){e[$]=aa(n),fa(e,t,n)}};function fa(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(f(t))i=Ce(t,r.props.value)>-1;else if(m(t))i=t.has(r.props.value);else{if(t===n)return;i=Se(t,va(e,!0))}e.checked!==i&&(e.checked=i)}var pa={created(e,{value:t},n){e.checked=Se(t,n.props.value),e[$]=aa(n),ia(e,`change`,()=>{e[$](_a(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[$]=aa(r),t!==n&&(e.checked=Se(t,r.props.value))}},ma={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,ia(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?le(_a(e)):_a(e)),r=e.multiple,i=r?m(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?f(i)?t.slice():t:i];try{e[$](i)}finally{Sn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[$]=aa(r)},mounted(e,{value:t}){ga(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[$]=aa(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!ha(t,n[1],n[0]))&&ga(e,t)}};function ha(e,t,n){if(!n||f(e))return Se(e,t);if(m(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function ga(e,t){let n=e.multiple,r=f(t);if(n&&!r&&!m(t)){process.env.NODE_ENV!==`production`&&Ni(`<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8,-1)}.`);return}for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=_a(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Ce(t,o)>-1}else a.selected=t.has(o)}else if(Se(_a(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}function _a(e){return`_value`in e?e._value:e.value}function va(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var ya={created(e,t,n){xa(e,t,n,null,`created`)},mounted(e,t,n){xa(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){xa(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){xa(e,t,n,r,`updated`)}};function ba(e,t){switch(e){case`SELECT`:return ma;case`TEXTAREA`:return ua;default:switch(t){case`checkbox`:return da;case`radio`:return pa;default:return ua}}}function xa(e,t,n,r,i){let a=ba(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}var Sa=[`ctrl`,`shift`,`alt`,`meta`],Ca={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Sa.some(n=>e[`${n}Key`]&&!t.includes(n))},wa=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Ca[t[e]];if(r&&r(n,t))return}return e(n,...r)}))};function Ta(){Mi()}process.env.NODE_ENV!==`production`&&Ta();function Ea(e){return e&&(0,t.asArray)(e).some(e=>e.type!==G)}function Da(e,n={}){return e=(0,t.isString)(e)?jr()[e]:e,Ea(e?.(n))}function Oa(e){return Ht({value:e})}var ka=[`type`,`title`,`disabled`],Aa={key:0,class:`dito-button__prefix`},ja={key:1,class:`dito-button__text`},Ma={key:2,class:`dito-button__suffix`};function Na(e,t,n,r,i,a){return q(),J(`button`,Q({class:[`dito-button`,[a.classes,{"dito-button--affixed":a.hasAffixes}]],type:n.type,title:n.title,disabled:n.disabled},a.attributes),[a.hasAffixes?(q(),J(`div`,Aa,[H(e.$slots,`prefix`)])):Z(``,!0),n.text||a.hasAffixes?(q(),J(`div`,ja,[mi(E(n.text||``),1),H(e.$slots,`default`)])):Z(``,!0),a.hasAffixes?(q(),J(`div`,Ma,[H(e.$slots,`suffix`)])):Z(``,!0)],16,ka)}var Pa=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},Fa=Pa({inheritAttrs:!1,props:{type:{type:String,default:`button`},text:{type:String,default:null},title:{type:String,default:null},disabled:{type:Boolean,default:!1}},computed:{hasAffixes(){return Da(this.$slots.prefix)||Da(this.$slots.suffix)},classes(){return this.$attrs.class},attributes(){let{class:e,...t}=this.$attrs;return t}}},[[`render`,Na]]);function Ia(e){return{year:e?.getFullYear()??0,month:e?.getMonth()??0,day:e?.getDate()??0,hour:e?.getHours()??0,minute:e?.getMinutes()??0,second:e?.getSeconds()??0,millisecond:e?.getMilliseconds()??0}}function La(e,t={}){return new Date(...Object.values({...Ia(e),...t}))}function Ra(e,{locale:t=`en-US`,date:n=!0,time:r=!0}={}){let i=r?null:0,a=e?.match(/\s*\b([ap])\.?m\.?$/i);a&&(e=e.slice(0,a.index));let[o,s,c,l,u,,d=i,,f=i,,p=i,,m=i]=Ba(e,{date:n,time:r});if(u&&u.length>=4){if((t===`en-US`&&s===`/`&&l===`/`||isNaN(+o)&&!isNaN(+c))&&([o,c]=[c,o]),a&&d!==null){let e=a[1].toLowerCase()===`p`;d=d%12+(e?12:0),d=String(d).padStart(2,`0`)}c=Va(c,{locale:t});let e=e=>e===null||e.length===2;if(c!==null&&(!r||e(d)&&e(f)&&e(p))){let e=new Date(+u,+c,+o,+d,+f,+p,+m);return e.getMonth()===+c&&e.getDate()===+o?e:null}}return null}function za(e,t,{locale:n=`en-US`,date:r=!0,time:i=!0}={}){let a=Ba(e,{date:r,time:i}),o=(e,t=a.length)=>{let n=0,r=0;for(;(e===null||n<=e)&&r<t;)n+=a[r++]?.length??0;return{position:n,index:r}},s=r?0:o(null,6).position;t+=s;let{index:c}=o(t),l=n===`en-US`,u=[l?`month`:`day`,null,l?`day`:`month`,null,`year`,null,`hour`,null,`minute`,null,`second`,null,`millisecond`];for(;c--;)if(u[c]){let e=o(null,c).position-s,t=e+a[c].length;return{name:u[c],start:e,end:t}}return null}function Ba(e,{date:t=!0,time:n=!0}={}){let r=e?.split(/([\s.,:/]+)/)||[];return t||r.unshift(`1`,`.`,`1`,`.`,`2000`,` `),!n&&r.length>5&&(r.length=5),r}function Va(e,{locale:t=`en-US`}={}){let n=+e;if(!isNaN(n))return n-1;let r=e.trim().toLowerCase();if(r.length<3)return null;let i=new Intl.DateTimeFormat(t,{month:`short`}),a=new Intl.DateTimeFormat(t,{month:`long`});for(let e=0;e<12;e++){let t=new Date(2e3,e,1);if(i.format(t).toLowerCase().startsWith(r)||a.format(t).toLowerCase().startsWith(r))return e}return null}var Ha={class:`dito-calendar`,role:`dialog`,"aria-label":`Choose date`},Ua={class:`dito-calendar-popup`},Wa={class:`dito-calendar-inner`},Ga={class:`dito-calendar-header`},Ka={class:`dito-calendar-body`},qa={class:`dito-calendar-weekdays`},Ja={class:`dito-calendar-dates`,role:`grid`},Ya=[`aria-label`,`aria-selected`,`aria-disabled`,`onClick`],Xa={class:`dito-calendar-footer`},Za=[`aria-label`,`title`],Qa={class:`dito-calendar-header`},$a={class:`dito-calendar-body`},eo={class:`dito-calendar-months`,role:`listbox`,"aria-label":`Month`},to=[`aria-label`,`aria-selected`,`onClick`],no={class:`dito-calendar-header`},ro={class:`dito-calendar-body`},io={class:`dito-calendar-years`,role:`listbox`,"aria-label":`Year`},ao=[`aria-label`,`aria-selected`,`onClick`];function oo(e,t,n,r,i,a){return q(),J(`div`,Ha,[Y(`div`,Ua,[Y(`div`,Wa,[i.currentMode===`day`?(q(),J(W,{key:0},[Y(`div`,Ga,[Y(`a`,{class:`dito-calendar-step-prev dito-calendar-step-year`,role:`button`,tabindex:`0`,"aria-label":`Previous year`,onClick:t[0]||=e=>a.stepYear(-1)}),Y(`a`,{class:`dito-calendar-step-prev dito-calendar-step-month`,role:`button`,tabindex:`0`,"aria-label":`Previous month`,onClick:t[1]||=e=>a.stepMonth(-1)}),Y(`span`,null,[Y(`a`,{class:`dito-calendar-select-year`,role:`button`,tabindex:`0`,"aria-label":`Switch to year selection`,onClick:t[2]||=e=>a.setMode(`year`)},E(a.dateToString(i.currentValue,{year:!0})),1),Y(`a`,{class:`dito-calendar-select-month`,role:`button`,tabindex:`0`,"aria-label":`Switch to month selection`,onClick:t[3]||=e=>a.setMode(`month`)},E(a.dateToString(i.currentValue,{month:!0})),1)]),Y(`a`,{class:`dito-calendar-step-next dito-calendar-step-month`,role:`button`,tabindex:`0`,"aria-label":`Next month`,onClick:t[4]||=e=>a.stepMonth(1)}),Y(`a`,{class:`dito-calendar-step-next dito-calendar-step-year`,role:`button`,tabindex:`0`,"aria-label":`Next year`,onClick:t[5]||=e=>a.stepYear(1)})]),Y(`div`,Ka,[Y(`div`,qa,[(q(!0),J(W,null,Tr(i.weekdayNames,e=>(q(),J(`span`,null,E(e.short),1))),256))]),Y(`div`,Ja,[(q(!0),J(W,null,Tr(i.dateRange,e=>(q(),J(`span`,{class:T(e.state&&`dito-calendar-item-${e.state}`),role:`gridcell`,"aria-label":a.dateToString(e.date),"aria-selected":e.state===`active`,"aria-disabled":e.state===`disabled`,onClick:t=>e.state!==`disabled`&&a.selectDate(e.date)},E(e.text),11,Ya))),256))])]),Y(`div`,Xa,[Y(`a`,{class:`dito-calendar-select-now`,role:`button`,tabindex:`0`,"aria-label":`Select today (${a.dateToString(new Date)})`,title:a.dateToString(new Date),onClick:t[6]||=e=>a.selectDate(new Date)},null,8,Za)])],64)):i.currentMode===`month`?(q(),J(W,{key:1},[Y(`div`,Qa,[Y(`a`,{class:`dito-calendar-step-prev`,role:`button`,tabindex:`0`,"aria-label":`Previous year`,onClick:t[7]||=e=>a.stepYear(-1)}),Y(`span`,null,[Y(`a`,{class:`dito-calendar-select-year`,role:`button`,tabindex:`0`,"aria-label":`Switch to year selection`,onClick:t[8]||=e=>a.setMode(`year`)},E(a.dateToString(i.currentValue,{year:!0})),1)]),Y(`a`,{class:`dito-calendar-step-next`,role:`button`,tabindex:`0`,"aria-label":`Next year`,onClick:t[9]||=e=>a.stepYear(1)})]),Y(`div`,$a,[Y(`div`,eo,[(q(!0),J(W,null,Tr(i.monthNames,(e,t)=>(q(),J(`span`,{class:T(a.getMonthClass(t)),role:`option`,"aria-label":e.long,"aria-selected":a.getMonthClass(t)[`dito-calendar-item-active`],onClick:e=>a.selectMonth(t)},E(e.short),11,to))),256))])])],64)):i.currentMode===`year`?(q(),J(W,{key:2},[Y(`div`,no,[Y(`a`,{class:`dito-calendar-step-prev`,role:`button`,tabindex:`0`,"aria-label":`Previous decade`,onClick:t[10]||=e=>a.stepDecade(-1)}),Y(`span`,null,E(a.decadeToString(i.currentValue)),1),Y(`a`,{class:`dito-calendar-step-next`,role:`button`,tabindex:`0`,"aria-label":`Next decade`,onClick:t[11]||=e=>a.stepDecade(1)})]),Y(`div`,ro,[Y(`div`,io,[(q(!0),J(W,null,Tr(i.yearRange,e=>(q(),J(`span`,{class:T(a.getYearClass(e)),role:`option`,"aria-label":String(e),"aria-selected":a.getYearClass(e)[`dito-calendar-item-active`],onClick:t=>a.selectYear(e)},E(e),11,ao))),256))])])],64)):Z(``,!0)])])])}var so={emits:[`update:modelValue`,`select`],props:{modelValue:{type:Date,default:null},locale:{type:String,default:`en-US`},disabledDate:{type:Function,default:()=>!1},mode:{type:String,default:`day`}},data(){let{weekdayNames:e,monthNames:t}=lo(this.locale);return{weekdayNames:e,monthNames:t,dateRange:[],yearRange:[],currentValue:this.modelValue||La(new Date,{hour:0,minute:0,second:0,millisecond:0}),currentMode:this.mode}},watch:{modelValue(e,t){+e!=+t&&(this.currentValue=e||new Date,this.updateDateRange())},currentValue(e,t){+e!=+t&&this.updateDateRange()},disabledDate:`updateDateRange`,mode(e){this.currentMode=e}},mounted(){this.updateDateRange()},methods:{getMonthClass(e){return{"dito-calendar-item-active":this.modelValue&&e===this.modelValue.getMonth()&&this.currentValue.getFullYear()===this.modelValue.getFullYear(),"dito-calendar-item-current":e===this.currentValue.getMonth()}},getYearClass(e){return{"dito-calendar-item-active":this.modelValue&&e===this.modelValue.getFullYear(),"dito-calendar-item-current":e===this.currentValue.getFullYear()}},setDate(e,t=!1){this.currentValue=La(this.currentValue,e),t&&this.$emit(`update:modelValue`,this.currentValue)},stepDecade(e){this.setDate({year:this.currentValue.getFullYear()+e*10})},setMode(e){this.currentMode=e},stepMonth(e){let{currentValue:t}=this,{year:n,month:r}=this.getYearMonth(t.getFullYear(),t.getMonth()+e);this.setDate({month:r,day:Math.min(this.getDaysInMonth(n,r),this.currentValue.getDate())})},stepYear(e){this.setDate({year:this.currentValue.getFullYear()+e})},selectDate(e){this.setDate(Ia(e),!0),this.$emit(`select`)},selectMonth(e){this.setMode(`day`),this.setDate({month:e,day:1},!0)},selectYear(e){this.setMode(`month`),this.setDate({year:e},!0)},getYearMonth(e,t){return t>11?(e++,t=0):t<0&&(e--,t=11),{year:e,month:t}},dateToString(e,{year:t,month:n,day:r}={year:!0,month:!0,day:!0}){return e.toLocaleString(this.locale,{year:t&&`numeric`,month:n&&`long`,day:r&&`numeric`})},decadeToString(e){let t=this.getFirstYearOfDecade(e.getFullYear());return`${t} – ${t+9}`},getDaysInMonth(e,t){return new Date(e,t+1,0).getDate()},getFirstYearOfDecade(e){return+`${e.toString().slice(0,-1)}0`},navigate({step:e,enter:t,mode:n=this.currentMode,update:r=!1}){let{currentValue:i}=this;if(e){switch(n){case`day`:this.setDate({day:i.getDate()+e},r);break;case`month`:this.setDate({month:i.getMonth()+e},r);break;case`year`:this.setDate({year:i.getFullYear()+e},r)}return!0}if(t){switch(this.currentMode){case`day`:this.selectDate(i);break;case`month`:this.setMode(`day`);break;case`year`:this.setMode(`month`)}return!0}},updateDateRange(){this.dateRange=[],this.yearRange=[];let{currentValue:e}=this,t=e.getFullYear(),n=e.getMonth(),r=this.getFirstYearOfDecade(t);for(let e=0;e<10;e++)this.yearRange.push(r+e);let i=new Date(t,n,1).getDay()+1;i===0&&(i=7);let a=this.getDaysInMonth(t,n);if(i>1){let e=this.getYearMonth(t,n-1),r=this.getDaysInMonth(e.year,e.month);for(let t=1;t<i;t++){let n=r-i+t+1,a=new Date(e.year,e.month,n);this.dateRange.push({text:n,date:a,state:this.disabledDate(a)?`disabled`:`gray`})}}let o=new Date;for(let r=1;r<=a;r++){let i=new Date(t,n,r),a=e=>e&&e.getDate()===r&&e.getFullYear()===t&&e.getMonth()===n,s=a(this.modelValue)?`active`:a(o)?`today`:this.disabledDate(i)?`disabled`:a(e)?`current`:null;this.dateRange.push({text:r,date:i,state:s})}let s=42-this.dateRange.length;if(s>0){let e=this.getYearMonth(t,n+1);for(let t=1;t<=s;t++){let n=new Date(e.year,e.month,t),r=this.disabledDate(n)?`disabled`:`gray`;this.dateRange.push({text:t,date:n,state:r})}}}}},co={};function lo(e){let t=co[e];if(!t){let n=[];for(let t=0;t<7;t++){let r=new Date(0,0,t);n.push({long:r.toLocaleString(e,{weekday:`long`}),short:r.toLocaleString(e,{weekday:`short`})})}let r=[];for(let t=1;t<=12;t++){let n=new Date(0,t,0);r.push({long:n.toLocaleString(e,{month:`long`}),short:n.toLocaleString(e,{month:`short`})})}t=co[e]={weekdayNames:n,monthNames:r}}return t}var uo=Pa(so,[[`render`,oo]]);function fo(e,n){e=e instanceof NodeList?Array.from(e):(0,t.asArray)(e);for(let[t,r]of Object.entries(n))for(let n of e)n.addEventListener(t,r,!1);return{remove(){for(let[t,r]of Object.entries(n))for(let n of e)n.removeEventListener(t,r,!1)}}}function po(...e){return{remove(){for(let t of e)t.remove()}}}function mo(e){return{37:`left`,38:`up`,39:`right`,40:`down`,13:`enter`}[e?.keyCode]}function ho(e){let t=mo(e);return{hor:{left:-1,right:1}[t]||0,ver:{up:-1,down:1}[t]||0,enter:t===`enter`}}function go(e){let n=(0,t.isString)(e.target)?e.$refs[e.target]:e.target;return n?.$el??n}var _o={class:`dito-trigger-container`};function vo(e,t,n,r,i,a){return q(),J(`div`,_o,[n.alwaysShow?(q(),J(`div`,{key:0,class:T([`dito-trigger`,a.triggerClass]),ref:`trigger`},[H(e.$slots,`trigger`)],2)):n.trigger===`click`?(q(),J(`div`,{key:1,class:T([`dito-trigger`,a.triggerClass]),ref:`trigger`,onClick:t[0]||=(...e)=>a.onClick&&a.onClick(...e)},[H(e.$slots,`trigger`)],2)):n.trigger===`hover`?(q(),J(`div`,{key:2,class:T([`dito-trigger`,a.triggerClass]),ref:`trigger`,onMouseenter:t[1]||=e=>a.onHover(!0),onMouseleave:t[2]||=e=>a.onHover(!1)},[H(e.$slots,`trigger`)],34)):n.trigger===`focus`||n.trigger===`always`?(q(),J(`div`,{key:3,class:T([`dito-trigger`,a.triggerClass]),ref:`trigger`},[H(e.$slots,`trigger`)],2)):Z(``,!0),X(zi,{name:`dito-${n.transition}`},{default:z(()=>[n.trigger===`hover`?qn((q(),J(`div`,{key:0,class:T([`dito-popup`,a.popupClass]),ref:`popup`,style:pe(a.popupStyle),onMouseenter:t[3]||=e=>a.onHover(!0),onMouseleave:t[4]||=e=>a.onHover(!1)},[i.showPopup?H(e.$slots,`popup`,{},void 0,void 0,0):Z(``,!0)],38)),[[na,i.showPopup]]):qn((q(),J(`div`,{key:1,class:T([`dito-popup`,a.popupClass]),ref:`popup`,style:pe(a.popupStyle)},[i.showPopup?H(e.$slots,`popup`,{},void 0,void 0,0):Z(``,!0)],6)),[[na,i.showPopup]])]),_:3},8,[`name`])])}var yo=Pa({emits:[`update:show`],props:{trigger:{type:String,default:`click`},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom`},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},target:{type:[String,HTMLElement],default:null},customClass:{type:String,default:null},zIndex:{type:Number,default:0},keepInView:{type:Boolean,default:!0},hideWhenClickOutside:{type:Boolean,default:!0},alwaysShow:{type:Boolean,default:!1},cover:{type:Boolean,default:!1},hideDelay:{type:Number,default:0}},data(){return{showPopup:this.show,popupPlacement:this.placement,focusEvents:null,closeEvents:null,popupEvents:null,blurTimer:null,mouseLeaveTimer:null}},computed:{triggerClass(){return{"dito-trigger-disabled":this.disabled}},popupClass(){let e={[`dito-popup-${(0,t.hyphenate)(this.placement)}`]:!0};return this.customClass&&(e[this.customClass]=!0),e},popupStyle(){return this.zIndex?`z-index: ${this.zIndex}`:``},triggerTarget(){return go(this)}},watch:{show(e){this.showPopup=e||this.alwaysShow},showPopup(e,t){e^t&&(this.$emit(`update:show`,e),this.$nextTick(()=>this.onShowPopup(e)))}},mounted(){let{trigger:e,popup:t}=this.$refs;this.trigger===`focus`&&(this.focusEvents=this.addFocusEvents(this.triggerTarget??e)),this.hideWhenClickOutside&&!this.alwaysShow&&(this.closeEvents=fo(window,{mouseup:n=>{this.showPopup&&!t.contains(n.target)&&!e.contains(n.target)&&!this.triggerTarget?.contains(n.target)&&(this.showPopup=!1)},blur:()=>{this.showPopup=!1}})),this.alwaysShow&&(this.showPopup=!0)},created(){this.showPopup=this.show},unmounted(){this.focusEvents?.remove(),this.closeEvents?.remove(),this.popupEvents?.remove()},methods:{isPopupFocused(){return!!this.$refs.popup?.matches(`:focus-within`)},updatePosition(){let{trigger:e,popup:t}=this.$refs;if(this.show&&t.offsetWidth===0){setTimeout(()=>this.updatePosition(),0);return}let n=this.triggerTarget??e,r=this.target===`popup`?e:t.firstElementChild;r&&(r.style.width=getComputedStyle(n).width);let i=n.getBoundingClientRect(),a=i.left+window.scrollX,o=i.top+window.scrollY,s=i.width,c=i.height,l=t.offsetWidth,u=t.offsetHeight,[d,f]=this.popupPlacement.split(`-`)||[];if(this.keepInView){let e=window.innerWidth,t=window.innerHeight,n=o,r=t-o-c,i=a,p=e-a-s,m=(e,t,n)=>e<n&&t>e;d===`top`?m(n,r,u)&&(d=`bottom`):d===`bottom`?m(r,n,u)&&(d=`top`):d===`left`?m(i,p,l)&&(d=`right`):d===`right`&&m(p,i,l)&&(d=`left`),f===`top`?m(t-o,o+c,u)&&(f=`bottom`):f===`bottom`?m(o+c,t-o,u)&&(f=`top`):f===`left`?m(e-a,a+s,l)&&(f=`right`):f===`right`&&m(a+s,e-a,l)&&(f=`left`)}let p=0,m=0;switch(d){case`top`:m-=u;break;case`left`:p-=l;break;case`right`:p+=s;break;case`bottom`:m+=c}switch(f){case`right`:p-=l-s;break;case`bottom`:m-=u-c}if(this.cover&&(d===`top`?m+=c:d===`bottom`&&(m-=c)),n!==e){let t=e.getBoundingClientRect();p+=a-t.left,m+=o-t.top}t.style.left=`${p}px`,t.style.top=`${m}px`},addFocusEvents(e){let t=e.querySelectorAll(`input, textarea`),n;return po(fo(t,{focus:()=>{this.showPopup=!0,clearTimeout(this.blurTimer)},blur:()=>{this.blurTimer=setTimeout(()=>{this.isPopupFocused()||(this.showPopup=!1)},0)}}),fo(e,{mousedown:e=>{e.target.matches(`input, textarea, button`)||(e.preventDefault(),e.stopPropagation()),e.target.matches(`.dito-button-clear`)||(n=(this.triggerTarget??this.$refs.trigger).querySelector(`input, textarea`),n&&!n.hasAttribute(`readonly`)?n.setAttribute(`readonly`,`true`):n=null)},mouseup:e=>{n&&setTimeout(()=>{n.removeAttribute(`readonly`),!e.target.matches(`input, textarea, button`)&&this.isPopupFocused()&&n.focus(),n=null},0)}}))},onShowPopup(e){e?(this.trigger===`focus`&&(this.popupEvents=this.addFocusEvents(this.$refs.popup)),this.updatePosition()):(this.popupEvents?.remove(),this.popupEvents=null)},onClick(){this.disabled||(this.showPopup=!0)},onHover(e){this.disabled||(clearTimeout(this.mouseLeaveTimer),e?this.showPopup=!0:this.hideDelay?this.mouseLeaveTimer=setTimeout(()=>{this.showPopup=!1},this.hideDelay):this.showPopup=!1)}}},[[`render`,vo]]),bo=[`id`,`type`,`name`,`title`,`disabled`,`readonly`,`autofocus`,`placeholder`,`autocomplete`,`aria-label`];function xo(e,t,n,r,i,a){return q(),J(`div`,{class:T([`dito-input`,a.classes]),onMousedown:t[2]||=(...e)=>a.onMouseDown&&a.onMouseDown(...e)},[H(e.$slots,`prefix`),qn(Y(`input`,Q({id:n.id,ref:`input`,"onUpdate:modelValue":t[0]||=e=>i.currentValue=e,type:n.type,name:n.name,title:n.title,disabled:n.disabled,readonly:n.readonly,autofocus:n.autofocus,placeholder:n.placeholder,autocomplete:n.autocomplete,"aria-label":n.title},a.attributes,{onMousedown:t[1]||=(...e)=>a.onMouseDown&&a.onMouseDown(...e)}),null,16,bo),[[ya,i.currentValue]]),H(e.$slots,`suffix`)],34)}var So=Pa({emits:[`update:modelValue`],inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:`text`},id:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},placeholder:{type:String,default:null},autocomplete:{type:String,default:`off`}},data(){return{currentValue:this.modelValue}},computed:{classes(){return[this.$attrs.class,{"dito-input--focus":this.focused}]},attributes(){let{class:e,...t}=this.$attrs;return t},input(){return this.$refs.input},size(){let{size:e,min:t,max:n}=this.$attrs,r=e=>e==null?0:`${e}`.length;return e||r(t)||r(n)||void 0}},watch:{modelValue(e,t){e!==t&&(this.currentValue=e)},currentValue(e){e!==this.modelValue&&this.$emit(`update:modelValue`,e)}},methods:{focus(){this.input.focus()},blur(){this.input.blur()},onMouseDown(e){e.target===this.input?e.stopPropagation():!this.disabled&&!this.readonly&&(this.focus(),e.preventDefault())}}},[[`render`,xo]]);function Co(e,t,n,r,i,a){return q(),J(`i`,{class:T([`dito-icon`,a.classes])},null,2)}var wo=Pa({props:{name:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classes(){let e=`dito-icon`;return{[`${e}--${this.name}`]:!0,[`${e}--disabled`]:this.disabled}}}},[[`render`,Co]]);function To(e,{start:t,end:n}){e?.setSelectionRange&&(e.focus(),e.setSelectionRange(t,n))}function Eo(e){return e&&`selectionStart`in e?{start:e.selectionStart,end:e.selectionEnd}:null}function Do(e,t,n,r,i,a){let o=V(`DitoIcon`),s=V(`DitoInput`),c=V(`DitoCalendar`),l=V(`DitoTrigger`);return q(),ni(l,Q({class:`dito-date-picker`,ref:`trigger`,show:i.showPopup,"onUpdate:show":t[7]||=e=>i.showPopup=e,trigger:`focus`},{transition:n.transition,placement:n.placement,disabled:n.disabled,target:n.target}),{trigger:z(()=>[e.$slots.trigger?H(e.$slots,`trigger`,{},void 0,void 0,0):(q(),ni(s,Q({key:1,class:`dito-date-picker-input`,ref:`input`,modelValue:a.currentText,"onUpdate:modelValue":t[1]||=e=>a.currentText=e,type:`text`},{placeholder:n.placeholder,disabled:n.disabled,focused:a.focused,...e.$attrs},{onFocus:t[2]||=e=>a.onFocus(!0),onBlur:t[3]||=e=>a.onFocus(!1),onKeydown:a.onKeyDown,onMousedown:t[4]||=wa(e=>a.onMouseDown(!1),[`stop`])}),{prefix:z(()=>[H(e.$slots,`prefix`)]),suffix:z(()=>[X(o,{name:`calendar`,disabled:n.disabled,onMousedown:t[0]||=wa(e=>a.onMouseDown(!0),[`prevent`])},null,8,[`disabled`]),H(e.$slots,`suffix`)]),_:3},16,[`modelValue`,`onKeydown`]))]),popup:z(()=>[X(c,Q({class:`dito-date-picker-popup`,ref:`calendar`,modelValue:i.currentValue,"onUpdate:modelValue":t[5]||=e=>i.currentValue=e},{locale:n.locale,disabledDate:n.disabledDate},{onSelect:t[6]||=e=>i.showPopup=!1}),null,16,[`modelValue`])]),_:3},16,[`show`])}var Oo=Pa({components:{DitoTrigger:yo,DitoCalendar:uo,DitoInput:So,DitoIcon:wo},emits:[`update:modelValue`,`update:show`,`change`,`focus`,`blur`],inheritAttrs:!1,props:{modelValue:{type:Date,default:null},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom-left`},placeholder:{type:String,default:null},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},target:{type:[String,HTMLElement],default:`trigger`},locale:{type:String,default:`en-US`},format:{type:Object,default:()=>({date:t.defaultFormats.date,time:!1})},disabledDate:{type:Function,default:()=>!1}},data(){return{currentValue:this.modelValue,showPopup:this.show,inputFocused:!1}},computed:{focused(){return this.inputFocused||this.showPopup},input(){return go(this)?.querySelector(`input`)},formatOptions(){return{locale:this.locale,...this.format}},currentText:{get(){return(0,t.format)(this.currentValue,this.formatOptions)||``},set(e){let t=Ra(e,this.formatOptions);t&&(this.currentValue=t)}}},watch:{modelValue(e,t){+e!=+t&&(this.currentValue=e)},currentValue(e){+e!=+this.modelValue&&(this.$emit(`update:modelValue`,e),this.$emit(`change`,e))},show(e){this.showPopup=e},showPopup(e,t){e^t&&this.$emit(`update:show`,e)},focused(e,t){e^t&&this.$emit(e?`focus`:`blur`)}},methods:{onFocus(e){this.inputFocused=e,this.showPopup=e},onKeyDown(e){if(e.key===`Escape`){this.showPopup=!1,e.preventDefault();return}let{ver:t,enter:n}=ho(e);if(t||n){e.preventDefault();let r=Eo(this.input)?.start,i=e=>za(this.currentText,e,this.formatOptions);if(t&&!this.showPopup)this.showPopup=!0;else{let{calendar:e}=this.$refs;if(e){let{name:a,start:o}=i(r)||{};a&&e.navigate({step:t,enter:n,mode:a,update:!0})&&this.$nextTick(()=>To(this.input,i(o)))}}}},onMouseDown(e){this.showPopup=!this.disabled&&(!e||!this.showPopup),this.showPopup&&this.focus()},focus(){this.input.focus()},blur(){this.input.blur()}}},[[`render`,Do]]),ko={class:`dito-time-picker-popup`,role:`dialog`,"aria-label":`Choose time`},Ao={class:`dito-time-picker-panel`},jo={class:`dito-time-picker-hour`,ref:`hour`,role:`listbox`,"aria-label":`Hour`},Mo=[`aria-label`,`aria-selected`,`onClick`],No={class:`dito-time-picker-panel`},Po={class:`dito-time-picker-minute`,ref:`minute`,role:`listbox`,"aria-label":`Minute`},Fo=[`aria-label`,`aria-selected`,`onClick`],Io={class:`dito-time-picker-panel`},Lo={class:`dito-time-picker-second`,ref:`second`,role:`listbox`,"aria-label":`Second`},Ro=[`aria-label`,`aria-selected`,`onClick`];function zo(e,t,n,r,i,a){let o=V(`DitoIcon`),s=V(`DitoInput`),c=V(`DitoTrigger`);return q(),ni(c,Q({class:`dito-time-picker`,ref:`trigger`,show:i.showPopup,"onUpdate:show":t[5]||=e=>i.showPopup=e,trigger:`focus`},{transition:n.transition,placement:n.placement,disabled:n.disabled,target:n.target}),{trigger:z(()=>[e.$slots.trigger?H(e.$slots,`trigger`,{},void 0,void 0,0):(q(),ni(s,Q({key:1,class:`dito-time-picker-input`,ref:`input`,modelValue:a.currentText,"onUpdate:modelValue":t[1]||=e=>a.currentText=e,type:`text`},{placeholder:n.placeholder,disabled:n.disabled,focused:a.focused,...e.$attrs},{onFocus:t[2]||=e=>a.onFocus(!0),onBlur:t[3]||=e=>a.onFocus(!1),onKeydown:a.onKeyDown,onMousedown:t[4]||=wa(e=>a.onMouseDown(!1),[`stop`])}),{prefix:z(()=>[H(e.$slots,`prefix`)]),suffix:z(()=>[X(o,{name:`clock`,disabled:n.disabled,onMousedown:t[0]||=wa(e=>a.onMouseDown(!0),[`prevent`])},null,8,[`disabled`]),H(e.$slots,`suffix`)]),_:3},16,[`modelValue`,`onKeydown`]))]),popup:z(()=>[Y(`div`,ko,[Y(`div`,Ao,[Y(`ul`,jo,[(q(),J(W,null,Tr(24,e=>(q(),J(W,null,[n.disabledHour(e-1)?Z(``,!0):(q(),J(`li`,{key:0,role:`option`,"aria-label":a.leftPad(e-1),"aria-selected":a.hour===e-1,class:T({selected:a.hour===e-1}),onClick:t=>a.hour=e-1},E(a.leftPad(e-1)),11,Mo))],64))),64))],512)]),Y(`div`,No,[Y(`ul`,Po,[(q(),J(W,null,Tr(60,e=>(q(),J(W,null,[n.disabledMinute(e-1)?Z(``,!0):(q(),J(`li`,{key:0,role:`option`,"aria-label":a.leftPad(e-1),"aria-selected":a.minute===e-1,class:T({selected:a.minute===e-1}),onClick:t=>a.minute=e-1},E(a.leftPad(e-1)),11,Fo))],64))),64))],512)]),Y(`div`,Io,[Y(`ul`,Lo,[(q(),J(W,null,Tr(60,e=>(q(),J(W,null,[n.disabledSecond(e-1)?Z(``,!0):(q(),J(`li`,{key:0,role:`option`,"aria-label":a.leftPad(e-1),"aria-selected":a.second===e-1,class:T({selected:a.second===e-1}),onClick:t=>a.second=e-1},E(a.leftPad(e-1)),11,Ro))],64))),64))],512)])])]),_:3},16,[`show`])}var Bo=Pa({components:{DitoTrigger:yo,DitoInput:So,DitoIcon:wo},emits:[`update:modelValue`,`update:show`,`change`,`focus`,`blur`],inheritAttrs:!1,props:{modelValue:{type:Date,default:null},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom-left`},placeholder:{type:String,default:null},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},target:{type:[String,HTMLElement],default:`trigger`},locale:{type:String,default:`en-US`},format:{type:Object,default:()=>({time:t.defaultFormats.time,date:!1})},disabledHour:{type:Function,default:()=>!1},disabledMinute:{type:Function,default:()=>!1},disabledSecond:{type:Function,default:()=>!1}},data(){return{currentValue:this.modelValue,showPopup:this.show,inputFocused:!1,ignoreNextChange:!1}},computed:{focused(){return this.inputFocused||this.showPopup},input(){return go(this)?.querySelector(`input`)},formatOptions(){return{locale:this.locale,...this.format}},currentText:{get(){return(0,t.format)(this.currentValue,this.formatOptions)||``},set(e){let t=Ra(e,this.formatOptions);t&&(this.currentValue=t)}},currentDate(){return this.currentValue||La(new Date,{hour:0,minute:0,second:0,millisecond:0})},hour:{get(){return this.currentDate.getHours()},set(e){this.setTime({hour:e})}},minute:{get(){return this.currentDate.getMinutes()},set(e){this.setTime({minute:e})}},second:{get(){return this.currentDate.getSeconds()},set(e){this.setTime({second:e})}}},watch:{modelValue(e,t){+e!=+t&&(this.currentValue=e,this.scrollAll(!0))},currentValue(e){+e!=+this.modelValue&&(this.$emit(`update:modelValue`,e),this.$emit(`change`,e),this.scrollAll(!0))},currentText(){let{input:e}=this,t=Eo(e);this.focused&&!this.ignoreNextChange&&t.start===t.end&&this.$nextTick(()=>To(e,t)),this.ignoreNextChange=!1},show(e){this.showPopup=e},showPopup(e,t){e&&this.scrollAll(!1),e^t&&this.$emit(`update:show`,e)},focused(e,t){e^t&&this.$emit(e?`focus`:`blur`)}},methods:{leftPad(e){return(`0`+e).slice(-2)},setTime(e){this.currentValue=La(this.currentDate,{...e,millisecond:0})},scrollAll(e){let t=(t,n)=>{let r=this.$refs[t];if(r){let t=r.scrollHeight/(r.childElementCount+6),i=Math.round(n*t),a=Math.abs(r.scrollTop-i);r.scrollTo({top:i,behavior:e&&a<100?`smooth`:`auto`})}};this.$nextTick(()=>{t(`hour`,this.hour),t(`minute`,this.minute),t(`second`,this.second)})},onFocus(e){this.inputFocused=e,this.showPopup=e},onKeyDown(e){if(e.key===`Escape`){this.showPopup=!1,e.preventDefault();return}let{input:n}=this,r=Eo(n),{ver:i,enter:a}=ho(e);if(i||a){e.preventDefault();let t=e=>za(this.currentText,e,this.formatOptions);if(i){if(!this.showPopup)this.showPopup=!0;else{let{name:e,start:a}=t(r.start)||{};if(e){let r=this[e]+i,o=this.$refs[e].childElementCount;this[e]=r<0?r+o:r>=o?r-o:r,this.ignoreNextChange=!0,this.$nextTick(()=>To(n,t(a)))}}}else a&&(this.showPopup=!1)}else if(r.start===r.end){let{value:i}=n,a=r.start,o=e=>!isNaN(Number(e));if(e.key.length===1){if(o(e.key)&&a<i.length)i[a]===`:`&&o(i[a-1])&&o(i[a-2])&&a++,o(i[a])&&(o(i[a+1])||o(i[a-1]))&&(n.value=i.slice(0,a)+i.slice(a+1),To(n,{start:a,end:a}));else{let a=(0,t.format)(this.currentValue,this.formatOptions).length;i.length===a?e.preventDefault():i.length>a&&(n.value=i.slice(0,a),To(n,r),e.preventDefault())}}else e.key===`Backspace`&&(a===1||[` `,`:`].includes(i[a-2]))&&(a===i.length||i[a]===`:`?(a--,n.value=i.slice(0,a)+((i[a-1]??``)+`00`)+i.slice(a+1),To(n,{start:a,end:a})):o(i[a])&&!o(+i[a+1])&&(n.value=i.slice(0,a)+`0`+i.slice(a),To(n,{start:a,end:a})))}},onMouseDown(e){this.showPopup=!this.disabled&&(!e||!this.showPopup),this.showPopup&&this.focus()},focus(){this.input.focus()},blur(){this.input.blur()}}},[[`render`,zo]]),Vo={class:`dito-date-time-picker`,ref:`picker`};function Ho(e,t,n,r,i,a){let o=V(`DitoIcon`),s=V(`DitoInput`),c=V(`DitoDatePicker`),l=V(`DitoTimePicker`);return q(),J(`div`,Vo,[Y(`div`,{class:T([`dito-date-time-picker__inner`,{"dito-date-time-picker__inner--focus":a.focused}])},[X(s,Q({class:`dito-date-time-picker__input`,ref:`input`,modelValue:a.currentText,"onUpdate:modelValue":t[1]||=e=>a.currentText=e,type:`text`},{placeholder:n.placeholder,disabled:n.disabled,focused:a.focused,...e.$attrs},{onFocus:t[2]||=e=>a.onFocus(!0),onBlur:t[3]||=e=>a.onFocus(!1),onKeydown:a.onKeyDown,onMousedown:t[4]||=wa(e=>a.onMouseDown(!1),[`stop`])}),{prefix:z(()=>[H(e.$slots,`prefix`)]),suffix:z(()=>[X(o,{name:`calendar`,disabled:n.disabled,onMousedown:t[0]||=wa(e=>a.onMouseDown(!0),[`prevent`])},null,8,[`disabled`]),H(e.$slots,`suffix`)]),_:3},16,[`modelValue`,`onKeydown`]),X(c,Q({ref:`date`,modelValue:i.currentValue,"onUpdate:modelValue":t[5]||=e=>i.currentValue=e,show:i.showDate,"onUpdate:show":t[6]||=e=>i.showDate=e,placement:`bottom-left`,target:e.$refs.picker},a.attributes),{trigger:z(()=>[...t[9]||=[]]),_:1},16,[`modelValue`,`show`,`target`]),X(l,Q({ref:`time`,modelValue:i.currentValue,"onUpdate:modelValue":t[7]||=e=>i.currentValue=e,show:i.showTime,"onUpdate:show":t[8]||=e=>i.showTime=e,placement:`bottom-right`,target:e.$refs.picker},a.attributes),{trigger:z(()=>[...t[10]||=[]]),_:1},16,[`modelValue`,`show`,`target`])],2)],512)}var Uo=Pa({components:{DitoInput:So,DitoDatePicker:Oo,DitoTimePicker:Bo,DitoIcon:wo},emits:[`update:modelValue`,`change`,`focus`,`blur`],inheritAttrs:!1,props:{modelValue:{type:Date,default:null},transition:{type:String,default:`slide`},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},locale:{type:String,default:`en-US`},format:{type:Object,default:null}},data(){return{currentValue:this.modelValue,showDate:!1,showTime:!1,inputFocused:!1,dateFocused:!1,timeFocused:!1,closedMode:null}},computed:{attributes(){let{transition:e,disabled:t,locale:n,formatOptions:r}=this;return{transition:e,disabled:t,locale:n,format:r}},focused(){return this.inputFocused||this.showDate||this.showTime},input(){return this.$refs.input.input},formatOptions(){return(0,t.assignDeeply)({locale:this.locale,time:t.defaultFormats.time,date:t.defaultFormats.date},{date:{month:`short`,format:(e,t,n)=>t===`literal`&&/\bat\b/.test(e)?`, `:this.format?.date?.format?.(e,t,n)??e}},this.format)},timeIndex(){let e=this.currentText;if(e){let t=e.match(/([\S]+\s*)$/)?.[1];if(t)return e.length-t.length}return null},currentText:{get(){return(0,t.format)(this.currentValue,this.formatOptions)||``},set(e){let t=Ra(e,this.formatOptions);if(t){let e=Eo(this.input);this.currentValue=t,this.$nextTick(()=>To(this.input,e))}}}},watch:{modelValue(e,t){+e!=+t&&(this.currentValue=e)},currentValue(e){+e!=+this.modelValue&&(this.$emit(`update:modelValue`,e),this.$emit(`change`,e))},focused(e,t){e^t&&this.$emit(e?`focus`:`blur`)}},methods:{onFocus(e){this.inputFocused=e,e?this.updatePopups():(this.showDate=!1,this.showTime=!1)},onMouseDown(e){e&&(this.showDate||this.showTime)?(this.showDate=!1,this.showTime=!1):this.disabled||(this.focus(),requestAnimationFrame(()=>this.updatePopups()))},onKeyDown(e){let t=this.getMode(e);this.$refs[t].onKeyDown(e),e.defaultPrevented?this.closedMode=t:t!==this.closedMode&&this.updatePopups(t)},getMode(e=null){let{start:t}=Eo(this.input),{hor:n}=ho(e);return this.timeIndex===null||t+n<this.timeIndex?`date`:`time`},updatePopups(e=this.getMode()){e&&(this.closedMode=null),this.showDate=e===`date`,this.showTime=e===`time`},focus(){this.input.focus()},blur(){this.input.blur()}}},[[`render`,Ho]]),Wo={class:`dito-pagination`,"aria-label":`Pagination`},Go={key:0,class:`dito-pagination-total`},Ko={key:1,class:`dito-buttons dito-buttons--round`},qo=[`disabled`,`aria-label`,`aria-current`,`onClick`],Jo={key:0};function Yo(e,t,n,r,i,a){return q(),J(`nav`,Wo,[n.showTotal?(q(),J(`div`,Go,[n.total>0?(q(),J(W,{key:0},[mi(E(a.first)+` – `+E(a.last)+` / `+E(n.total),1)],64)):Z(``,!0)])):Z(``,!0),a.numPages>1?(q(),J(`div`,Ko,[(q(!0),J(W,null,Tr(a.buttons,e=>(q(),J(`button`,{class:T([`dito-button`,a.getButtonClasses(e)]),disabled:e.disabled,"aria-label":a.getButtonLabel(e),"aria-current":e.active?`page`:null,onClick:t=>a.onClickButton(e)},[e.text?(q(),J(`span`,Jo,E(e.text),1)):Z(``,!0)],10,qo))),256))])):Z(``,!0)])}var Xo=Pa({emits:[`update:page`],props:{total:{type:Number,default:0},page:{type:Number,default:1},pageSize:{type:Number,default:10},showTotal:{type:Boolean,default:!0}},data(){return{showPrev:!0,showNext:!0,currentPage:this.page}},computed:{first(){return(this.currentPage-1)*this.pageSize+1},last(){return Math.min(this.first+this.pageSize-1,this.total)},numPages(){return Math.ceil(this.total/this.pageSize)},buttons(){let{showPrev:e,showNext:t,currentPage:n,numPages:r}=this,i=e+t+1,a=1,o;r<=i?o=r:n<=e+1?o=i:n>=r-t?(o=r,a=r-i+1):(a=n-e,o=n+t);let s=[];s.push({index:n-1,type:`prev`,disabled:n<=1}),a>=2&&s.push({index:1,text:1}),a>2&&s.push({index:Math.max(1,n-10),type:`ellipsis-prev`});for(let e=a;e<=o;e++)s.push({index:e,text:e,active:e===n});return o<r-1&&s.push({index:Math.min(r,n+10),type:`ellipsis-next`}),o<=r-1&&s.push({index:r,text:r}),s.push({index:n+1,type:`next`,disabled:n>=r}),s}},watch:{page(e){this.currentPage=e},pageSize(){this.currentPage>this.numPages&&(this.currentPage=this.numPages)},currentPage(e,t){e!==t&&this.$emit(`update:page`,e)}},created(){this.currentPage=this.page},methods:{getButtonClasses(e){let t=`dito-button`;return{[`${t}--${e.type}`]:e.type,[`${t}--active`]:e.active}},getButtonLabel(e){return e.type===`prev`?`Previous page`:e.type===`next`?`Next page`:e.text?`Page ${e.text}`:null},onClickButton(e){e.index&&!e.disabled&&e.index!==this.currentPage&&(this.currentPage=e.index)}}},[[`render`,Yo]]),Zo={class:`dito-switch__pane`},Qo=[`id`,`aria-checked`,`name`,`disabled`],$o={key:0,class:`dito-switch__label`};function es(e,t,n,r,i,a){return q(),J(`div`,{class:T([`dito-switch`,a.classes]),style:pe(a.styles)},[Y(`div`,Zo,[qn(Y(`input`,Q({id:n.id,ref:`input`},a.attributes,{"onUpdate:modelValue":t[0]||=e=>i.checked=e,role:`switch`,type:`checkbox`,"aria-checked":i.checked,name:n.name,disabled:n.disabled}),null,16,Qo),[[da,i.checked]]),t[1]||=Y(`div`,{class:`dito-switch__button`},null,-1),n.labels?(q(),J(`span`,$o,[i.checked?H(e.$slots,`checked`,{},()=>[mi(E(n.labels.checked||`on`),1)],void 0,0):H(e.$slots,`unchecked`,{},()=>[mi(E(n.labels.unchecked||`off`),1)],void 0,1)])):Z(``,!0)])],6)}var ts=Pa({emits:[`update:modelValue`,`change`],inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!1},id:{type:String,default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},labels:{type:[Object,Boolean],default:!1}},data(){return{checked:this.modelValue}},computed:{classes(){let e=`dito-switch`;return[this.$attrs.class,{[`${e}--checked`]:this.checked,[`${e}--disabled`]:this.disabled}]},styles(){let{labels:{checked:e,unchecked:t}={}}=this,n=Math.max(0,e?.length,t?.length);return{"--switch-width":n?`${n*1.5}rem`:null}},attributes(){let{class:e,...t}=this.$attrs;return t}},watch:{modelValue(e){this.checked=e},checked(e){e!==this.modelValue&&(this.$emit(`update:modelValue`,e),this.$emit(`change`,e))}},methods:{focus(){this.$refs.input.focus()}}},[[`render`,es]]);function ns({enabled:e},{slots:t}){return e?ji(zi,ss,t):t.default()}ns.props={enabled:{type:Boolean,default:!0}};var rs=ns,is=(e,t)=>Object.assign(e.style,t),as=e=>setTimeout(e,0),os=e=>getComputedStyle(e).height,ss={name:`dito-height`,onAfterEnter(e){as(()=>is(e,{height:null}))},onEnter(e){let{width:t}=getComputedStyle(e);is(e,{width:t,position:`absolute`,visibility:`hidden`,height:`auto`}),as(()=>{let{height:t}=getComputedStyle(e);is(e,{width:null,position:null,visibility:null,height:0}),os(e),as(()=>is(e,{height:t}))})},onLeave(e){let{height:t}=getComputedStyle(e);is(e,{height:t}),os(e),as(()=>is(e,{height:0}))}};e.DitoButton=Fa,e.DitoCalendar=uo,e.DitoDatePicker=Oo,e.DitoDateTimePicker=Uo,e.DitoIcon=wo,e.DitoInput=So,e.DitoPagination=Xo,e.DitoSwitch=ts,e.DitoTimePicker=Bo,e.DitoTrigger=yo,e.TransitionHeight=rs,e.addEvents=fo,e.alterDate=La,e.combineEvents=po,e.describeDate=Ia,e.getDatePartAtPosition=za,e.getKey=mo,e.getKeyNavigation=ho,e.getSelection=Eo,e.hasSlotContent=Da,e.hasVNodeContent=Ea,e.parseDate=Ra,e.raw=Oa,e.setSelection=To});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue"),require("@ditojs/utils")):typeof define==`function`&&define.amd?define([`exports`,`vue`,`@ditojs/utils`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`dito-ui`]={},e.vue,e[`@ditojs/utils`]))})(this,function(e,t,n){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function r(e){return e&&(0,n.asArray)(e).some(e=>e.type!==t.Comment)}function i(e,i={}){return e=(0,n.isString)(e)?(0,t.useSlots)()[e]:e,r(e?.(i))}function a(e){return(0,t.markRaw)({value:e})}function o({verb:e,subject:t=null,text:r=null,hasText:i=!!r}){let a=i?null:`${(0,n.labelize)(e)}${t?` ${t}`:``}`;return{class:`dito-button--${e}`,...a&&{title:a,"aria-label":a}}}var s={key:0,class:`dito-button__prefix`},c={class:`dito-button__text`},l={key:1,class:`dito-button__suffix`};function u(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(r.as),(0,t.mergeProps)({class:[`dito-button`,[o.classes,o.verbAttributes.class,{"dito-button--affixed":o.hasAffixes,"dito-button--disabled":o.isAriaDisabled}]],type:o.isNativeButton?r.type:null,disabled:o.isNativeButton?r.disabled:null,"aria-disabled":o.isAriaDisabled?`true`:null,tabindex:o.isAriaDisabled?-1:null,title:r.title??o.verbAttributes.title,"aria-label":o.verbAttributes[`aria-label`]},o.attributes,{onClickCapture:o.onClickCapture}),{default:(0,t.withCtx)(()=>[r.text||o.hasAffixes?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[o.hasAffixes?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,s,[(0,t.renderSlot)(e.$slots,`prefix`)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,c,[(0,t.createTextVNode)((0,t.toDisplayString)(r.text||``),1),(0,t.renderSlot)(e.$slots,`default`)]),o.hasAffixes?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,l,[(0,t.renderSlot)(e.$slots,`suffix`)])):(0,t.createCommentVNode)(``,!0)],64)):(0,t.renderSlot)(e.$slots,`default`,{},void 0,void 0,1)]),_:3},16,[`type`,`disabled`,`aria-disabled`,`tabindex`,`title`,`aria-label`,`class`,`onClickCapture`])}var d=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function f(e){return(0,n.asArray)(e).some(e=>(0,n.isString)(e)?e.trim()!==``:!!e&&e.type!==t.Comment&&((0,n.isString)(e.children)?e.children.trim()!==``:(0,n.isArray)(e.children)&&f(e.children)))}var p=d({inheritAttrs:!1,props:{as:{type:[String,Object],default:`button`},type:{type:String,default:`button`},text:{type:String,default:null},title:{type:String,default:null},disabled:{type:Boolean,default:!1},verb:{type:String,default:null},subject:{type:String,default:null}},computed:{isNativeButton(){return this.as===`button`},isAriaDisabled(){return this.disabled&&!this.isNativeButton},verbAttributes(){let{verb:e,subject:t,hasText:n}=this;return e?o({verb:e,subject:t,hasText:n}):{}},hasText(){return!!this.text||f(this.$slots.default?.())},hasAffixes(){return i(this.$slots.prefix)||i(this.$slots.suffix)},classes(){return this.$attrs.class},attributes(){let{class:e,...t}=this.$attrs;return t}},methods:{onClickCapture(e){this.isAriaDisabled&&(e.preventDefault(),e.stopImmediatePropagation())}}},[[`render`,u]]);function m(e){return{year:e?.getFullYear()??0,month:e?.getMonth()??0,day:e?.getDate()??0,hour:e?.getHours()??0,minute:e?.getMinutes()??0,second:e?.getSeconds()??0,millisecond:e?.getMilliseconds()??0}}function h(e,t={}){return new Date(...Object.values({...m(e),...t}))}function g(e,t,n){let r=m(e);return r[t]+=n,(t===`year`||t===`month`)&&(r.day=Math.min(r.day,ee(r.year,r.month))),h(e,r)}function ee(e,t){return new Date(e,t+1,0).getDate()}function _(e,{locale:t=`en-US`,date:n=!0,time:r=!0}={}){let i=r?null:0,a=e?.match(/\s*\b([ap])\.?m\.?$/i);a&&(e=e.slice(0,a.index));let[o,s,c,l,u,,d=i,,f=i,,p=i,,m=i]=y(e,{date:n,time:r});if(u&&u.length>=4){if((t===`en-US`&&s===`/`&&l===`/`||isNaN(+o)&&!isNaN(+c))&&([o,c]=[c,o]),a&&d!==null){let e=a[1].toLowerCase()===`p`;d=d%12+(e?12:0),d=String(d).padStart(2,`0`)}c=te(c,{locale:t});let e=e=>e===null||e.length===2;if(c!==null&&(!r||e(d)&&e(f)&&e(p))){let e=new Date(+u,+c,+o,+d,+f,+p,+m);return e.getMonth()===+c&&e.getDate()===+o?e:null}}return null}function v(e,t,{locale:n=`en-US`,date:r=!0,time:i=!0}={}){let a=y(e,{date:r,time:i}),o=(e,t=a.length)=>{let n=0,r=0;for(;(e===null||n<=e)&&r<t;)n+=a[r++]?.length??0;return{position:n,index:r}},s=r?0:o(null,6).position;t+=s;let{index:c}=o(t),l=n===`en-US`,u=[l?`month`:`day`,null,l?`day`:`month`,null,`year`,null,`hour`,null,`minute`,null,`second`,null,`millisecond`];for(;c--;)if(u[c]){let e=o(null,c).position-s,t=e+a[c].length;return{name:u[c],start:e,end:t}}return null}function y(e,{date:t=!0,time:n=!0}={}){let r=e?.split(/([\s.,:/]+)/)||[];return t||r.unshift(`1`,`.`,`1`,`.`,`2000`,` `),!n&&r.length>5&&(r.length=5),r}function te(e,{locale:t=`en-US`}={}){let n=+e;if(!isNaN(n))return n-1;let r=e.trim().toLowerCase();if(r.length<3)return null;let i=new Intl.DateTimeFormat(t,{month:`short`}),a=new Intl.DateTimeFormat(t,{month:`long`});for(let e=0;e<12;e++){let t=new Date(2e3,e,1);if(i.format(t).toLowerCase().startsWith(r)||a.format(t).toLowerCase().startsWith(r))return e}return null}function b(e,t,{signal:r}={}){e=e instanceof NodeList?Array.from(e):(0,n.asArray)(e);let i=new AbortController;if(!r?.aborted){r?.addEventListener(`abort`,()=>i.abort(),{once:!0,signal:i.signal});for(let[n,r]of Object.entries(t))for(let t of e)t.addEventListener(n,r,{signal:i.signal})}return{remove(){i.abort()}}}function x(...e){return{remove(){for(let t of e)t.remove()}}}function S(e){return{37:`left`,38:`up`,39:`right`,40:`down`,13:`enter`}[e?.keyCode]}function C(e){let t=S(e);return{hor:{left:-1,right:1}[t]||0,ver:{up:-1,down:1}[t]||0,enter:t===`enter`}}var w={class:`dito-calendar`,role:`dialog`,"aria-label":`Choose date`},ne={class:`dito-calendar-popup`},re={class:`dito-calendar-inner`},ie={class:`dito-calendar-header`},ae={class:`dito-calendar-body`},oe=[`aria-label`],T={class:`dito-calendar-weekdays`,role:`row`},E=[`aria-label`],D=[`tabindex`,`aria-label`,`aria-selected`,`aria-disabled`,`onClick`],O={class:`dito-calendar-footer`},se=[`aria-label`,`title`],ce={class:`dito-calendar-header`},le={class:`dito-calendar-body`},ue={class:`dito-calendar-months`},de=[`aria-label`,`aria-pressed`,`onClick`],fe={class:`dito-calendar-header`},pe={class:`dito-calendar-body`},me={class:`dito-calendar-years`},he=[`aria-label`,`aria-pressed`,`onClick`];function k(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,w,[(0,t.createElementVNode)(`div`,ne,[(0,t.createElementVNode)(`div`,re,[a.currentMode===`day`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`div`,ie,[(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-prev dito-calendar-step-year`,type:`button`,"aria-label":`Previous year`,onClick:n[0]||=e=>o.stepYear(-1)}),(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-prev dito-calendar-step-month`,type:`button`,"aria-label":`Previous month`,onClick:n[1]||=e=>o.stepMonth(-1)}),(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`button`,{class:`dito-calendar-select-year`,type:`button`,"aria-label":`Switch to year selection`,onClick:n[2]||=e=>o.setMode(`year`)},(0,t.toDisplayString)(o.dateToString(a.currentValue,{year:!0})),1),(0,t.createElementVNode)(`button`,{class:`dito-calendar-select-month`,type:`button`,"aria-label":`Switch to month selection`,onClick:n[3]||=e=>o.setMode(`month`)},(0,t.toDisplayString)(o.dateToString(a.currentValue,{month:!0})),1)]),(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-next dito-calendar-step-month`,type:`button`,"aria-label":`Next month`,onClick:n[4]||=e=>o.stepMonth(1)}),(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-next dito-calendar-step-year`,type:`button`,"aria-label":`Next year`,onClick:n[5]||=e=>o.stepYear(1)})]),(0,t.createElementVNode)(`div`,ae,[(0,t.createElementVNode)(`div`,{class:`dito-calendar-dates`,role:`grid`,"aria-label":o.monthLabel,onKeydown:n[6]||=(...e)=>o.onDatesKeyDown&&o.onDatesKeyDown(...e)},[(0,t.createElementVNode)(`div`,T,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.weekdayNames,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{role:`columnheader`,"aria-label":e.long},(0,t.toDisplayString)(e.short),9,E))),256))]),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.weeks,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`dito-calendar__week`,key:+e[0].date,role:`row`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([`dito-calendar__item`,e.state&&`dito-calendar-item-${e.state}`]),key:+e.date,ref_for:!0,ref:e.isCursor?`cursorItem`:void 0,type:`button`,role:`gridcell`,tabindex:e.isCursor?0:-1,"aria-label":o.dateToString(e.date),"aria-selected":e.state===`active`?`true`:`false`,"aria-disabled":e.isDisabled?`true`:null,onClick:t=>o.selectDay(e.date)},(0,t.toDisplayString)(e.date.getDate()),11,D))),128))]))),128))],40,oe)]),(0,t.createElementVNode)(`div`,O,[(0,t.createElementVNode)(`button`,{class:`dito-calendar-select-now`,type:`button`,"aria-label":`Select today (${o.dateToString(new Date)})`,title:o.dateToString(new Date),onClick:n[7]||=e=>o.selectDate(new Date)},null,8,se)])],64)):a.currentMode===`month`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`div`,ce,[(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-prev`,type:`button`,"aria-label":`Previous year`,onClick:n[8]||=e=>o.stepYear(-1)}),(0,t.createElementVNode)(`span`,null,[(0,t.createElementVNode)(`button`,{class:`dito-calendar-select-year`,type:`button`,"aria-label":`Switch to year selection`,onClick:n[9]||=e=>o.setMode(`year`)},(0,t.toDisplayString)(o.dateToString(a.currentValue,{year:!0})),1)]),(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-next`,type:`button`,"aria-label":`Next year`,onClick:n[10]||=e=>o.stepYear(1)})]),(0,t.createElementVNode)(`div`,le,[(0,t.createElementVNode)(`div`,ue,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.monthNames,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([`dito-calendar__item`,o.getMonthClass(n)]),ref_for:!0,ref:o.isCurrentMonth(n)?`cursorItem`:void 0,type:`button`,"aria-label":e.long,"aria-pressed":o.isActiveMonth(n)?`true`:`false`,onClick:e=>o.selectMonth(n)},(0,t.toDisplayString)(e.short),11,de))),256))])])],64)):a.currentMode===`year`?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.createElementVNode)(`div`,fe,[(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-prev`,type:`button`,"aria-label":`Previous decade`,onClick:n[11]||=e=>o.stepDecade(-1)}),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(o.decadeToString(a.currentValue)),1),(0,t.createElementVNode)(`button`,{class:`dito-calendar-step-next`,type:`button`,"aria-label":`Next decade`,onClick:n[12]||=e=>o.stepDecade(1)})]),(0,t.createElementVNode)(`div`,pe,[(0,t.createElementVNode)(`div`,me,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.yearRange,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{class:(0,t.normalizeClass)([`dito-calendar__item`,o.getYearClass(e)]),ref_for:!0,ref:o.isCurrentYear(e)?`cursorItem`:void 0,type:`button`,"aria-label":String(e),"aria-pressed":o.isActiveYear(e)?`true`:`false`,onClick:t=>o.selectYear(e)},(0,t.toDisplayString)(e),11,he))),256))])])],64)):(0,t.createCommentVNode)(``,!0)])])])}function A(){return h(new Date,{hour:0,minute:0,second:0,millisecond:0})}var j=366,M={emits:[`update:modelValue`,`select`],props:{modelValue:{type:Date,default:null},locale:{type:String,default:`en-US`},disabledDate:{type:Function,default:()=>!1},mode:{type:String,default:`day`}},data(){let{weekdayNames:e,monthNames:t}=P(this.locale);return{weekdayNames:e,monthNames:t,currentValue:this.modelValue||A(),currentMode:this.mode}},computed:{dateRange(){let{currentValue:e}=this,t=e.getFullYear(),n=e.getMonth(),r=new Date(t,n,1-new Date(t,n).getDay()),i=(e,t)=>!!t&&e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),a=new Date,o=[];for(let t=0;t<42;t++){let s=new Date(r.getFullYear(),r.getMonth(),r.getDate()+t),c=this.disabledDate(s),l=s.getMonth()===n?i(s,this.modelValue)?`active`:i(s,a)?`today`:c?`disabled`:i(s,e)?`current`:null:c?`disabled`:`gray`;o.push({date:s,state:l,isDisabled:c,isCursor:i(s,e)})}return o},monthLabel(){return this.dateToString(this.currentValue,{year:!0,month:!0})},weeks(){let e=[];for(let t=0;t<this.dateRange.length;t+=7)e.push(this.dateRange.slice(t,t+7));return e},yearRange(){let e=this.getFirstYearOfDecade(this.currentValue.getFullYear());return Array.from({length:10},(t,n)=>e+n)}},watch:{modelValue(e,t){+e!=+t&&(this.currentValue=e||A())},mode(e){this.currentMode=e}},methods:{isActiveMonth(e){return!!this.modelValue&&e===this.modelValue.getMonth()&&this.currentValue.getFullYear()===this.modelValue.getFullYear()},isCurrentMonth(e){return e===this.currentValue.getMonth()},isActiveYear(e){return!!this.modelValue&&e===this.modelValue.getFullYear()},isCurrentYear(e){return e===this.currentValue.getFullYear()},getMonthClass(e){return{"dito-calendar-item-active":this.isActiveMonth(e),"dito-calendar-item-current":this.isCurrentMonth(e)}},getYearClass(e){return{"dito-calendar-item-active":this.isActiveYear(e),"dito-calendar-item-current":this.isCurrentYear(e)}},setDate(e,t=!1){let n=h(this.currentValue,e);this.currentValue=n,t&&this.commitDate(n)},commitDate(e){return!this.disabledDate(e)&&(this.currentValue=e,this.$emit(`update:modelValue`,e),!0)},stepDecade(e){this.currentValue=g(this.currentValue,`year`,e*10)},setMode(e){this.currentMode=e,this.focusCursorItemIfFocused()},stepMonth(e){this.currentValue=g(this.currentValue,`month`,e)},stepYear(e){this.currentValue=g(this.currentValue,`year`,e)},selectDate(e){this.commitDate(e)&&this.$emit(`select`)},selectDay(e){this.selectDate(h(this.currentValue,{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}))},selectMonth(e){this.setMode(`day`),this.setDate({month:e,day:1},!0)},selectYear(e){this.setMode(`month`),this.setDate({year:e},!0)},dateToString(e,{year:t,month:n,day:r}={year:!0,month:!0,day:!0}){return e.toLocaleString(this.locale,{year:t&&`numeric`,month:n&&`long`,day:r&&`numeric`})},decadeToString(e){let t=this.getFirstYearOfDecade(e.getFullYear());return`${t} – ${t+9}`},getFirstYearOfDecade(e){return+`${e.toString().slice(0,-1)}0`},navigate({step:e,enter:t,mode:n=this.currentMode,update:r=!1}){if(e){if(![`day`,`month`,`year`].includes(n))return!1;let t=this.currentValue,i=0;do t=g(t,n,e);while(r&&this.disabledDate(t)&&++i<j);return r?this.commitDate(t):(this.currentValue=t,!0)}if(t){switch(this.currentMode){case`day`:this.selectDate(this.currentValue);break;case`month`:this.setMode(`day`);break;case`year`:this.setMode(`month`)}return!0}return!1},handleKey(e,t){let{ver:n,enter:r}=C(e);return n?!!t&&this.navigate({step:n,mode:t.name,update:!0}):this.navigate({enter:r})},focusCursorItemIfFocused(){this.$el?.contains(document.activeElement)&&this.$nextTick(()=>(0,n.asArray)(this.$refs.cursorItem)[0]?.focus())},onDatesKeyDown(e){let{key:t,shiftKey:n}=e,{currentValue:r}=this,i=r.getDate(),a={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[t];if(a)this.setDate({day:i+a});else if(t===`PageUp`||t===`PageDown`){let e=t===`PageUp`?-1:1;n?this.stepYear(e):this.stepMonth(e)}else if(t===`Home`)this.setDate({day:1});else if(t===`End`)this.setDate({month:r.getMonth()+1,day:0});else return;e.preventDefault(),this.focusCursorItemIfFocused()}}},N={};function P(e){let t=N[e];if(!t){let n=[];for(let t=0;t<7;t++){let r=new Date(0,0,t);n.push({long:r.toLocaleString(e,{weekday:`long`}),short:r.toLocaleString(e,{weekday:`short`})})}let r=[];for(let t=1;t<=12;t++){let n=new Date(0,t,0);r.push({long:n.toLocaleString(e,{month:`long`}),short:n.toLocaleString(e,{month:`short`})})}t=N[e]={weekdayNames:n,monthNames:r}}return t}var F=d(M,[[`render`,k]]);function I(e){let t=(0,n.isString)(e.target)?e.$refs[e.target]:e.target;return t?.$el??t}function L(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`dito-trigger-container`,onKeydown:n[5]||=(...e)=>o.onKeyDown&&o.onKeyDown(...e)},[r.alwaysShow?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`dito-trigger`,o.triggerClass]),ref:`trigger`},[(0,t.renderSlot)(e.$slots,`trigger`)],2)):r.trigger===`click`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([`dito-trigger`,o.triggerClass]),ref:`trigger`,onClick:n[0]||=(...e)=>o.onClick&&o.onClick(...e)},[(0,t.renderSlot)(e.$slots,`trigger`)],2)):r.trigger===`hover`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:2,class:(0,t.normalizeClass)([`dito-trigger`,o.triggerClass]),ref:`trigger`,onMouseenter:n[1]||=e=>o.onHover(!0),onMouseleave:n[2]||=e=>o.onHover(!1)},[(0,t.renderSlot)(e.$slots,`trigger`)],34)):r.trigger===`focus`||r.trigger===`always`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:3,class:(0,t.normalizeClass)([`dito-trigger`,o.triggerClass]),ref:`trigger`},[(0,t.renderSlot)(e.$slots,`trigger`)],2)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(t.Transition,{name:r.transition?`dito-${r.transition}`:void 0,css:!!r.transition},{default:(0,t.withCtx)(()=>[r.trigger===`hover`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)([`dito-popup`,o.popupClass]),ref:`popup`,style:(0,t.normalizeStyle)(o.popupStyle),onMouseenter:n[3]||=e=>o.onHover(!0),onMouseleave:n[4]||=e=>o.onHover(!1)},[a.showPopup?(0,t.renderSlot)(e.$slots,`popup`,{},void 0,void 0,0):(0,t.createCommentVNode)(``,!0)],38)),[[t.vShow,a.showPopup]]):(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:(0,t.normalizeClass)([`dito-popup`,o.popupClass]),ref:`popup`,style:(0,t.normalizeStyle)(o.popupStyle)},[a.showPopup?(0,t.renderSlot)(e.$slots,`popup`,{},void 0,void 0,0):(0,t.createCommentVNode)(``,!0)],6)),[[t.vShow,a.showPopup]])]),_:3},8,[`name`,`css`])],32)}function R(e){return!!e.matches?.(`input, textarea, select, button`)}function ge(e){return!!e.matches?.(`input, textarea, select`)}var z=d({emits:[`update:show`],props:{trigger:{type:String,default:`click`},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom`},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},target:{type:[String,HTMLElement],default:null},customClass:{type:String,default:null},zIndex:{type:Number,default:0},keepInView:{type:Boolean,default:!0},hideWhenClickOutside:{type:Boolean,default:!0},matchTargetWidth:{type:Boolean,default:!0},alwaysShow:{type:Boolean,default:!1},cover:{type:Boolean,default:!1},hideDelay:{type:Number,default:0}},data(){return{showPopup:this.show,focusEvents:null,closeEvents:null,popupEvents:null,mouseLeaveTimer:null,targetResizeObserver:null}},computed:{triggerClass(){return{"dito-trigger-disabled":this.disabled}},popupClass(){let e={[`dito-popup-${(0,n.hyphenate)(this.placement)}`]:!0};return this.customClass&&(e[this.customClass]=!0),e},popupStyle(){return this.zIndex?`z-index: ${this.zIndex}`:``}},watch:{show(e){this.showPopup=e||this.alwaysShow},showPopup(e,t){e^t&&(!e&&this.trigger===`focus`&&this.isPopupFocused()&&this.focusTriggerInput(),this.$emit(`update:show`,e),this.$nextTick(()=>this.onShowPopup(e)))},target(){this.$refs.trigger&&(this.addTargetEvents(),this.targetResizeObserver&&(this.unobserveTargetSize(),this.observeTargetSize()))},placement(){this.$nextTick(()=>this.updatePosition())}},mounted(){this.addTargetEvents(),this.showPopup?this.onShowPopup(!0):this.alwaysShow&&(this.showPopup=!0)},created(){this.showPopup=this.show,this.isFocusingTriggerInput=!1},unmounted(){this.focusEvents?.remove(),this.removeCloseEvents(),this.popupEvents?.remove(),this.unobserveTargetSize(),clearTimeout(this.mouseLeaveTimer)},methods:{open(){this.disabled||(this.showPopup=!0)},close(){this.alwaysShow||(this.showPopup=!1)},toggle(){this.showPopup?this.close():this.open()},getTargetElement(){return I(this)??this.$refs.trigger},isPopupFocused(){return!!this.$refs.popup?.contains(document.activeElement)},containsElement(e){return!!e&&(this.$el.contains(e)||this.getTargetElement().contains(e))},getTriggerInput(){return this.getTargetElement()?.querySelector(`input, textarea`)??null},focusTriggerInput(){this.isFocusingTriggerInput=!0;try{this.getTriggerInput()?.focus()}finally{this.isFocusingTriggerInput=!1}},addTargetEvents(){this.focusEvents?.remove(),this.focusEvents=this.trigger===`focus`?this.addFocusEvents(this.getTargetElement()):null},addCloseEvents(){if(this.hideWhenClickOutside&&!this.alwaysShow&&!this.closeEvents){let{trigger:e,popup:t}=this.$refs;this.closeEvents=b(window,{mouseup:n=>{this.showPopup&&!t.contains(n.target)&&!e.contains(n.target)&&!this.getTargetElement().contains(n.target)&&(this.showPopup=!1)},blur:()=>{this.showPopup=!1}})}},removeCloseEvents(){this.closeEvents?.remove(),this.closeEvents=null},onKeyDown(e){e.key===`Escape`&&this.showPopup&&!this.alwaysShow&&(e.stopPropagation(),this.close())},observeTargetSize(){this.targetResizeObserver||(this.targetResizeObserver=new ResizeObserver(()=>this.updatePosition()),this.targetResizeObserver.observe(this.getTargetElement()))},unobserveTargetSize(){this.targetResizeObserver?.disconnect(),this.targetResizeObserver=null},updatePosition(){let{trigger:e,popup:t}=this.$refs;if(!t||!this.showPopup||t.offsetWidth===0)return;let n=this.getTargetElement();if(this.matchTargetWidth){let r=this.target===`popup`?e:t.firstElementChild;r&&(r.style.width=getComputedStyle(n).width)}let r=n.getBoundingClientRect(),i=r.left+window.scrollX,a=r.top+window.scrollY,o=r.width,s=r.height,c=t.offsetWidth,l=t.offsetHeight,[u,d]=this.placement.split(`-`)||[];if(this.keepInView){let e=window.innerWidth,t=window.innerHeight,n=a,r=t-a-s,f=i,p=e-i-o,m=(e,t,n)=>e<n&&t>e;u===`top`?m(n,r,l)&&(u=`bottom`):u===`bottom`?m(r,n,l)&&(u=`top`):u===`left`?m(f,p,c)&&(u=`right`):u===`right`&&m(p,f,c)&&(u=`left`),d===`top`?m(t-a,a+s,l)&&(d=`bottom`):d===`bottom`?m(a+s,t-a,l)&&(d=`top`):d===`left`?m(e-i,i+o,c)&&(d=`right`):d===`right`&&m(i+o,e-i,c)&&(d=`left`)}let f=0,p=0;switch(u){case`top`:p-=l;break;case`left`:f-=c;break;case`right`:f+=o;break;case`bottom`:p+=s}switch(d){case`right`:f-=c-o;break;case`bottom`:p-=l-s}if(this.cover&&(u===`top`?p+=s:u===`bottom`&&(p-=s)),n!==e){let t=e.getBoundingClientRect();f+=i-t.left,p+=a-t.top}t.style.left=`${f}px`,t.style.top=`${p}px`},addFocusEvents(e){let t=e.querySelectorAll(`input, textarea`),n=null,r=null,i=e=>{let t=n;n=null,r.remove(),r=null,setTimeout(()=>{t.removeAttribute(`readonly`),!R(e.target)&&this.isPopupFocused()&&t.focus()},0)},a=e=>{this.containsElement(e.relatedTarget)||this.close()};return e.addEventListener(`blur`,a,!0),x(b(t,{focus:()=>{this.isFocusingTriggerInput||this.open()}}),b(e,{mousedown:e=>{let{target:t}=e,a=!!this.$refs.popup?.contains(t),o=a?ge(t):R(t);if(o||(e.preventDefault(),e.stopPropagation()),!n&&!(a&&o)){let e=this.getTriggerInput();e&&!e.hasAttribute(`readonly`)&&(e.setAttribute(`readonly`,`true`),n=e,r=b(window,{mouseup:i}))}}}),{remove(){e.removeEventListener(`blur`,a,!0),r?.remove(),r=null,n?.removeAttribute(`readonly`),n=null}})},onShowPopup(e){e===this.showPopup&&this.$refs.popup&&(e?(this.trigger===`focus`&&(this.popupEvents?.remove(),this.popupEvents=this.addFocusEvents(this.$refs.popup)),this.addCloseEvents(),this.observeTargetSize()):(this.popupEvents?.remove(),this.popupEvents=null,this.removeCloseEvents(),this.unobserveTargetSize()))},onClick(){this.toggle()},onHover(e){this.disabled||(clearTimeout(this.mouseLeaveTimer),e?this.showPopup=!0:this.hideDelay?this.mouseLeaveTimer=setTimeout(()=>{this.showPopup=!1},this.hideDelay):this.showPopup=!1)}}},[[`render`,L]]),_e=[`id`,`type`,`name`,`title`,`disabled`,`readonly`,`autofocus`,`placeholder`,`autocomplete`,`aria-label`,`size`];function ve(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`dito-input`,o.classes]),onMousedown:n[2]||=(...e)=>o.onMouseDown&&o.onMouseDown(...e)},[(0,t.renderSlot)(e.$slots,`prefix`),(0,t.withDirectives)((0,t.createElementVNode)(`input`,(0,t.mergeProps)({id:r.id,ref:`input`,"onUpdate:modelValue":n[0]||=e=>a.currentValue=e,type:r.type,name:r.name,title:r.title,disabled:r.disabled,readonly:r.readonly,autofocus:r.autofocus,placeholder:r.placeholder,autocomplete:r.autocomplete,"aria-label":r.title,size:o.size},o.attributes,{onMousedown:n[1]||=(...e)=>o.onMouseDown&&o.onMouseDown(...e)}),null,16,_e),[[t.vModelDynamic,a.currentValue]]),(0,t.renderSlot)(e.$slots,`suffix`)],34)}var B=d({emits:[`update:modelValue`],inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:null},type:{type:String,default:`text`},id:{type:String,default:null},name:{type:String,default:null},title:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},placeholder:{type:String,default:null},autocomplete:{type:String,default:`off`}},data(){return{currentValue:this.modelValue}},computed:{classes(){return[this.$attrs.class,{"dito-input--focus":this.focused}]},attributes(){let{class:e,size:t,...n}=this.$attrs;return n},input(){return this.$refs.input},size(){let{size:e,min:t,max:n}=this.$attrs,r=e=>e==null?0:`${e}`.length;return e||Math.max(r(t),r(n))||void 0}},watch:{modelValue(e,t){e!==t&&(this.currentValue=e)},currentValue(e){e!==this.modelValue&&this.$emit(`update:modelValue`,e)}},methods:{focus(){this.input.focus()},blur(){this.input.blur()},onMouseDown(e){e.target===this.input?e.stopPropagation():!this.disabled&&!this.readonly&&(this.focus(),e.preventDefault())}}},[[`render`,ve]]);function ye(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`i`,{class:(0,t.normalizeClass)([`dito-icon`,o.classes])},null,2)}var V=d({props:{name:{type:String,required:!0},disabled:{type:Boolean,default:!1}},computed:{classes(){let e=`dito-icon`;return{[`${e}--${this.name}`]:!0,[`${e}--disabled`]:this.disabled}}}},[[`render`,ye]]);function H(e,{start:t,end:n}){e?.setSelectionRange&&(e.focus(),e.setSelectionRange(t,n))}function U(e){return e&&`selectionStart`in e?{start:e.selectionStart,end:e.selectionEnd}:null}var be=[`hour`,`minute`,`second`,`millisecond`];function W(e){return be.includes(e)}function G(e,t){let n=[];for(let r=0;r<e;r++)t(r)||n.push(r);return n}function K(e,t,n){return e.length===0?null:n>0?e.find(e=>e>t)??e[0]:e.findLast(e=>e<t)??e.at(-1)}function xe(e,t){return e.includes(t)?t:K(e,t,1)}function Se(e,{disabledHour:t,disabledMinute:n,disabledSecond:r}){return t(e.getHours())||n(e.getMinutes())||r(e.getSeconds())}function q(e){return/^\d$/.test(e)}function Ce(e,t,n){if(e.metaKey||e.ctrlKey&&!e.altKey)return;let r=t.selectionStart;if(r!==t.selectionEnd)return;let{value:i}=t,a=r;e.key.length===1?q(e.key)&&a<i.length?(i[a]===`:`&&q(i[a-1])&&q(i[a-2])&&a++,q(i[a])&&(q(i[a+1])||q(i[a-1]))&&(t.value=i.slice(0,a)+i.slice(a+1),t.setSelectionRange(a,a))):i.length===n?e.preventDefault():i.length>n&&(t.value=i.slice(0,n),t.setSelectionRange(r,r),e.preventDefault()):e.key===`Backspace`&&(a===1||[` `,`:`].includes(i[a-2]))&&(a===i.length||i[a]===`:`?(a--,t.value=i.slice(0,a)+((i[a-1]??``)+`00`)+i.slice(a+1),t.setSelectionRange(a,a)):q(i[a])&&!q(i[a+1])&&(t.value=i.slice(0,a)+`0`+i.slice(a),t.setSelectionRange(a,a)))}var we=[`aria-label`,`aria-expanded`,`disabled`];function Te(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`DitoIcon`),c=(0,t.resolveComponent)(`DitoInput`),l=(0,t.resolveComponent)(`DitoTrigger`);return(0,t.openBlock)(),(0,t.createBlock)(l,(0,t.mergeProps)({class:`dito-picker-input`,ref:`trigger`,trigger:`focus`},{show:r.show,transition:r.transition,placement:r.placement,disabled:r.disabled,target:r.target},{"onUpdate:show":o.onUpdateShow}),{trigger:(0,t.withCtx)(()=>[e.$slots.trigger?(0,t.renderSlot)(e.$slots,`trigger`,{},void 0,void 0,0):((0,t.openBlock)(),(0,t.createBlock)(c,(0,t.mergeProps)({key:1,ref:`input`,modelValue:o.currentText,"onUpdate:modelValue":n[2]||=e=>o.currentText=e,type:`text`,class:r.inputClass},{placeholder:r.placeholder,disabled:r.disabled,focused:o.isFocused,...r.inputAttributes},{onFocus:o.onInputFocus,onBlur:n[3]||=e=>a.isInputFocused=!1,onClick:o.onInputClick,onKeydown:o.onInputKeyDown,onKeyup:o.updateCaretPart}),{prefix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`prefix`)]),suffix:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{class:`dito-picker-input__toggle`,type:`button`,"aria-label":r.toggleLabel,"aria-haspopup":`dialog`,"aria-expanded":a.isPopupShown?`true`:`false`,disabled:r.disabled,onMousedown:n[0]||=(0,t.withModifiers)(()=>{},[`stop`,`prevent`]),onClick:n[1]||=(...e)=>o.onToggleClick&&o.onToggleClick(...e)},[(0,t.createVNode)(s,{name:r.icon,disabled:r.disabled},null,8,[`name`,`disabled`])],40,we),(0,t.renderSlot)(e.$slots,`suffix`)]),_:3},16,[`modelValue`,`class`,`onFocus`,`onClick`,`onKeydown`,`onKeyup`]))]),popup:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`popup`,{value:a.currentValue,setValue:o.setValue,close:o.close})]),_:3},16,[`onUpdate:show`])}var J=d({components:{DitoTrigger:z,DitoInput:B,DitoIcon:V},emits:[`update:modelValue`,`update:show`,`change`,`focus`,`blur`,`caretPartChange`],props:{modelValue:{type:Date,default:null},formatOptions:{type:Object,required:!0},icon:{type:String,required:!0},toggleLabel:{type:String,required:!0},placeholder:{type:String,default:null},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom-left`},target:{type:[String,HTMLElement],default:`trigger`},inputClass:{type:String,default:null},inputAttributes:{type:Object,default:()=>({})},isValueDisabled:{type:Function,default:()=>!1},handlePanelKey:{type:Function,default:()=>!1}},data(){return{currentValue:this.modelValue,isPopupShown:this.show,isInputFocused:!1,caretPartName:null}},computed:{isFocused(){return this.isInputFocused||this.isPopupShown},currentText:{get(){return(0,n.format)(this.currentValue,this.formatOptions)||``},set(e){let t=_(e,this.formatOptions);if(t){let e=this.getInputElement(),n=U(e);this.setValue(t)&&n&&this.$nextTick(()=>H(e,n))}}}},watch:{modelValue(e,t){+e!=+t&&(this.currentValue=e)},isFocused(e,t){e^t&&this.$emit(e?`focus`:`blur`)}},methods:{getInputElement(){return this.$refs.input?.input??null},setValue(e){return e&&this.isValueDisabled(e)?!1:(+e!=+this.currentValue&&(this.currentValue=e,+e!=+this.modelValue&&(this.$emit(`update:modelValue`,e),this.$emit(`change`,e))),!0)},open(){this.$refs.trigger.open()},close(){this.$refs.trigger.close()},focus(){this.$refs.input?.focus()},blur(){this.$refs.input?.blur()},getCaretPart(){let e=U(this.getInputElement())?.start;return e==null?null:v(this.currentText,e,this.formatOptions)},updateCaretPart(){let e=this.getCaretPart()?.name??null;e!==this.caretPartName&&(this.caretPartName=e,this.$emit(`caretPartChange`,e))},onUpdateShow(e){this.isPopupShown=e,this.$emit(`update:show`,e)},onInputFocus(){this.isInputFocused=!0,this.updateCaretPart()},onInputClick(){this.updateCaretPart(),this.open()},onToggleClick(){this.isPopupShown?this.close():(this.open(),this.focus())},onInputKeyDown(e){let{ver:t,enter:n}=C(e),r=this.getCaretPart();if(t||n){if(e.preventDefault(),!this.isPopupShown)t&&this.open();else if(this.handlePanelKey(e,r)&&r){let e=this.getInputElement();this.$nextTick(()=>{let t=v(this.currentText,r.start,this.formatOptions);t&&H(e,t)})}}else W(r?.name)&&Ce(e,this.getInputElement(),this.currentText.length)}}},[[`render`,Te]]);function Ee(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`DitoCalendar`),c=(0,t.resolveComponent)(`DitoPickerInput`);return(0,t.openBlock)(),(0,t.createBlock)(c,(0,t.mergeProps)({class:`dito-date-picker`,ref:`pickerInput`},{modelValue:r.modelValue,show:r.show,transition:r.transition,placement:r.placement,target:r.target,disabled:r.disabled},{placeholder:r.placeholder,formatOptions:o.formatOptions,icon:`calendar`,toggleLabel:`Choose date`,inputClass:`dito-date-picker-input`,inputAttributes:e.$attrs,isValueDisabled:r.disabledDate,handlePanelKey:o.handlePanelKey,"onUpdate:modelValue":n[0]||=t=>e.$emit(`update:modelValue`,t),"onUpdate:show":n[1]||=t=>e.$emit(`update:show`,t),onChange:n[2]||=t=>e.$emit(`change`,t),onFocus:n[3]||=t=>e.$emit(`focus`),onBlur:n[4]||=t=>e.$emit(`blur`)}),(0,t.createSlots)({prefix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`prefix`)]),suffix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`suffix`)]),popup:(0,t.withCtx)(({value:e,setValue:n,close:i})=>[(0,t.createVNode)(s,(0,t.mergeProps)({class:`dito-date-picker-popup`,ref:`calendar`,modelValue:e},{locale:r.locale,disabledDate:r.disabledDate},{"onUpdate:modelValue":n,onSelect:i}),null,16,[`modelValue`,`onUpdate:modelValue`,`onSelect`])]),_:2},[e.$slots.trigger?{name:`trigger`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`trigger`)]),key:`0`}:void 0]),1040,[`placeholder`,`formatOptions`,`inputAttributes`,`isValueDisabled`,`handlePanelKey`])}var De=d({components:{DitoPickerInput:J,DitoCalendar:F},emits:[`update:modelValue`,`update:show`,`change`,`focus`,`blur`],inheritAttrs:!1,props:{modelValue:{type:Date,default:null},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom-left`},placeholder:{type:String,default:null},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},target:{type:[String,HTMLElement],default:`trigger`},locale:{type:String,default:`en-US`},format:{type:Object,default:()=>({date:n.defaultFormats.date,time:!1})},disabledDate:{type:Function,default:()=>!1}},computed:{formatOptions(){return{locale:this.locale,...this.format}}},methods:{handlePanelKey(e,t){return this.$refs.calendar?.handleKey(e,t)??!1},focus(){this.$refs.pickerInput.focus()},blur(){this.$refs.pickerInput.blur()}}},[[`render`,Ee]]),Oe={class:`dito-time-picker-popup`,role:`dialog`,"aria-label":`Choose time`},ke=[`aria-label`],Ae=[`aria-label`,`aria-selected`,`onClick`];function je(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,Oe,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.columns,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`dito-time-picker-panel`,key:e.name},[(0,t.createElementVNode)(`ul`,{ref_for:!0,ref:t=>o.setListElement(e.name,t),class:(0,t.normalizeClass)(`dito-time-picker-${e.name}`),role:`listbox`,"aria-label":e.label},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.values,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:n,ref_for:!0,ref:t=>o.setOptionElement(e.name,n,t),role:`option`,"aria-label":o.leftPad(n),"aria-selected":n===e.value,class:(0,t.normalizeClass)({selected:n===e.value}),onClick:t=>o.setTime({[e.name]:n})},(0,t.toDisplayString)(o.leftPad(n)),11,Ae))),128))],10,ke)]))),128))])}var Y=d({emits:[`update:modelValue`,`select`],props:{modelValue:{type:Date,default:null},disabledHour:{type:Function,default:()=>!1},disabledMinute:{type:Function,default:()=>!1},disabledSecond:{type:Function,default:()=>!1}},computed:{currentDate(){return this.modelValue||h(new Date,{hour:0,minute:0,second:0,millisecond:0})},enabledValues(){return{hour:G(24,this.disabledHour),minute:G(60,this.disabledMinute),second:G(60,this.disabledSecond)}},columns(){let{currentDate:e,enabledValues:t}=this;return[{name:`hour`,label:`Hour`,value:e.getHours(),values:t.hour},{name:`minute`,label:`Minute`,value:e.getMinutes(),values:t.minute},{name:`second`,label:`Second`,value:e.getSeconds(),values:t.second}]}},watch:{modelValue(e,t){+e!=+t&&this.scrollToSelectedOptions({smooth:!0})}},created(){this.listElements={},this.optionElements={hour:{},minute:{},second:{}}},mounted(){this.scrollToSelectedOptions({smooth:!1})},methods:{leftPad(e){return(`0`+e).slice(-2)},setListElement(e,t){this.listElements[e]=t},setOptionElement(e,t,n){n?this.optionElements[e][t]=n:delete this.optionElements[e][t]},setTime(e){let t={millisecond:0};for(let{name:n,value:r,values:i}of this.columns)if(t[n]=xe(i,e[n]??r),t[n]===null)return;this.$emit(`update:modelValue`,h(this.currentDate,t))},handleKey(e,t){let{ver:n,enter:r}=C(e);if(r)return this.$emit(`select`),!0;let i=n&&this.columns.find(({name:e})=>e===t?.name);if(i){let e=K(i.values,i.value,n);return e!==null&&this.setTime({[i.name]:e}),!0}return!1},scrollToSelectedOptions({smooth:e}){this.$nextTick(()=>{for(let{name:t,value:n}of this.columns){let r=this.listElements[t],i=this.optionElements[t][n];if(r&&i){let t=Math.round(i.offsetTop-(r.clientHeight-i.offsetHeight)/2),n=Math.abs(r.scrollTop-t);r.scrollTo({top:t,behavior:e&&n<100?`smooth`:`auto`})}}})}}},[[`render`,je]]);function Me(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`DitoCalendar`),c=(0,t.resolveComponent)(`DitoTimePanel`),l=(0,t.resolveComponent)(`DitoPickerInput`);return(0,t.openBlock)(),(0,t.createBlock)(l,(0,t.mergeProps)({class:`dito-date-time-picker`,ref:`pickerInput`},{modelValue:r.modelValue,transition:r.transition,disabled:r.disabled,placeholder:r.placeholder,formatOptions:o.formatOptions},{placement:a.activePanel===`time`?`bottom-right`:`bottom-left`,icon:`calendar`,toggleLabel:`Choose date and time`,inputClass:`dito-date-time-picker__input`,inputAttributes:e.$attrs,handlePanelKey:o.handlePanelKey,"onUpdate:modelValue":n[0]||=t=>e.$emit(`update:modelValue`,t),onChange:n[1]||=t=>e.$emit(`change`,t),onFocus:n[2]||=t=>e.$emit(`focus`),onBlur:n[3]||=t=>e.$emit(`blur`),onCaretPartChange:o.onCaretPartChange}),{prefix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`prefix`)]),suffix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`suffix`)]),popup:(0,t.withCtx)(({value:e,setValue:n,close:i})=>[a.activePanel===`date`?((0,t.openBlock)(),(0,t.createBlock)(s,{key:0,class:`dito-date-picker-popup`,ref:`calendar`,modelValue:e,locale:r.locale,"onUpdate:modelValue":n,onSelect:i},null,8,[`modelValue`,`locale`,`onUpdate:modelValue`,`onSelect`])):((0,t.openBlock)(),(0,t.createBlock)(c,{key:1,ref:`timePanel`,modelValue:e,"onUpdate:modelValue":n,onSelect:i},null,8,[`modelValue`,`onUpdate:modelValue`,`onSelect`]))]),_:3},16,[`placement`,`inputAttributes`,`handlePanelKey`,`onCaretPartChange`])}var Ne=d({components:{DitoPickerInput:J,DitoCalendar:F,DitoTimePanel:Y},emits:[`update:modelValue`,`change`,`focus`,`blur`],inheritAttrs:!1,props:{modelValue:{type:Date,default:null},transition:{type:String,default:`slide`},placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},locale:{type:String,default:`en-US`},format:{type:Object,default:null}},data(){return{activePanel:`date`}},computed:{formatOptions(){let e=(0,n.assignDeeply)({locale:this.locale,time:n.defaultFormats.time,date:n.defaultFormats.date},{date:{month:`short`}},this.format);if((0,n.isPlainObject)(e.date)){let{format:t}=e.date;e.date.format=(e,n,r)=>n===`literal`&&/\bat\b/.test(e)?`, `:t?.(e,n,r)??e}return e}},methods:{getPanelForPart(e){return W(e)?`time`:`date`},onCaretPartChange(e){let t=this.getPanelForPart(e);t!==this.activePanel&&(this.activePanel=t,this.$refs.pickerInput.open())},handlePanelKey(e,t){if(this.getPanelForPart(t?.name)!==this.activePanel)return!1;let{calendar:n,timePanel:r}=this.$refs;return(this.activePanel===`time`?r:n)?.handleKey(e,t)??!1},focus(){this.$refs.pickerInput.focus()},blur(){this.$refs.pickerInput.blur()}}},[[`render`,Me]]),Pe=[`aria-disabled`,`onClick`];function Fe(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`DitoButton`),c=(0,t.resolveComponent)(`DitoTrigger`);return(0,t.openBlock)(),(0,t.createBlock)(c,{class:(0,t.normalizeClass)([`dito-menu-button`,{"dito-menu-button--open":a.isOpen,"dito-menu-button--offset":r.offset}]),show:a.isOpen,"onUpdate:show":n[2]||=e=>a.isOpen=e,trigger:`click`,placement:r.placement,disabled:r.disabled,matchTargetWidth:!1,cover:r.cover,transition:null},{trigger:(0,t.withCtx)(()=>[(0,t.createVNode)(s,(0,t.mergeProps)({ref:`button`,"aria-haspopup":`menu`,"aria-expanded":a.isOpen?`true`:`false`,disabled:r.disabled},e.$attrs,{onKeydown:o.onButtonKeyDown,onKeyup:o.onKeyUp}),{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`default`)]),_:3},16,[`aria-expanded`,`disabled`,`onKeydown`,`onKeyup`])]),popup:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`ul`,{class:`dito-menu-button__menu`,role:`menu`,onKeydown:n[0]||=(...e)=>o.onMenuKeyDown&&o.onMenuKeyDown(...e),onKeyup:n[1]||=(...e)=>o.onKeyUp&&o.onKeyUp(...e)},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.items,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e.value,role:`none`},[(0,t.createElementVNode)(`button`,{class:(0,t.normalizeClass)([`dito-menu-button__item`,{"dito-menu-button__item--disabled":e.disabled}]),ref_for:!0,ref:t=>o.setItemElement(e,t),type:`button`,role:`menuitem`,tabindex:`-1`,"aria-disabled":e.disabled?`true`:null,onClick:t=>o.selectItem(e)},(0,t.toDisplayString)(e.label),11,Pe)]))),128))],32)]),_:3},8,[`show`,`placement`,`disabled`,`cover`,`class`])}var Ie=d({components:{DitoTrigger:z,DitoButton:p},inheritAttrs:!1,emits:[`select`],props:{items:{type:Array,required:!0},placement:{type:String,default:`bottom`},cover:{type:Boolean,default:!0},offset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},data(){return{isOpen:!1}},created(){this.itemElements=new Map},methods:{setItemElement(e,t){t?this.itemElements.set(e,t):this.itemElements.delete(e)},getFocusedItemIndex(){return this.items.findIndex(e=>this.itemElements.get(e)===document.activeElement)},focusItemAt(e){this.itemElements.get(this.items[e])?.focus()},async open(e){this.isOpen=!0,await this.$nextTick(),this.focusItemAt(e)},close(){this.isOpen=!1,this.focusButton()},focusButton(){this.$refs.button.$el.focus()},selectItem(e){e.disabled||(this.close(),this.$emit(`select`,e))},onButtonKeyDown(e){let{key:t}=e;t===`Enter`||t===` `||t===`ArrowDown`?(e.preventDefault(),this.open(0)):t===`ArrowUp`&&(e.preventDefault(),this.open(this.items.length-1))},onMenuKeyDown(e){let{key:t}=e,n=this.items.length,r=this.getFocusedItemIndex();if(t===`Escape`)this.focusButton();else if(t===`Enter`||t===` `){e.preventDefault();let t=this.items[r];t&&this.selectItem(t)}else if(t===`Tab`)this.isOpen=!1;else{let i={ArrowDown:(r+1)%n,ArrowUp:(r-1+n)%n,Home:0,End:n-1}[t];i!==void 0&&(e.preventDefault(),this.focusItemAt(i))}},onKeyUp(e){e.key===` `&&e.preventDefault()}}},[[`render`,Fe]]),Le={class:`dito-pagination`,"aria-label":`Pagination`},Re={key:0,class:`dito-pagination-total`},ze={key:1,class:`dito-buttons dito-buttons--round`},Be={key:0};function Ve(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`DitoButton`);return(0,t.openBlock)(),(0,t.createElementBlock)(`nav`,Le,[r.showTotal?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Re,[r.total>0?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createTextVNode)((0,t.toDisplayString)(o.first)+` – `+(0,t.toDisplayString)(o.last)+` / `+(0,t.toDisplayString)(r.total),1)],64)):(0,t.createCommentVNode)(``,!0)])):(0,t.createCommentVNode)(``,!0),o.numPages>1?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ze,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.buttons,e=>((0,t.openBlock)(),(0,t.createBlock)(s,{key:e.type||e.index,class:(0,t.normalizeClass)(o.getButtonClasses(e)),disabled:e.disabled,"aria-label":o.getButtonLabel(e),"aria-current":e.active?`page`:null,onClick:t=>o.onClickButton(e)},{default:(0,t.withCtx)(()=>[e.text?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Be,(0,t.toDisplayString)(e.text),1)):(0,t.createCommentVNode)(``,!0)]),_:2},1032,[`class`,`disabled`,`aria-label`,`aria-current`,`onClick`]))),128))])):(0,t.createCommentVNode)(``,!0)])}var He=d({components:{DitoButton:p},emits:[`update:page`],props:{total:{type:Number,default:0},page:{type:Number,default:1},pageSize:{type:Number,default:10},showTotal:{type:Boolean,default:!0}},data(){return{showPrev:!0,showNext:!0,currentPage:this.page}},computed:{first(){return(this.currentPage-1)*this.pageSize+1},last(){return Math.min(this.first+this.pageSize-1,this.total)},numPages(){return Math.ceil(this.total/this.pageSize)},buttons(){let{showPrev:e,showNext:t,currentPage:n,numPages:r}=this,i=e+t+1,a=1,o;r<=i?o=r:n<=e+1?o=i:n>=r-t?(o=r,a=r-i+1):(a=n-e,o=n+t);let s=[];s.push({index:n-1,type:`prev`,disabled:n<=1}),a>=2&&s.push({index:1,text:1}),a>2&&s.push({index:Math.max(1,n-10),type:`ellipsis-prev`});for(let e=a;e<=o;e++)s.push({index:e,text:e,active:e===n});return o<r-1&&s.push({index:Math.min(r,n+10),type:`ellipsis-next`}),o<=r-1&&s.push({index:r,text:r}),s.push({index:n+1,type:`next`,disabled:n>=r}),s}},watch:{page(e){this.currentPage=e},pageSize(){let e=Math.max(1,this.numPages);this.currentPage>e&&(this.currentPage=e)},currentPage(e,t){e!==t&&this.$emit(`update:page`,e)}},created(){this.currentPage=this.page},methods:{getButtonClasses(e){let t=`dito-button`;return{[`${t}--${e.type}`]:e.type,[`${t}--active`]:e.active}},getButtonLabel(e){return e.type===`prev`?`Previous page`:e.type===`next`?`Next page`:e.text?`Page ${e.text}`:null},onClickButton(e){e.index&&!e.disabled&&e.index!==this.currentPage&&(this.currentPage=e.index)}}},[[`render`,Ve]]),Ue={class:`dito-switch__pane`},We=[`id`,`aria-checked`,`name`,`disabled`],Ge={key:0,class:`dito-switch__label`};function Ke(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`dito-switch`,o.classes]),style:(0,t.normalizeStyle)(o.styles)},[(0,t.createElementVNode)(`div`,Ue,[(0,t.withDirectives)((0,t.createElementVNode)(`input`,(0,t.mergeProps)({id:r.id,ref:`input`},o.attributes,{"onUpdate:modelValue":n[0]||=e=>a.checked=e,role:`switch`,type:`checkbox`,"aria-checked":a.checked,name:r.name,disabled:r.disabled}),null,16,We),[[t.vModelCheckbox,a.checked]]),n[1]||=(0,t.createElementVNode)(`div`,{class:`dito-switch__button`},null,-1),r.labels?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,Ge,[a.checked?(0,t.renderSlot)(e.$slots,`checked`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(r.labels.checked||`on`),1)],void 0,0):(0,t.renderSlot)(e.$slots,`unchecked`,{},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(r.labels.unchecked||`off`),1)],void 0,1)])):(0,t.createCommentVNode)(``,!0)])],6)}var qe=d({emits:[`update:modelValue`,`change`],inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!1},id:{type:String,default:null},name:{type:String,default:null},disabled:{type:Boolean,default:!1},labels:{type:[Object,Boolean],default:!1}},data(){return{checked:this.modelValue}},computed:{classes(){let e=`dito-switch`;return[this.$attrs.class,{[`${e}--checked`]:this.checked,[`${e}--disabled`]:this.disabled}]},styles(){let{labels:{checked:e,unchecked:t}={}}=this,n=Math.max(e?.length??0,t?.length??0);return{"--switch-width":n?`${n*1.5}rem`:null}},attributes(){let{class:e,...t}=this.$attrs;return t}},watch:{modelValue(e){this.checked=e},checked(e){e!==this.modelValue&&(this.$emit(`update:modelValue`,e),this.$emit(`change`,e))}},methods:{focus(){this.$refs.input.focus()}}},[[`render`,Ke]]);function Je(e,n,r,i,a,o){let s=(0,t.resolveComponent)(`DitoTimePanel`),c=(0,t.resolveComponent)(`DitoPickerInput`);return(0,t.openBlock)(),(0,t.createBlock)(c,(0,t.mergeProps)({class:`dito-time-picker`,ref:`pickerInput`},{modelValue:r.modelValue,show:r.show,transition:r.transition,placement:r.placement,target:r.target,disabled:r.disabled},{placeholder:r.placeholder,formatOptions:o.formatOptions,icon:`clock`,toggleLabel:`Choose time`,inputClass:`dito-time-picker-input`,inputAttributes:e.$attrs,isValueDisabled:o.isValueDisabled,handlePanelKey:o.handlePanelKey,"onUpdate:modelValue":n[0]||=t=>e.$emit(`update:modelValue`,t),"onUpdate:show":n[1]||=t=>e.$emit(`update:show`,t),onChange:n[2]||=t=>e.$emit(`change`,t),onFocus:n[3]||=t=>e.$emit(`focus`),onBlur:n[4]||=t=>e.$emit(`blur`)}),(0,t.createSlots)({prefix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`prefix`)]),suffix:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`suffix`)]),popup:(0,t.withCtx)(({value:e,setValue:n,close:i})=>[(0,t.createVNode)(s,(0,t.mergeProps)({ref:`timePanel`,modelValue:e},{disabledHour:r.disabledHour,disabledMinute:r.disabledMinute,disabledSecond:r.disabledSecond},{"onUpdate:modelValue":n,onSelect:i}),null,16,[`modelValue`,`onUpdate:modelValue`,`onSelect`])]),_:2},[e.$slots.trigger?{name:`trigger`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(e.$slots,`trigger`)]),key:`0`}:void 0]),1040,[`placeholder`,`formatOptions`,`inputAttributes`,`isValueDisabled`,`handlePanelKey`])}var Ye=d({components:{DitoPickerInput:J,DitoTimePanel:Y},emits:[`update:modelValue`,`update:show`,`change`,`focus`,`blur`],inheritAttrs:!1,props:{modelValue:{type:Date,default:null},transition:{type:String,default:`slide`},placement:{type:String,default:`bottom-left`},placeholder:{type:String,default:null},show:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},target:{type:[String,HTMLElement],default:`trigger`},locale:{type:String,default:`en-US`},format:{type:Object,default:()=>({time:n.defaultFormats.time,date:!1})},disabledHour:{type:Function,default:()=>!1},disabledMinute:{type:Function,default:()=>!1},disabledSecond:{type:Function,default:()=>!1}},computed:{formatOptions(){return{locale:this.locale,...this.format}}},methods:{isValueDisabled(e){let{disabledHour:t,disabledMinute:n,disabledSecond:r}=this;return Se(e,{disabledHour:t,disabledMinute:n,disabledSecond:r})},handlePanelKey(e,t){return this.$refs.timePanel?.handleKey(e,t)??!1},focus(){this.$refs.pickerInput.focus()},blur(){this.$refs.pickerInput.blur()}}},[[`render`,Je]]);function X({enabled:e},{slots:n}){return e?(0,t.h)(t.Transition,Ze,n):n.default()}X.props={enabled:{type:Boolean,default:!0}};var Xe=X,Z=(e,t)=>Object.assign(e.style,t),Q=e=>setTimeout(e,0),$=e=>getComputedStyle(e).height,Ze={name:`dito-height`,onAfterEnter(e){Q(()=>Z(e,{height:null}))},onEnter(e){let{width:t}=getComputedStyle(e);Z(e,{width:t,position:`absolute`,visibility:`hidden`,height:`auto`}),Q(()=>{let{height:t}=getComputedStyle(e);Z(e,{width:null,position:null,visibility:null,height:0}),$(e),Q(()=>Z(e,{height:t}))})},onLeave(e){let{height:t}=getComputedStyle(e);Z(e,{height:t}),$(e),Q(()=>Z(e,{height:0}))}};e.DitoButton=p,e.DitoCalendar=F,e.DitoDatePicker=De,e.DitoDateTimePicker=Ne,e.DitoIcon=V,e.DitoInput=B,e.DitoMenuButton=Ie,e.DitoPagination=He,e.DitoSwitch=qe,e.DitoTimePicker=Ye,e.DitoTrigger=z,e.TransitionHeight=Xe,e.addEvents=b,e.alterDate=h,e.combineEvents=x,e.describeDate=m,e.getDatePartAtPosition=v,e.getKey=S,e.getKeyNavigation=C,e.getSelection=U,e.getVerbButtonAttributes=o,e.hasSlotContent=i,e.hasVNodeContent=r,e.parseDate=_,e.raw=a,e.setSelection=H,e.stepDate=g});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ditojs/ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Dito.js UI is a simple UI library, built with Vue.js for use in Dito.js Admin and elsewhere",
|
|
6
6
|
"repository": "https://github.com/ditojs/dito/tree/main/packages/ui",
|
|
@@ -21,13 +21,15 @@
|
|
|
21
21
|
"src/",
|
|
22
22
|
"dist/",
|
|
23
23
|
"!src/**/*.test.js",
|
|
24
|
-
"!src/**/__snapshots__/"
|
|
24
|
+
"!src/**/__snapshots__/",
|
|
25
|
+
"!src/test/",
|
|
26
|
+
"!src/**/node_modules/"
|
|
25
27
|
],
|
|
26
28
|
"scripts": {
|
|
27
29
|
"build:icons": "inline-assets src/icons/*.svg --template src/icons/template.js > src/styles/mixins/_icons.scss",
|
|
28
30
|
"build:vite": "vite build",
|
|
29
31
|
"build": "pnpm run build:icons && pnpm run build:vite",
|
|
30
|
-
"watch": "pnpm run build:
|
|
32
|
+
"watch": "pnpm run build:vite --mode 'development' --watch",
|
|
31
33
|
"prepare": "pnpm run build"
|
|
32
34
|
},
|
|
33
35
|
"engines": {
|
|
@@ -36,15 +38,19 @@
|
|
|
36
38
|
"browserslist": [
|
|
37
39
|
"> 1%",
|
|
38
40
|
"last 2 versions",
|
|
39
|
-
"ie
|
|
40
|
-
"ie_mob
|
|
41
|
+
"not ie > 0",
|
|
42
|
+
"not ie_mob > 0"
|
|
41
43
|
],
|
|
42
44
|
"dependencies": {
|
|
43
|
-
"@ditojs/utils": "^3.
|
|
45
|
+
"@ditojs/utils": "^3.3.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"vue": "^3.5.43"
|
|
44
49
|
},
|
|
45
50
|
"devDependencies": {
|
|
46
|
-
"@ditojs/build": "^3.
|
|
47
|
-
"vite": "^8.3.
|
|
51
|
+
"@ditojs/build": "^3.3.0",
|
|
52
|
+
"vite": "^8.3.4",
|
|
53
|
+
"vue": "^3.5.43"
|
|
48
54
|
},
|
|
49
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "1ba6ba0a6642294959966a3488b0944c7c321b39"
|
|
50
56
|
}
|
|
@@ -1,39 +1,102 @@
|
|
|
1
1
|
<template lang="pug">
|
|
2
|
-
|
|
3
|
-
:
|
|
4
|
-
:
|
|
5
|
-
:disabled="disabled"
|
|
6
|
-
:
|
|
2
|
+
component.dito-button(
|
|
3
|
+
:is="as"
|
|
4
|
+
:type="isNativeButton ? type : null"
|
|
5
|
+
:disabled="isNativeButton ? disabled : null"
|
|
6
|
+
:aria-disabled="isAriaDisabled ? 'true' : null"
|
|
7
|
+
:tabindex="isAriaDisabled ? -1 : null"
|
|
8
|
+
:title="title ?? verbAttributes.title"
|
|
9
|
+
:aria-label="verbAttributes['aria-label']"
|
|
10
|
+
:class=`[
|
|
11
|
+
classes,
|
|
12
|
+
verbAttributes.class,
|
|
13
|
+
{
|
|
14
|
+
'dito-button--affixed': hasAffixes,
|
|
15
|
+
'dito-button--disabled': isAriaDisabled
|
|
16
|
+
}
|
|
17
|
+
]`
|
|
7
18
|
v-bind="attributes"
|
|
19
|
+
@click.capture="onClickCapture"
|
|
8
20
|
)
|
|
9
|
-
|
|
10
|
-
v-if="hasAffixes"
|
|
11
|
-
)
|
|
12
|
-
slot(name="prefix")
|
|
13
|
-
.dito-button__text(
|
|
21
|
+
template(
|
|
14
22
|
v-if="text || hasAffixes"
|
|
15
|
-
) {{ text || '' }}
|
|
16
|
-
slot
|
|
17
|
-
.dito-button__suffix(
|
|
18
|
-
v-if="hasAffixes"
|
|
19
23
|
)
|
|
20
|
-
|
|
24
|
+
.dito-button__prefix(
|
|
25
|
+
v-if="hasAffixes"
|
|
26
|
+
)
|
|
27
|
+
slot(name="prefix")
|
|
28
|
+
.dito-button__text {{ text || '' }}
|
|
29
|
+
slot
|
|
30
|
+
.dito-button__suffix(
|
|
31
|
+
v-if="hasAffixes"
|
|
32
|
+
)
|
|
33
|
+
slot(name="suffix")
|
|
34
|
+
slot(
|
|
35
|
+
v-else
|
|
36
|
+
)
|
|
21
37
|
</template>
|
|
22
38
|
|
|
23
39
|
<script>
|
|
40
|
+
import { Comment } from 'vue'
|
|
41
|
+
import { isArray, isString, asArray } from '@ditojs/utils'
|
|
24
42
|
import { hasSlotContent } from '../utils/vue.js'
|
|
43
|
+
import { getVerbButtonAttributes } from '../utils/button.js'
|
|
25
44
|
|
|
45
|
+
// Returns whether `vnodes` render text, also inside elements and fragments,
|
|
46
|
+
// e.g. the slots that `DitoMenuButton` forwards, which render as fragments also
|
|
47
|
+
// when empty. Components and their slots aren't searched, so that buttons that
|
|
48
|
+
// only display icons are still labelled by their verb.
|
|
49
|
+
function hasVNodeText(vnodes) {
|
|
50
|
+
return asArray(vnodes).some(vnode =>
|
|
51
|
+
isString(vnode)
|
|
52
|
+
? vnode.trim() !== ''
|
|
53
|
+
: !!vnode &&
|
|
54
|
+
vnode.type !== Comment && (
|
|
55
|
+
isString(vnode.children)
|
|
56
|
+
? vnode.children.trim() !== ''
|
|
57
|
+
: isArray(vnode.children) && hasVNodeText(vnode.children)
|
|
58
|
+
)
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Renders all buttons, so that they're of `type="button"` unless stated
|
|
63
|
+
// otherwise and not accidentally submit their forms.
|
|
26
64
|
export default {
|
|
27
65
|
inheritAttrs: false,
|
|
28
66
|
|
|
29
67
|
props: {
|
|
68
|
+
// The element or component to render, e.g. 'a' or 'RouterLink' for links
|
|
69
|
+
// styled as buttons, which are disabled through `aria-disabled`.
|
|
70
|
+
as: { type: [String, Object], default: 'button' },
|
|
30
71
|
type: { type: String, default: 'button' },
|
|
31
72
|
text: { type: String, default: null },
|
|
32
73
|
title: { type: String, default: null },
|
|
33
|
-
disabled: { type: Boolean, default: false }
|
|
74
|
+
disabled: { type: Boolean, default: false },
|
|
75
|
+
// The verb that the button performs, e.g. 'delete', which styles it and
|
|
76
|
+
// labels it when it doesn't display text, along with its `subject`.
|
|
77
|
+
verb: { type: String, default: null },
|
|
78
|
+
subject: { type: String, default: null }
|
|
34
79
|
},
|
|
35
80
|
|
|
36
81
|
computed: {
|
|
82
|
+
isNativeButton() {
|
|
83
|
+
return this.as === 'button'
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
isAriaDisabled() {
|
|
87
|
+
return this.disabled && !this.isNativeButton
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
verbAttributes() {
|
|
91
|
+
const { verb, subject, hasText } = this
|
|
92
|
+
return verb ? getVerbButtonAttributes({ verb, subject, hasText }) : {}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
// Whether the button displays text, through `text` or its default slot.
|
|
96
|
+
hasText() {
|
|
97
|
+
return !!this.text || hasVNodeText(this.$slots.default?.())
|
|
98
|
+
},
|
|
99
|
+
|
|
37
100
|
hasAffixes() {
|
|
38
101
|
return (
|
|
39
102
|
hasSlotContent(this.$slots.prefix) ||
|
|
@@ -49,6 +112,18 @@ export default {
|
|
|
49
112
|
const { class: _, ...attributes } = this.$attrs
|
|
50
113
|
return attributes
|
|
51
114
|
}
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
methods: {
|
|
118
|
+
onClickCapture(event) {
|
|
119
|
+
// Disabled links don't navigate nor reach the click handlers of their
|
|
120
|
+
// owners, like disabled native buttons. Capture listeners on the target
|
|
121
|
+
// run before all others, e.g. the navigation of `RouterLink`.
|
|
122
|
+
if (this.isAriaDisabled) {
|
|
123
|
+
event.preventDefault()
|
|
124
|
+
event.stopImmediatePropagation()
|
|
125
|
+
}
|
|
126
|
+
}
|
|
52
127
|
}
|
|
53
128
|
}
|
|
54
129
|
</script>
|