const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('', '', 'dist/index-CYbvdXx_.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_WKCRq3.chunk.mjs'),window.OC.filePath('', '', 'dist/runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs'),window.OC.filePath('', '', 'dist/translation-DoG5ZELJ-Bni_xMHF.chunk.mjs'),window.OC.filePath('', '', 'dist/index-Bndk0DrU.chunk.mjs'),window.OC.filePath('', '', 'dist/createElementId-DhjFt1I9-C_oBIsvc.chunk.css'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-CklyzrxW.chunk.mjs'),window.OC.filePath('', '', 'dist/logger-D3RVzcfQ-R3us1MM8.chunk.css'),window.OC.filePath('', '', 'dist/index-BrC2bLMO.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-Bm11w6Fn.chunk.mjs'),window.OC.filePath('', '', 'dist/mdi-BYHcrfvW.chunk.css'),window.OC.filePath('', '', 'dist/index-CySLkPBX.chunk.css'),window.OC.filePath('', '', 'dist/PencilOutline-BR85Y6ME.chunk.mjs'),window.OC.filePath('', '', 'dist/index-DCpg1aui.chunk.mjs'),window.OC.filePath('', '', 'dist/PencilOutline-DdQinVMt.chunk.css'),window.OC.filePath('', '', 'dist/NcSelect-DLheQ2yp-CP6uPo1K.chunk.mjs'),window.OC.filePath('', '', 'dist/NcSelect-DLheQ2yp-B9mkBKAR.chunk.css'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-DJtp_yB7.chunk.mjs'),window.OC.filePath('', '', 'dist/NcInputField-o5OFv3z6-BYlw6Xsd.chunk.css'),window.OC.filePath('', '', 'dist/NcRichText-DJlaHs_Q-tqMkpCtc.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-C71YD40i.chunk.mjs'),window.OC.filePath('', '', 'dist/NcNoteCard-Cok_4Fld-Jq77EThs.chunk.css'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-BMsPx74L-CrcuxmoM.chunk.mjs'),window.OC.filePath('', '', 'dist/NcCheckboxRadioSwitch-BMsPx74L-CQwJiKOs.chunk.css'),window.OC.filePath('', '', 'dist/index-BT4ljBnH.chunk.mjs'),window.OC.filePath('', '', 'dist/string_decoder-BO00msnV.chunk.mjs'),window.OC.filePath('', '', 'dist/Plus-QzdZMNfM.chunk.mjs'),window.OC.filePath('', '', 'dist/Plus-DoZPzs7J.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-C9d7Wrc8-eVjVuCIX.chunk.mjs'),window.OC.filePath('', '', 'dist/colors-BHGKZFDI-BKHpzg2v.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-XiwrgeCm-Bx6e8UaI.chunk.mjs'),window.OC.filePath('', '', 'dist/NcUserStatusIcon-XiwrgeCm-Bq_6hmXG.chunk.css'),window.OC.filePath('', '', 'dist/NcDateTime.vue_vue_type_script_setup_true_lang-BhB8yA4U-BLfKZ80U.chunk.mjs'),window.OC.filePath('', '', 'dist/NcDateTime-DS-ziNw6.chunk.css'),window.OC.filePath('', '', 'dist/NcAvatar-C9d7Wrc8-D_G6wUEW.chunk.css'),window.OC.filePath('', '', 'dist/TrashCanOutline-B5FsJrKA.chunk.mjs'),window.OC.filePath('', '', 'dist/NcRichText-DJlaHs_Q-CD7ETMqH.chunk.css'),window.OC.filePath('', '', 'dist/NcEmojiPicker-Djc9a0gw-BS_Juv3z.chunk.mjs'),window.OC.filePath('', '', 'dist/NcColorPicker-DDHxR-iN-BXwxdmCO.chunk.mjs'),window.OC.filePath('', '', 'dist/NcColorPicker-DDHxR-iN-Bwe91UZ7.chunk.css'),window.OC.filePath('', '', 'dist/NcEmojiPicker-Djc9a0gw-ChsL0oK6.chunk.css'),window.OC.filePath('', '', 'dist/index-CmFi2esc.chunk.css'),window.OC.filePath('', '', 'dist/index--bLvrHeb.chunk.mjs')])))=>i.map(i=>d[i]); import{_ as V}from"./index-DCpg1aui.chunk.mjs";import{b as A,q as R,s as j,j as I,o as v,k as g,t as S,n as w,z as T,p as P,a as N,f as k,m as Y,M as L,H as Z,l as D,c as x,e as H,w as W}from"./runtime-dom.esm-bundler-CU8rrbZA.chunk.mjs";import{r as z,q as G,_ as B,a as F,c as C,s as J}from"./createElementId-DhjFt1I9-C_WKCRq3.chunk.mjs";import{a as K}from"./PencilOutline-BR85Y6ME.chunk.mjs";import{N as Q}from"./NcPasswordField-uaMO2pdt-Bi58_jEx.chunk.mjs";import{_ as X}from"./TrashCanOutline-B5FsJrKA.chunk.mjs";import{f as tt}from"./index-Bndk0DrU.chunk.mjs";z(G);const et=["for"],it=["id","type","value","min","max"],st=A({inheritAttrs:!1,__name:"NcDateTimePickerNative",props:R({class:{default:void 0},id:{default:()=>C()},inputClass:{default:""},type:{default:"date"},label:{default:()=>F("Please choose a date")},min:{default:null},max:{default:null},hideLabel:{type:Boolean}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=j(r,"modelValue"),t=r,o=P(()=>e.value?u(e.value):""),d=P(()=>t.max?u(t.max):void 0),a=P(()=>t.min?u(t.min):void 0);function m(i){const s=i.getFullYear().toString().padStart(4,"0"),c=(i.getMonth()+1).toString().padStart(2,"0"),h=i.getDate().toString().padStart(2,"0"),p=i.getHours().toString().padStart(2,"0"),f=i.getMinutes().toString().padStart(2,"0");return{yyyy:s,MM:c,dd:h,hh:p,mm:f}}function u(i){const{yyyy:s,MM:c,dd:h,hh:p,mm:f}=m(i);if(t.type==="datetime-local")return`${s}-${c}-${h}T${p}:${f}`;if(t.type==="date")return`${s}-${c}-${h}`;if(t.type==="month")return`${s}-${c}`;if(t.type==="time")return`${p}:${f}`;if(t.type==="week"){const l=new Date(Number.parseInt(s),0,1),b=Math.floor((i.getTime()-l.getTime())/(1440*60*1e3)),_=Math.ceil(b/7);return`${s}-W${_}`}return""}function n(i){const s=i.target;if(!s||isNaN(s.valueAsNumber))e.value=null;else if(t.type==="time"){const c=s.value,{yyyy:h,MM:p,dd:f}=m(e.value||new Date);e.value=new Date(`${h}-${p}-${f}T${c}`)}else if(t.type==="month"){const c=(new Date(s.value).getMonth()+1).toString().padStart(2,"0"),{yyyy:h,dd:p,hh:f,mm:l}=m(e.value||new Date);e.value=new Date(`${h}-${c}-${p}T${f}:${l}`)}else{const c=new Date(s.valueAsNumber).getTimezoneOffset()*1e3*60,h=s.valueAsNumber+c;e.value=new Date(h)}}return(i,s)=>(v(),I("div",{class:w(["native-datetime-picker",i.$props.class])},[g("label",{class:w(["native-datetime-picker__label",{"hidden-visually":i.hideLabel}]),for:i.id},S(i.label),11,et),g("input",T({id:i.id,class:["native-datetime-picker__input",i.inputClass],type:i.type,value:o.value,min:a.value,max:d.value},i.$attrs,{onInput:n}),null,16,it)],2))}}),nt=B(st,[["__scopeId","data-v-b97e1f7a"]]);z(J);const rt={name:"NcActionInput",components:{NcDateTimePickerNative:nt,NcPasswordField:Q,NcTextField:X,NcColorPicker:N(()=>V(()=>import("./index-CYbvdXx_.chunk.mjs").then(r=>r.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url)),NcDateTimePicker:N(()=>V(()=>import("./index-CYbvdXx_.chunk.mjs").then(r=>r.b),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url)),NcSelect:N(()=>V(()=>import("./index--bLvrHeb.chunk.mjs").then(r=>r.i),__vite__mapDeps([42,1,2,3,4,5,6,7,15,8,9,10,11,16,24,25]),import.meta.url))},mixins:[K],inheritAttrs:!1,props:{id:{type:String,default:()=>"action-"+C(),validator:r=>r.trim()!==""},inputId:{type:String,default:()=>"action-input-"+C(),validator:r=>r.trim()!==""},icon:{type:String,default:""},type:{type:String,default:"text",validator(r){return["date","datetime-local","month","multiselect","number","password","search","tel","text","time","url","week","color","email"].includes(r)}},idNativeDateTimePicker:{type:String,default:"date-time-picker_id"},isNativePicker:{type:Boolean,default:!1},label:{type:String,default:null},labelOutside:{type:Boolean,default:!0},modelValue:{type:[String,Date,Number,Array],default:""},disabled:{type:Boolean,default:!1},ariaLabel:{type:String,default:""},showTrailingButton:{type:Boolean,default:!0},trailingButtonLabel:{type:String,default:F("Submit")},class:{type:[String,Array,Object],default:""}},emits:["submit","update:modelValue"],computed:{isIconUrl(){try{return new URL(this.icon)}catch{return!1}},isMultiselectType(){return this.type==="multiselect"},nativeDatePickerType(){switch(this.type){case"date":case"month":case"time":case"week":case"datetime-local":return this.type}return!1},datePickerType(){if(!this.isNativePicker)switch(this.type){case"date":case"month":case"time":return this.type;case"datetime-local":return"datetime"}return!1},isFocusable(){return!this.disabled}},methods:{onLeave(){this.$refs.datetimepicker&&this.$refs.datetimepicker.$refs.datepicker&&this.$refs.datetimepicker.$refs.datepicker.closePopup()},onSubmit(r){if(r.preventDefault(),r.stopPropagation(),!this.disabled)this.$emit("submit",r);else return!1},onUpdateModelValue(r){this.$emit("update:modelValue",r)}}},at={class:"action-input__icon-wrapper"},ot=["disabled"],lt={class:"action-input__container"},ut=["for"],ct={class:"action-input__input-container"},ht={key:4,class:"action-input__container"},dt=["for"],pt={class:"action-input__input-container"};function mt(r,e,t,o,d,a){const m=k("NcDateTimePicker"),u=k("NcDateTimePickerNative"),n=k("NcSelect"),i=k("NcPasswordField"),s=k("NcColorPicker"),c=k("NcTextField");return v(),I("li",{class:w(["action",[{"action--disabled":t.disabled},r.$props.class]])},[g("span",{class:w(["action-input",{"action-input-picker--disabled":t.disabled,"action-input--visible-label":t.labelOutside&&t.label}]),onMouseleave:e[3]||(e[3]=(...h)=>a.onLeave&&a.onLeave(...h))},[g("span",at,[Y(r.$slots,"icon",{},()=>[g("span",{"aria-hidden":"true",class:w(["action-input__icon",[a.isIconUrl?"action-input__icon--url":t.icon]]),style:L({backgroundImage:a.isIconUrl?`url(${t.icon})`:null})},null,6)],!0)]),g("form",{ref:"form",class:"action-input__form",disabled:t.disabled,onSubmit:e[2]||(e[2]=Z((...h)=>a.onSubmit&&a.onSubmit(...h),["prevent"]))},[g("div",lt,[t.label&&t.labelOutside&&!t.isNativePicker?(v(),I("label",{key:0,class:w(["action-input__text-label",{"action-input__text-label--hidden":!t.labelOutside}]),for:t.inputId},S(t.label),11,ut)):D("",!0),g("div",ct,[a.datePickerType?(v(),x(m,T({key:0,ref:"datetimepicker",modelValue:t.modelValue,style:{"z-index":"99999999999"},placeholder:r.text,disabled:t.disabled,type:a.datePickerType,inputClass:["mx-input",{focusable:a.isFocusable}],class:"action-input__datetimepicker",appendToBody:""},r.$attrs,{"onUpdate:modelValue":a.onUpdateModelValue}),null,16,["modelValue","placeholder","disabled","type","inputClass","onUpdate:modelValue"])):t.isNativePicker?(v(),x(u,T({key:1,id:t.idNativeDateTimePicker,modelValue:t.modelValue,label:t.label,type:a.nativeDatePickerType,inputClass:{focusable:a.isFocusable},class:"action-input__datetimepicker"},r.$attrs,{"onUpdate:modelValue":a.onUpdateModelValue}),null,16,["id","modelValue","label","type","inputClass","onUpdate:modelValue"])):a.isMultiselectType?(v(),x(n,T({key:2,modelValue:t.modelValue,placeholder:r.text,disabled:t.disabled,appendToBody:!1,inputClass:{focusable:a.isFocusable},class:"action-input__multi"},r.$attrs,{"onUpdate:modelValue":a.onUpdateModelValue}),null,16,["modelValue","placeholder","disabled","inputClass","onUpdate:modelValue"])):t.type==="password"?(v(),x(i,T({key:3,id:t.inputId,modelValue:t.modelValue,label:t.label,labelOutside:!t.label||t.labelOutside,placeholder:r.text,disabled:t.disabled,inputClass:{focusable:a.isFocusable},showTrailingButton:t.showTrailingButton&&!t.disabled},r.$attrs,{"onUpdate:modelValue":a.onUpdateModelValue}),null,16,["id","modelValue","label","labelOutside","placeholder","disabled","inputClass","showTrailingButton","onUpdate:modelValue"])):t.type==="color"?(v(),I("div",ht,[t.label&&t.type==="color"?(v(),I("label",{key:0,class:w(["action-input__text-label",{"action-input__text-label--hidden":!t.labelOutside}]),for:t.inputId},S(t.label),11,dt)):D("",!0),g("div",pt,[H(s,T({id:"inputId",modelValue:t.modelValue,class:"colorpicker__trigger"},r.$attrs,{"onUpdate:modelValue":a.onUpdateModelValue,onSubmit:e[0]||(e[0]=h=>r.$refs.form.requestSubmit())}),{default:W(()=>[g("button",{class:w(["colorpicker__preview",{focusable:a.isFocusable}]),style:L({"background-color":t.modelValue})},null,6)]),_:1},16,["modelValue","onUpdate:modelValue"])])])):(v(),x(c,T({key:5,id:t.inputId,modelValue:t.modelValue,label:t.label,labelOutside:!t.label||t.labelOutside,placeholder:r.text,disabled:t.disabled,inputClass:{focusable:a.isFocusable},type:t.type,trailingButtonIcon:"arrowRight",trailingButtonLabel:t.trailingButtonLabel,showTrailingButton:t.showTrailingButton&&!t.disabled},r.$attrs,{onTrailingButtonClick:e[1]||(e[1]=h=>r.$refs.form.requestSubmit()),"onUpdate:modelValue":a.onUpdateModelValue}),null,16,["id","modelValue","label","labelOutside","placeholder","disabled","inputClass","type","trailingButtonLabel","showTrailingButton","onUpdate:modelValue"]))])])],40,ot)],34)],2)}const Pt=B(rt,[["render",mt],["__scopeId","data-v-3a83acfa"]]);var O={exports:{}},M;function ft(){return M||(M=1,(function(r){var e=Object.prototype.hasOwnProperty,t="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(t=!1));function d(n,i,s){this.fn=n,this.context=i,this.once=s||!1}function a(n,i,s,c,h){if(typeof s!="function")throw new TypeError("The listener must be a function");var p=new d(s,c||n,h),f=t?t+i:i;return n._events[f]?n._events[f].fn?n._events[f]=[n._events[f],p]:n._events[f].push(p):(n._events[f]=p,n._eventsCount++),n}function m(n,i){--n._eventsCount===0?n._events=new o:delete n._events[i]}function u(){this._events=new o,this._eventsCount=0}u.prototype.eventNames=function(){var n=[],i,s;if(this._eventsCount===0)return n;for(s in i=this._events)e.call(i,s)&&n.push(t?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(i)):n},u.prototype.listeners=function(n){var i=t?t+n:n,s=this._events[i];if(!s)return[];if(s.fn)return[s.fn];for(var c=0,h=s.length,p=new Array(h);cr.reason??new DOMException("This operation was aborted.","AbortError");function vt(r,e){const{milliseconds:t,fallback:o,message:d,customTimers:a={setTimeout,clearTimeout},signal:m}=e;let u,n;const i=new Promise((s,c)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(m?.aborted){c(U(m));return}if(m&&(n=()=>{c(U(m))},m.addEventListener("abort",n,{once:!0})),r.then(s,c),t===Number.POSITIVE_INFINITY)return;const h=new E;u=a.setTimeout.call(void 0,()=>{if(o){try{s(o())}catch(p){c(p)}return}typeof r.cancel=="function"&&r.cancel(),d===!1?s():d instanceof Error?c(d):(h.message=d??`Promise timed out after ${t} milliseconds`,c(h))},t)}).finally(()=>{i.clear(),n&&m&&m.removeEventListener("abort",n)});return i.clear=()=>{a.clearTimeout.call(void 0,u),u=void 0},i}function gt(r,e,t){let o=0,d=r.length;for(;d>0;){const a=Math.trunc(d/2);let m=o+a;t(r[m],e)<=0?(o=++m,d-=a+1):d=a}return o}class _t{#i=[];enqueue(e,t){const{priority:o=0,id:d}=t??{},a={priority:o,id:d,run:e};if(this.size===0||this.#i[this.size-1].priority>=o){this.#i.push(a);return}const m=gt(this.#i,a,(u,n)=>n.priority-u.priority);this.#i.splice(m,0,a)}setPriority(e,t){const o=this.#i.findIndex(a=>a.id===e);if(o===-1)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[d]=this.#i.splice(o,1);this.enqueue(d.run,{priority:t,id:e})}dequeue(){return this.#i.shift()?.run}filter(e){return this.#i.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#i.length}}class Nt extends bt{#i;#a;#o=0;#p;#f=!1;#v=!1;#l;#I=0;#g=0;#u;#c;#r;#n=[];#s=0;#t;#V;#e=0;#y;#h;#E=1n;#b=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:_t,strict:!1,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);if(e.strict&&e.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(e.strict&&e.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#i=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#a=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#p=e.intervalCap,this.#l=e.interval,this.#r=e.strict,this.#t=new e.queueClass,this.#V=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#h=e.autoStart===!1,this.#F()}#_(e){for(;this.#s=this.#l)this.#s++;else break}(this.#s>100&&this.#s>this.#n.length/2||this.#s===this.#n.length)&&(this.#n=this.#n.slice(this.#s),this.#s=0)}#L(e){this.#r?this.#n.push(e):this.#o++}#D(){this.#r?this.#n.length>this.#s&&this.#n.pop():this.#o>0&&this.#o--}#w(){return this.#n.length-this.#s}get#O(){return this.#a?!0:this.#r?this.#w()=this.#p){const t=this.#n[this.#s],o=this.#l-(e-t);return this.#T(o),!0}return!1}if(this.#u===void 0){const t=this.#I-e;if(t<0){if(this.#g>0){const o=e-this.#g;if(o{this.#z()},e))}#k(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}#P(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#$(){if(this.#t.size===0){if(this.#k(),this.emit("empty"),this.#e===0){if(this.#P(),this.#r&&this.#s>0){const t=Date.now();this.#_(t)}this.emit("idle")}return!1}let e=!1;if(!this.#h){const t=Date.now(),o=!this.#B(t);if(this.#O&&this.#M){const d=this.#t.dequeue();this.#a||(this.#L(t),this.#m()),this.emit("active"),d(),o&&this.#N(),e=!0}}return e}#N(){this.#a||this.#u!==void 0||this.#r||(this.#u=setInterval(()=>{this.#S()},this.#l),this.#I=Date.now()+this.#l)}#S(){this.#r||(this.#o===0&&this.#e===0&&this.#u&&this.#k(),this.#o=this.#i?this.#e:0),this.#x(),this.#m()}#x(){for(;this.#$(););}get concurrency(){return this.#y}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#y=e,this.#x()}setPriority(e,t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#t.setPriority(e,t)}async add(e,t={}){return t={timeout:this.timeout,...t,id:t.id??(this.#E++).toString()},new Promise((o,d)=>{const a=Symbol(`task-${t.id}`);this.#t.enqueue(async()=>{this.#e++,this.#b.set(a,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});let m;try{try{t.signal?.throwIfAborted()}catch(i){throw this.#q(),this.#b.delete(a),i}this.#g=Date.now();let u=e({signal:t.signal});if(t.timeout&&(u=vt(Promise.resolve(u),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#e} running, ${this.#t.size} waiting)`})),t.signal){const{signal:i}=t;u=Promise.race([u,new Promise((s,c)=>{m=()=>{c(i.reason)},i.addEventListener("abort",m,{once:!0})})])}const n=await u;o(n),this.emit("completed",n)}catch(u){d(u),this.emit("error",u)}finally{m&&t.signal?.removeEventListener("abort",m),this.#b.delete(a),queueMicrotask(()=>{this.#U()})}},t),this.emit("add"),this.#$()})}async addAll(e,t){return Promise.all(e.map(async o=>this.add(o,t)))}start(){return this.#h?(this.#h=!1,this.#x(),this):this}pause(){this.#h=!0}clear(){this.#t=new this.#V,this.#k(),this.#C(),this.emit("empty"),this.#e===0&&(this.#P(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#t.size!==0&&await this.#d("empty")}async onSizeLessThan(e){this.#t.sizethis.#t.size{const o=d=>{this.off("error",o),t(d)};this.on("error",o)})}async#d(e,t){return new Promise(o=>{const d=()=>{t&&!t()||(this.off(e,d),o())};this.on(e,d)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#e}get isPaused(){return this.#h}#F(){this.#a||(this.on("add",()=>{this.#t.size>0&&this.#m()}),this.on("next",()=>{this.#m()}))}#m(){this.#a||this.#v||(this.#v=!0,queueMicrotask(()=>{this.#v=!1,this.#C()}))}#q(){this.#a||(this.#D(),this.#m())}#C(){const e=this.#f;if(this.#a||this.#t.size===0){e&&(this.#f=!1,this.emit("rateLimitCleared"));return}let t;if(this.#r){const d=Date.now();this.#_(d),t=this.#w()}else t=this.#o;const o=t>=this.#p;o!==e&&(this.#f=o,this.emit(o?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#f}get isSaturated(){return this.#e===this.#y&&this.#t.size>0||this.isRateLimited&&this.#t.size>0}get runningTasks(){return[...this.#b.values()].map(e=>({...e}))}}export{nt as N,Nt as P,Pt as a}; //# sourceMappingURL=NcBreadcrumbs-5gl8Syfa-BsIGEccC.chunk.mjs.map