@phila/phila-ui-date-field 0.0.9-beta.4 → 0.1.0-beta.5

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/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseProps } from '@phila/phila-ui-core';
1
+ import { BaseProps, UseVisibilityProps } from '@phila/phila-ui-core';
2
2
  import { TextFieldProps } from '@phila/phila-ui-text-field';
3
3
  import { Dayjs } from 'dayjs';
4
4
  export { default as DateField } from './DateField.vue';
@@ -7,7 +7,7 @@ export interface DatePickerOptions {
7
7
  openOnClick?: boolean;
8
8
  openOnHover?: boolean;
9
9
  }
10
- export interface DateFieldProps extends BaseProps, TextFieldProps {
10
+ export interface DateFieldProps extends BaseProps, UseVisibilityProps, TextFieldProps {
11
11
  format?: string;
12
12
  datePicker?: boolean;
13
13
  imaskProps?: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,cAAc;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AACD,eAAO,MAAM,aAAa,GAAI,KAAK,KAAK,GAAG,MAAM,EAAE,MAAM,IAAI,EAAE,MAAM,IAAI,KAAG,OAc3E,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,OAAO,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AACD,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,kBAAkB,EAAE,cAAc;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AACD,eAAO,MAAM,aAAa,GAAI,KAAK,KAAK,GAAG,MAAM,EAAE,MAAM,IAAI,EAAE,MAAM,IAAI,KAAG,OAc3E,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const i=require("vue"),$=require("@phila/phila-ui-core"),Ie=["disabled"],Te=i.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(u){const e=u,t=r=>"href"in r&&r.href!==void 0||"to"in r&&r.to!==void 0,s=i.computed(()=>$.cn("phila-button",`phila-button--${e.variant}`,e.size&&`is-${e.size}`,e.iconOnly&&"icon-button",e.iconOnly&&e.variant==="standard"&&"icon-button--standard",e.className)),a=i.computed(()=>t(e)?"to"in e&&e.to!==void 0?{to:e.to,disabled:e.disabled,className:s.value}:{href:e.href,target:e.target,rel:e.rel,disabled:e.disabled,className:s.value}:{}),n=i.computed(()=>({iconDefinition:e.iconDefinition,iconClass:e.iconClass,src:e.src,iconRight:e.iconRight,iconOnly:e.iconOnly,text:e.text,size:e.size}));return(r,o)=>t(e)?(i.openBlock(),i.createBlock(i.unref($.BaseLink),i.mergeProps({key:0},{...a.value,...r.$attrs},{role:"button"}),{default:i.withCtx(()=>[i.createVNode(i.unref($.ActionContent),i.normalizeProps(i.guardReactiveProps(n.value)),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(e.text),1)])]),_:3},16)]),_:3},16)):(i.openBlock(),i.createElementBlock("button",i.mergeProps({key:1,type:"button",disabled:e.disabled,class:s.value},r.$attrs),[i.createVNode(i.unref($.ActionContent),i.normalizeProps(i.guardReactiveProps(n.value)),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(e.text),1)])]),_:3},16)],16,Ie))}});var Pe={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Re=Pe,Oe={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},Le=Oe;function ee(u){return typeof u=="string"||u instanceof String}function Ae(u){var e;return typeof u=="object"&&u!=null&&(u==null||(e=u.constructor)==null?void 0:e.name)==="Object"}function De(u,e){return Array.isArray(e)?De(u,(t,s)=>e.includes(s)):Object.entries(u).reduce((t,s)=>{let[a,n]=s;return e(n,a)&&(t[a]=n),t},{})}const g={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ne(u){switch(u){case g.LEFT:return g.FORCE_LEFT;case g.RIGHT:return g.FORCE_RIGHT;default:return u}}function ve(u){return u.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function ce(u,e){if(e===u)return!0;const t=Array.isArray(e),s=Array.isArray(u);let a;if(t&&s){if(e.length!=u.length)return!1;for(a=0;a<e.length;a++)if(!ce(e[a],u[a]))return!1;return!0}if(t!=s)return!1;if(e&&u&&typeof e=="object"&&typeof u=="object"){const n=e instanceof Date,r=u instanceof Date;if(n&&r)return e.getTime()==u.getTime();if(n!=r)return!1;const o=e instanceof RegExp,l=u instanceof RegExp;if(o&&l)return e.toString()==u.toString();if(o!=l)return!1;const h=Object.keys(e);for(a=0;a<h.length;a++)if(!Object.prototype.hasOwnProperty.call(u,h[a]))return!1;for(a=0;a<h.length;a++)if(!ce(u[h[a]],e[h[a]]))return!1;return!0}else if(e&&u&&typeof e=="function"&&typeof u=="function")return e.toString()===u.toString();return!1}class $e{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?g.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?g.RIGHT:g.LEFT}}function E(u,e){return new E.InputMask(u,e)}function Se(u){if(u==null)throw new Error("mask property should be defined");return u instanceof RegExp?E.MaskedRegExp:ee(u)?E.MaskedPattern:u===Date?E.MaskedDate:u===Number?E.MaskedNumber:Array.isArray(u)||u===Array?E.MaskedDynamic:E.Masked&&u.prototype instanceof E.Masked?u:E.Masked&&u instanceof E.Masked?u.constructor:u instanceof Function?E.MaskedFunction:E.Masked}function ue(u){if(!u)throw new Error("Options in not defined");if(E.Masked){if(u.prototype instanceof E.Masked)return{mask:u};const{mask:e=void 0,...t}=u instanceof E.Masked?{mask:u}:Ae(u)&&u.mask instanceof E.Masked?u:{};if(e){const s=e.mask;return{...De(e,(a,n)=>!n.startsWith("_")),mask:e.constructor,_mask:s,...t}}}return Ae(u)?{...u}:{mask:u}}function X(u){if(E.Masked&&u instanceof E.Masked)return u;const e=ue(u),t=Se(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}E.createMask=X;class Ce{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}E.MaskElement=Ce;const xe=90,Ue=89;class fe extends Ce{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return(e=(t=(s=this.input).getRootNode)==null?void 0:t.call(s))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===xe&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===Ue&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===xe&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}E.HTMLMaskElement=fe;class Ye extends fe{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}E.HTMLMaskElement=fe;class Be extends fe{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||s==null||s<a?s:a}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,a=t&&t.focusOffset;return a==null||s==null||s>a?s:a}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);const a=this.rootElement,n=a.getSelection&&a.getSelection();n&&(n.removeAllRanges(),n.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}E.HTMLContenteditableMaskElement=Be;class me{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>me.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}me.MAX_LENGTH=100;class ze{constructor(e,t){this.el=e instanceof Ce?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Be(e):new Ye(e),this.masked=X(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new me,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof E.Masked)&&this.masked.constructor===Se(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof E.Masked?e:X({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const s=this._listeners[e];s&&s.forEach(a=>a(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue,this.el.value,this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,s=this.masked.value,a=this.masked.rawInputValue,n=this.displayValue,r=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==a;this._unmaskedValue=t,this._value=s,this._rawInputValue=a,this.el.value!==n&&(this.el.value=n),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...s}=e,a=!this.maskEquals(t),n=this.masked.optionsIsChanged(s);a&&(this.mask=t),n&&this.masked.updateOptions(s),(a||n)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,g.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new $e({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,a=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,n=s===this.masked.rawInputValue?t.removeDirection:g.NONE;let r=this.masked.nearestInputPos(t.startChangePos+a,n);n!==g.NONE&&(r=this.masked.nearestInputPos(r,g.NONE)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}E.InputMask=ze;class F{static normalize(e){return Array.isArray(e)?e:[e,new F]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}E.ChangeDetails=F;class G{constructor(e,t,s){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class U{constructor(e){this._value="",this._update({...U.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new G(this.extractInput(e,t),e)}appendTail(e){return ee(e)&&(e=new G(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new F({inserted:e,rawInserted:e})):new F}_appendChar(e,t,s){t===void 0&&(t={});const a=this.state;let n;if([e,n]=this.doPrepareChar(e,t),e&&(n=n.aggregate(this._appendCharRaw(e,t)),!n.rawInserted&&this.autofix==="pad")){const r=this.state;this.state=a;let o=this.pad(t);const l=this._appendCharRaw(e,t);o=o.aggregate(l),l.rawInserted||o.equals(n)?n=o:this.state=r}if(n.inserted){let r,o=this.doValidate(t)!==!1;if(o&&s!=null){const l=this.state;if(this.overwrite===!0){r=s.state;for(let d=0;d<n.rawInserted.length;++d)s.unshift(this.displayValue.length-n.tailShift)}let h=this.appendTail(s);if(o=h.rawInserted.length===s.toString().length,!(o&&h.inserted)&&this.overwrite==="shift"){this.state=l,r=s.state;for(let d=0;d<n.rawInserted.length;++d)s.shift();h=this.appendTail(s),o=h.rawInserted.length===s.toString().length}o&&h.inserted&&(this.state=l)}o||(n=new F,this.state=a,s&&r&&(s.state=r))}return n}_appendPlaceholder(){return new F}_appendEager(){return new F}append(e,t,s){if(!ee(e))throw new Error("value should be string");const a=ee(s)?new G(String(s)):s;t!=null&&t.tail&&(t._beforeTailState=this.state);let n;[e,n]=this.doPrepare(e,t);for(let r=0;r<e.length;++r){const o=this._appendChar(e[r],t,a);if(!o.rawInserted&&!this.doSkipInvalid(e[r],t,a))break;n.aggregate(o)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&n.aggregate(this._appendEager()),a!=null&&(n.tailShift+=this.appendTail(a).tailShift),n}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new F}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,s=this.value,a=e();return this.rawInputValue=t,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,a}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),F.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),F.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,a,n){s===void 0&&(s=""),a===void 0&&(a=g.NONE),n===void 0&&(n={input:!0});const r=e+t,o=this.extractTail(r),l=this.eager===!0||this.eager==="remove";let h;l&&(a=Ne(a),h=this.extractInput(0,r,{raw:!0}));let d=e;const p=new F;if(a!==g.NONE&&(d=this.nearestInputPos(e,t>1&&e!==0&&!l?g.NONE:a),p.tailShift=d-e),p.aggregate(this.remove(d)),l&&a!==g.NONE&&h===this.rawInputValue)if(a===g.FORCE_LEFT){let _;for(;h===this.rawInputValue&&(_=this.displayValue.length);)p.aggregate(new F({tailShift:-1})).aggregate(this.remove(_-1))}else a===g.FORCE_RIGHT&&o.unshift();return p.aggregate(this.append(s,n,o))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!ce(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||U.EMPTY_VALUES.includes(e)&&U.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new F}}U.DEFAULTS={skipInvalid:!0};U.EMPTY_VALUES=[void 0,null,""];E.Masked=U;class ae{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ee(e)?new G(String(e)):e;const t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof G)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof ae){if(e.stop==null){let a;for(;e.chunks.length&&e.chunks[0].stop==null;)a=e.chunks.shift(),a.from+=e.from,this.extend(a)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof E.MaskedPattern))return new G(this.toString()).appendTo(e);const t=new F;for(let s=0;s<this.chunks.length;++s){const a=this.chunks[s],n=e._mapPosToBlock(e.displayValue.length),r=a.stop;let o;if(r!=null&&(!n||n.index<=r)&&((a instanceof ae||e._stops.indexOf(r)>=0)&&t.aggregate(e._appendPlaceholder(r)),o=a instanceof ae&&e._blocks[r]),o){const l=o.appendTail(a);t.aggregate(l);const h=a.toString().slice(l.rawInserted.length);h&&t.aggregate(e.append(h,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(a=>{const n="chunks"in a?new ae:new G;return n.state=a,n})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let s=0;for(;s<this.chunks.length;){const a=this.chunks[s],n=a.unshift(t);if(a.toString()){if(!n)break;++s}else this.chunks.splice(s,1);if(n)return n}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class je{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:a}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=a,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,g.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,g.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,g.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,g.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,g.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,g.NONE),!0})}}class Ve{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new F}nearestInputPos(e,t){t===void 0&&(t=g.NONE);const s=0,a=this._value.length;switch(t){case g.LEFT:case g.FORCE_LEFT:return s;case g.NONE:case g.RIGHT:case g.FORCE_RIGHT:default:return a}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new F;const s=this.eager===!0||this.eager==="append",a=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,n=new F({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new F;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new G("")}appendTail(e){return ee(e)&&(e=new G(String(e))),e.appendTo(this)}append(e,t,s){const a=this._appendChar(e[0],t);return s!=null&&(a.tailShift+=this.appendTail(s).tailShift),a}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class pe{constructor(e){const{parent:t,isOptional:s,placeholderChar:a,displayChar:n,lazy:r,eager:o,...l}=e;this.masked=X(l),Object.assign(this,{parent:t,isOptional:s,placeholderChar:a,displayChar:n,lazy:r,eager:o})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new F}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new F;const s=this.masked.state;let a=this.masked._appendChar(e,this.currentMaskFlags(t));return a.inserted&&this.doValidate(t)===!1&&(a=new F,this.masked.state=s),!a.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(a.inserted=this.placeholderChar),a.skip=!a.inserted&&!this.isOptional,this.isFilled=!!a.inserted,a}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new F:(this.isFilled=!0,new F({inserted:this.placeholderChar}))}_appendEager(){return new F}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){t===void 0&&(t=g.NONE);const s=0,a=this.value.length,n=Math.min(Math.max(e,s),a);switch(t){case g.LEFT:case g.FORCE_LEFT:return this.isComplete?n:s;case g.RIGHT:case g.FORCE_RIGHT:return this.isComplete?n:a;case g.NONE:default:return n}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||e?._beforeTailState}}pad(e){return new F}}pe.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class He extends U{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=s=>s.search(t)>=0),super._update(e)}}E.MaskedRegExp=He;class Y extends U{constructor(e){super({...Y.DEFAULTS,...e,definitions:Object.assign({},pe.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let s=!1,a=!1;for(let n=0;n<t.length;++n){if(this.blocks){const h=t.slice(n),d=Object.keys(this.blocks).filter(_=>h.indexOf(_)===0);d.sort((_,v)=>v.length-_.length);const p=d[0];if(p){const{expose:_,repeat:v,...V}=ue(this.blocks[p]),B={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...V,repeat:v,parent:this},T=v!=null?new E.RepeatBlock(B):X(B);T&&(this._blocks.push(T),_&&(this.exposeBlock=T),this._maskedBlocks[p]||(this._maskedBlocks[p]=[]),this._maskedBlocks[p].push(this._blocks.length-1)),n+=p.length-1;continue}}let r=t[n],o=r in e;if(r===Y.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(r==="{"||r==="}"){s=!s;continue}if(r==="["||r==="]"){a=!a;continue}if(r===Y.ESCAPE_CHAR){if(++n,r=t[n],!r)break;o=!1}const l=o?new pe({isOptional:a,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ue(e[r]),parent:this}):new Ve({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...s}=e;this._blocks.forEach((a,n)=>a.state=t[n]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new F;let s=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(s==null)return t;this._blocks[s].isFilled&&++s;for(let a=s;a<this._blocks.length;++a){const n=this._blocks[a]._appendEager();if(!n.inserted)break;t.aggregate(n)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._mapPosToBlock(this.displayValue.length),a=new F;if(!s)return a;for(let r=s.index,o;o=this._blocks[r];++r){var n;const l=o._appendChar(e,{...t,_beforeTailState:(n=t._beforeTailState)==null||(n=n._blocks)==null?void 0:n[r]});if(a.aggregate(l),l.consumed)break}return a}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=new ae;return e===t||this._forEachBlocksInRange(e,t,(a,n,r,o)=>{const l=a.extractTail(r,o);l.stop=this._findStopBefore(n),l.from=this._blockStartPos(n),l instanceof ae&&(l.blockIndex=n),s.extend(l)}),s}extractInput(e,t,s){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),s===void 0&&(s={}),e===t)return"";let a="";return this._forEachBlocksInRange(e,t,(n,r,o,l)=>{a+=n.extractInput(o,l,s)}),a}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){const a=this._stops[s];if(a<=e)t=a;else break}return t}_appendPlaceholder(e){const t=new F;if(this.lazy&&e==null)return t;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;const a=s.index,n=e??this._blocks.length;return this._blocks.slice(a,n).forEach(r=>{if(!r.lazy||e!=null){var o;t.aggregate(r._appendPlaceholder((o=r._blocks)==null?void 0:o.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){const a=this._blocks[s],n=t.length;if(t+=a.displayValue,e<=t.length)return{index:s,offset:e-n}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,s)=>t+=s.displayValue.length,0)}_forEachBlocksInRange(e,t,s){t===void 0&&(t=this.displayValue.length);const a=this._mapPosToBlock(e);if(a){const n=this._mapPosToBlock(t),r=n&&a.index===n.index,o=a.offset,l=n&&r?n.offset:this._blocks[a.index].displayValue.length;if(s(this._blocks[a.index],a.index,o,l),n&&!r){for(let h=a.index+1;h<n.index;++h)s(this._blocks[h],h,0,this._blocks[h].displayValue.length);s(this._blocks[n.index],n.index,0,n.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(a,n,r,o)=>{s.aggregate(a.remove(r,o))}),s}nearestInputPos(e,t){if(t===void 0&&(t=g.NONE),!this._blocks.length)return 0;const s=new je(this,e);if(t===g.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===g.LEFT||t===g.FORCE_LEFT){if(t===g.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===g.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===g.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return t===g.RIGHT||t===g.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:t===g.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(e,g.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(a,n,r,o)=>{s+=a.totalInputPositions(r,o)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(s=>this._blocks[s]):[]}pad(e){const t=new F;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}Y.DEFAULTS={...U.DEFAULTS,lazy:!0,placeholderChar:"_"};Y.STOP_CHAR="`";Y.ESCAPE_CHAR="\\";Y.InputDefinition=pe;Y.FixedDefinition=Ve;E.MaskedPattern=Y;class he extends Y{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:s=this.from||0,maxLength:a=this.maxLength||0,autofix:n=this.autofix,...r}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,a),this.autofix=n;const o=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let h=0;for(;h<l.length&&l[h]===o[h];)++h;r.mask=l.slice(0,h).replace(/0/g,"\\0")+"0".repeat(this.maxLength-h),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="";const[,a,n]=e.match(/^(\D*)(\d*)(\D*)/)||[];return n&&(t="0".repeat(a.length)+n,s="9".repeat(a.length)+n),t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[t,s]}doPrepareChar(e,t){t===void 0&&(t={});let s;return[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const s=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),[n,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],t):Number(n)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(a[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[s,a]=this.boundaries(t);return this.from<=Number(a)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){const t=new F;if(this.value.length===this.maxLength)return t;const s=this.value,a=this.maxLength-this.value.length;if(a){this.reset();for(let n=0;n<a;++n)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(n=>this._appendCharRaw(n))}return t}}E.MaskedRange=he;const qe="d{.}`m{.}`Y";class W extends Y{static extractPatternOptions(e){const{mask:t,pattern:s,...a}=e;return{...a,mask:ee(t)?t:s}}constructor(e){super(W.extractPatternOptions({...W.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:s,blocks:a,...n}={...W.DEFAULTS,...e},r=Object.assign({},W.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,a),super._update({...n,mask:ee(t)?t:s,blocks:r})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(W.extractPatternOptions(e))}}W.GET_DEFAULT_BLOCKS=()=>({d:{mask:he,from:1,to:31,maxLength:2},m:{mask:he,from:1,to:12,maxLength:2},Y:{mask:he,from:1900,to:9999}});W.DEFAULTS={...Y.DEFAULTS,mask:Date,pattern:qe,format:(u,e)=>{if(!u)return"";const t=String(u.getDate()).padStart(2,"0"),s=String(u.getMonth()+1).padStart(2,"0"),a=u.getFullYear();return[t,s,a].join(".")},parse:(u,e)=>{const[t,s,a]=u.split(".").map(Number);return new Date(a,s-1,t)}};E.MaskedDate=W;class ge extends U{constructor(e){super({...ge.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:s,...a}=ue(t),n=X({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...a});return s&&(this.exposeMask=n),n}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){e===void 0&&(e=""),t===void 0&&(t={}),s===void 0&&(s="");const a=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,n=this.rawInputValue,r=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:n,o=n.slice(r.length),l=this.currentMask,h=new F,d=l?.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),h.tailShift=this.currentMask.value.length-a.length),o&&(h.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift)):d&&(this.currentMask.state=d)),h}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new F;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((s=e._beforeTailState)==null?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return t===void 0&&(t={}),s===void 0&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[s,a]=super.doPrepare(e,t);if(this.currentMask){let n;[s,n]=super.doPrepare(s,this.currentMaskFlags(t)),a=a.aggregate(n)}return[s,a]}doPrepareChar(e,t){t===void 0&&(t={});let[s,a]=super.doPrepareChar(e,t);if(this.currentMask){let n;[s,n]=super.doPrepareChar(s,this.currentMaskFlags(t)),a=a.aggregate(n)}return[s,a]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const s=new F;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:s,currentMask:a,...n}=e;t&&this.compiledMasks.forEach((r,o)=>r.state=t[o]),s!=null&&(this.currentMask=s,this.currentMask.state=a),super.state=n}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;const{mask:a,...n}=e[s];return ce(t,n)&&t.maskEquals(a)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}ge.DEFAULTS={...U.DEFAULTS,dispatch:(u,e,t,s)=>{if(!e.compiledMasks.length)return;const a=e.rawInputValue,n=e.compiledMasks.map((r,o)=>{const l=e.currentMask===r,h=l?r.displayValue.length:r.nearestInputPos(r.displayValue.length,g.FORCE_LEFT);return r.rawInputValue!==a?(r.reset(),r.append(a,{raw:!0})):l||r.remove(h),r.append(u,e.currentMaskFlags(t)),r.appendTail(s),{index:o,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(h,r.nearestInputPos(r.displayValue.length,g.FORCE_LEFT)))}});return n.sort((r,o)=>o.weight-r.weight||o.totalInputPositions-r.totalInputPositions),e.compiledMasks[n[0].index]}};E.MaskedDynamic=ge;class ke extends Y{constructor(e){super({...ke.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...s}=e;if(t){const a=t.map(o=>o.length),n=Math.min(...a),r=Math.max(...a)-n;s.mask="*".repeat(n),r&&(s.mask+="["+"*".repeat(r)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){t===void 0&&(t={});const s=Math.min(this.nearestInputPos(0,g.FORCE_RIGHT),this.value.length),a=this.enum.filter(n=>this.matchValue(n,this.unmaskedValue+e,s));if(a.length){a.length===1&&this._forEachBlocksInRange(0,this.value.length,(r,o)=>{const l=a[0][o];o>=this.value.length||l===r.value||(r.reset(),r._appendChar(l,t))});const n=super._appendCharRaw(a[0][this.value.length],t);return a.length===1&&a[0].slice(this.unmaskedValue.length).split("").forEach(r=>n.aggregate(super._appendCharRaw(r))),n}return new F({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new G("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new F;const s=Math.min(super.nearestInputPos(0,g.FORCE_RIGHT),this.value.length);let a;for(a=e;a>=0&&!(this.enum.filter(r=>this.matchValue(r,this.value.slice(s,a),s)).length>1);--a);const n=super.remove(a,t);return n.tailShift+=a-e,n}get isComplete(){return this.enum.indexOf(this.value)>=0}}ke.DEFAULTS={...Y.DEFAULTS,matchValue:(u,e,t)=>u.indexOf(e,t)===t};E.MaskedEnum=ke;class Ke extends U{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}E.MaskedFunction=Ke;var Me;class j extends U{constructor(e){super({...j.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",s=(this.scale?"("+ve(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(ve).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(ve(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[s,a]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(a.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&a.aggregate(this._appendChar("-")),[s,a]}_separatorsCount(e,t){t===void 0&&(t=!1);let s=0;for(let a=0;a<e;++a)this._value.indexOf(this.thousandsSeparator,a)===a&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){t===void 0&&(t={});const s=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const n=this._value;this._value+=e;const r=this.number;let o=!isNaN(r),l=!1;if(o){let _;this.min!=null&&this.min<0&&this.number<this.min&&(_=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(_=this.max),_!=null&&(this.autofix?(this._value=this.format(_,this).replace(j.UNMASKED_RADIX,this.radix),l||(l=n===this._value&&!t.tail)):o=!1),o&&(o=!!this._value.match(this._numberRegExp))}let h;o?h=new F({inserted:this._value.slice(n.length),rawInserted:l?"":e,skip:l}):(this._value=n,h=new F),this._value=this._insertThousandsSeparators(this._value);const d=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,p=this._separatorsCountFromSlice(d);return h.tailShift+=(p-a)*this.thousandsSeparator.length,h}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,t){const s=this._findSeparatorAround(e);s>=0&&(e=s);const a=this._findSeparatorAround(t);return a>=0&&(t=a+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const s=this.value.slice(0,e),a=this.value.slice(t),n=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+a));const r=this._separatorsCountFromSlice(s);return new F({tailShift:(r-n)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case g.NONE:case g.LEFT:case g.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const a=s+this.thousandsSeparator.length;if(e<a||this.value.length<=a||t===g.FORCE_LEFT)return s}break}case g.RIGHT:case g.FORCE_RIGHT:{const s=this._findSeparatorAround(e);if(s>=0)return s+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(s,a,n,r)=>a+r),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){t===void 0&&(t={});const a=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===j.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!a}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,j.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(j.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||j.EMPTY_VALUES.includes(e)&&j.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Me=j;j.UNMASKED_RADIX=".";j.EMPTY_VALUES=[...U.EMPTY_VALUES,0];j.DEFAULTS={...U.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Me.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:u=>u.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};E.MaskedNumber=j;const _e={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function we(u,e,t){e===void 0&&(e=_e.MASKED),t===void 0&&(t=_e.MASKED);const s=X(u);return a=>s.runIsolated(n=>(n[e]=a,n[t]))}function Ge(u,e,t,s){return we(e,t,s)(u)}E.PIPE_TYPE=_e;E.createPipe=we;E.pipe=Ge;class Ze extends Y{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,a;const{repeat:n,...r}=ue(e);this._blockOpts=Object.assign({},this._blockOpts,r);const o=X(this._blockOpts);this.repeat=(t=(s=n??o.repeat)!=null?s:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((a=this._blocks)==null?void 0:a.length)||0,this.repeatFrom)),blocks:{m:o},eager:o.eager,overwrite:o.overwrite,skipInvalid:o.skipInvalid,lazy:o.lazy,placeholderChar:o.placeholderChar,displayChar:o.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(X(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const s=new F;for(let l=(a=(n=this._mapPosToBlock(this.displayValue.length))==null?void 0:n.index)!=null?a:Math.max(this._blocks.length-1,0),h,d;h=(r=this._blocks[l])!=null?r:d=!d&&this._allocateBlock(l);++l){var a,n,r,o;const p=h._appendChar(e,{...t,_beforeTailState:(o=t._beforeTailState)==null||(o=o._blocks)==null?void 0:o[l]});if(p.skip&&d){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(p),p.consumed)break}return s}_trimEmptyTail(e,t){var s,a;e===void 0&&(e=0);const n=Math.max(((s=this._mapPosToBlock(e))==null?void 0:s.index)||0,this.repeatFrom,0);let r;t!=null&&(r=(a=this._mapPosToBlock(t))==null?void 0:a.index),r==null&&(r=this._blocks.length-1);let o=0;for(let l=r;n<=l&&!this._blocks[l].unmaskedValue;--l,++o);o&&(this._blocks.splice(r-o+1,o),this.mask=this.mask.slice(o))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}E.RepeatBlock=Ze;try{globalThis.IMask=E}catch{}var We={mask:void 0,prepare:Function,prepareChar:Function,validate:Function,commit:Function,overwrite:{type:Boolean,required:!1,default:void 0},eager:{required:!1,default:void 0,validator:u=>["append","remove"].includes(u)||typeof u=="boolean"},skipInvalid:{type:Boolean,required:!1,default:void 0},placeholderChar:String,displayChar:String,lazy:{type:Boolean,required:!1,default:void 0},definitions:Object,blocks:Object,enum:Array,maxLength:Number,from:Number,to:Number,pattern:String,format:Function,parse:Function,autofix:{required:!1,default:void 0,validator:u=>u==="pad"||typeof u=="boolean"},radix:String,thousandsSeparator:String,mapToRadix:Array,scale:Number,normalizeZeros:{type:Boolean,required:!1,default:void 0},padFractionalZeros:{type:Boolean,required:!1,default:void 0},min:[Number,Date],max:[Number,Date],dispatch:Function};function Xe(u,e){let{emit:t,onAccept:s,onComplete:a,defaultValue:n,defaultUnmaskedValue:r,defaultTypedValue:o}=e===void 0?{}:e;const l=i.isRef(u)?u:i.ref(u),h=i.ref(),d=i.ref(),p=i.ref(""),_=i.ref(""),v=i.ref();let V,B=p.value,T=_.value,H=v.value;function J(){H=v.value=d.value.typedValue,T=_.value=d.value.unmaskedValue,B=p.value=d.value.value}function D(b){J(),t&&(t("accept",p.value,b),t("accept:masked",p.value,b),t("accept:typed",v.value,b),t("accept:unmasked",_.value,b)),s?.(b)}function P(b){t&&(t("complete",d.value.value,b),t("complete:masked",d.value.value,b),t("complete:typed",d.value.typedValue,b),t("complete:unmasked",d.value.unmaskedValue,b)),a?.(b)}const y=()=>{!d.value||_.value===void 0||(T!==_.value&&(d.value.unmaskedValue=_.value,d.value.unmaskedValue!==_.value&&D()),T=void 0)};i.watch(_,y);const w=()=>{!d.value||p.value===void 0||(B!==p.value&&(d.value.value=p.value,d.value.value!==p.value&&D()),B=void 0)};i.watch(p,w);const L=()=>{!d.value||v.value===void 0||(H!==v.value&&(d.value.typedValue=v.value,d.value.masked.typedValueEquals(v.value)||D()),H=void 0)};i.watch(v,L);function R(){V=h.value;const b=l.value;!V||!(b!=null&&b.mask)||(d.value=E(V,b),n!==void 0&&(p.value=n),r!==void 0&&(_.value=r),o!==void 0&&(v.value=o),y(),w(),L(),J(),d.value.on("accept",D).on("complete",P))}function Z(){var b;(b=d.value)==null||b.destroy(),d.value=void 0}return i.onMounted(R),i.onUnmounted(Z),i.watch([h,l],()=>{const b=h.value,S=l.value;(!(S!=null&&S.mask)||b!==V)&&Z(),b&&(d.value?d.value.updateOptions(S):R())}),{el:h,mask:i.readonly(d),masked:p,unmasked:_,typed:v}}function Je(u,e){return u={...u},Object.keys(u).forEach(t=>{(u[t]===void 0||e.includes(t))&&delete u[t]}),u}const Qe=["typed","unmasked","value","modelValue"];var et=i.defineComponent({name:"imask-input",inheritAttrs:!1,props:{modelValue:String,value:String,unmasked:String,typed:{validator:()=>!0},...We},emits:["update:modelValue","update:masked","update:value","update:unmasked","update:typed","accept","accept:value","accept:masked","accept:unmasked","accept:typed","complete","complete:value","complete:masked","complete:unmasked","complete:typed"],setup(u,e){let{attrs:t,emit:s}=e;const{el:a,mask:n,masked:r,unmasked:o,typed:l}=Xe(Je(u,Qe),{emit:s,onAccept:v=>{const V=r.value;s("accept:value",V,v),s("update:value",V,v),s("update:masked",V,v),s("update:modelValue",V,v),s("update:unmasked",o.value,v),s("update:typed",l.value,v)},onComplete:v=>{s("complete:value",r.value,v)}}),h=i.toRef(u,"value"),d=i.toRef(u,"modelValue"),p=i.toRef(u,"unmasked"),_=i.toRef(u,"typed");return r.value=d.value||h.value||"",o.value=p.value||"",l.value=_.value,i.watch(h,v=>r.value=v),i.watch(d,v=>r.value=v),i.watch(p,v=>o.value=v),i.watch(_,v=>l.value=v),()=>{const v={...t,value:u.value!=null?u.value:u.modelValue!=null?u.modelValue:n.value?n.value.displayValue:"",ref:a};return u.mask||(v.onInput=V=>{s("update:modelValue",V.target.value),s("update:value",V.target.value)}),i.h("input",v)}}}),tt=et;const st=["for"],at={class:"state-layer"},it={class:"content"},nt={class:"input-text-container"},rt=["id","placeholder","aria-label"],ut={key:1,class:"has-text-body-small phila-supporting-text"},ot={key:2,class:"has-text-body-small phila-error-text"},be=i.defineComponent({inheritAttrs:!1,__name:"TextField",props:{modelValue:{default:void 0},className:{default:""},label:{default:""},id:{default:`phila-text-field-${Math.random().toString(36).substring(2,9)}`},imaskProps:{default:void 0},supportingText:{default:""},placeholder:{default:""},leadingIcon:{default:""},trailingIcon:{default:""},error:{default(){return[]}}},emits:["update:modelValue","complete"],setup(u,{expose:e,emit:t}){const s=i.useAttrs(),a=u,n=i.computed(()=>typeof a.error=="string"?a.error:a.error[0]),r=i.toRef(a,"id"),o=t,l=i.ref(""),h=i.computed({get:()=>a.modelValue!==void 0?a.modelValue:l.value,set:B=>{o("update:modelValue",B),l.value=B}}),d=i.computed(()=>{const B=["default-class"];return s.disabled!=null&&B.push("phila-input--disabled"),n.value&&B.push("phila-input--error"),s.required!=null&&B.push("phila-input--required"),$.cn(...B)}),p=i.computed(()=>{const B=[];return h.value!==""&&B.push("phila-text-field--filled"),a.className&&B.push(a.className),$.cn(...B)}),_=i.computed(()=>{if(!(a.label||s["aria-label"]))return a.placeholder||void 0}),v=i.ref(null),V=B=>{B.target.closest("button")||v.value?.focus()};return e({inputRef:v}),(B,T)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["phila-input",d.value])},[a.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:r.value,class:"has-text-label-small phila-label"},i.toDisplayString(a.label),9,st)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["phila-text-field",p.value]),onClick:i.withModifiers(V,["prevent"])},[i.createElementVNode("div",at,[a.leadingIcon?(i.openBlock(),i.createBlock(i.unref($.Icon),{key:0,"icon-class":a.leadingIcon,inline:"",decorative:""},null,8,["icon-class"])):i.createCommentVNode("",!0),i.createElementVNode("div",it,[i.createElementVNode("div",nt,[a.imaskProps?.mask?(i.openBlock(),i.createBlock(i.unref(tt),i.mergeProps({key:0},{...i.unref(s),...a.imaskProps},{id:r.value,modelValue:h.value,"onUpdate:modelValue":T[0]||(T[0]=H=>h.value=H),class:"phila-text-field-input has-text-body-default",placeholder:a.placeholder,onComplete:T[1]||(T[1]=()=>o("complete",l.value))}),null,16,["id","modelValue","placeholder"])):i.withDirectives((i.openBlock(),i.createElementBlock("input",i.mergeProps({key:1,id:r.value,ref_key:"inputRef",ref:v},i.unref(s),{"onUpdate:modelValue":T[2]||(T[2]=H=>h.value=H),class:"phila-text-field-input has-text-body-default",placeholder:a.placeholder,"aria-label":_.value}),null,16,rt)),[[i.vModelDynamic,h.value]])])]),h.value!=""?(i.openBlock(),i.createBlock(i.unref(Te),{key:1,variant:"standard",size:"small","icon-only":"","icon-definition":i.unref(Le),onClick:T[3]||(T[3]=H=>h.value="")},null,8,["icon-definition"])):i.createCommentVNode("",!0),a.trailingIcon?(i.openBlock(),i.createBlock(i.unref($.Icon),{key:2,size:"small","icon-class":a.trailingIcon,inline:"",decorative:""},null,8,["icon-class"])):i.createCommentVNode("",!0),i.renderSlot(B.$slots,"trailing-action")])],2),a.supportingText?(i.openBlock(),i.createElementBlock("div",ut,i.toDisplayString(a.supportingText),1)):i.createCommentVNode("",!0),n.value?(i.openBlock(),i.createElementBlock("div",ot,[i.createVNode(i.unref($.Icon),{"icon-definition":i.unref(Re),size:"small",inline:"",decorative:""},null,8,["icon-definition"]),i.createTextVNode(" "+i.toDisplayString(n.value),1)])):i.createCommentVNode("",!0)],2))}}),lt=["data-toggle","aria-label","aria-expanded","aria-controls"],ht=i.defineComponent({__name:"CollapsePanel",props:{className:{},id:{},group:{default:void 0},blurClose:{type:Boolean,default:!1},openSingle:{type:Boolean,default:!1},mouseOverToggle:{type:Boolean,default:!1},outsideClickClose:{type:Boolean,default:!1},escapeKeyClose:{type:Boolean,default:!1},toggleAttrs:{default:void 0}},setup(u){const e=u,{isCollapsed:t,onMouseEnter:s,onMouseLeave:a,onClickToggle:n,onClickOpen:r,focusChange:o}=$.useCollapse(e),l=i.computed(()=>t(e.id));return(h,d)=>(i.openBlock(),i.createElementBlock("div",{onMouseenter:d[1]||(d[1]=(...p)=>i.unref(s)&&i.unref(s)(...p)),onMouseleave:d[2]||(d[2]=(...p)=>i.unref(a)&&i.unref(a)(...p)),onFocusout:d[3]||(d[3]=(...p)=>i.unref(o)&&i.unref(o)(...p))},[i.renderSlot(h.$slots,"toggle",i.normalizeProps(i.guardReactiveProps({open:l.value,ariaLabel:l.value?"Close panel":"Open panel",ariaExpanded:l.value,ariaControls:u.id,onClickToggle:i.unref(n),onClickOpen:i.unref(r),focusChange:i.unref(o),onClick:i.unref(n)})),()=>[i.createElementVNode("button",i.mergeProps({"data-toggle":u.id,"aria-label":l.value?"Close panel":"Open panel","aria-expanded":l.value,"aria-controls":u.id},u.toggleAttrs,{onClick:d[0]||(d[0]=i.withModifiers((...p)=>i.unref(n)&&i.unref(n)(...p),["prevent"]))}),null,16,lt)]),i.renderSlot(h.$slots,"default",i.normalizeProps(i.guardReactiveProps({id:u.id,open:l.value,onClickToggle:i.unref(n),focusChange:i.unref(o),hidden:!l.value})))],32))}}),dt=["disabled"],ct=i.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(u){const e=u,t=r=>"href"in r&&r.href!==void 0||"to"in r&&r.to!==void 0,s=i.computed(()=>$.cn("phila-button",`phila-button--${e.variant}`,e.size&&`is-${e.size}`,e.iconOnly&&"icon-button",e.iconOnly&&e.variant==="standard"&&"icon-button--standard",e.className)),a=i.computed(()=>t(e)?"to"in e&&e.to!==void 0?{to:e.to,disabled:e.disabled,className:s.value}:{href:e.href,target:e.target,rel:e.rel,disabled:e.disabled,className:s.value}:{}),n=i.computed(()=>({iconDefinition:e.iconDefinition,iconClass:e.iconClass,src:e.src,iconRight:e.iconRight,iconOnly:e.iconOnly,text:e.text,size:e.size}));return(r,o)=>t(e)?(i.openBlock(),i.createBlock(i.unref($.BaseLink),i.mergeProps({key:0},{...a.value,...r.$attrs},{role:"button"}),{default:i.withCtx(()=>[i.createVNode(i.unref($.ActionContent),i.normalizeProps(i.guardReactiveProps(n.value)),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(e.text),1)])]),_:3},16)]),_:3},16)):(i.openBlock(),i.createElementBlock("button",i.mergeProps({key:1,type:"button",disabled:e.disabled,class:s.value},r.$attrs),[i.createVNode(i.unref($.ActionContent),i.normalizeProps(i.guardReactiveProps(n.value)),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(e.text),1)])]),_:3},16)],16,dt))}});var pt={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},ft=pt;function mt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var de={exports:{}},gt=de.exports,Fe;function kt(){return Fe||(Fe=1,(function(u,e){(function(t,s){u.exports=s()})(gt,(function(){var t=1e3,s=6e4,a=36e5,n="millisecond",r="second",o="minute",l="hour",h="day",d="week",p="month",_="quarter",v="year",V="date",B="Invalid Date",T=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,H=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,J={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(C){var m=["th","st","nd","rd"],c=C%100;return"["+C+(m[(c-20)%10]||m[c]||m[0])+"]"}},D=function(C,m,c){var k=String(C);return!k||k.length>=m?C:""+Array(m+1-k.length).join(c)+C},P={s:D,z:function(C){var m=-C.utcOffset(),c=Math.abs(m),k=Math.floor(c/60),f=c%60;return(m<=0?"+":"-")+D(k,2,"0")+":"+D(f,2,"0")},m:function C(m,c){if(m.date()<c.date())return-C(c,m);var k=12*(c.year()-m.year())+(c.month()-m.month()),f=m.clone().add(k,p),A=c-f<0,x=m.clone().add(k+(A?-1:1),p);return+(-(k+(c-f)/(A?f-x:x-f))||0)},a:function(C){return C<0?Math.ceil(C)||0:Math.floor(C)},p:function(C){return{M:p,y:v,w:d,d:h,D:V,h:l,m:o,s:r,ms:n,Q:_}[C]||String(C||"").toLowerCase().replace(/s$/,"")},u:function(C){return C===void 0}},y="en",w={};w[y]=J;var L="$isDayjsObject",R=function(C){return C instanceof oe||!(!C||!C[L])},Z=function C(m,c,k){var f;if(!m)return y;if(typeof m=="string"){var A=m.toLowerCase();w[A]&&(f=A),c&&(w[A]=c,f=A);var x=m.split("-");if(!f&&x.length>1)return C(x[0])}else{var M=m.name;w[M]=m,f=M}return!k&&f&&(y=f),f||!k&&y},b=function(C,m){if(R(C))return C.clone();var c=typeof m=="object"?m:{};return c.date=C,c.args=arguments,new oe(c)},S=P;S.l=Z,S.i=R,S.w=function(C,m){return b(C,{locale:m.$L,utc:m.$u,x:m.$x,$offset:m.$offset})};var oe=(function(){function C(c){this.$L=Z(c.locale,null,!0),this.parse(c),this.$x=this.$x||c.x||{},this[L]=!0}var m=C.prototype;return m.parse=function(c){this.$d=(function(k){var f=k.date,A=k.utc;if(f===null)return new Date(NaN);if(S.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var x=f.match(T);if(x){var M=x[2]-1||0,I=(x[7]||"0").substring(0,3);return A?new Date(Date.UTC(x[1],M,x[3]||1,x[4]||0,x[5]||0,x[6]||0,I)):new Date(x[1],M,x[3]||1,x[4]||0,x[5]||0,x[6]||0,I)}}return new Date(f)})(c),this.init()},m.init=function(){var c=this.$d;this.$y=c.getFullYear(),this.$M=c.getMonth(),this.$D=c.getDate(),this.$W=c.getDay(),this.$H=c.getHours(),this.$m=c.getMinutes(),this.$s=c.getSeconds(),this.$ms=c.getMilliseconds()},m.$utils=function(){return S},m.isValid=function(){return this.$d.toString()!==B},m.isSame=function(c,k){var f=b(c);return this.startOf(k)<=f&&f<=this.endOf(k)},m.isAfter=function(c,k){return b(c)<this.startOf(k)},m.isBefore=function(c,k){return this.endOf(k)<b(c)},m.$g=function(c,k,f){return S.u(c)?this[k]:this.set(f,c)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(c,k){var f=this,A=!!S.u(k)||k,x=S.p(c),M=function(se,z){var Q=S.w(f.$u?Date.UTC(f.$y,z,se):new Date(f.$y,z,se),f);return A?Q:Q.endOf(h)},I=function(se,z){return S.w(f.toDate()[se].apply(f.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(z)),f)},O=this.$W,N=this.$M,q=this.$D,ie="set"+(this.$u?"UTC":"");switch(x){case v:return A?M(1,0):M(31,11);case p:return A?M(1,N):M(0,N+1);case d:var te=this.$locale().weekStart||0,ne=(O<te?O+7:O)-te;return M(A?q-ne:q+(6-ne),N);case h:case V:return I(ie+"Hours",0);case l:return I(ie+"Minutes",1);case o:return I(ie+"Seconds",2);case r:return I(ie+"Milliseconds",3);default:return this.clone()}},m.endOf=function(c){return this.startOf(c,!1)},m.$set=function(c,k){var f,A=S.p(c),x="set"+(this.$u?"UTC":""),M=(f={},f[h]=x+"Date",f[V]=x+"Date",f[p]=x+"Month",f[v]=x+"FullYear",f[l]=x+"Hours",f[o]=x+"Minutes",f[r]=x+"Seconds",f[n]=x+"Milliseconds",f)[A],I=A===h?this.$D+(k-this.$W):k;if(A===p||A===v){var O=this.clone().set(V,1);O.$d[M](I),O.init(),this.$d=O.set(V,Math.min(this.$D,O.daysInMonth())).$d}else M&&this.$d[M](I);return this.init(),this},m.set=function(c,k){return this.clone().$set(c,k)},m.get=function(c){return this[S.p(c)]()},m.add=function(c,k){var f,A=this;c=Number(c);var x=S.p(k),M=function(N){var q=b(A);return S.w(q.date(q.date()+Math.round(N*c)),A)};if(x===p)return this.set(p,this.$M+c);if(x===v)return this.set(v,this.$y+c);if(x===h)return M(1);if(x===d)return M(7);var I=(f={},f[o]=s,f[l]=a,f[r]=t,f)[x]||1,O=this.$d.getTime()+c*I;return S.w(O,this)},m.subtract=function(c,k){return this.add(-1*c,k)},m.format=function(c){var k=this,f=this.$locale();if(!this.isValid())return f.invalidDate||B;var A=c||"YYYY-MM-DDTHH:mm:ssZ",x=S.z(this),M=this.$H,I=this.$m,O=this.$M,N=f.weekdays,q=f.months,ie=f.meridiem,te=function(z,Q,re,le){return z&&(z[Q]||z(k,A))||re[Q].slice(0,le)},ne=function(z){return S.s(M%12||12,z,"0")},se=ie||function(z,Q,re){var le=z<12?"AM":"PM";return re?le.toLowerCase():le};return A.replace(H,(function(z,Q){return Q||(function(re){switch(re){case"YY":return String(k.$y).slice(-2);case"YYYY":return S.s(k.$y,4,"0");case"M":return O+1;case"MM":return S.s(O+1,2,"0");case"MMM":return te(f.monthsShort,O,q,3);case"MMMM":return te(q,O);case"D":return k.$D;case"DD":return S.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return te(f.weekdaysMin,k.$W,N,2);case"ddd":return te(f.weekdaysShort,k.$W,N,3);case"dddd":return N[k.$W];case"H":return String(M);case"HH":return S.s(M,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return se(M,I,!0);case"A":return se(M,I,!1);case"m":return String(I);case"mm":return S.s(I,2,"0");case"s":return String(k.$s);case"ss":return S.s(k.$s,2,"0");case"SSS":return S.s(k.$ms,3,"0");case"Z":return x}return null})(z)||x.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(c,k,f){var A,x=this,M=S.p(k),I=b(c),O=(I.utcOffset()-this.utcOffset())*s,N=this-I,q=function(){return S.m(x,I)};switch(M){case v:A=q()/12;break;case p:A=q();break;case _:A=q()/3;break;case d:A=(N-O)/6048e5;break;case h:A=(N-O)/864e5;break;case l:A=N/a;break;case o:A=N/s;break;case r:A=N/t;break;default:A=N}return f?A:S.a(A)},m.daysInMonth=function(){return this.endOf(p).$D},m.$locale=function(){return w[this.$L]},m.locale=function(c,k){if(!c)return this.$L;var f=this.clone(),A=Z(c,k,!0);return A&&(f.$L=A),f},m.clone=function(){return S.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},C})(),ye=oe.prototype;return b.prototype=ye,[["$ms",n],["$s",r],["$m",o],["$H",l],["$W",h],["$M",p],["$y",v],["$D",V]].forEach((function(C){ye[C[1]]=function(m){return this.$g(m,C[0],C[1])}})),b.extend=function(C,m){return C.$i||(C(m,oe,b),C.$i=!0),b},b.locale=Z,b.isDayjs=R,b.unix=function(C){return b(1e3*C)},b.en=w[y],b.Ls=w,b.p={},b}))})(de)),de.exports}var vt=kt();const K=mt(vt),_t=["id"],Ct={class:"date-picker-close is-flex is-justify-flex-end"},Et={class:"date-picker-header is-flex is-justify-space-between is-align-center mb-2 content"},yt={class:"calendar is-flex is-flex-wrap content"},At=["title","tabindex","disabled","onClick"],xt=["id","title","tabindex","disabled","onClick"],bt=["title","disabled","onClick"],Ft=i.defineComponent({__name:"DatePicker",props:{id:{},close:{type:Function},initialValue:{},min:{},max:{},format:{}},emits:["update:modelValue"],setup(u,{expose:e,emit:t}){const s=u,a=t,n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=i.ref(K(s.initialValue===""?void 0:s.initialValue)),o=i.ref(r.value),l=i.computed(()=>{const D=o.value.daysInMonth();return Array.from({length:D},(P,y)=>o.value.date(y+1))}),h=i.computed(()=>Array.from({length:o.value.date(1).day()},(P,y)=>o.value.date(-y)).reverse()),d=i.computed(()=>Array.from({length:6-o.value.endOf("month").day()},(P,y)=>o.value.endOf("month").add(y+1,"day"))),p=D=>!Ee(D,s.min,s.max),_=D=>{r.value=D,a("update:modelValue",r.value.format(s.format)),s.close()},v=D=>{a("update:modelValue",D),D?(r.value=K(D,s.format),o.value=r.value):(r.value=K(),o.value=K())},V=()=>{o.value=o.value.add(1,"month")},B=()=>{o.value=o.value.subtract(1,"month")},T=D=>{const P=document.querySelector("#selected-day");P instanceof HTMLButtonElement&&(D.preventDefault(),P.focus())},H=D=>{const P=document.querySelector(`#${s.id} button`);P instanceof HTMLButtonElement&&(D.preventDefault(),P.focus())},J=D=>{if(D.key==="Tab"&&!D.shiftKey&&H(D),["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(D.key)){D.preventDefault();const y=document.activeElement;if(y instanceof HTMLButtonElement){const w=Array.from(document.querySelectorAll(".calendar button")).filter(Z=>!Z.disabled),L=w.indexOf(y);let R=L;switch(D.key){case"ArrowUp":R=L-7;break;case"ArrowDown":R=L+7;break;case"ArrowLeft":R=L-1;break;case"ArrowRight":R=L+1;break;case"Home":R=0;break;case"End":R=w.length-1;break}R>=0&&R<w.length?w[R].focus():R<0?(B(),i.nextTick(()=>{document.querySelector(".calendar > span:last-of-type button:last-of-type")?.focus()})):R>=w.length&&(V(),i.nextTick(()=>{document.querySelector(".calendar button")?.focus()}))}}};return e({update:v,focusDatePicker:T}),(D,P)=>(i.openBlock(),i.createElementBlock("div",{id:u.id,class:"date-picker"},[i.createElementVNode("div",Ct,[i.createVNode(i.unref(ct),{id:`${u.id}-date-picker-toggle`,variant:"standard",size:"extra-small","icon-only":"","icon-definition":i.unref(ft),"aria-label":"close date picker",onClick:i.withModifiers(u.close,["prevent"])},null,8,["id","icon-definition","onClick"])]),i.createElementVNode("div",Et,[i.createElementVNode("button",{class:"phila-button icon-button--secondary is-extra-small",onClick:i.withModifiers(B,["prevent"])}," Prev "),i.createElementVNode("span",null,i.toDisplayString(o.value.format("MMMM YYYY")),1),i.createElementVNode("button",{class:"phila-button is-extra-small",onClick:i.withModifiers(V,["prevent"])},"Next")]),i.createElementVNode("div",yt,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(n,y=>i.createElementVNode("span",{key:y,class:"calendar-day is-5 has-text-weight-bold"},i.toDisplayString(y),1)),64)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(y,w)=>(i.openBlock(),i.createElementBlock("span",{key:"day-in-previous-month-"+y.date(),class:"calendar-day outside-month is-5"},[i.createElementVNode("button",{class:"phila-button is-extra-small p-2",title:`${y.format("MMMM D, YYYY")}`,tabindex:w===0?0:-1,disabled:p(y),onKeydown:P[0]||(P[0]=L=>J(L)),onClick:i.withModifiers(L=>_(y),["prevent"])},i.toDisplayString(y.date()),41,At)]))),128)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(y,w)=>(i.openBlock(),i.createElementBlock("span",{key:`day-in-current-month-${y.date()}`,class:"calendar-day is-5"},[i.createElementVNode("button",{id:y.isSame(r.value,"day")?"selected-day":void 0,class:i.normalizeClass(["phila-button is-extra-small p-2",{active:y.isSame(r.value,"day")}]),title:y.format("MMMM D, YYYY"),tabindex:y.isSame(r.value,"day")||y.month()!==r.value.month()&&w===0?0:-1,disabled:p(y),onKeydown:P[1]||(P[1]=L=>J(L)),onClick:i.withModifiers(()=>_(y),["prevent"])},i.toDisplayString(y.date()),43,xt)]))),128)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,y=>(i.openBlock(),i.createElementBlock("span",{key:"day-in-next-month-"+y.date(),class:"calendar-day outside-month is-5"},[i.createElementVNode("button",{class:"phila-button is-extra-small p-2",title:`${y.format("MMMM D, YYYY")}`,tabindex:"-1",disabled:p(y),onKeydown:P[2]||(P[2]=w=>J(w)),onClick:i.withModifiers(w=>_(y),["prevent"])},i.toDisplayString(y.date()),41,bt)]))),128))])],8,_t))}}),Dt=(u,e)=>{const t=u.__vccOpts||u;for(const[s,a]of e)t[s]=a;return t},St=Dt(Ft,[["__scopeId","data-v-225c8851"]]),Bt=i.defineComponent({inheritAttrs:!1,__name:"DateField",props:{format:{default:"MM/DD/YYYY"},datePicker:{type:Boolean},imaskProps:{default:()=>({mask:Date,pattern:"m/d/Y",format:u=>K(u).format("MM/DD/YYYY"),parse:u=>K(u,"MM/DD/YYYY").toDate()})},datePickerOptions:{},min:{},max:{},className:{},modelValue:{},label:{},id:{default:()=>$.generateRandomId("phila-date-field-")},supportingText:{},placeholder:{},leadingIcon:{},trailingIcon:{},error:{}},setup(u){const e=u,t=i.useAttrs(),s=i.useTemplateRef("datePicker"),a=i.ref(e.modelValue),n=i.ref(""),r=i.computed(()=>$.cn("default-class",e.className)),o=h=>{a.value=h},l=h=>{(e.min||e.max)&&(Ee(h,e.min,e.max)?n.value="":n.value="Selected date should be between "+K(e.min).format(e.format)+" and "+K(e.max).format(e.format)),s.value?.update(h)};return(h,d)=>u.datePicker?(i.openBlock(),i.createBlock(i.unref(ht),{key:0,id:`${e.id}-date-picker`,group:"date-picker","outside-click-close":"","escape-key-close":"","open-single":""},{toggle:i.withCtx(p=>[i.createVNode(i.unref(be),i.mergeProps({...i.unref(t),...e},{modelValue:a.value,"onUpdate:modelValue":[d[0]||(d[0]=_=>a.value=_),o],class:r.value,"aria-controls":p.ariaControls,"trailing-icon":"fa-solid fa-calendar",min:void 0,max:void 0,error:n.value||e.error,onFocus:_=>p.open?null:p?.onClickToggle(_),onClick:_=>p.open?null:p?.onClickOpen(_),onKeydown:d[1]||(d[1]=i.withKeys(_=>s.value?.focusDatePicker(_),["tab"])),onComplete:l}),null,16,["modelValue","class","aria-controls","error","onFocus","onClick"])]),default:i.withCtx(({open:p,id:_,onClickToggle:v})=>[p?(i.openBlock(),i.createBlock(St,i.mergeProps({key:0,id:_,ref:"datePicker"},e.datePickerOptions,{"initial-value":a.value,min:e.min,max:e.max,format:e.format,close:v,"onUpdate:modelValue":o}),null,16,["id","initial-value","min","max","format","close"])):i.createCommentVNode("",!0)]),_:1},8,["id"])):(i.openBlock(),i.createBlock(i.unref(be),i.mergeProps({key:1},{...i.unref(t),...e},{modelValue:a.value,"onUpdate:modelValue":[d[2]||(d[2]=p=>a.value=p),o],class:r.value,label:"Date field","trailing-icon":"fa-solid fa-calendar",errors:n.value||e.error,min:void 0,max:void 0}),null,16,["modelValue","class","errors"]))}}),Ee=(u,e,t)=>{typeof u=="string"&&(u=K(u));const s=e?K(e):null,a=t?K(t):null;return!(s&&u.isBefore(s,"day")||a&&u.isAfter(a,"day"))};exports.DateField=Bt;exports.isInDateRange=Ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const a=require("vue"),U=require("@phila/phila-ui-core"),Ie=["disabled"],Te=a.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(u){const e=u,t=r=>"href"in r&&r.href!==void 0||"to"in r&&r.to!==void 0,s=a.computed(()=>U.cn("phila-button",`phila-button--${e.variant}`,e.size&&`is-${e.size}`,e.iconOnly&&"icon-button",e.iconOnly&&e.variant==="standard"&&"icon-button--standard",e.className)),i=a.computed(()=>t(e)?"to"in e&&e.to!==void 0?{to:e.to,disabled:e.disabled,className:s.value}:{href:e.href,target:e.target,rel:e.rel,disabled:e.disabled,className:s.value}:{}),n=a.computed(()=>({iconDefinition:e.iconDefinition,iconClass:e.iconClass,src:e.src,iconRight:e.iconRight,iconOnly:e.iconOnly,text:e.text,size:e.size}));return(r,o)=>t(e)?(a.openBlock(),a.createBlock(a.unref(U.BaseLink),a.mergeProps({key:0},{...i.value,...r.$attrs},{role:"button"}),{default:a.withCtx(()=>[a.createVNode(a.unref(U.ActionContent),a.normalizeProps(a.guardReactiveProps(n.value)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(e.text),1)])]),_:3},16)]),_:3},16)):(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:1,type:"button",disabled:e.disabled,class:s.value},r.$attrs),[a.createVNode(a.unref(U.ActionContent),a.normalizeProps(a.guardReactiveProps(n.value)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(e.text),1)])]),_:3},16)],16,Ie))}});var Pe={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Re=Pe,Oe={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},Le=Oe;function ee(u){return typeof u=="string"||u instanceof String}function Ae(u){var e;return typeof u=="object"&&u!=null&&(u==null||(e=u.constructor)==null?void 0:e.name)==="Object"}function De(u,e){return Array.isArray(e)?De(u,(t,s)=>e.includes(s)):Object.entries(u).reduce((t,s)=>{let[i,n]=s;return e(n,i)&&(t[i]=n),t},{})}const f={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ne(u){switch(u){case f.LEFT:return f.FORCE_LEFT;case f.RIGHT:return f.FORCE_RIGHT;default:return u}}function ve(u){return u.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function ce(u,e){if(e===u)return!0;const t=Array.isArray(e),s=Array.isArray(u);let i;if(t&&s){if(e.length!=u.length)return!1;for(i=0;i<e.length;i++)if(!ce(e[i],u[i]))return!1;return!0}if(t!=s)return!1;if(e&&u&&typeof e=="object"&&typeof u=="object"){const n=e instanceof Date,r=u instanceof Date;if(n&&r)return e.getTime()==u.getTime();if(n!=r)return!1;const o=e instanceof RegExp,l=u instanceof RegExp;if(o&&l)return e.toString()==u.toString();if(o!=l)return!1;const h=Object.keys(e);for(i=0;i<h.length;i++)if(!Object.prototype.hasOwnProperty.call(u,h[i]))return!1;for(i=0;i<h.length;i++)if(!ce(u[h[i]],e[h[i]]))return!1;return!0}else if(e&&u&&typeof e=="function"&&typeof u=="function")return e.toString()===u.toString();return!1}class $e{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?f.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?f.RIGHT:f.LEFT}}function C(u,e){return new C.InputMask(u,e)}function Se(u){if(u==null)throw new Error("mask property should be defined");return u instanceof RegExp?C.MaskedRegExp:ee(u)?C.MaskedPattern:u===Date?C.MaskedDate:u===Number?C.MaskedNumber:Array.isArray(u)||u===Array?C.MaskedDynamic:C.Masked&&u.prototype instanceof C.Masked?u:C.Masked&&u instanceof C.Masked?u.constructor:u instanceof Function?C.MaskedFunction:C.Masked}function ue(u){if(!u)throw new Error("Options in not defined");if(C.Masked){if(u.prototype instanceof C.Masked)return{mask:u};const{mask:e=void 0,...t}=u instanceof C.Masked?{mask:u}:Ae(u)&&u.mask instanceof C.Masked?u:{};if(e){const s=e.mask;return{...De(e,(i,n)=>!n.startsWith("_")),mask:e.constructor,_mask:s,...t}}}return Ae(u)?{...u}:{mask:u}}function X(u){if(C.Masked&&u instanceof C.Masked)return u;const e=ue(u),t=Se(e.mask);if(!t)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===t&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new t(e)}C.createMask=X;class Ce{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}C.MaskElement=Ce;const be=90,Ue=89;class me extends Ce{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return(e=(t=(s=this.input).getRootNode)==null?void 0:t.call(s))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===be&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===Ue&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===be&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}C.HTMLMaskElement=me;class Ye extends me{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}C.HTMLMaskElement=me;class Be extends me{get _unsafeSelectionStart(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return i==null||s==null||s<i?s:i}get _unsafeSelectionEnd(){const e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return i==null||s==null||s>i?s:i}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);const i=this.rootElement,n=i.getSelection&&i.getSelection();n&&(n.removeAllRanges(),n.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}C.HTMLContenteditableMaskElement=Be;class fe{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>fe.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}fe.MAX_LENGTH=100;class He{constructor(e,t){this.el=e instanceof Ce?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Be(e):new Ye(e),this.masked=X(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new fe,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){var t;return e==null||((t=this.masked)==null?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof C.Masked)&&this.masked.constructor===Se(e)){this.masked.updateOptions({mask:e});return}const t=e instanceof C.Masked?e:X({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){const s=this._listeners[e];s&&s.forEach(i=>i(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue,this.el.value,this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){const t=this.masked.unmaskedValue,s=this.masked.value,i=this.masked.rawInputValue,n=this.displayValue,r=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==i;this._unmaskedValue=t,this._value=s,this._rawInputValue=i,this.el.value!==n&&(this.el.value=n),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:t,...s}=e,i=!this.maskEquals(t),n=this.masked.optionsIsChanged(s);i&&(this.mask=t),n&&this.masked.updateOptions(s),(i||n)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,f.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const t=new $e({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,i=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,n=s===this.masked.rawInputValue?t.removeDirection:f.NONE;let r=this.masked.nearestInputPos(t.startChangePos+i,n);n!==f.NONE&&(r=this.masked.nearestInputPos(r,f.NONE)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}C.InputMask=He;class F{static normalize(e){return Array.isArray(e)?e:[e,new F]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}C.ChangeDetails=F;class G{constructor(e,t,s){e===void 0&&(e=""),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class Y{constructor(e){this._value="",this._update({...Y.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new G(this.extractInput(e,t),e)}appendTail(e){return ee(e)&&(e=new G(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new F({inserted:e,rawInserted:e})):new F}_appendChar(e,t,s){t===void 0&&(t={});const i=this.state;let n;if([e,n]=this.doPrepareChar(e,t),e&&(n=n.aggregate(this._appendCharRaw(e,t)),!n.rawInserted&&this.autofix==="pad")){const r=this.state;this.state=i;let o=this.pad(t);const l=this._appendCharRaw(e,t);o=o.aggregate(l),l.rawInserted||o.equals(n)?n=o:this.state=r}if(n.inserted){let r,o=this.doValidate(t)!==!1;if(o&&s!=null){const l=this.state;if(this.overwrite===!0){r=s.state;for(let m=0;m<n.rawInserted.length;++m)s.unshift(this.displayValue.length-n.tailShift)}let h=this.appendTail(s);if(o=h.rawInserted.length===s.toString().length,!(o&&h.inserted)&&this.overwrite==="shift"){this.state=l,r=s.state;for(let m=0;m<n.rawInserted.length;++m)s.shift();h=this.appendTail(s),o=h.rawInserted.length===s.toString().length}o&&h.inserted&&(this.state=l)}o||(n=new F,this.state=i,s&&r&&(s.state=r))}return n}_appendPlaceholder(){return new F}_appendEager(){return new F}append(e,t,s){if(!ee(e))throw new Error("value should be string");const i=ee(s)?new G(String(s)):s;t!=null&&t.tail&&(t._beforeTailState=this.state);let n;[e,n]=this.doPrepare(e,t);for(let r=0;r<e.length;++r){const o=this._appendChar(e[r],t,i);if(!o.rawInserted&&!this.doSkipInvalid(e[r],t,i))break;n.aggregate(o)}return(this.eager===!0||this.eager==="append")&&t!=null&&t.input&&e&&n.aggregate(this._appendEager()),i!=null&&(n.tailShift+=this.appendTail(i).tailShift),n}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new F}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const t=this.rawInputValue,s=this.value,i=e();return this.rawInputValue=t,this.value&&this.value!==s&&s.indexOf(this.value)===0&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),F.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),F.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,i,n){s===void 0&&(s=""),i===void 0&&(i=f.NONE),n===void 0&&(n={input:!0});const r=e+t,o=this.extractTail(r),l=this.eager===!0||this.eager==="remove";let h;l&&(i=Ne(i),h=this.extractInput(0,r,{raw:!0}));let m=e;const g=new F;if(i!==f.NONE&&(m=this.nearestInputPos(e,t>1&&e!==0&&!l?f.NONE:i),g.tailShift=m-e),g.aggregate(this.remove(m)),l&&i!==f.NONE&&h===this.rawInputValue)if(i===f.FORCE_LEFT){let b;for(;h===this.rawInputValue&&(b=this.displayValue.length);)g.aggregate(new F({tailShift:-1})).aggregate(this.remove(b-1))}else i===f.FORCE_RIGHT&&o.unshift();return g.aggregate(this.append(s,n,o))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!ce(this,e)}typedValueEquals(e){const t=this.typedValue;return e===t||Y.EMPTY_VALUES.includes(e)&&Y.EMPTY_VALUES.includes(t)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new F}}Y.DEFAULTS={skipInvalid:!0};Y.EMPTY_VALUES=[void 0,null,""];C.Masked=Y;class ie{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ee(e)?new G(String(e)):e;const t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||e.stop==null)&&e.from===t.from+t.toString().length;if(e instanceof G)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof ie){if(e.stop==null){let i;for(;e.chunks.length&&e.chunks[0].stop==null;)i=e.chunks.shift(),i.from+=e.from,this.extend(i)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof C.MaskedPattern))return new G(this.toString()).appendTo(e);const t=new F;for(let s=0;s<this.chunks.length;++s){const i=this.chunks[s],n=e._mapPosToBlock(e.displayValue.length),r=i.stop;let o;if(r!=null&&(!n||n.index<=r)&&((i instanceof ie||e._stops.indexOf(r)>=0)&&t.aggregate(e._appendPlaceholder(r)),o=i instanceof ie&&e._blocks[r]),o){const l=o.appendTail(i);t.aggregate(l);const h=i.toString().slice(l.rawInserted.length);h&&t.aggregate(e.append(h,{tail:!0}))}else t.aggregate(e.append(i.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(i=>{const n="chunks"in i?new ie:new G;return n.state=i,n})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const t=e!=null?e-this.from:e;let s=0;for(;s<this.chunks.length;){const i=this.chunks[s],n=i.unshift(t);if(i.toString()){if(!n)break;++s}else this.chunks.splice(s,1);if(n)return n}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class ze{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:i}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((t=this.block)==null?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,f.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,f.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,f.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,f.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,f.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,f.NONE),!0})}}class Ve{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new F}nearestInputPos(e,t){t===void 0&&(t=f.NONE);const s=0,i=this._value.length;switch(t){case f.LEFT:case f.FORCE_LEFT:return s;case f.NONE:case f.RIGHT:case f.FORCE_RIGHT:default:return i}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new F;const s=this.eager===!0||this.eager==="append",i=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,n=new F({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),n}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new F;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new G("")}appendTail(e){return ee(e)&&(e=new G(String(e))),e.appendTo(this)}append(e,t,s){const i=this._appendChar(e[0],t);return s!=null&&(i.tailShift+=this.appendTail(s).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class pe{constructor(e){const{parent:t,isOptional:s,placeholderChar:i,displayChar:n,lazy:r,eager:o,...l}=e;this.masked=X(l),Object.assign(this,{parent:t,isOptional:s,placeholderChar:i,displayChar:n,lazy:r,eager:o})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new F}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new F;const s=this.masked.state;let i=this.masked._appendChar(e,this.currentMaskFlags(t));return i.inserted&&this.doValidate(t)===!1&&(i=new F,this.masked.state=s),!i.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new F:(this.isFilled=!0,new F({inserted:this.placeholderChar}))}_appendEager(){return new F}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){t===void 0&&(t=f.NONE);const s=0,i=this.value.length,n=Math.min(Math.max(e,s),i);switch(t){case f.LEFT:case f.FORCE_LEFT:return this.isComplete?n:s;case f.RIGHT:case f.FORCE_RIGHT:return this.isComplete?n:i;case f.NONE:default:return n}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||e?._beforeTailState}}pad(e){return new F}}pe.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class je extends Y{updateOptions(e){super.updateOptions(e)}_update(e){const t=e.mask;t&&(e.validate=s=>s.search(t)>=0),super._update(e)}}C.MaskedRegExp=je;class H extends Y{constructor(e){super({...H.DEFAULTS,...e,definitions:Object.assign({},pe.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const t=this.mask;if(!t||!e)return;let s=!1,i=!1;for(let n=0;n<t.length;++n){if(this.blocks){const h=t.slice(n),m=Object.keys(this.blocks).filter(b=>h.indexOf(b)===0);m.sort((b,v)=>v.length-b.length);const g=m[0];if(g){const{expose:b,repeat:v,...M}=ue(this.blocks[g]),D={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...M,repeat:v,parent:this},V=v!=null?new C.RepeatBlock(D):X(D);V&&(this._blocks.push(V),b&&(this.exposeBlock=V),this._maskedBlocks[g]||(this._maskedBlocks[g]=[]),this._maskedBlocks[g].push(this._blocks.length-1)),n+=g.length-1;continue}}let r=t[n],o=r in e;if(r===H.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(r==="{"||r==="}"){s=!s;continue}if(r==="["||r==="]"){i=!i;continue}if(r===H.ESCAPE_CHAR){if(++n,r=t[n],!r)break;o=!1}const l=o?new pe({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ue(e[r]),parent:this}):new Ve({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:t,...s}=e;this._blocks.forEach((i,n)=>i.state=t[n]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const t=new F;let s=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(s==null)return t;this._blocks[s].isFilled&&++s;for(let i=s;i<this._blocks.length;++i){const n=this._blocks[i]._appendEager();if(!n.inserted)break;t.aggregate(n)}return t}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._mapPosToBlock(this.displayValue.length),i=new F;if(!s)return i;for(let r=s.index,o;o=this._blocks[r];++r){var n;const l=o._appendChar(e,{...t,_beforeTailState:(n=t._beforeTailState)==null||(n=n._blocks)==null?void 0:n[r]});if(i.aggregate(l),l.consumed)break}return i}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=new ie;return e===t||this._forEachBlocksInRange(e,t,(i,n,r,o)=>{const l=i.extractTail(r,o);l.stop=this._findStopBefore(n),l.from=this._blockStartPos(n),l instanceof ie&&(l.blockIndex=n),s.extend(l)}),s}extractInput(e,t,s){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),s===void 0&&(s={}),e===t)return"";let i="";return this._forEachBlocksInRange(e,t,(n,r,o,l)=>{i+=n.extractInput(o,l,s)}),i}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){const i=this._stops[s];if(i<=e)t=i;else break}return t}_appendPlaceholder(e){const t=new F;if(this.lazy&&e==null)return t;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;const i=s.index,n=e??this._blocks.length;return this._blocks.slice(i,n).forEach(r=>{if(!r.lazy||e!=null){var o;t.aggregate(r._appendPlaceholder((o=r._blocks)==null?void 0:o.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){const i=this._blocks[s],n=t.length;if(t+=i.displayValue,e<=t.length)return{index:s,offset:e-n}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((t,s)=>t+=s.displayValue.length,0)}_forEachBlocksInRange(e,t,s){t===void 0&&(t=this.displayValue.length);const i=this._mapPosToBlock(e);if(i){const n=this._mapPosToBlock(t),r=n&&i.index===n.index,o=i.offset,l=n&&r?n.offset:this._blocks[i.index].displayValue.length;if(s(this._blocks[i.index],i.index,o,l),n&&!r){for(let h=i.index+1;h<n.index;++h)s(this._blocks[h],h,0,this._blocks[h].displayValue.length);s(this._blocks[n.index],n.index,0,n.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(i,n,r,o)=>{s.aggregate(i.remove(r,o))}),s}nearestInputPos(e,t){if(t===void 0&&(t=f.NONE),!this._blocks.length)return 0;const s=new ze(this,e);if(t===f.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===f.LEFT||t===f.FORCE_LEFT){if(t===f.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===f.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===f.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return t===f.RIGHT||t===f.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:t===f.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(e,f.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(i,n,r,o)=>{s+=i.totalInputPositions(r,o)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const t=this._maskedBlocks[e];return t?t.map(s=>this._blocks[s]):[]}pad(e){const t=new F;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}H.DEFAULTS={...Y.DEFAULTS,lazy:!0,placeholderChar:"_"};H.STOP_CHAR="`";H.ESCAPE_CHAR="\\";H.InputDefinition=pe;H.FixedDefinition=Ve;C.MaskedPattern=H;class he extends H{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:t=this.to||0,from:s=this.from||0,maxLength:i=this.maxLength||0,autofix:n=this.autofix,...r}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,i),this.autofix=n;const o=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0");let h=0;for(;h<l.length&&l[h]===o[h];)++h;r.mask=l.slice(0,h).replace(/0/g,"\\0")+"0".repeat(this.maxLength-h),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="";const[,i,n]=e.match(/^(\D*)(\d*)(\D*)/)||[];return n&&(t="0".repeat(i.length)+n,s="9".repeat(i.length)+n),t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[t,s]}doPrepareChar(e,t){t===void 0&&(t={});let s;return[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);const s=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[n,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],t):Number(n)>this.to?!t.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(i[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){const t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;const[s,i]=this.boundaries(t);return this.from<=Number(i)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){const t=new F;if(this.value.length===this.maxLength)return t;const s=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let n=0;n<i;++n)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(n=>this._appendCharRaw(n))}return t}}C.MaskedRange=he;const qe="d{.}`m{.}`Y";class W extends H{static extractPatternOptions(e){const{mask:t,pattern:s,...i}=e;return{...i,mask:ee(t)?t:s}}constructor(e){super(W.extractPatternOptions({...W.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:t,pattern:s,blocks:i,...n}={...W.DEFAULTS,...e},r=Object.assign({},W.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,i),super._update({...n,mask:ee(t)?t:s,blocks:r})}doValidate(e){const t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(W.extractPatternOptions(e))}}W.GET_DEFAULT_BLOCKS=()=>({d:{mask:he,from:1,to:31,maxLength:2},m:{mask:he,from:1,to:12,maxLength:2},Y:{mask:he,from:1900,to:9999}});W.DEFAULTS={...H.DEFAULTS,mask:Date,pattern:qe,format:(u,e)=>{if(!u)return"";const t=String(u.getDate()).padStart(2,"0"),s=String(u.getMonth()+1).padStart(2,"0"),i=u.getFullYear();return[t,s,i].join(".")},parse:(u,e)=>{const[t,s,i]=u.split(".").map(Number);return new Date(i,s-1,t)}};C.MaskedDate=W;class ge extends Y{constructor(e){super({...ge.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(t=>{const{expose:s,...i}=ue(t),n=X({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return s&&(this.exposeMask=n),n}):[])}_appendCharRaw(e,t){t===void 0&&(t={});const s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){e===void 0&&(e=""),t===void 0&&(t={}),s===void 0&&(s="");const i=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,n=this.rawInputValue,r=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:n,o=n.slice(r.length),l=this.currentMask,h=new F,m=l?.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),h.tailShift=this.currentMask.value.length-i.length),o&&(h.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift)):m&&(this.currentMask.state=m)),h}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const t=new F;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:((t=e._beforeTailState)==null?void 0:t.currentMaskRef)===this.currentMask&&((s=e._beforeTailState)==null?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return t===void 0&&(t={}),s===void 0&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[s,i]=super.doPrepare(e,t);if(this.currentMask){let n;[s,n]=super.doPrepare(s,this.currentMaskFlags(t)),i=i.aggregate(n)}return[s,i]}doPrepareChar(e,t){t===void 0&&(t={});let[s,i]=super.doPrepareChar(e,t);if(this.currentMask){let n;[s,n]=super.doPrepareChar(s,this.currentMaskFlags(t)),i=i.aggregate(n)}return[s,i]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(t=>t.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,t){const s=new F;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(t=>t.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:t,currentMaskRef:s,currentMask:i,...n}=e;t&&this.compiledMasks.forEach((r,o)=>r.state=t[o]),s!=null&&(this.currentMask=s,this.currentMask.state=i),super.state=n}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;const{mask:i,...n}=e[s];return ce(t,n)&&t.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!((t=this.currentMask)!=null&&t.typedValueEquals(e))}}ge.DEFAULTS={...Y.DEFAULTS,dispatch:(u,e,t,s)=>{if(!e.compiledMasks.length)return;const i=e.rawInputValue,n=e.compiledMasks.map((r,o)=>{const l=e.currentMask===r,h=l?r.displayValue.length:r.nearestInputPos(r.displayValue.length,f.FORCE_LEFT);return r.rawInputValue!==i?(r.reset(),r.append(i,{raw:!0})):l||r.remove(h),r.append(u,e.currentMaskFlags(t)),r.appendTail(s),{index:o,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(h,r.nearestInputPos(r.displayValue.length,f.FORCE_LEFT)))}});return n.sort((r,o)=>o.weight-r.weight||o.totalInputPositions-r.totalInputPositions),e.compiledMasks[n[0].index]}};C.MaskedDynamic=ge;class ke extends H{constructor(e){super({...ke.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:t,...s}=e;if(t){const i=t.map(o=>o.length),n=Math.min(...i),r=Math.max(...i)-n;s.mask="*".repeat(n),r&&(s.mask+="["+"*".repeat(r)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){t===void 0&&(t={});const s=Math.min(this.nearestInputPos(0,f.FORCE_RIGHT),this.value.length),i=this.enum.filter(n=>this.matchValue(n,this.unmaskedValue+e,s));if(i.length){i.length===1&&this._forEachBlocksInRange(0,this.value.length,(r,o)=>{const l=i[0][o];o>=this.value.length||l===r.value||(r.reset(),r._appendChar(l,t))});const n=super._appendCharRaw(i[0][this.value.length],t);return i.length===1&&i[0].slice(this.unmaskedValue.length).split("").forEach(r=>n.aggregate(super._appendCharRaw(r))),n}return new F({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new G("",e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new F;const s=Math.min(super.nearestInputPos(0,f.FORCE_RIGHT),this.value.length);let i;for(i=e;i>=0&&!(this.enum.filter(r=>this.matchValue(r,this.value.slice(s,i),s)).length>1);--i);const n=super.remove(i,t);return n.tailShift+=i-e,n}get isComplete(){return this.enum.indexOf(this.value)>=0}}ke.DEFAULTS={...H.DEFAULTS,matchValue:(u,e,t)=>u.indexOf(e,t)===t};C.MaskedEnum=ke;class Ke extends Y{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}C.MaskedFunction=Ke;var Me;class j extends Y{constructor(e){super({...j.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),t="\\d*",s=(this.scale?"("+ve(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+t+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(ve).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(ve(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});const[s,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(i.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&i.aggregate(this._appendChar("-")),[s,i]}_separatorsCount(e,t){t===void 0&&(t=!1);let s=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){t===void 0&&(t={});const s=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const n=this._value;this._value+=e;const r=this.number;let o=!isNaN(r),l=!1;if(o){let b;this.min!=null&&this.min<0&&this.number<this.min&&(b=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(b=this.max),b!=null&&(this.autofix?(this._value=this.format(b,this).replace(j.UNMASKED_RADIX,this.radix),l||(l=n===this._value&&!t.tail)):o=!1),o&&(o=!!this._value.match(this._numberRegExp))}let h;o?h=new F({inserted:this._value.slice(n.length),rawInserted:l?"":e,skip:l}):(this._value=n,h=new F),this._value=this._insertThousandsSeparators(this._value);const m=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,g=this._separatorsCountFromSlice(m);return h.tailShift+=(g-i)*this.thousandsSeparator.length,h}_findSeparatorAround(e){if(this.thousandsSeparator){const t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,t){const s=this._findSeparatorAround(e);s>=0&&(e=s);const i=this._findSeparatorAround(t);return i>=0&&(t=i+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);const s=this.value.slice(0,e),i=this.value.slice(t),n=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+i));const r=this._separatorsCountFromSlice(s);return new F({tailShift:(r-n)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case f.NONE:case f.LEFT:case f.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const i=s+this.thousandsSeparator.length;if(e<i||this.value.length<=i||t===f.FORCE_LEFT)return s}break}case f.RIGHT:case f.FORCE_RIGHT:{const s=this._findSeparatorAround(e);if(s>=0)return s+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){const t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(s,i,n,r)=>i+r),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){t===void 0&&(t={});const i=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===j.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,j.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(j.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||j.EMPTY_VALUES.includes(e)&&j.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Me=j;j.UNMASKED_RADIX=".";j.EMPTY_VALUES=[...Y.EMPTY_VALUES,0];j.DEFAULTS={...Y.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Me.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:u=>u.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})};C.MaskedNumber=j;const _e={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function we(u,e,t){e===void 0&&(e=_e.MASKED),t===void 0&&(t=_e.MASKED);const s=X(u);return i=>s.runIsolated(n=>(n[e]=i,n[t]))}function Ge(u,e,t,s){return we(e,t,s)(u)}C.PIPE_TYPE=_e;C.createPipe=we;C.pipe=Ge;class Ze extends H{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,i;const{repeat:n,...r}=ue(e);this._blockOpts=Object.assign({},this._blockOpts,r);const o=X(this._blockOpts);this.repeat=(t=(s=n??o.repeat)!=null?s:this.repeat)!=null?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((i=this._blocks)==null?void 0:i.length)||0,this.repeatFrom)),blocks:{m:o},eager:o.eager,overwrite:o.overwrite,skipInvalid:o.skipInvalid,lazy:o.lazy,placeholderChar:o.placeholderChar,displayChar:o.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(X(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});const s=new F;for(let l=(i=(n=this._mapPosToBlock(this.displayValue.length))==null?void 0:n.index)!=null?i:Math.max(this._blocks.length-1,0),h,m;h=(r=this._blocks[l])!=null?r:m=!m&&this._allocateBlock(l);++l){var i,n,r,o;const g=h._appendChar(e,{...t,_beforeTailState:(o=t._beforeTailState)==null||(o=o._blocks)==null?void 0:o[l]});if(g.skip&&m){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(g),g.consumed)break}return s}_trimEmptyTail(e,t){var s,i;e===void 0&&(e=0);const n=Math.max(((s=this._mapPosToBlock(e))==null?void 0:s.index)||0,this.repeatFrom,0);let r;t!=null&&(r=(i=this._mapPosToBlock(t))==null?void 0:i.index),r==null&&(r=this._blocks.length-1);let o=0;for(let l=r;n<=l&&!this._blocks[l].unmaskedValue;--l,++o);o&&(this._blocks.splice(r-o+1,o),this.mask=this.mask.slice(o))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);const s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}C.RepeatBlock=Ze;try{globalThis.IMask=C}catch{}var We={mask:void 0,prepare:Function,prepareChar:Function,validate:Function,commit:Function,overwrite:{type:Boolean,required:!1,default:void 0},eager:{required:!1,default:void 0,validator:u=>["append","remove"].includes(u)||typeof u=="boolean"},skipInvalid:{type:Boolean,required:!1,default:void 0},placeholderChar:String,displayChar:String,lazy:{type:Boolean,required:!1,default:void 0},definitions:Object,blocks:Object,enum:Array,maxLength:Number,from:Number,to:Number,pattern:String,format:Function,parse:Function,autofix:{required:!1,default:void 0,validator:u=>u==="pad"||typeof u=="boolean"},radix:String,thousandsSeparator:String,mapToRadix:Array,scale:Number,normalizeZeros:{type:Boolean,required:!1,default:void 0},padFractionalZeros:{type:Boolean,required:!1,default:void 0},min:[Number,Date],max:[Number,Date],dispatch:Function};function Xe(u,e){let{emit:t,onAccept:s,onComplete:i,defaultValue:n,defaultUnmaskedValue:r,defaultTypedValue:o}=e===void 0?{}:e;const l=a.isRef(u)?u:a.ref(u),h=a.ref(),m=a.ref(),g=a.ref(""),b=a.ref(""),v=a.ref();let M,D=g.value,V=b.value,R=v.value;function J(){R=v.value=m.value.typedValue,V=b.value=m.value.unmaskedValue,D=g.value=m.value.value}function S(x){J(),t&&(t("accept",g.value,x),t("accept:masked",g.value,x),t("accept:typed",v.value,x),t("accept:unmasked",b.value,x)),s?.(x)}function P(x){t&&(t("complete",m.value.value,x),t("complete:masked",m.value.value,x),t("complete:typed",m.value.typedValue,x),t("complete:unmasked",m.value.unmaskedValue,x)),i?.(x)}const E=()=>{!m.value||b.value===void 0||(V!==b.value&&(m.value.unmaskedValue=b.value,m.value.unmaskedValue!==b.value&&S()),V=void 0)};a.watch(b,E);const I=()=>{!m.value||g.value===void 0||(D!==g.value&&(m.value.value=g.value,m.value.value!==g.value&&S()),D=void 0)};a.watch(g,I);const N=()=>{!m.value||v.value===void 0||(R!==v.value&&(m.value.typedValue=v.value,m.value.masked.typedValueEquals(v.value)||S()),R=void 0)};a.watch(v,N);function O(){M=h.value;const x=l.value;!M||!(x!=null&&x.mask)||(m.value=C(M,x),n!==void 0&&(g.value=n),r!==void 0&&(b.value=r),o!==void 0&&(v.value=o),E(),I(),N(),J(),m.value.on("accept",S).on("complete",P))}function Z(){var x;(x=m.value)==null||x.destroy(),m.value=void 0}return a.onMounted(O),a.onUnmounted(Z),a.watch([h,l],()=>{const x=h.value,B=l.value;(!(B!=null&&B.mask)||x!==M)&&Z(),x&&(m.value?m.value.updateOptions(B):O())}),{el:h,mask:a.readonly(m),masked:g,unmasked:b,typed:v}}function Je(u,e){return u={...u},Object.keys(u).forEach(t=>{(u[t]===void 0||e.includes(t))&&delete u[t]}),u}const Qe=["typed","unmasked","value","modelValue"];var et=a.defineComponent({name:"imask-input",inheritAttrs:!1,props:{modelValue:String,value:String,unmasked:String,typed:{validator:()=>!0},...We},emits:["update:modelValue","update:masked","update:value","update:unmasked","update:typed","accept","accept:value","accept:masked","accept:unmasked","accept:typed","complete","complete:value","complete:masked","complete:unmasked","complete:typed"],setup(u,e){let{attrs:t,emit:s}=e;const{el:i,mask:n,masked:r,unmasked:o,typed:l}=Xe(Je(u,Qe),{emit:s,onAccept:v=>{const M=r.value;s("accept:value",M,v),s("update:value",M,v),s("update:masked",M,v),s("update:modelValue",M,v),s("update:unmasked",o.value,v),s("update:typed",l.value,v)},onComplete:v=>{s("complete:value",r.value,v)}}),h=a.toRef(u,"value"),m=a.toRef(u,"modelValue"),g=a.toRef(u,"unmasked"),b=a.toRef(u,"typed");return r.value=m.value||h.value||"",o.value=g.value||"",l.value=b.value,a.watch(h,v=>r.value=v),a.watch(m,v=>r.value=v),a.watch(g,v=>o.value=v),a.watch(b,v=>l.value=v),()=>{const v={...t,value:u.value!=null?u.value:u.modelValue!=null?u.modelValue:n.value?n.value.displayValue:"",ref:i};return u.mask||(v.onInput=M=>{s("update:modelValue",M.target.value),s("update:value",M.target.value)}),a.h("input",v)}}}),tt=et;const st=["for"],it={class:"state-layer"},at={class:"content"},nt={class:"input-text-container"},rt=["id","placeholder","aria-label"],ut={key:1,class:"has-text-body-small phila-supporting-text"},ot={key:2,class:"has-text-body-small phila-error-text"},xe=a.defineComponent({inheritAttrs:!1,__name:"TextField",props:{modelValue:{default:void 0},className:{default:""},label:{default:""},id:{default:`phila-text-field-${Math.random().toString(36).substring(2,9)}`},imaskProps:{default:void 0},supportingText:{default:""},placeholder:{default:""},leadingIcon:{default:""},trailingIcon:{default:""},error:{default(){return[]}}},emits:["update:modelValue","complete"],setup(u,{expose:e,emit:t}){const s=a.useAttrs(),i=u,n=a.computed(()=>typeof i.error=="string"?i.error:i.error[0]),r=a.toRef(i,"id"),o=t,l=a.ref(""),h=a.computed({get:()=>i.modelValue!==void 0?i.modelValue:l.value,set:D=>{o("update:modelValue",D),l.value=D}}),m=a.computed(()=>{const D=["default-class"];return s.disabled!=null&&D.push("phila-input--disabled"),n.value&&D.push("phila-input--error"),s.required!=null&&D.push("phila-input--required"),U.cn(...D)}),g=a.computed(()=>{const D=[];return h.value!==""&&D.push("phila-text-field--filled"),i.className&&D.push(i.className),U.cn(...D)}),b=a.computed(()=>{if(!(i.label||s["aria-label"]))return i.placeholder||void 0}),v=a.ref(null),M=D=>{D.target.closest("button")||v.value?.focus()};return e({inputRef:v}),(D,V)=>(a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass(["phila-input",m.value])},[i.label?(a.openBlock(),a.createElementBlock("label",{key:0,for:r.value,class:"has-text-label-small phila-label"},a.toDisplayString(i.label),9,st)):a.createCommentVNode("",!0),a.createElementVNode("div",{class:a.normalizeClass(["phila-text-field",g.value]),onClick:a.withModifiers(M,["prevent"])},[a.createElementVNode("div",it,[i.leadingIcon?(a.openBlock(),a.createBlock(a.unref(U.Icon),{key:0,"icon-class":i.leadingIcon,inline:"",decorative:""},null,8,["icon-class"])):a.createCommentVNode("",!0),a.createElementVNode("div",at,[a.createElementVNode("div",nt,[i.imaskProps?.mask?(a.openBlock(),a.createBlock(a.unref(tt),a.mergeProps({key:0},{...a.unref(s),...i.imaskProps},{id:r.value,modelValue:h.value,"onUpdate:modelValue":V[0]||(V[0]=R=>h.value=R),class:"phila-text-field-input has-text-body-default",placeholder:i.placeholder,onComplete:V[1]||(V[1]=()=>o("complete",l.value))}),null,16,["id","modelValue","placeholder"])):a.withDirectives((a.openBlock(),a.createElementBlock("input",a.mergeProps({key:1,id:r.value,ref_key:"inputRef",ref:v},a.unref(s),{"onUpdate:modelValue":V[2]||(V[2]=R=>h.value=R),class:"phila-text-field-input has-text-body-default",placeholder:i.placeholder,"aria-label":b.value}),null,16,rt)),[[a.vModelDynamic,h.value]])])]),h.value!=""?(a.openBlock(),a.createBlock(a.unref(Te),{key:1,variant:"standard",size:"small","icon-only":"","icon-definition":a.unref(Le),onClick:V[3]||(V[3]=R=>h.value="")},null,8,["icon-definition"])):a.createCommentVNode("",!0),i.trailingIcon?(a.openBlock(),a.createBlock(a.unref(U.Icon),{key:2,size:"small","icon-class":i.trailingIcon,inline:"",decorative:""},null,8,["icon-class"])):a.createCommentVNode("",!0),a.renderSlot(D.$slots,"trailing-action")])],2),i.supportingText?(a.openBlock(),a.createElementBlock("div",ut,a.toDisplayString(i.supportingText),1)):a.createCommentVNode("",!0),n.value?(a.openBlock(),a.createElementBlock("div",ot,[a.createVNode(a.unref(U.Icon),{"icon-definition":a.unref(Re),size:"small",inline:"",decorative:""},null,8,["icon-definition"]),a.createTextVNode(" "+a.toDisplayString(n.value),1)])):a.createCommentVNode("",!0)],2))}}),lt=["disabled"],ht=a.defineComponent({inheritAttrs:!1,__name:"PhlButton",props:{href:{},to:{},target:{},rel:{},disabled:{type:Boolean,default:!1},clickTarget:{},variant:{default:"primary"},size:{default:"medium"},iconOnly:{type:Boolean,default:!1},iconRight:{type:Boolean},text:{},className:{},iconDefinition:{},iconClass:{},src:{},svgRaw:{}},setup(u){const e=u,t=r=>"href"in r&&r.href!==void 0||"to"in r&&r.to!==void 0,s=a.computed(()=>U.cn("phila-button",`phila-button--${e.variant}`,e.size&&`is-${e.size}`,e.iconOnly&&"icon-button",e.iconOnly&&e.variant==="standard"&&"icon-button--standard",e.className)),i=a.computed(()=>t(e)?"to"in e&&e.to!==void 0?{to:e.to,disabled:e.disabled,className:s.value}:{href:e.href,target:e.target,rel:e.rel,disabled:e.disabled,className:s.value}:{}),n=a.computed(()=>({iconDefinition:e.iconDefinition,iconClass:e.iconClass,src:e.src,iconRight:e.iconRight,iconOnly:e.iconOnly,text:e.text,size:e.size}));return(r,o)=>t(e)?(a.openBlock(),a.createBlock(a.unref(U.BaseLink),a.mergeProps({key:0},{...i.value,...r.$attrs},{role:"button"}),{default:a.withCtx(()=>[a.createVNode(a.unref(U.ActionContent),a.normalizeProps(a.guardReactiveProps(n.value)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(e.text),1)])]),_:3},16)]),_:3},16)):(a.openBlock(),a.createElementBlock("button",a.mergeProps({key:1,type:"button",disabled:e.disabled,class:s.value},r.$attrs),[a.createVNode(a.unref(U.ActionContent),a.normalizeProps(a.guardReactiveProps(n.value)),{default:a.withCtx(()=>[a.renderSlot(r.$slots,"default",{},()=>[a.createTextVNode(a.toDisplayString(e.text),1)])]),_:3},16)],16,lt))}});var dt={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]},ct=dt;function pt(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var de={exports:{}},mt=de.exports,Fe;function ft(){return Fe||(Fe=1,(function(u,e){(function(t,s){u.exports=s()})(mt,(function(){var t=1e3,s=6e4,i=36e5,n="millisecond",r="second",o="minute",l="hour",h="day",m="week",g="month",b="quarter",v="year",M="date",D="Invalid Date",V=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,R=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,J={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var p=["th","st","nd","rd"],d=_%100;return"["+_+(p[(d-20)%10]||p[d]||p[0])+"]"}},S=function(_,p,d){var k=String(_);return!k||k.length>=p?_:""+Array(p+1-k.length).join(d)+_},P={s:S,z:function(_){var p=-_.utcOffset(),d=Math.abs(p),k=Math.floor(d/60),c=d%60;return(p<=0?"+":"-")+S(k,2,"0")+":"+S(c,2,"0")},m:function _(p,d){if(p.date()<d.date())return-_(d,p);var k=12*(d.year()-p.year())+(d.month()-p.month()),c=p.clone().add(k,g),y=d-c<0,A=p.clone().add(k+(y?-1:1),g);return+(-(k+(d-c)/(y?c-A:A-c))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:g,y:v,w:m,d:h,D:M,h:l,m:o,s:r,ms:n,Q:b}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},E="en",I={};I[E]=J;var N="$isDayjsObject",O=function(_){return _ instanceof oe||!(!_||!_[N])},Z=function _(p,d,k){var c;if(!p)return E;if(typeof p=="string"){var y=p.toLowerCase();I[y]&&(c=y),d&&(I[y]=d,c=y);var A=p.split("-");if(!c&&A.length>1)return _(A[0])}else{var w=p.name;I[w]=p,c=w}return!k&&c&&(E=c),c||!k&&E},x=function(_,p){if(O(_))return _.clone();var d=typeof p=="object"?p:{};return d.date=_,d.args=arguments,new oe(d)},B=P;B.l=Z,B.i=O,B.w=function(_,p){return x(_,{locale:p.$L,utc:p.$u,x:p.$x,$offset:p.$offset})};var oe=(function(){function _(d){this.$L=Z(d.locale,null,!0),this.parse(d),this.$x=this.$x||d.x||{},this[N]=!0}var p=_.prototype;return p.parse=function(d){this.$d=(function(k){var c=k.date,y=k.utc;if(c===null)return new Date(NaN);if(B.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var A=c.match(V);if(A){var w=A[2]-1||0,T=(A[7]||"0").substring(0,3);return y?new Date(Date.UTC(A[1],w,A[3]||1,A[4]||0,A[5]||0,A[6]||0,T)):new Date(A[1],w,A[3]||1,A[4]||0,A[5]||0,A[6]||0,T)}}return new Date(c)})(d),this.init()},p.init=function(){var d=this.$d;this.$y=d.getFullYear(),this.$M=d.getMonth(),this.$D=d.getDate(),this.$W=d.getDay(),this.$H=d.getHours(),this.$m=d.getMinutes(),this.$s=d.getSeconds(),this.$ms=d.getMilliseconds()},p.$utils=function(){return B},p.isValid=function(){return this.$d.toString()!==D},p.isSame=function(d,k){var c=x(d);return this.startOf(k)<=c&&c<=this.endOf(k)},p.isAfter=function(d,k){return x(d)<this.startOf(k)},p.isBefore=function(d,k){return this.endOf(k)<x(d)},p.$g=function(d,k,c){return B.u(d)?this[k]:this.set(c,d)},p.unix=function(){return Math.floor(this.valueOf()/1e3)},p.valueOf=function(){return this.$d.getTime()},p.startOf=function(d,k){var c=this,y=!!B.u(k)||k,A=B.p(d),w=function(se,z){var Q=B.w(c.$u?Date.UTC(c.$y,z,se):new Date(c.$y,z,se),c);return y?Q:Q.endOf(h)},T=function(se,z){return B.w(c.toDate()[se].apply(c.toDate("s"),(y?[0,0,0,0]:[23,59,59,999]).slice(z)),c)},L=this.$W,$=this.$M,q=this.$D,ae="set"+(this.$u?"UTC":"");switch(A){case v:return y?w(1,0):w(31,11);case g:return y?w(1,$):w(0,$+1);case m:var te=this.$locale().weekStart||0,ne=(L<te?L+7:L)-te;return w(y?q-ne:q+(6-ne),$);case h:case M:return T(ae+"Hours",0);case l:return T(ae+"Minutes",1);case o:return T(ae+"Seconds",2);case r:return T(ae+"Milliseconds",3);default:return this.clone()}},p.endOf=function(d){return this.startOf(d,!1)},p.$set=function(d,k){var c,y=B.p(d),A="set"+(this.$u?"UTC":""),w=(c={},c[h]=A+"Date",c[M]=A+"Date",c[g]=A+"Month",c[v]=A+"FullYear",c[l]=A+"Hours",c[o]=A+"Minutes",c[r]=A+"Seconds",c[n]=A+"Milliseconds",c)[y],T=y===h?this.$D+(k-this.$W):k;if(y===g||y===v){var L=this.clone().set(M,1);L.$d[w](T),L.init(),this.$d=L.set(M,Math.min(this.$D,L.daysInMonth())).$d}else w&&this.$d[w](T);return this.init(),this},p.set=function(d,k){return this.clone().$set(d,k)},p.get=function(d){return this[B.p(d)]()},p.add=function(d,k){var c,y=this;d=Number(d);var A=B.p(k),w=function($){var q=x(y);return B.w(q.date(q.date()+Math.round($*d)),y)};if(A===g)return this.set(g,this.$M+d);if(A===v)return this.set(v,this.$y+d);if(A===h)return w(1);if(A===m)return w(7);var T=(c={},c[o]=s,c[l]=i,c[r]=t,c)[A]||1,L=this.$d.getTime()+d*T;return B.w(L,this)},p.subtract=function(d,k){return this.add(-1*d,k)},p.format=function(d){var k=this,c=this.$locale();if(!this.isValid())return c.invalidDate||D;var y=d||"YYYY-MM-DDTHH:mm:ssZ",A=B.z(this),w=this.$H,T=this.$m,L=this.$M,$=c.weekdays,q=c.months,ae=c.meridiem,te=function(z,Q,re,le){return z&&(z[Q]||z(k,y))||re[Q].slice(0,le)},ne=function(z){return B.s(w%12||12,z,"0")},se=ae||function(z,Q,re){var le=z<12?"AM":"PM";return re?le.toLowerCase():le};return y.replace(R,(function(z,Q){return Q||(function(re){switch(re){case"YY":return String(k.$y).slice(-2);case"YYYY":return B.s(k.$y,4,"0");case"M":return L+1;case"MM":return B.s(L+1,2,"0");case"MMM":return te(c.monthsShort,L,q,3);case"MMMM":return te(q,L);case"D":return k.$D;case"DD":return B.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return te(c.weekdaysMin,k.$W,$,2);case"ddd":return te(c.weekdaysShort,k.$W,$,3);case"dddd":return $[k.$W];case"H":return String(w);case"HH":return B.s(w,2,"0");case"h":return ne(1);case"hh":return ne(2);case"a":return se(w,T,!0);case"A":return se(w,T,!1);case"m":return String(T);case"mm":return B.s(T,2,"0");case"s":return String(k.$s);case"ss":return B.s(k.$s,2,"0");case"SSS":return B.s(k.$ms,3,"0");case"Z":return A}return null})(z)||A.replace(":","")}))},p.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},p.diff=function(d,k,c){var y,A=this,w=B.p(k),T=x(d),L=(T.utcOffset()-this.utcOffset())*s,$=this-T,q=function(){return B.m(A,T)};switch(w){case v:y=q()/12;break;case g:y=q();break;case b:y=q()/3;break;case m:y=($-L)/6048e5;break;case h:y=($-L)/864e5;break;case l:y=$/i;break;case o:y=$/s;break;case r:y=$/t;break;default:y=$}return c?y:B.a(y)},p.daysInMonth=function(){return this.endOf(g).$D},p.$locale=function(){return I[this.$L]},p.locale=function(d,k){if(!d)return this.$L;var c=this.clone(),y=Z(d,k,!0);return y&&(c.$L=y),c},p.clone=function(){return B.w(this.$d,this)},p.toDate=function(){return new Date(this.valueOf())},p.toJSON=function(){return this.isValid()?this.toISOString():null},p.toISOString=function(){return this.$d.toISOString()},p.toString=function(){return this.$d.toUTCString()},_})(),ye=oe.prototype;return x.prototype=ye,[["$ms",n],["$s",r],["$m",o],["$H",l],["$W",h],["$M",g],["$y",v],["$D",M]].forEach((function(_){ye[_[1]]=function(p){return this.$g(p,_[0],_[1])}})),x.extend=function(_,p){return _.$i||(_(p,oe,x),_.$i=!0),x},x.locale=Z,x.isDayjs=O,x.unix=function(_){return x(1e3*_)},x.en=I[E],x.Ls=I,x.p={},x}))})(de)),de.exports}var gt=ft();const K=pt(gt),kt=["id"],vt={class:"date-picker-close is-flex is-justify-flex-end"},_t={class:"date-picker-header is-flex is-justify-space-between is-align-center mb-2 content"},Ct={class:"calendar is-flex is-flex-wrap content"},Et=["title","tabindex","disabled","onClick"],yt=["id","title","tabindex","disabled","onClick"],At=["title","disabled","onClick"],bt=a.defineComponent({__name:"DatePicker",props:{id:{},close:{type:Function},initialValue:{},min:{},max:{},format:{}},emits:["update:modelValue"],setup(u,{expose:e,emit:t}){const s=u,i=t,n=["Su","Mo","Tu","We","Th","Fr","Sa"],r=a.ref(K(s.initialValue===""?void 0:s.initialValue)),o=a.ref(r.value),l=a.computed(()=>{const S=o.value.daysInMonth();return Array.from({length:S},(P,E)=>o.value.date(E+1))}),h=a.computed(()=>Array.from({length:o.value.date(1).day()},(P,E)=>o.value.date(-E)).reverse()),m=a.computed(()=>Array.from({length:6-o.value.endOf("month").day()},(P,E)=>o.value.endOf("month").add(E+1,"day"))),g=S=>!Ee(S,s.min,s.max),b=S=>{r.value=S,i("update:modelValue",r.value.format(s.format)),s.close()},v=S=>{i("update:modelValue",S),S?(r.value=K(S,s.format),o.value=r.value):(r.value=K(),o.value=K())},M=()=>{o.value=o.value.add(1,"month")},D=()=>{o.value=o.value.subtract(1,"month")},V=S=>{const P=document.querySelector("#selected-day");P instanceof HTMLButtonElement&&(S.preventDefault(),P.focus())},R=S=>{const P=document.querySelector(`#${s.id} button`);P instanceof HTMLButtonElement&&(S.preventDefault(),P.focus())},J=S=>{if(S.key==="Tab"&&!S.shiftKey&&R(S),["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(S.key)){S.preventDefault();const E=document.activeElement;if(E instanceof HTMLButtonElement){const I=Array.from(document.querySelectorAll(".calendar button")).filter(Z=>!Z.disabled),N=I.indexOf(E);let O=N;switch(S.key){case"ArrowUp":O=N-7;break;case"ArrowDown":O=N+7;break;case"ArrowLeft":O=N-1;break;case"ArrowRight":O=N+1;break;case"Home":O=0;break;case"End":O=I.length-1;break}O>=0&&O<I.length?I[O].focus():O<0?(D(),a.nextTick(()=>{document.querySelector(".calendar > span:last-of-type button:last-of-type")?.focus()})):O>=I.length&&(M(),a.nextTick(()=>{document.querySelector(".calendar button")?.focus()}))}}};return e({update:v,focusDatePicker:V}),(S,P)=>(a.openBlock(),a.createElementBlock("div",{id:u.id,class:"date-picker"},[a.createElementVNode("div",vt,[a.createVNode(a.unref(ht),{id:`${u.id}-date-picker-toggle`,variant:"standard",size:"extra-small","icon-only":"","icon-definition":a.unref(ct),"aria-label":"close date picker",onClick:a.withModifiers(u.close,["prevent"])},null,8,["id","icon-definition","onClick"])]),a.createElementVNode("div",_t,[a.createElementVNode("button",{class:"phila-button icon-button--secondary is-extra-small",onClick:a.withModifiers(D,["prevent"])}," Prev "),a.createElementVNode("span",null,a.toDisplayString(o.value.format("MMMM YYYY")),1),a.createElementVNode("button",{class:"phila-button is-extra-small",onClick:a.withModifiers(M,["prevent"])},"Next")]),a.createElementVNode("div",Ct,[(a.openBlock(),a.createElementBlock(a.Fragment,null,a.renderList(n,E=>a.createElementVNode("span",{key:E,class:"calendar-day is-5 has-text-weight-bold"},a.toDisplayString(E),1)),64)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(h.value,(E,I)=>(a.openBlock(),a.createElementBlock("span",{key:"day-in-previous-month-"+E.date(),class:"calendar-day outside-month is-5"},[a.createElementVNode("button",{class:"phila-button is-extra-small p-2",title:`${E.format("MMMM D, YYYY")}`,tabindex:I===0?0:-1,disabled:g(E),onKeydown:P[0]||(P[0]=N=>J(N)),onClick:a.withModifiers(N=>b(E),["prevent"])},a.toDisplayString(E.date()),41,Et)]))),128)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,(E,I)=>(a.openBlock(),a.createElementBlock("span",{key:`day-in-current-month-${E.date()}`,class:"calendar-day is-5"},[a.createElementVNode("button",{id:E.isSame(r.value,"day")?"selected-day":void 0,class:a.normalizeClass(["phila-button is-extra-small p-2",{active:E.isSame(r.value,"day")}]),title:E.format("MMMM D, YYYY"),tabindex:E.isSame(r.value,"day")||E.month()!==r.value.month()&&I===0?0:-1,disabled:g(E),onKeydown:P[1]||(P[1]=N=>J(N)),onClick:a.withModifiers(()=>b(E),["prevent"])},a.toDisplayString(E.date()),43,yt)]))),128)),(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(m.value,E=>(a.openBlock(),a.createElementBlock("span",{key:"day-in-next-month-"+E.date(),class:"calendar-day outside-month is-5"},[a.createElementVNode("button",{class:"phila-button is-extra-small p-2",title:`${E.format("MMMM D, YYYY")}`,tabindex:"-1",disabled:g(E),onKeydown:P[2]||(P[2]=I=>J(I)),onClick:a.withModifiers(I=>b(E),["prevent"])},a.toDisplayString(E.date()),41,At)]))),128))])],8,kt))}}),xt=(u,e)=>{const t=u.__vccOpts||u;for(const[s,i]of e)t[s]=i;return t},Ft=xt(bt,[["__scopeId","data-v-225c8851"]]),Dt={key:0},St=a.defineComponent({inheritAttrs:!1,__name:"DateField",props:{format:{default:"MM/DD/YYYY"},datePicker:{type:Boolean},imaskProps:{default:()=>({mask:Date,pattern:"m/d/Y",format:u=>K(u).format("MM/DD/YYYY"),parse:u=>K(u,"MM/DD/YYYY").toDate()})},datePickerOptions:{},min:{},max:{},className:{},id:{default:()=>U.generateRandomId("phila-date-field-")},group:{},blurHide:{type:Boolean},showSingle:{type:Boolean,default:!0},mouseOverToggle:{type:Boolean},outsideClickHide:{type:Boolean,default:!0},escapeKeyHide:{type:Boolean,default:!0},visibleOnMount:{type:Boolean},modelValue:{},label:{},supportingText:{},placeholder:{},leadingIcon:{},trailingIcon:{},error:{}},setup(u){const e=u,{setVisibility:t,isVisible:s,toggleProps:i}=U.useVisibility({id:`${e.id}-date-picker`,group:e.group??"date-picker",outsideClickHide:e.outsideClickHide,escapeKeyHide:e.escapeKeyHide,showSingle:e.showSingle}),n=a.computed(()=>s()),r=a.useAttrs(),o=a.useTemplateRef("datePicker"),l=a.useTemplateRef("text-field"),h=a.ref(e.modelValue),m=a.ref(""),g=a.computed(()=>U.cn("default-class",e.className)),b=D=>{h.value=D},v=D=>{(e.min||e.max)&&(Ee(D,e.min,e.max)?m.value="":m.value="Selected date should be between "+K(e.min).format(e.format)+" and "+K(e.max).format(e.format)),o.value?.update(D)},M=a.computed(()=>n.value?null:()=>t(!0));return a.watch(()=>n.value,D=>{if(!D){const V=l.value?.$el.querySelector("input");V&&V.focus()}},{immediate:!0}),(D,V)=>u.datePicker?(a.openBlock(),a.createElementBlock("div",Dt,[a.createVNode(a.unref(xe),a.mergeProps({...a.unref(r),...e},{ref:"text-field",modelValue:h.value,"onUpdate:modelValue":[V[0]||(V[0]=R=>h.value=R),b],class:g.value,"aria-controls":`${e.id}-date-picker`,"trailing-icon":"fa-solid fa-calendar",min:void 0,max:void 0,error:m.value||e.error,"data-toggle":a.unref(i)?.["data-toggle"],onFocus:M.value,onClick:M.value,onKeydown:V[1]||(V[1]=a.withKeys(R=>o.value?.focusDatePicker(R),["tab"])),onComplete:v}),null,16,["modelValue","class","aria-controls","error","data-toggle","onFocus","onClick"]),n.value?(a.openBlock(),a.createBlock(Ft,a.mergeProps({key:0,id:`${e.id}-date-picker`,ref:"datePicker"},e.datePickerOptions,{"initial-value":h.value,min:e.min,max:e.max,format:e.format,close:()=>a.unref(t)(!1),"onUpdate:modelValue":b}),null,16,["id","initial-value","min","max","format","close"])):a.createCommentVNode("",!0)])):(a.openBlock(),a.createBlock(a.unref(xe),a.mergeProps({key:1},{...a.unref(r),...e},{modelValue:h.value,"onUpdate:modelValue":[V[2]||(V[2]=R=>h.value=R),b],class:g.value,label:"Date field","trailing-icon":"fa-solid fa-calendar",errors:m.value||e.error,min:void 0,max:void 0}),null,16,["modelValue","class","errors"]))}}),Ee=(u,e,t)=>{typeof u=="string"&&(u=K(u));const s=e?K(e):null,i=t?K(t):null;return!(s&&u.isBefore(s,"day")||i&&u.isAfter(i,"day"))};exports.DateField=St;exports.isInDateRange=Ee;