@vue-js-cron/light
Version:
lightweight vue.js cron editor
9 lines (8 loc) • 40 kB
JavaScript
(function(E,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(E=typeof globalThis<"u"?globalThis:E||self,s(E.CronLight={},E.Vue))})(this,function(E,s){"use strict";var me=Object.defineProperty,he=(e,t,n)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t,n)=>(he(e,typeof t!="symbol"?t+"":t,n),n),T=(e=>(e.Any="any",e.Value="value",e.Range="range",e.Step="step",e.RangeStep="rangeStep",e.Combined="combined",e.NoSpecific="noSpecific",e))(T||{}),q=(e=>(e.Prefix="prefix",e.Suffix="suffix",e.Text="text",e))(q||{});class ye{constructor(t){c(this,"field"),c(this,"itemMap"),this.field=t,this.itemMap=this.field.items.reduce((n,i)=>(n[i.value]=i,n),{})}get id(){return this.field.id}get items(){return this.field.items}get onChange(){return this.field.onChange}get segmentFactories(){return this.field.segmentFactories}get min(){return this.items[0].value}get max(){return this.items[this.items.length-1].value}getItem(t){return this.itemMap[t]}}function ge(e,t,n=1){const i=[];for(let r=e;r<=t;r+=n)i.push(r);return i}class ve{constructor(t,n,i=1){return c(this,"start"),c(this,"end"),c(this,"step"),this.start=t,this.end=n,this.step=i,new Proxy(this,{get:function(r,a){const o=typeof a=="string"?parseInt(a):a;return typeof o=="number"&&o>=0&&o<=r.length?r.start+r.step*o:Reflect.get(r,a)}})}get length(){return(this.end-this.start)/this.step+1}[Symbol.iterator](){let t=-1;return{next:()=>({value:this[++t],done:this[t+1]===void 0})}}}function j(e,t,n=r=>r+"",i=r=>r+""){const r=[];for(const a of new ve(e,t))r.push({text:n(a),alt:i(a),value:a});return r}function ke(e,t="crontab"){const n=(r,a=!1)=>new Date(2021,r-1,1).toLocaleDateString(e,{month:a?"short":"long"}),i=(r,a=!1)=>new Date(2021,0,3+r).toLocaleDateString(e,{weekday:a?"short":"long"});return{secondItems:j(0,59,r=>_(r,2)),minuteItems:j(0,59,r=>_(r,2)),hourItems:j(0,23,r=>_(r,2)),dayItems:j(1,31),monthItems:j(1,12,n,r=>n(r,!0)),dayOfWeekItems:t==="quartz"?j(1,7,r=>i(r-1),r=>i(r-1,!0)):j(0,6,i,r=>i(r,!0))}}function _(e,t){const n=e+"";return n.length<t?new Array(t-n.length).fill("0").join("")+e:n}function N(e){return e&&typeof e=="object"&&!Array.isArray(e)}function J(e,...t){if(!N(e)||t.length===0)return;const n=t.shift();if(N(n))for(const[i,r]of Object.entries(n))N(r)?(N(e[i])||(e[i]={}),J(e[i],n[i])):e[i]=n[i];return t.length>0&&J(e,...t),e}function Z(e,...t){if(t.length===0)return e;for(const n of t[0])if(n in e){const i=Z(e[n],...t.slice(1));if(i!==void 0)return i}}function we(e){for(let t=1;t<e.length;t++)if(e[t-1]+1!==e[t])return!1;return!0}function Se(){throw new Error("not implemented")}function Ce(e,t,n=!0){const i=[];for(let r=0;r<e.length;r+=t){const a=e.slice(r,r+t);for(;n&&a.length<t;)a.push(null);i.push(a)}return i}class R{constructor(t){c(this,"field"),c(this,"type",T.NoSpecific),this.field=t}toCron(){return"?"}toArray(){return[]}get items(){return{}}static fromString(t,n){return t!=="?"?null:new R(n)}}class O{constructor(t){c(this,"field"),c(this,"type",T.Any),this.field=t}toCron(){return"*"}toArray(){return[]}get items(){return{}}static fromString(t,n){return t!=="*"?null:new O(n)}static fromArray(t,n){const{items:i}=n;if(t.length===0)return new O(n);if(t.length!==i.length)return null;for(const r of i)if(!t.includes(r.value))return null;return we(i.map(r=>r.value))?new O(n):null}}const Q=class X{constructor(t,n,i){c(this,"field"),c(this,"type",T.Range),c(this,"start"),c(this,"end"),this.field=t,this.start=n,this.end=i}toCron(){return`${this.start}-${this.end}`}toArray(){const t=this.start,n=this.end;return ge(t,n)}get items(){return{start:this.field.itemMap[this.start],end:this.field.itemMap[this.end]}}static fromString(t,n){if(!X.re.test(t))return null;const{min:i,max:r}=n,a=t.split("-"),o=parseInt(a[0]),l=parseInt(a[1]);return o>l||o<i||l>r?null:new X(n,o,l)}};c(Q,"re",/^\d+-\d+$/);let D=Q;function ee(e,t,n){const i=[];for(let r=t;r<=n;r+=e)i.push(r);return i}const te=class z{constructor(t,n,i,r){c(this,"field"),c(this,"step"),c(this,"start"),c(this,"end"),this.field=t,this.step=n,this.start=i??t.min,this.end=r??t.max}get type(){const{min:t,max:n}=this.field;return this.start!==t||n-this.end>=this.step?T.RangeStep:T.Step}toCron(){return this.type==T.RangeStep?`${this.start}-${this.end}/${this.step}`:`*/${this.step}`}toArray(){return ee(this.step,this.start,this.end)}get items(){return{step:this.field.itemMap[this.step],start:this.field.itemMap[this.start],end:this.field.itemMap[this.end]}}static fromString(t,n){if(!z.re.test(t))return null;const[i,r]=t.split("/"),a=parseInt(r);if(a>n.items.length)return null;const o=t.split("-").map(x=>parseInt(x)),l=i=="*"?n.min:o[0],u=i=="*"?n.max:o[1];return ee(a,l,u).length==0?null:new z(n,a,l,u)}static fromArray(t,n){if(t.length<3)return null;const i=t[1]-t[0];if(i<=1)return null;for(let r=2;r<t.length;r++)if(t[r]-t[r-1]!=i)return null;return new z(n,i,t[0],t[t.length-1])}};c(te,"re",/^(\*|\d+-\d+)\/\d+$/);let U=te;class ${constructor(t,n){c(this,"field"),c(this,"type",T.Value),c(this,"value"),this.field=t,this.value=n}toCron(){return`${this.value}`}toArray(){return[this.value]}get items(){return{value:this.field.itemMap[this.value]}}static fromString(t,n){const{min:i,max:r}=n,a=parseInt(t);return String(a)===t&&a>=i&&a<=r?new $(n,a):null}static fromArray(t,n){const{min:i,max:r}=n;if(t.length!=1)return null;const a=t[0];return a<i||a>r?null:a}}const ne=class H{constructor(t,n=[]){c(this,"field"),c(this,"segments"),this.field=t,this.segments=n}get type(){return this.segments.length==1?this.segments[0].type:T.Range}addSegment(t){this.segments.push(t)}toCron(){return this.segments.map(t=>t.toCron()).join(",")}toArray(){const t=new Set;for(const n of this.segments)n.toArray().forEach(i=>t.add(i));return Array.from(t)}get items(){return Se()}static fromString(t,n){const i=n.segmentFactories??H.segmentFactories;let r=[];for(const a of t.split(",")){if(a==="*"){r=[new O(n)];break}let o=null;for(const l of i)if(o=l(a,n),o!==null)break;if(o===null)return null;r.push(o)}return new H(n,r)}static fromArray(t,n){const{min:i,max:r}=n,a=t[0],o=t[t.length-1];if(a<i||o>r)return null;const l=[];let u=0;for(let x=0;x<t.length;x++)(t[x+1]===void 0||t[x+1]-t[x]>1)&&(x===u?l.push(new $(n,t[u])):l.push(new D(n,t[u],t[x])),u=x+1);return new H(n,l)}};c(ne,"segmentFactories",[O.fromString,U.fromString,D.fromString,$.fromString]);let Y=ne;function re(e,t){return Y.fromString(e,t)}function be(e,t){for(const n of[O.fromArray,U.fromArray,Y.fromArray]){const i=n(e,t);if(i!=null)return i}return null}/*!
* mustache.js - Logic-less {{mustache}} templates with JavaScript
* http://github.com/janl/mustache.js
*/var Ve=Object.prototype.toString,B=Array.isArray||function(e){return Ve.call(e)==="[object Array]"};function G(e){return typeof e=="function"}function Ee(e){return B(e)?"array":typeof e}function K(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ie(e,t){return e!=null&&typeof e=="object"&&t in e}function Ae(e,t){return e!=null&&typeof e!="object"&&e.hasOwnProperty&&e.hasOwnProperty(t)}var Te=RegExp.prototype.test;function Oe(e,t){return Te.call(e,t)}var We=/\S/;function qe(e){return!Oe(We,e)}var je={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Me(e){return String(e).replace(/[&<>"'`=\/]/g,function(t){return je[t]})}var $e=/\s*/,Be=/\s+/,ae=/\s*=/,Ie=/\s*\}/,Le=/#|\^|\/|>|\{|&|=|!/;function Pe(e,t){if(!e)return[];var n=!1,i=[],r=[],a=[],o=!1,l=!1,u="",x=0;function y(){if(o&&!l)for(;a.length;)delete r[a.pop()];else a=[];o=!1,l=!1}var g,v,W;function A(V){if(typeof V=="string"&&(V=V.split(Be,2)),!B(V)||V.length!==2)throw new Error("Invalid tags: "+V);g=new RegExp(K(V[0])+"\\s*"),v=new RegExp("\\s*"+K(V[1])),W=new RegExp("\\s*"+K("}"+V[1]))}A(t||C.tags);for(var p=new L(e),m,f,h,b,M,d;!p.eos();){if(m=p.pos,h=p.scanUntil(g),h)for(var k=0,S=h.length;k<S;++k)b=h.charAt(k),qe(b)?(a.push(r.length),u+=b):(l=!0,n=!0,u+=" "),r.push(["text",b,m,m+1]),m+=1,b===`
`&&(y(),u="",x=0,n=!1);if(!p.scan(g))break;if(o=!0,f=p.scan(Le)||"name",p.scan($e),f==="="?(h=p.scanUntil(ae),p.scan(ae),p.scanUntil(v)):f==="{"?(h=p.scanUntil(W),p.scan(Ie),p.scanUntil(v),f="&"):h=p.scanUntil(v),!p.scan(v))throw new Error("Unclosed tag at "+p.pos);if(f==">"?M=[f,h,m,p.pos,u,x,n]:M=[f,h,m,p.pos],x++,r.push(M),f==="#"||f==="^")i.push(M);else if(f==="/"){if(d=i.pop(),!d)throw new Error('Unopened section "'+h+'" at '+m);if(d[1]!==h)throw new Error('Unclosed section "'+d[1]+'" at '+m)}else f==="name"||f==="{"||f==="&"?l=!0:f==="="&&A(h)}if(y(),d=i.pop(),d)throw new Error('Unclosed section "'+d[1]+'" at '+p.pos);return Re(Ne(r))}function Ne(e){for(var t=[],n,i,r=0,a=e.length;r<a;++r)n=e[r],n&&(n[0]==="text"&&i&&i[0]==="text"?(i[1]+=n[1],i[3]=n[3]):(t.push(n),i=n));return t}function Re(e){for(var t=[],n=t,i=[],r,a,o=0,l=e.length;o<l;++o)switch(r=e[o],r[0]){case"#":case"^":n.push(r),i.push(r),n=r[4]=[];break;case"/":a=i.pop(),a[5]=r[2],n=i.length>0?i[i.length-1][4]:t;break;default:n.push(r)}return t}function L(e){this.string=e,this.tail=e,this.pos=0}L.prototype.eos=function(){return this.tail===""},L.prototype.scan=function(e){var t=this.tail.match(e);if(!t||t.index!==0)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},L.prototype.scanUntil=function(e){var t=this.tail.search(e),n;switch(t){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,t),this.tail=this.tail.substring(t)}return this.pos+=n.length,n};function I(e,t){this.view=e,this.cache={".":this.view},this.parent=t}I.prototype.push=function(e){return new I(e,this)},I.prototype.lookup=function(e){var t=this.cache,n;if(t.hasOwnProperty(e))n=t[e];else{for(var i=this,r,a,o,l=!1;i;){if(e.indexOf(".")>0)for(r=i.view,a=e.split("."),o=0;r!=null&&o<a.length;)o===a.length-1&&(l=ie(r,a[o])||Ae(r,a[o])),r=r[a[o++]];else r=i.view[e],l=ie(i.view,e);if(l){n=r;break}i=i.parent}t[e]=n}return G(n)&&(n=n.call(this.view)),n};function w(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}w.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()},w.prototype.parse=function(e,t){var n=this.templateCache,i=e+":"+(t||C.tags).join(":"),r=typeof n<"u",a=r?n.get(i):void 0;return a==null&&(a=Pe(e,t),r&&n.set(i,a)),a},w.prototype.render=function(e,t,n,i){var r=this.getConfigTags(i),a=this.parse(e,r),o=t instanceof I?t:new I(t,void 0);return this.renderTokens(a,o,n,e,i)},w.prototype.renderTokens=function(e,t,n,i,r){for(var a="",o,l,u,x=0,y=e.length;x<y;++x)u=void 0,o=e[x],l=o[0],l==="#"?u=this.renderSection(o,t,n,i,r):l==="^"?u=this.renderInverted(o,t,n,i,r):l===">"?u=this.renderPartial(o,t,n,r):l==="&"?u=this.unescapedValue(o,t):l==="name"?u=this.escapedValue(o,t,r):l==="text"&&(u=this.rawValue(o)),u!==void 0&&(a+=u);return a},w.prototype.renderSection=function(e,t,n,i,r){var a=this,o="",l=t.lookup(e[1]);function u(g){return a.render(g,t,n,r)}if(l){if(B(l))for(var x=0,y=l.length;x<y;++x)o+=this.renderTokens(e[4],t.push(l[x]),n,i,r);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")o+=this.renderTokens(e[4],t.push(l),n,i,r);else if(G(l)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(t.view,i.slice(e[3],e[5]),u),l!=null&&(o+=l)}else o+=this.renderTokens(e[4],t,n,i,r);return o}},w.prototype.renderInverted=function(e,t,n,i,r){var a=t.lookup(e[1]);if(!a||B(a)&&a.length===0)return this.renderTokens(e[4],t,n,i,r)},w.prototype.indentPartial=function(e,t,n){for(var i=t.replace(/[^ \t]/g,""),r=e.split(`
`),a=0;a<r.length;a++)r[a].length&&(a>0||!n)&&(r[a]=i+r[a]);return r.join(`
`)},w.prototype.renderPartial=function(e,t,n,i){if(n){var r=this.getConfigTags(i),a=G(n)?n(e[1]):n[e[1]];if(a!=null){var o=e[6],l=e[5],u=e[4],x=a;l==0&&u&&(x=this.indentPartial(a,u,o));var y=this.parse(x,r);return this.renderTokens(y,t,n,x,i)}}},w.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(n!=null)return n},w.prototype.escapedValue=function(e,t,n){var i=this.getConfigEscape(n)||C.escape,r=t.lookup(e[1]);if(r!=null)return typeof r=="number"&&i===C.escape?String(r):i(r)},w.prototype.rawValue=function(e){return e[1]},w.prototype.getConfigTags=function(e){return B(e)?e:e&&typeof e=="object"?e.tags:void 0},w.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!B(e))return e.escape};var C={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){P.templateCache=e},get templateCache(){return P.templateCache}},P=new w;C.clearCache=function(){return P.clearCache()},C.parse=function(e,t){return P.parse(e,t)},C.render=function(e,t,n,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Ee(e)+'" was given as the first argument for mustache#render(template, view, partials)');return P.render(e,t,n,i)},C.escape=Me,C.Scanner=L,C.Context=I,C.Writer=w;const De={"*":{prefix:"每",suffix:"",text:"未知","*":{any:{text:"每 {{field.id}}"},value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"每 {{step.value}}"}},month:{"*":{prefix:"的"},any:{text:"每月"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"的"},any:{text:"每日"},value:{text:"{{value.alt}}号"},range:{text:"{{start.alt}}号-{{end.alt}}号"},noSpecific:{text:"无特定日期"}},dayOfWeek:{"*":{prefix:"的"},any:{text:"一周的每一天"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{text:"无特定星期几"}},hour:{"*":{prefix:"的"},any:{text:"每小时"}},minute:{"*":{prefix:":"},any:{text:"每分钟"}},second:{"*":{prefix:":"},any:{text:"每秒"}}},minute:{text:"分"},hour:{text:"小时",minute:{"*":{prefix:":",suffix:"分钟"},any:{text:"每"}}},day:{text:"天"},week:{text:"周",dayOfWeek:{"*":{prefix:"的"},any:{text:"每天"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}}},month:{text:"月",dayOfWeek:{"*":{prefix:"和"}},day:{"*":{prefix:"的"}}},year:{text:"年",dayOfWeek:{"*":{prefix:"和"}}},"q-second":{text:"秒"},"q-minute":{text:"分钟",second:{"*":{prefix:":",suffix:"秒"},any:{text:"每"}}},"q-hour":{text:"小时",minute:{"*":{prefix:":"}}}},Ue={"*":{prefix:"Hver",suffix:"",text:"Ukendt","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"hver {{step.value}}"}},month:{"*":{prefix:"i"},any:{text:"hver måned"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"og"},any:{text:"hver dag i måneden"},value:{text:"{{value.alt}}."},range:{text:"{{start.alt}}.-{{end.alt}}."},noSpecific:{text:"ingen specifik dag"}},dayOfWeek:{"*":{prefix:"på"},any:{text:"hver dag i ugen"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{text:"ingen specifik dag i ugen"}},hour:{"*":{prefix:"klokken"},any:{text:"hver time"}},minute:{"*":{prefix:":"},any:{text:"hvert minut"}},second:{"*":{prefix:":"},any:{text:"hvert sekund"}}},second:{prefix:"Hvert"},minute:{prefix:"Hvert",text:"Minut"},hour:{text:"Time",minute:{"*":{prefix:"ved",suffix:"minutter"},any:{text:"alle"}}},day:{text:"Dag"},week:{text:"Uge"},month:{text:"Måned",dayOfWeek:{"*":{prefix:"og"}}},year:{prefix:"Hvert",text:"År",dayOfWeek:{"*":{prefix:"og"}}},"q-second":{text:"Sekund"},"q-minute":{text:"Minut",second:{"*":{suffix:"sekund(er)"},any:{text:"hvert"}}},"q-hour":{text:"Time",minute:{"*":{prefix:"på"}}}},Fe={"*":{prefix:"Jede",suffix:"",text:"Unknown","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"alle {{step.value}}"}},month:{"*":{prefix:"im"},any:{prefix:"in",text:"jedem Monat"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"den"},any:{prefix:"an",text:"jedem Tag"},step:{prefix:"",text:"alle {{step.value}} Tage"},noSpecific:{prefix:"an",text:"keinem bestimmten Tag"}},dayOfWeek:{"*":{prefix:"am"},any:{prefix:"an",text:"jedem Wochentag"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{prefix:"und",text:"keinem bestimmten Wochentag"}},hour:{"*":{prefix:"um"},any:{prefix:"zu",text:"jeder Stunde"},step:{prefix:"",text:"alle {{step.value}} Stunden"}},minute:{"*":{prefix:":"},any:{text:"jede Minute"},step:{prefix:"",text:"alle {{step.value}} Minuten"}},second:{"*":{prefix:":"},any:{text:"jede Sekunde"},step:{prefix:"",text:"alle {{step.value}} Sekunden"}}},minute:{text:"Minute"},hour:{text:"Stunde",minute:{"*":{prefix:"zu",suffix:"Minute(n)"},any:{text:"jeder"}}},day:{prefix:"Jeden",text:"Tag"},week:{text:"Woche"},month:{prefix:"Jedes",text:"Monat"},year:{prefix:"Jedes",text:"Jahr"},"q-second":{text:"Sekunde"},"q-minute":{text:"Minute",second:{"*":{prefix:"und"}}},"q-hour":{text:"Stunde",minute:{"*":{prefix:"und"}},second:{"*":{prefix:"und"}}}},ze={"*":{prefix:"Every",suffix:"",text:"Unknown","*":{any:{text:"every {{field.id}}"},value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"every {{step.value}}"},rangeStep:{text:"{{start.text}}-{{end.text}}/{{step.value}}"}},month:{"*":{prefix:"in"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},rangeStep:{text:"{{start.alt}}-{{end.alt}}/{{step.value}}"}},day:{"*":{prefix:"on"},noSpecific:{text:"no specific day"}},dayOfWeek:{"*":{prefix:"on"},any:{text:"every day of the week"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},rangeStep:{text:"{{start.alt}}-{{end.alt}}/{{step.value}}"},noSpecific:{text:"no specific day of the week"}},hour:{"*":{prefix:"at"}},minute:{"*":{prefix:":"}},second:{"*":{prefix:":"}}},minute:{text:"Minute"},hour:{text:"Hour",minute:{"*":{prefix:"at",suffix:"minute(s)"},any:{text:"every"}}},day:{text:"Day"},week:{text:"Week"},month:{text:"Month",dayOfWeek:{"*":{prefix:"and"}}},year:{text:"Year",dayOfWeek:{"*":{prefix:"and"}}},"q-second":{text:"Second"},"q-minute":{text:"Minute",second:{"*":{prefix:"at",suffix:"second(s)"},any:{text:"every"}}},"q-hour":{text:"Hour",minute:{"*":{prefix:"at"}}}},He={"*":{prefix:"todos los",suffix:"",text:"Desconocido","*":{any:{text:"todos los {{ field.id }}"},value:{text:"{{ value.text }}"},range:{text:"{{ start.text }}-{{ end.text }}"},step:{text:"todos/as {{ step.value }}"}},month:{"*":{prefix:"en"},any:{text:"todos los meses"},value:{text:"{{ value.alt }}"},range:{text:"{{ start.alt }}-{{ end.alt }}"}},day:{"*":{prefix:"en"},any:{text:"todos los días"},value:{text:"los días {{ value.alt }}"}},dayOfWeek:{"*":{prefix:"de"},any:{text:"todos los días de la semana"},value:{text:"los {{ value.alt }}"},range:{text:"{{ start.alt }}-{{ end.alt }}"}},hour:{"*":{prefix:"a"},any:{text:"todas las horas"},value:{text:"las {{ value.text }}"}},minute:{"*":{prefix:":"},any:{text:"todos los minutos"}}},minute:{prefix:"todos los",text:"minutos"},hour:{prefix:"todas las",text:"horas",minute:{"*":{prefix:"a los",suffix:"minutos"},any:{text:"todos",prefix:"a",suffix:"los minutos"}}},day:{text:"Días"},week:{text:"Semanas"},month:{text:"Meses",dayOfWeek:{"*":{prefix:"y"}}},year:{text:"años",dayOfWeek:{"*":{prefix:"y"}}}},_e={"*":{prefix:"Toutes",suffix:"",text:"Inconnu","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"tous les {{step.value}}"}},month:{"*":{prefix:"en"},any:{prefix:"en",text:"tous les mois"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"le"},any:{prefix:"à",text:"tous les jours"},step:{prefix:"",text:"tous les {{step.value}} jours"},noSpecific:{prefix:"à",text:"aucun jour particulier"}},dayOfWeek:{"*":{prefix:"le"},any:{prefix:"à",text:"tous les jours de la semaine"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{prefix:"et",text:"aucun jour de la semaine particulier"}},hour:{"*":{prefix:"à"},any:{prefix:"à",text:"toutes les heures"},step:{prefix:"",text:"toutes les {{step.value}} heures"}},minute:{"*":{prefix:":"},any:{text:"toutes les minutes"},step:{prefix:"",text:"toutes les {{step.value}} minutes"}},second:{"*":{prefix:":"},any:{text:"toutes les secondes"},step:{prefix:"",text:"toutes les {{step.value}} secondes"}}},minute:{text:"Minute"},hour:{text:"Heure",minute:{"*":{prefix:"à",suffix:"minute(s)"},any:{text:"toutes"}}},day:{prefix:"Tous",text:"Jour"},week:{text:"Semaine"},month:{prefix:"Tous",text:"Mois"},year:{prefix:"Tous",text:"Année"},"q-second":{text:"Seconde"},"q-minute":{text:"Minute",second:{"*":{prefix:"et"}}},"q-hour":{text:"Heure",minute:{"*":{prefix:"et"}},second:{"*":{prefix:"et"}}}},Je={"*":{prefix:"בכל",suffix:"",text:"לא ידוע","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"כל {{step.value}}"}},month:{"*":{prefix:"ב"},any:{text:"כל חודש"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"ב"},any:{text:"כל יום"},value:{text:"יום {{value.alt}} לחודש"},noSpecific:{text:"ללא יום מוגדר"}},dayOfWeek:{"*":{prefix:"ב"},any:{text:"כל יום מימות השבוע"},value:{text:"ימי {{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{text:"ללא יום בשבוע מוגדר"}},hour:{"*":{prefix:"ב"},any:{text:"כל שעה"},value:{text:"שעה {{value.text}}"}},minute:{"*":{prefix:":"},any:{text:"כל דקה"}},second:{"*":{prefix:":"},any:{text:"כל שניה"}}},minute:{text:"דקה"},hour:{text:"שעה",minute:{"*":{prefix:"ב",suffix:"דקות"},any:{text:"כל"}}},day:{text:"יום"},week:{text:"שבוע"},month:{text:"חודש",dayOfWeek:{"*":{prefix:"ו"}}},year:{text:"שנה",dayOfWeek:{"*":{prefix:"ו"}}},"q-second":{text:"שניה"},"q-minute":{text:"דקה",second:{"*":{prefix:"ב",suffix:"שניות"},any:{text:"כל"}}},"q-hour":{text:"שעה",minute:{"*":{prefix:"ב"}}}},Ye={"*":{prefix:"हर",suffix:"",text:"अज्ञात","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"{{step.value}} हर"}},month:{"*":{prefix:"में"},any:{prefix:"के",text:"हर महीने"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"के"},any:{prefix:"पर",text:"हर दिन"},step:{prefix:"",text:"{{step.value}} दिन हर"},noSpecific:{prefix:"पर",text:"कोई विशेष दिन नहीं"}},dayOfWeek:{"*":{prefix:"पर"},any:{prefix:"पर",text:"हर सप्ताह"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{prefix:"और",text:"कोई विशेष सप्ताह नहीं"}},hour:{"*":{prefix:"को"},any:{prefix:"पर",text:"हर घंटे"},step:{prefix:"",text:"{{step.value}} घंटे हर"}},minute:{"*":{prefix:":"},any:{text:"हर मिनट"},step:{prefix:"",text:"{{step.value}} मिनट हर"}},second:{"*":{prefix:":"},any:{text:"हर सेकंड"},step:{prefix:"",text:"{{step.value}} सेकंड हर"}}},minute:{text:"मिनट"},hour:{text:"घंटा",minute:{"*":{prefix:"पर",suffix:"मिनट"},any:{text:"हर"}}},day:{prefix:"हर",text:"दिन"},week:{text:"सप्ताह"},month:{prefix:"हर",text:"महीना"},year:{prefix:"हर",text:"साल"},"q-second":{text:"सेकंड"},"q-minute":{text:"मिनट",second:{"*":{prefix:"और"}}},"q-hour":{text:"घंटा",minute:{"*":{prefix:"और"}},second:{"*":{prefix:"और"}}}},Ge={"*":{prefix:"毎",suffix:"",text:"不明","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"{{step.value}}ごとに"}},month:{"*":{prefix:"に"},any:{prefix:"の",text:"毎月"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"の"},any:{prefix:"に",text:"毎日"},step:{prefix:"",text:"{{step.value}}日ごとに"},noSpecific:{prefix:"に",text:"特定の日はなし"}},dayOfWeek:{"*":{prefix:"の"},any:{prefix:"に",text:"毎週"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{prefix:"と",text:"特定の曜日はなし"}},hour:{"*":{prefix:"の"},any:{prefix:"に",text:"毎時"},step:{prefix:"",text:"{{step.value}}時間ごとに"}},minute:{"*":{prefix:":"},any:{text:"毎分"},step:{prefix:"",text:"{{step.value}}分ごとに"}},second:{"*":{prefix:":"},any:{text:"毎秒"},step:{prefix:"",text:"{{step.value}}秒ごとに"}}},minute:{text:"分"},hour:{text:"時",minute:{"*":{prefix:"に",suffix:"分"},any:{text:"毎"}}},day:{prefix:"毎",text:"日"},week:{text:"週"},month:{prefix:"毎",text:"月"},year:{prefix:"毎",text:"年"},"q-second":{text:"秒"},"q-minute":{text:"分",second:{"*":{prefix:"と"}}},"q-hour":{text:"時",minute:{"*":{prefix:"と"}},second:{"*":{prefix:"と"}}}},Ke={"*":{prefix:"매",suffix:"",text:"알 수 없음","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"{{step.value}}마다"}},month:{"*":{prefix:"에"},any:{prefix:"의",text:"매월"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"의"},any:{prefix:"에",text:"매일"},step:{prefix:"",text:"{{step.value}}일마다"},noSpecific:{prefix:"에",text:"특정한 날 없음"}},dayOfWeek:{"*":{prefix:"의"},any:{prefix:"에",text:"매주"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{prefix:"과",text:"특정한 요일 없음"}},hour:{"*":{prefix:"의"},any:{prefix:"에",text:"매시"},step:{prefix:"",text:"{{step.value}}시간마다"}},minute:{"*":{prefix:":"},any:{text:"매분"},step:{prefix:"",text:"{{step.value}}분마다"}},second:{"*":{prefix:":"},any:{text:"매초"},step:{prefix:"",text:"{{step.value}}초마다"}}},minute:{text:"분"},hour:{text:"시",minute:{"*":{prefix:"에",suffix:"분"},any:{text:"매"}}},day:{prefix:"매",text:"일"},week:{text:"주"},month:{prefix:"매",text:"월"},year:{prefix:"매",text:"년"},"q-second":{text:"초"},"q-minute":{text:"분",second:{"*":{prefix:"와"}}},"q-hour":{text:"시",minute:{"*":{prefix:"와"}},second:{"*":{prefix:"와"}}}},Xe={"*":{prefix:"Todo(a)",suffix:"",text:"Desconhecido","*":{any:{text:"todo {{field.id}}"},value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"todo {{step.value}}"}},month:{"*":{prefix:"de"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},any:{text:"todo mês"}},day:{"*":{prefix:"no(s) dia(s)"},any:{text:"todos"}},dayOfWeek:{"*":{prefix:"de"},any:{text:"todos dias da semana"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},hour:{"*":{prefix:"às"},any:{text:"cada hora"}},minute:{"*":{prefix:":"},any:{text:"cada minuto"}}},minute:{text:"Minuto"},hour:{text:"Hora",minute:{"*":{prefix:"e",suffix:"minuto(s)"},any:{text:"cada"}}},day:{text:"Dia"},week:{text:"Semana"},month:{text:"Mês",dayOfWeek:{"*":{prefix:"e de"}}},year:{text:"Ano",dayOfWeek:{"*":{prefix:"e de"}}}},Ze={"*":{prefix:"Каждый",suffix:"",text:"Неизвестно","*":{value:{text:"{{value.text}}"},range:{text:"{{start.text}}-{{end.text}}"},step:{text:"каждый {{step.value}}"}},month:{"*":{prefix:"в"},any:{prefix:"в",text:"каждом месяце"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"}},day:{"*":{prefix:"в"},any:{prefix:"в",text:"каждый день"},step:{prefix:"",text:"каждые {{step.value}} дня"},noSpecific:{prefix:"в",text:"нет определенного дня"}},dayOfWeek:{"*":{prefix:"по"},any:{prefix:"по",text:"каждому дню недели"},value:{text:"{{value.alt}}"},range:{text:"{{start.alt}}-{{end.alt}}"},noSpecific:{prefix:"и",text:"нет определенного дня недели"}},hour:{"*":{prefix:"в"},any:{prefix:"в",text:"каждый час"},step:{prefix:"",text:"каждые {{step.value}} часа"}},minute:{"*":{prefix:":"},any:{text:"каждую минуту"},step:{prefix:"",text:"каждые {{step.value}} минуты"}},second:{"*":{prefix:":"},any:{text:"каждую секунду"},step:{prefix:"",text:"каждые {{step.value}} секунды"}}},minute:{text:"Минута"},hour:{text:"Час",minute:{"*":{prefix:"в",suffix:"минут(а/ы)"},any:{text:"каждый"}}},day:{prefix:"Каждый",text:"День"},week:{text:"Неделя"},month:{prefix:"Каждый",text:"Месяц"},year:{prefix:"Каждый",text:"Год"},"q-second":{text:"Секунда"},"q-minute":{text:"Минута",second:{"*":{prefix:"и"}}},"q-hour":{text:"Час",minute:{"*":{prefix:"и"}},second:{"*":{prefix:"и"}}}},F={empty:{},en:ze,de:Fe,pt:Xe,es:He,da:Ue,zh:De,he:Je,ru:Ze,fr:_e,hi:Ye,ja:Ge,ko:Ke};class Qe{constructor(t){c(this,"dict"),this.dict=t}getTemplate(...t){const n=t.map(i=>[i,"*"]);return Z(this.dict,...n)||""}render(t,n,i,r,a){const o=this.getTemplate(t,n,i,r);return C.render(o,a||{})}}function et(e,t){const[n]=e.split("-"),i=F[e.toLowerCase()]||F[n.toLowerCase()]||F.en,r=J({},F.en,i,t||{});return new Qe(r)}function tt(e){const{period:t,field:n,initialCron:i="*",l10n:r}=e,a=s.ref(i),o=s.ref(""),l=s.ref([]),u=s.ref(""),x=s.ref(""),y=s.ref(""),g=p=>{const m=p instanceof Y?p.segments:[p];u.value=m.map(f=>r.render(t.value.id,n.id,f.type,q.Text,{field:n,...f.items})).join(","),x.value=r.getTemplate(t.value.id,n.id,p.type,q.Prefix),y.value=r.getTemplate(t.value.id,n.id,p.type,q.Suffix)},v=p=>{const m=re(p,n);m!=null?(l.value=m.toArray(),g(m)):o.value=`${p} is not a valid cron segment (${n.id})`},W=p=>{if(a.value=="?"&&p.length==0)return;const m=be(p,n);m!=null?(a.value=m.toCron(),g(m)):o.value=`failed to convert ${p} to cron (${n.id})`};v(i);const A=p=>{const m=Array.from(p).sort((f,h)=>f>h?1:-1);l.value=m};return s.watch(a,p=>{v(p)}),s.watch(l,p=>{W(p)}),s.watch(t,()=>{const p=re(a.value,n);p!=null&&g(p)}),{id:n.id,items:n.items,cron:a,selected:l,error:o,select:A,text:u,prefix:x,suffix:y}}function se(e,t="*"){return new Array(e).fill(t).join(" ")}function nt(e){return e!==void 0}class rt{constructor(){c(this,"locale","en"),c(this,"format","crontab")}initialValue(t,n="*"){return se(t,n)}fields(t,n){const i=t=="quartz"||t=="spring",r=ke(n,t),a=o=>(l,{segmentMap:u})=>{if(l.cron.value=="?")return;const x=u.get(o);x&&(x.cron.value="?")};return[...i?[{id:"second",items:r.secondItems}]:[],{id:"minute",items:r.minuteItems},{id:"hour",items:r.hourItems},{id:"day",items:r.dayItems,onChange:i?a("dayOfWeek"):void 0,segmentFactories:i?[O.fromString,R.fromString,U.fromString,D.fromString,$.fromString]:void 0},{id:"month",items:r.monthItems},{id:"dayOfWeek",items:r.dayOfWeekItems,onChange:i?a("day"):void 0,segmentFactories:i?[O.fromString,R.fromString,U.fromString,D.fromString,$.fromString]:void 0}]}periods(t){const n=t=="quartz"||t=="spring",i=n?[{id:"q-second",value:[]}]:[],r=n?["second"]:[],a=n?"q-":"";return[...i,{id:a+"minute",value:[...r]},{id:a+"hour",value:["minute",...r]},{id:"day",value:["hour","minute",...r]},{id:"week",value:["dayOfWeek","hour","minute",...r]},{id:"month",value:["day","dayOfWeek","hour","minute",...r]},{id:"year",value:["month","day","dayOfWeek","hour","minute",...r]}]}}function it(e,t,n){const i=t.split(" ");if(i.length!==n.length)return;const r=n.filter((a,o)=>!["*","?"].includes(i[o])).map(a=>a.id);return e.find(a=>{const o=new Set(a.value);return r.every(l=>o.has(l))})}function at(e){const t=new rt,n=e.locale??t.locale,i=e.format??t.format,{customLocale:r,fields:a=t.fields(i,n)}=e,o=e.initialValue??t.initialValue(a.length),l=et(n,r),u=(e.periods??t.periods(i)).map(d=>({...d,text:d.text??l.getTemplate(d.id,q.Text)})),x=(e.initialPeriod?u.find(d=>d.id==e.initialPeriod):void 0)??it([...u].reverse(),o,a)??u[u.length-1],y=s.ref(o),g=s.ref(""),v=s.ref(x),W=s.ref(""),A=s.ref(""),p=a.map(d=>tt({field:new ye(d),l10n:l,period:v})),m=new Map(p.map(d=>[d.id,d])),f=s.computed(()=>v.value.value.map(d=>{const k=m.get(d);if(nt(k))return k;throw Error("${fieldId} not found")})),h=d=>{if(!d){y.value=se(a.length);return}const k=d.split(" ");if(k.length!==a.length){g.value="invalid pattern";return}for(let S=0;S<k.length;S++)p[S].cron.value!=k[S]&&(p[S].cron.value=k[S]);g.value=""};h(o);const b=()=>{y.value=p.map(d=>v.value.value.includes(d.id)||d.cron.value=="?"?d.cron.value:"*").join(" ")},M=()=>{W.value=l.getTemplate(v.value.id,q.Prefix),A.value=l.getTemplate(v.value.id,q.Suffix)};return M(),s.watch(y,h),s.watch(v,()=>{b(),M()}),p.forEach((d,k)=>{s.watch(d.cron,()=>{var S,V;(V=(S=a[k]).onChange)==null||V.call(S,d,{segmentMap:m}),b()}),s.watch(d.error,S=>{g.value=S})}),{cron:y,error:g,segments:p,selected:f,period:{select:d=>{const k=u.map(S=>S.id).indexOf(d);k!=-1&&(v.value=u[k])},selected:v,items:u,prefix:W,suffix:A}}}function oe(e,{emit:t}){const n={...e,initialValue:e.modelValue,initialPeriod:e.period},i=at(n);return s.watch(()=>e.modelValue,r=>{r&&(i.cron.value=r)}),s.watch(()=>e.period,r=>{r&&i.period.select(r)}),s.watch(i.cron,r=>{t("update:model-value",r)}),s.watch(i.period.selected,r=>{t("update:period",r.id)}),s.watch(i.error,r=>{t("error",r)}),i}const le=()=>({modelValue:{type:String},period:{type:String},format:{type:String},locale:{type:String},fields:{type:Array},periods:{type:Array},customLocale:{type:Object},cols:{type:Object,default:()=>({second:5,minute:5,hour:4,day:4})},disabled:{type:Boolean,default:!1}});s.defineComponent({name:"VueCronCore",props:le(),emits:["update:model-value","update:period","error"],setup(e,t){const{error:n,selected:i,period:r}=oe(e,t);return()=>{var a,o;const l={error:n,fields:i.value.map(u=>({id:u.id,items:u.items,cron:u.cron.value,selectedStr:u.text.value,events:{"update:model-value":u.select},attrs:{modelValue:u.selected.value},prefix:u.prefix.value,suffix:u.suffix.value})),period:{attrs:{modelValue:r.selected.value.id},events:{"update:model-value":r.select},items:r.items,prefix:r.prefix.value,suffix:r.suffix.value}};return(o=(a=t.slots).default)==null?void 0:o.call(a,l)}}});function st(e){const{items:t}=e,n=new Set,i=s.ref(0),r=()=>{i.value=i.value+1},a=u=>{t.indexOf(u)!=-1&&(n.add(u),r())},o=u=>n.has(u),l=u=>{n.delete(u)&&r()};return{values:n,add:a,toggle:u=>{o(u)?l(u):a(u)},remove:l,clear:()=>{n.clear(),r()},updated:i,equals:u=>{if(u.length!=n.size)return!1;for(const x of u)if(!n.has(x))return!1;return!0}}}function ue(){return{modelValue:{type:[String,Number,Array]},selection:{type:String},clearable:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},multiple:{type:Boolean,default:!1},cols:{type:Number,default:1},itemText:{type:[String,Function],default:"text"},itemValue:{type:[String,Function],default:"value"},disabled:{type:Boolean,default:!1}}}function pe(e){const{items:t,cols:n=1,multiple:i=!1,itemText:r="text",itemValue:a="value"}=e,o=st(e),l=i?s.ref([]):s.ref(null),u=s.ref(""),x=f=>{i?o.toggle(f):(o.clear(),o.add(f))},y=f=>{if(f===null)return!1;const h=g(f);return Array.isArray(l.value)?l.value.includes(h):l.value===h},g=f=>typeof a=="function"?a(f):f[a],v=f=>typeof r=="function"?r(f):f[r],W=new Map(t.map(f=>[g(f),f])),A=f=>{o.equals(f)||(o.clear(),f.forEach(h=>x(h)))},p=f=>{f=Array.isArray(f)?f:[f];const h=f.map(b=>W.get(b)).filter(b=>!!b);A(h)};s.watch(o.updated,()=>{const f=Array.from(o.values);l.value=i?f.map(g):g(f[0]),u.value=f.map(v).join(",")});const m=s.computed(()=>i?!Array.isArray(l.value)||l.value.length==0:!!l.value);return{...o,select:x,selected:l,selectedStr:u,itemRows:Ce(t,n),setItems:A,setValues:p,isEmpty:m,has:y}}function ot(e,t,{emit:n}){const i=pe(e);return s.watch(i.selected,()=>{n("update:model-value",i.selected.value)}),s.watch(t,r=>{r&&i.setValues(r)},{immediate:!0}),i}s.defineComponent({name:"RenderlessSelect",props:{...ue(),modelValue:{type:[String,Number,Array]},selection:{type:String},clearable:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t,slots:n}){const i=pe(e);return s.watch(i.selected,()=>{t("update:modelValue",i.selected.value)}),s.watch(()=>e.modelValue,r=>{r&&i.setValues(r)},{immediate:!0}),()=>{var r;const a={selectedStr:e.selection||i.selectedStr.value,modelValue:e.modelValue,items:e.items,select:i.select,isSelected:i.has,clearable:e.clearable&&!i.isEmpty.value,clear:i.clear,cols:e.cols,rows:i.itemRows.length,itemRows:i.itemRows,multiple:e.multiple,itemText:e.itemText,itemValue:e.itemValue};return(r=n.default)==null?void 0:r.call(n,a)}}});const lt=s.defineComponent({name:"CustomSelect",props:{...ue()},emits:["update:model-value"],setup(e,t){const n=ot(e,()=>e.modelValue,t),i=s.ref(!1),r=()=>{i.value=!1,document.removeEventListener("click",r)};return{...n,menu:i,toggleMenu:()=>{i.value=!i.value,i.value?setTimeout(()=>{document.addEventListener("click",r)},1):document.removeEventListener("click",r)}}}}),kt="",fe=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},ut={class:"vcron-select-container"},pt={key:0,class:"vcron-select-list"},ft=["onClick"],xt={key:0};function dt(e,t,n,i,r,a){return s.openBlock(),s.createElementBlock("div",ut,[s.createElementVNode("span",{class:s.normalizeClass(["vcron-select-input",{"vcron-select-disabled":e.disabled}]),onClick:t[1]||(t[1]=()=>{e.disabled||e.toggleMenu()})},[s.createTextVNode(s.toDisplayString(e.selection??e.selectedStr)+" ",1),e.clearable&&!e.isEmpty?(s.openBlock(),s.createElementBlock("span",{key:0,onClick:t[0]||(t[0]=(...o)=>e.clear&&e.clear(...o))},"✕")):s.createCommentVNode("",!0)],2),e.menu?(s.openBlock(),s.createElementBlock("div",pt,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.itemRows,(o,l)=>(s.openBlock(),s.createElementBlock("div",{class:"vcron-select-row",key:l},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o,(u,x)=>(s.openBlock(),s.createElementBlock("div",{key:l+"-"+x,class:s.normalizeClass(["vcron-select-col",{"vcron-select-selected":e.has(u)}]),onClick:[y=>e.select(u),t[2]||(t[2]=s.withModifiers(y=>e.multiple?()=>{}:e.toggleMenu(),["stop"]))]},[u?(s.openBlock(),s.createElementBlock("div",xt,s.toDisplayString(u.text),1)):s.createCommentVNode("",!0)],10,ft))),128))]))),128))])):s.createCommentVNode("",!0)])}const ct=fe(lt,[["render",dt]]),xe=()=>({...le()}),mt=s.defineComponent({name:"CronLight",components:{CustomSelect:ct},emits:["update:model-value","update:period","error"],props:xe(),setup(e,t){return oe(e,t)}}),wt="",ht={class:"vcron-editor"},yt={class:"vcron-l-spacer"},gt={class:"vcron-l-spacer"};function vt(e,t,n,i,r,a){const o=s.resolveComponent("custom-select");return s.openBlock(),s.createElementBlock("span",ht,[s.createElementVNode("span",null,s.toDisplayString(e.period.prefix.value),1),s.createElementVNode("div",yt,[s.createVNode(o,{"model-value":e.period.selected.value.id,"item-value":"id",items:e.period.items,"onUpdate:modelValue":t[0]||(t[0]=l=>e.period.select(l)),cols:e.cols.period||1,disabled:e.disabled},null,8,["model-value","items","cols","disabled"])]),s.createElementVNode("span",null,s.toDisplayString(e.period.suffix.value),1),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.selected,l=>(s.openBlock(),s.createElementBlock(s.Fragment,{key:l.id},[s.createElementVNode("span",null,s.toDisplayString(l.prefix.value),1),s.createElementVNode("div",gt,[s.createVNode(o,{"model-value":l.selected.value,"onUpdate:modelValue":u=>l.select(u),items:l.items,cols:e.cols[l.id]||1,selection:l.text.value,multiple:"",clearable:"",disabled:e.disabled},null,8,["model-value","onUpdate:modelValue","items","cols","selection","disabled"])]),s.createElementVNode("span",null,s.toDisplayString(l.suffix.value),1)],64))),128))])}const de=fe(mt,[["render",vt]]),ce={install:e=>{e.component("CronLight",de)}};E.CronLight=de,E.CronLightPlugin=ce,E.cronLightProps=xe,E.default=ce,Object.defineProperties(E,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
//# sourceMappingURL=light.umd.cjs.map