@formkit/pro 0.115.8 → 0.115.10
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/index.cjs +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,o){e in $n||($n[e]={timer:0,inputs:new Set});const n=$n[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=fn((()=>{hn[e]||(hn[e]=fn((()=>bn.add(e)),2e3)),function(e){if(un){window.addEventListener(pn(),(o=>{const n=new URL(o.blockedURI).hostname;cn.some(((e,t)=>gn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=mn(rn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from($n[e].inputs),i=l.filter((t=>!(yn[e]&&yn[e].has(t)))).join("");if(vn(e),i){o++;try{const a=await window[mn(an)](`${n}${r}${gn((s+o)%cn.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${i}`)}`),p=await a.json();if(p[mn(sn)])return t(e,p.schema);if(a.ok)return yn[e]||(yn[e]=new Set),void l.forEach((t=>yn[e].add(t)))}catch(e){}o<2&&fn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){bn.add(e),function(e,t){xn[e]&&xn[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return bn.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e){return No(e)&&"value"in e&&"label"in e}function s(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function a(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function l(e,t,n,r){return(...s)=>a=>l=>{const p=function(e,t,n,r,s,a){const l=a[n],p="function"==typeof r?r():{$el:r},d=s.map((e=>"string"==typeof e?e:e(t)(a)));let u=d.length&&p?Jo(p,{children:d}):p;if(u=Jo(u,l),"object"==typeof u){let s=u;if(!Ko(u)&&!jo(u)||u.meta||(u.meta={section:n,node:r}),Ko(u)){const{$el:r,...a}=u;a.attrs?"class"in a.attrs||"if"in a.attrs||(a.attrs={class:`$classes.${n}`,...a.attrs}):a.attrs={class:`$classes.${n}`},s=i(t,n,Object.defineProperty(a,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(jo(u)){const{$cmp:r,...a}=u;s=i(t,n,Object.defineProperty(a,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in u){u.outerClass=`$classes.${n}`;const{$formkit:r,...a}=u;s=i(t,n,Object.defineProperty(a,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return s}return i(t,n,u)}(e,a,t,n,s,l);return r&&No(p)&&(p.memo=e+JSON.stringify(l)),r?[p]:p}}function i(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function p(e){return(t,o,n=!1)=>l(e,t,o,n)}function d(e){return{outer:e("outer",wn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",_n,!1),icon:On,label:e("label",kn,!1),prefix:e("prefix",Tn,!1),suffix:e("suffix",Tn,!1),help:e("help",Dn,!1),messages:e("messages",Sn,!1),message:e("message",Ln,!1)}}function u(e){return{overlayPlaceholder:e("overlayPlaceholder",Mn),overlayLiteral:e("overlayLiteral",En),overlayChar:e("overlayChar",An),overlayEnum:e("overlayEnum",Cn),overlay:e("overlay",In),overlayParts:e("overlayParts",Vn),overlayInner:e("overlayInner",Bn)}}function c(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(qo(s)?Object.assign(s.else,{if:e}):Go(s)&&Object.assign(s,{if:e}),s)}}function f(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",onBlur:"$handlers.blurListitem",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),s=e("loadMoreInner","span"),a=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=e("emptyMessageInner","span"),i=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}})));return()=>t(o(a(l("$emptyMessage")),n(c("$fns.isSelected($option)",On("selected")),i("$option.label")),r(c("$state.loading && $isLoadingOptions || $state.hasNextPage",s(c("$state.loading",On("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}function v(e,t=!0){e.props.isLoadingOptions=!0,e.store.set(fr),e.props.loadingCounter++,e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,cr.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function h(e){e.props.allowAppendOptions=!0,v(e)}function m(e,t){e.props.page++,cr.set(e,t),e.store.set(Uo({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function g(e){return"__original"in e?e.__original:e.value}function $(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!Po(g(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function y(e){const t=$r(e);e.props.isLoadingOption=!0;const o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>Po(g(e),t))))):e.props.inputStd;if(o.forEach((o=>{!function(e,t,o){if(e.props.multiple&&"truncate"!==e.props.selectionAppearance){const n=o||{label:String(t),value:t};e.props.selections.includes(n)||(e.props.selections=[...e.props.selections,n]),e.props.currentOptionsLoading.push(n.value)}const n=e.props.optionLoader(t,o),s=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:No(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},a=t=>{const o=e.props.memoOptions.findIndex((e=>e.value===t.value));return-1===o?e.props.memoOptions.push(t):e.props.memoOptions[o]=t,t};n instanceof Promise?(e.props.loadingCounter++,e.store.set(fr),n.then((e=>{if("string"==typeof e||r(e))return a(s(e))})).finally((()=>{e.props.currentOptionsLoading=e.props.currentOptionsLoading.filter((e=>e!==t)),e.props.loadingCounter--}))):a(s(n))}(e,o,Array.isArray(t)&&t.find((e=>Po(g(e),o)&&!e.noOptionFound)))})),e.props.loadingCounter){const t=e.on("prop:loadingCounter",(()=>{b(e),e.props.loadingCounter||(e.props.isLoadingOption=!1,e.off(t))}))}else b(e)}async function b(e){const t=$r(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:mr&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function x(e){var t,o;if(e.props.options&&e.props.options.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=g(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.options.find((t=>Po(g(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}e.props.reloadOnCommit||e.props.searchValue?e.props.activeValue=g(e.props.options[0]):(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))&&e.props.selections[e.props.selections.length-1]?e.props.activeValue=g(e.props.selections[e.props.selections.length-1]):e.props.activeValue=g(e.props.options[0])}}function w(e,t,o){const n=Qo(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=g(r))}function _(e,t,o){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,w(e,t,o);const n=Qo(o);e.props.options=n,e.props.options.length||(e.store.set(vr),e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}))),x(e),gr.set(e,e.props.searchValue)}function k(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(g(t)!==hr?(e.props.option=t,e.props.maxReached&&!D(e,t)||e.input(S(e,g(t)))):null===(n=e.context)||void 0===n||n.handlers.loadMore())}function S(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];return o.includes(t)?(e.props.optionRemoved=!0,o.filter((e=>e!==t))):[...o,t]}return t===e.value?void(e.props.optionRemoved=!0):t}function L(e,t){return Po(e.props.activeValue,g(t))||void 0}function D(e,t){return e.props.multiple?!!Array.isArray(e.value)&&e.value.includes(g(t)):Po(e.value,g(t))}function T(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","currentOptionsLoading","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll"]),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],e.props.options||(zo(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.props.selections=[],e.props.memoOptions=[],e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:hr},e.props.listboxStyles={},e.props.loadingCounter=0,e.props.searchable=Wo(e.props.searchable),e.props.loadOnScroll=Wo(e.props.loadOnScroll),e.props.multiple=Wo(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=Wo(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&Wo(e.props.openOnRemove),e.props.hasNextPage=m.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.currentOptionsLoading=[],e.props.loadOnCreated=Wo(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0)}function O(e){function t(e,t){var n;if(!e.props.expanded||!e.props.options||!e.props.options.length||yr.has(e))return;const r=e.props.options.reduce(((t,o,n)=>{var r,s;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}`);return a&&t.push([a,o]),t}),[]),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),yr.add(e),r.length&&o(e,r,t)}function o(e,n,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const t=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>t.top&&e.props.mouseY<t.bottom){let t=r||0,o=r;const s=(t,o)=>{var n;const s=o[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){r=t;const s=o[1];return e.props.activeValue=s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?g(s):void 0,!0}return!1};do{if(null!==t&&s(t,n[t]))break;if(null!==o&&s(o,n[o]))break;null!==t&&(t++,t>n.length-1&&(t=null)),null!==o&&(o--,o<0&&(o=null))}while(null!==t||null!==o)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||M(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(a=e.store.loading)||void 0===a?void 0:a.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(e.props.allowAppendOptions=!0,null===(i=e.context)||void 0===i||i.handlers.loadMore(!1)),yr.has(e)?requestAnimationFrame(o.bind(null,e,n,r)):t(e,r)):yr.delete(e)}if(!mr)return;e.props.positionListBox=function(e,t){var o,n;let r=null;if(e.props.activeDescendant){r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>Po(e.value,g(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&M(e)}if("undefined"==typeof window)return r;const s=t.getBoundingClientRect(),a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(a){const t=a.getBoundingClientRect();t.top+t.height+s.height>window.innerHeight&&t.top+t.height>s.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),Ro(`${e.props.id}_dropdown_wrapper`,function(e,o){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(o).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"}),new MutationObserver((()=>{const n=e.props.positionListBox(o);yr.delete(e),t(e,n);let r,s=null;const a=new ResizeObserver((()=>{clearTimeout(r),r=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(o),s||(s=e.on("prop:expanded",(()=>{a.disconnect(),e.off(s)})))}),100)}));a.observe(o)})).observe(o,{childList:!0,subtree:!0})}.bind(null,e),e.props.__root);const n=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_dropdown_wrapper`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},r=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,s;mr&&(t?null===(s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_dropdown_wrapper`))||void 0===s||s.removeEventListener("scroll",r):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_dropdown_wrapper`))})),e.on("prop:expanded",(({payload:t})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:t||e.props.forceExpanded?"999":"-1",pointerEvents:t?"auto":"none"},t?(document.addEventListener("mousemove",n),e.props.styleWrapper(),x(e)):document.removeEventListener("mousemove",n)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;mr&&(t?null===(n=document.getElementById(`${e.props.id}_dropdown_wrapper`))||void 0===n||n.removeEventListener("scroll",r):null===(o=document.getElementById(`${e.props.id}_dropdown_wrapper`))||void 0===o||o.addEventListener("scroll",r))})),e.on("prop:activeValue",(({payload:t})=>{if(t===hr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Po(g(e),t)));e.props.activeDescendant=o>=0?`${e.props.id}_listitem_${o}`:void 0}))}function M(e){var t,o;if(!mr)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_dropdown_wrapper`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function E(){}function A(e){e.on("created",(()=>{if(!e.context||!mr)return;e.context.fns.isActive=L.bind(null,e),e.context.fns.isSelected=t=>D(e,t),e.context.handlers.selectOption=t=>o=>W.call(null,e,t,o),e.context.handlers.loadMore=h.bind(null,e),e.context.handlers.removeSelection=t=>o=>function(e,t,o){o&&o.stopPropagation();if(e.props.disabled)return;e.props.userAction={type:"handleRemoveSelection"},$(e,t)}(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?V.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.handlers.tagClick=t=>F.bind(null,e,t),e.context.handlers.tagFocus=t=>N.bind(null,e,t),e.context.handlers.tagBlur=()=>P.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){t(),o&&function(e,t){var o;if(e.props.disabled)return;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e,o)}.bind(null,e),e.context.handlers.touchmove=C.bind(null,e),e.context.handlers.touchend=I.bind(null,e)}))}function C(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=br.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else br.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function I(e){br.delete(e)}function B(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function V(e,t,o){o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue!==g(t)?(e.props.activeSelectionValue=g(t),o.currentTarget.focus()):e.props.activeSelectionValue=void 0)}function H(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function F(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue!==g(t)?(e.props.activeSelectionValue=g(t),o.currentTarget.focus()):e.props.activeSelectionValue=void 0))}function N(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=g(t),e.props.justFocused=!0)}function P(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function W(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},k(e,t))}function R(e,t,o,n){T(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,g(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),function(e){e.props.firstCommit=!0;let t=null;e.on("commit",(async()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&await v(e),"function"!=typeof e.props.optionLoader||e.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?(t=e.props.inputStd,b(e)):(t=e.props.inputStd,await y(e))}))}(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),O(e),e.props.loadOnCreated&&v(e),e.props.forceExpanded=Wo(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),A(n),t(n),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t?(e.props.expanded=!1,e.props.disabledInternally=!0):e.props.disabledInternally=!1})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&(e.store.set(vr),e.props.isLoadingOptions=!1,e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length))})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0)})),e.on("prop:expanded",(({payload:o})=>{var n;if(mr)if(o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),o.value="",o.value=e.props.inputText)}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(n),o(n)}function Y(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function K(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.options.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(g(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(hr);const a=o.indexOf(e.props.activeValue);-1===a&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>a+1?e.props.activeValue=o[a+1]:"ArrowUp"===t&&a>0?e.props.activeValue=o[a-1]:"ArrowUp"===t&&0===a&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===s||s.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function j(e,t){var o,n,r,s,a;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[e.props.selections.length-1])||void 0===r?void 0:r.value)||void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(s=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===s||s.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[0])||void 0===a?void 0:a.value)||void 0),e.props.expanded=!1}}function U(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function z(e,t,o,n=!0){var r,s,l,i,p,d;const u=o.key;if(o.altKey){const n=a(),r=e.props.selections.findIndex((e=>e.value===t.value)),s=[...e.props.selections];"ArrowRight"===o.key?r<e.props.selections.length-1&&(s.splice(r,1),s.splice(r+1,0,t)):"ArrowLeft"===o.key&&r>0&&(s.splice(r,1),s.splice(r-1,0,t)),e.props.activeSelectionValue=t.value,e.input([...s.map(g)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.map(g).indexOf(g(t));if(-1===o)return;const a="ArrowRight"===u?o+1:o-1;if(a>=e.props.selections.length){if(!n)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());null===(i=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`))||void 0===i||i.focus()}else if(a<0)return;const c=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_tag-wrapper_${a}`);c&&c.focus(),e.props.activeSelectionValue=(null===(d=e.props.selections[a])||void 0===d?void 0:d.value)||void 0}}function Z(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.map(g).indexOf(g(t));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);o.currentTarget.style.display="none",a&&a.focus(),e.props.userAction={type:"tagDelete"},$(e,t)}function X(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(S(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===hr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Po(g(t),e.props.activeValue)));if(!t)return;k(e,t)}else e.props.expanded=!0}function q(e){e.props.expanded&&(e.props.expanded=!1)}function G(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":U(e);break;case"ArrowRight":case"ArrowLeft":z(e,t,o,!1);break;case"Delete":case"Backspace":Z(e,t,o);break;case"Tab":!function(e,t,o,n=!1){var r,s;o.preventDefault();const a=e.props.selections.map(g).indexOf(g(t));if(-1===a)return;const l=o.shiftKey?a-1:a+1;if(l>=e.props.selections.length)return n?(e.props.expanded=!0,void(e.props.activeSelectionValue=void 0)):void 0;if(l<0)return;const i=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${l}`);i&&i.focus(),e.props.activeSelectionValue=(null===(s=e.props.selections[l])||void 0===s?void 0:s.value)||void 0}(e,t,o)}}function J(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var n,r,s,a;o.preventDefault();const l=o.key,i=e.props.selections.map(g).indexOf(g(t));if(-1===i)return;const p="ArrowDown"===l?i+1:i-1;if(p<0&&(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus()),p<0||p>=e.props.selections.length)return;const d=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${p}`);d&&d.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[p])||void 0===a?void 0:a.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var n,r,s,a;if(t){const l=e.props.selections.map(g).indexOf(g(t));if(-1===l)return;const i=o.shiftKey?l-1:l+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus());const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${i}`);p&&p.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[i])||void 0===a?void 0:a.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o,n;if(t){const r=e.props.selections.map(g).indexOf(g(t));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${s}`);a&&a.focus(),e.props.activeSelectionValue=(null===(n=e.props.selections[s])||void 0===n?void 0:n.value)||void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),$(e,t)}(e,t)}}function Q(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":K(e,o,t);break;case"ArrowLeft":case"ArrowRight":j(e,o);break;case"Enter":X(e,t);break;case"Escape":q(e);break;case"Delete":case"Backspace":Y(e);break;default:e.emit("unusedKeydown",t)}}function ee(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":K(e,o,t);break;case"ArrowRight":case"ArrowLeft":j(e,o);break;case"Enter":X(e,t);break;case"Escape":q(e);break;case"Delete":case"Backspace":Y(e)}}function te(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function oe(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function ne(e){let t,o="";e.on("unusedKeydown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){if(!o&&" "===n.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===hr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Po(g(t),e.props.activeValue)));if(!t)return;k(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=g(r)),t=setTimeout((()=>{o=""}),400)}}))}function re(e){se(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,se(e)})),mr&&Ro(`${e.props.id}_selections`,le.bind(null,e),e.props.__root)}function se(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function ae(e){var t,o;if(!mr||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout((()=>{se(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,se(e)}function le(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:ae(e))})),n=new ResizeObserver((()=>{ae(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ie(e,t=[],o,n,r){function s(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const o=wr.get(t),s=e.currentTarget;s.id="dropZone";const a=t.children;if(a&&a instanceof HTMLCollection)for(let e=0;e<a.length;e++)if(a[e]instanceof HTMLElement){const t=a[e];if(n&&!n(t))continue;xr.set(t,{value:o[e],index:e})}const l=xr.get(s);p=l.index,d=l.value,setTimeout((function(){const e=r.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function a(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const o=xr.get(t.currentTarget),n=o.index,s=t.currentTarget;if(d===o.value)return;const a=r.getElementById("dropZone");s&&e&&a&&(n<p?e.insertBefore(a,s):e.insertBefore(a,s.nextSibling),p=n,d=o.value)}}function l(){const t=r.getElementById("dropZone"),s=null==t?void 0:t.parentNode;if(s&&e===s&&(s.removeEventListener("drop",l),t&&t.parentNode)){t.classList.remove("dropZone"),t.removeAttribute("id");const e=[],r=s.children;if(r&&r instanceof HTMLCollection){for(let t=0;t<r.length;t++)if(r[t]instanceof HTMLElement){const o=r[t];if(n&&!n(o))continue;const s=xr.get(o);e.push(s.value)}wr.set(s,e),o&&o(e)}}}function i(e){e.preventDefault(),l()}let p=0,d=null;if(null!=r||(r=document),_r.has(e))wr.set(e,t),e.addEventListener("drop",l);else{const o=new MutationObserver((function(){const o=e,r=[];for(let e=0;e<o.children.length;e++){const t=o.children[e];(n&&n(t)||!n)&&r.push(t)}r.forEach(((e,o)=>{const n=xr.get(e);t&&(n?xr.set(e,{value:n.value,index:o}):xr.set(e,{value:t[o],index:o})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","0"),e.addEventListener("dragstart",s),e.addEventListener("dragend",i),e.addEventListener("dragenter",a)}))}));o.observe(e,{childList:!0}),e.addEventListener("drop",l),document.addEventListener("drop",l),_r.add(e);const r=[];for(let t=0;t<e.children.length;t++){const o=e.children[t];(n&&n(o)||!n)&&r.push(o)}const p=[];for(let e=0;e<r.length;e++)r[e].setAttribute("draggable","true"),r[e].setAttribute("tabindex","0"),r[e].addEventListener("dragstart",s),r[e].addEventListener("dragend",i),r[e].addEventListener("dragenter",a),xr.set(r[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);wr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){S(e,t)}const o=t=>{const o="taglist"===e.props.type||"dropdown"===e.props.type?"formkit-tag-wrapper":"formkit-selection";return t.classList.contains(o)&&!e.props.disabled};e.on("prop:loadingCounter",(({payload:n})=>{0===n&&mr&&!e.props.disableDragAndDrop&&setTimeout((()=>{var n;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_selections`);r&&!0===e.props.multiple&&ie(r,e.value,t,o,e.props.__root)}))})),e.on("commit",(({payload:n})=>{var r;if(e.context&&mr&&!e.props.disableDragAndDrop){const s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_selections`);if(!s||!0!==e.props.multiple)return;ie(s,n,t,o,e.props.__root)}})),e.on("created",(()=>{Ro(`${e.props.id}_selections`,(n=>{n instanceof HTMLElement&&ie(n,e.value,t,o,e.props.__root)}),e.props.__root)}))}function de(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_dropdown_wrapper`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",u=Math.round(i.left-p.left-5)+"px",c=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:u,paddingBottom:c},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function ue(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),u=s.offsetTop-p,c=Math.max(u-p,0),f=Math.max(t.scrollHeight-d-u-l.height,0),v=i.height-c-f;t.scrollTop=u;const h=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:c<d?0:u-d},m=Math.min(150,i.height);c>0&&f>0||0===c&&0===f||v>m?t.scrollTop=u:h();t.clientHeight/2<t.scrollTop&&(r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>Po(e.value,g(t))))),-1===r&&(r=null)}return r}function ce(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&Zo(300,[e]),e.props.dropdownWrapperStyles=Yo(kr),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=de.bind(null,e),e.props.positionListBox=ue.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Or=document.documentElement.scrollTop;for(const e in Sr)Tr[e]=document.documentElement.style[e],document.documentElement.style[e]=Sr[e];for(const e in Lr)Dr[e]=document.body.style[e],document.body.style[e]=Lr[e];document.body.scrollTop=Or}():function(){for(const e in Sr)document.documentElement.style[e]=Tr[e];for(const e in Lr)document.body.style[e]=Dr[e];document.body.scrollTop=0,document.documentElement.scrollTop=Or}())}))}function fe(e){var t,o,r,s,a,l,i,p,d,u,c,f,v,h;if(null!==(t=(p=e.props).removeControl)&&void 0!==t||(p.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(r=(u=e.props).downControl)&&void 0!==r||(u.downControl=!0),null!==(s=(c=e.props).insertControl)&&void 0!==s||(c.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=e.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=e.props).addAttrs)&&void 0!==i||(h.addAttrs={}),e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if("disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),Array.isArray(e.value))if(e.value.length<e.props.min){const t=n(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(n(e.props.min,(()=>({}))),!1);e.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(e,e.context.fns)}function ve(e,t){var o,n;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let r;t instanceof MouseEvent?r=t.clientX:(r=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let s=ge(e,r,t.currentTarget)||0;s=s>e.props.min?s:e.props.min,s=s<e.props.max?s:e.props.max,e.input(s),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()}}function he(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){ye(e,ge(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function me(e){ye(e)}function ge(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function $e(e){setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&(e.props.wrapperWidth=`0 0 ${o.offsetWidth/e.props.max}px`)}))}function ye(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function be(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=we.bind(null,e),e.props.reloadOnCommit=Wo(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=Wo(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&mr&&(e.context.handlers.focus=ke.bind(null,e),e.context.handlers.input=xe.bind(null,e),e.context.handlers.focus=ke.bind(null,e),e.context.handlers.click=_e.bind(null,e),e.context.handlers.toggleListbox=Se.bind(null,e),e.context.handlers.keydown=ee.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>J(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":U(e);break;case"ArrowRight":case"ArrowLeft":z(e,t,o);break;case"Delete":case"Backspace":Z(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>g(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||gr.delete(e)}))}function xe(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&we(e,!0)}function we(e,t=!1){if("function"==typeof e.props.optionsLoader){e.store.set(fr),t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(da.get(e));const o=e.props.searchValue?e.props.debounce:0;da.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),o))}else Array.isArray(e.props.options)&&(pa.add(e),e.props.options=[...e.props.initialOptions.filter((t=>{var o;return e.props.filter(t,null!==(o=e.props.searchValue)&&void 0!==o?o:"",e)}))]);x(e)}function _e(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function ke(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function Se(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function Le(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||De(e)})),e.on("created",(()=>{if(!e.context||!ca)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=Oe(e);if(e.props.highlightedRange){const[t,n]=Te(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){Ro(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&fa.set(t,e)}),e.props.__root),ca&&!va&&(va=!0,document.addEventListener("selectionchange",(()=>{const e=a();if(e instanceof HTMLInputElement&&fa.has(e)){const t=fa.get(e);t&&function(e){clearTimeout(ua.get(e)),ua.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=Oe(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=Te(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,De(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=Oe(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?($(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],we(e))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(ca&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),a()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",we(e,!0))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=Oe(e),l=t>=0?t:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,x(e))}))}function De(e){var t;if(!ca)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function Te(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function Oe(e){const t=$r(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function Me(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],we(e))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&we(e,!0))}))}(e)}function Ee(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand?(e.props.inputText="",e.props.searchValue=""):e.props.searchExpand&&(e.props.searchExpand=!1),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],we(e))}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&we(e,!0)}))}(e)}function Ae(e,t){var o;if(ul.has(e))return;ul.set(e,[]),t.reverse&&kl.add(e),t.prefix&&Sl.set(e,t.prefix),t.suffix&&Ll.set(e,t.suffix),He(e,t.pattern,t.partOverrides,t.explicitParts);const n=hl.get(e),r=null==n?void 0:n.some((e=>Pe(e))),s=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const l=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===l)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===l)&&ml.add(e),gl.set(e,l),t.onChange&&wl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Il)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=ul.get(e);if(null==r?void 0:r.length){const o=(null!==(n=cl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;Ge(e,s),e.setSelectionRange(...s.selectionAfter),cl.set(e,o),wl.has(e)&&wl.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=Ke(e),a=e.value;n&&je(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===l&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),bt(e);case"ArrowLeft":return t.preventDefault(),bt(e,-1);case"ArrowUp":return void(xt(e,1)&&t.preventDefault());case"ArrowDown":return void(xt(e,-1)&&t.preventDefault());case"Tab":return Ol?void t.preventDefault():void(bt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=ml.has(e),n=gl.get(e);if(o){let o=null,r=null,s=!1;const l="shift"===n?0:1,i=e.value;lt(e,{type:"insert",data:i,selectionBefore:[0,0,"none"],valueBefore:i},"shift"===n?"":i,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-l),(Ne(t)||Pe(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-l,!1):("char"===t.type&&(s=!0),!0))));const p=null!==(t=null!=r?r:s?i.length:o)&&void 0!==t?t:null;if(null!==p){let t=[p,p,"none"];if("select"===gl.get(e)){const[o]=ht(e),n=_t(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){yl.set(e,ze(e,t));const n=async()=>{if(!Cl||a()!==e)return;"select"===gl.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=Ke(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Ze(e,t);const[o]=ht(e),n=_t(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&yl.set(e,ze(e,o[n]))}(e));const t=yl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),yl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(yl.get(e))return;Tt(e),t=Ze(e,t);const[o]=ht(e),n=_t(e,t),r=void 0!==n&&ze(e,o[n]);r&&!Ye(t,r)&&qe(e,r,!0)}(e,t.detail))),je(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ce(e){var t,o;if(Tl.has(e))return;const n=null!==(t=ul.get(e))&&void 0!==t?t:[],r=n[null!==(o=cl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=ht(e,r.valueAfter),s=_t(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Tl.set(e,[r,l])}}}function Ie(e){Tl.delete(e)}function Be(e,t){const o="string"==typeof e||!ul.has(e),n="string"==typeof e?Ve(e):e;if(o)t.prefix&&Sl.set(n,t.prefix),t.suffix&&Ll.set(n,t.suffix),n.value=Ue(n,n.value),Ae(n,t);else{const e=kt(n),o=n.value;n.value="",je(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Ve(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function He(e,t,o,n,r){r=e&&kl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(El);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Re(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Fe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Fe(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=Je(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=He(null,r,void 0,t,o);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...s};return e.push(l),e}),[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),u=t.split(p).reduce(((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e}),[]);return r&&u.reverse(),e&&hl.set(e,u),u}function Fe(e){return!!e&&(Re(e)||Ne(e)||Pe(e))}function Ne(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&We(e))}function Pe(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&We(e))}function We(e){return!!e&&("placeholder"in e&&"token"in e)}function Re(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Ye(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Ke(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function je(e,t){var o;kl.has(e)&&Dt(t);let n=!1;switch(_l.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Xe(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===gl.get(e)){const[s,a]=ht(e),l=s.findIndex((e=>Ye(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(Ne(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=st(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=Je(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(Pe(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=lt(e,t,o);return vl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:at(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Xe(t),n=t.selectionBefore,r=kl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=Qe(o,s):s-=Qe(o,s,"backward"));const l=gl.get(e);let i="";if("select"===l){const[o,n]=ht(e),r=_t(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];Ne(l)?i=l.placeholder.repeat(a-s):Pe(l)&&([i,s]=Ye(p,Ke(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=Qe(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=gt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&$t(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=lt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:ct(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(kl.has(e)&&n&&Dt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=ze(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){wl.has(e)&&Dl.set(e,(()=>{Dl.delete(e),n&&wl.get(e)(n,e)})),_l.set(e,"beforeCallback");let t=null!==(o=ul.get(e))&&void 0!==o?o:[];const r=cl.get(e);r&&(t=t.slice(0,r),cl.delete(e)),t.push(n),ul.set(e,t),Cl&&a()===e&&"function"==typeof document.execCommand&&!Il?(qe(e,[0,e.value.length,"forward"],!0),Il=!0,document.execCommand("insertText",void 0,n.valueAfter),Il=!1):Ge(e,n),Cl&&a()===e&&qe(e,n.selectionAfter);const s=Dl.get(e);s&&s(),Tt(e)}_l.set(e,"complete")}function Ue(e,t){var o,n;const r=null!==(o=Sl.get(e))&&void 0!==o?o:"",s=null!==(n=Ll.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function ze(e,t){const o=Sl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Ze(e,t){const o=Sl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Xe(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function qe(e,t,o=!1){o&&(fl.add(e),setTimeout((()=>fl.delete(e)),5)),yl.get(e)&&yl.set(e,t),e.setSelectionRange(...t)}function Ge(e,t,o="After"){if(e.value=t[`value${o}`],Cl){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function Je(e){if(null==e)return"";const t=$l.test(e.charAt(0))&&$l.test(e.charAt(1))?2:1;return e.substring(0,t)}function Qe(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:$l.test(e.charAt(t))&&$l.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:Je(e.substring(t)).length}function et(e,t){const o=Je(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function tt(e){const t=Je(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ot(e,t){const o=Je(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function nt(e,t){for(;t.buffer;){const o=Je(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function rt(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(Qe(t.buffer,0))}return null}function st(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function at(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=Ke(e);o=[n[0],t.endPos,"none"];const[r,s]=ht(e,t.value),a=_t(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(Ne(i)&&st(p,i).length===p.length&&a<r.length-1)return Ml(),r[a+1];if(Pe(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=gt(o.values,r);if(s)return vt(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return $t(i.values,p)?[l[1],l[1],"forward"]:(Ml(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return Ye(s,n)||(fl.add(e),setTimeout((()=>fl.delete(e)),5)),s}return l}function lt(e,t,o,n){var r,s;const a=null!==(r=hl.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:ml.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:gl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:ht(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return it(a,l,void 0,n),l}function it(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":dt(o,t,e.at(-1)===o);break;case"char":ut(o,t,l);break;case"enum":pt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};it(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Re(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),u=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&u&&s)return o.repeats++,it(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Re(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function pt(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=gt(e.values.concat([e.placeholder]),n);if(r){const s=vt(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):rt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=rt(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function dt(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?Je(t.data):"",s=Je(n);if(e===s)n=et(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ot(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function ut(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=Je(t.data);if(e.pattern.test(n))return et(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void nt(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=Je(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,tt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return tt(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function ct(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=ht(e),a=_t(e,r,s),[l,i]=ht(e,t.value),p=void 0!==a&&ft(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>ft(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function ft(e,t,o){if(Re(o))return!1;if(Ne(o)){let n=t[0];for(;n<t[1];){const t=Je(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Pe(o)||e.substring(t[0],t[1])===o.placeholder}function vt(e,t){let o="";do{const n=Je(e).toLowerCase(),r=Je(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function ht(e,t){const o=hl.get(e);if(!o)return[[],[]];if(bl.has(e))return bl.get(e);const n=null!=t?t:Ue(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Re(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(Ne(a)&&Ne(e)&&e.token===a.token)i++;else if(Ne(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Pe(e)){l&&r.push([l,i,"none"]),yt(e)||(p=!1);const t=mt(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&bl.set(e,d),d}function mt(e,t,o){if(yt(t))return t.values[0].length;const n=e.slice(o),r=gt(t.values.concat([t.placeholder]),n);return r?r.length:0}function gt(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=Je(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=gt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function $t(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function yt(e){if(!xl.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;xl.set(e,e.values.every((e=>e.length===t)))}return xl.get(e)}function bt(e,t=1){const[o]=ht(e),n=_t(e,Ze(e,Ke(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...ze(e,o[n+t])),!0)}function xt(e,t=1){const[o,n]=ht(e),r=_t(e,Ke(e));if(void 0!==r&&r in n){const s=n[r];if(Pe(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>je(e,t)),0),!0}}}return!1}function wt(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return wt(e.slice(...r),t)}function _t(e,t,o){const[n]=null!=o?o:ht(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!Ye(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=wt([...s],t[1]);return l in a?a[l]:void 0}function kt(e){var t,o;const n=null!==(t=ul.get(e))&&void 0!==t?t:[];return n[null!==(o=cl.get(e))&&void 0!==o?o:n.length-1]}function St(e,t=!1){const o=kt(e);return o&&(o.complete||t)?kl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Lt(e){var t;const o=kt(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Dt(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function Tt(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}function Ot(e){if(e||(e=new Date),e instanceof Date){const t=new Date(e);return t.setMilliseconds(0),t}if(function(e){const t=e.match(jl);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(jl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Mt(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0),t}function Et(e){const t=Ot(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function At(e){return Et(e).getDate()}function Ct(e,t=0){const o=Ot(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function It(e,t=1){const o=Ot(e);return o.setDate(o.getDate()+t),o}function Bt(e,t=1,o=!1){const n=Ot(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=At(n);n.setDate(e<r?e:r)}return n}function Vt(e,t=1,o=!1){const n=Ot(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=At(n);n.setDate(e<r?e:r)}return n}function Ht(e,t){const o=Ot(e),n=Ot(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function Ft(e,t,o){if(!Vl.has(e)){const t=new Date(Bl),o=[3,8,9,7,6,4,3],n=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in o&&t.setDate(o[a]),t.setUTCHours(8+a);for(const o of r){const r=new Intl.DateTimeFormat(e,n.reduce(((e,t)=>Object.assign(e,{[t]:o})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(Gt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Gt).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&n&&(r[s]=n)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:o})}))}}Vl.set(e,s)}const n=Vl.get(e);return n?n[t][o]:void 0}function Nt(e,t){const o=Yl.get(t);if(o&&o[e])return o[e];const n=new Date(Bl);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Gt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Yl.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function Pt(e,t){const o={timeZone:"UTC"};"string"==typeof e?o.dateStyle=e:("date"in e&&(o.dateStyle=e.date),"time"in e&&(o.timeStyle=e.time));const n=new Intl.DateTimeFormat(t,o),r=n.formatToParts(new Date(Bl)).map(Gt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Gt).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const o=e.type,n=function(e,t,o,n){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?Rl.get("YY"):Rl.get("YYYY");case"month":return s?1===r?Rl.get("M"):Rl.get("MM"):(a=Ft(o,e,t),"long"===a?Rl.get("MMMM"):Rl.get("MMM"));case"day":return 1===r?Rl.get("D"):Rl.get("DD");case"weekday":switch(a=Ft(o,e,t),a){case"narrow":return Rl.get("d");case"short":return Rl.get("ddd");default:return Rl.get("dddd")}case"hour":return 12===n?1===r?Rl.get("h"):Rl.get("hh"):1===r?Rl.get("H"):Rl.get("HH");case"minute":return 1===r?Rl.get("m"):Rl.get("mm");case"second":return 1===r?Rl.get("s"):Rl.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Rl.get("A"):Rl.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Rl.get("ZZ"):Rl.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===n)return;const r=n[1][o];return r?(n[2]||(n[2]=new RegExp(`${n[0]}`,"g")),{option:{[o]:r},partName:o,partValue:r,token:n[0],pattern:n[2],hour12:12===a}):void 0})).filter((e=>!!e))}function Wt(e,t){function o(e,[t,o,n]){const r=Object.keys(o)[0];return{option:o,partName:r,partValue:o[r],token:t,pattern:n,hour12:e}}if(Kl.includes(e)||"object"==typeof e)return Pt(e,t);let n=e,r=0;const s=e=>{if(e[2]||(e[2]=new RegExp(`(.)?(${e[0]})`,"g")),e[2].test(n)){let t=0;return n=n.replace(e[2],((e,o,n)=>"\\"===o?n:`${"string"==typeof o?o:""}{!${t++?r:r++}!}`)),!!t}return!1},a=function(e){const t=e.map((e=>e.partName)),o=new Set(t);if(t.length>o.size)throw new Error("Cannot reuse format tokens.");return e}(Hl.filter(s).concat(Fl.filter(s)).map(o.bind(null,!1)).concat(Nl.filter(s).map(o.bind(null,!0)))),l=/^\{!(\d+)!\}$/;return n.split(/(\{!\d+!\})/).map((e=>{const t=e.match(l);return t?a[Number(t[1])]:{option:{literal:e},partName:"literal",partValue:e,token:e,pattern:new RegExp(""),hour12:!1}})).filter((e=>!("literal"===e.partName&&""===e.partValue)))}function Rt(e,t="en",o=!1,n=(()=>!0)){return Wt(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Hl.concat(Fl).concat(Nl).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],((e,t,o)=>"\\"===o[t-1]?e:`\\${e}`))),e)}(t.token):t.token)),"").normalize("NFKC")}function Yt(e,t,o,n=!1){function r({partName:e,partValue:t,token:n}){if("literal"===e)return t;const r=s[e];if("hour"===e&&"H"===n)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==n&&"ss"!==n||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=Nt(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Jt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&Wl.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Gt)),n&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(Gt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Gt)}const o=t.find((t=>t.type===e.partName)),n=i.findIndex((t=>t.type===e.partName));o&&n>-1&&(i[n]=o)}}const s=Ot(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];return a.length&&r(a,!0),l.length&&r(l),i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Ot(e);return t.map((e=>({...e,value:r(e)})))}function Kt(e,t="long",o="en",n=!1,r=(()=>!0)){return"ISO8601"===t?Ot(e).toISOString():Yt(e,Wt(t,o).filter(r),o,n).map((e=>e.value)).join("")}function jt(e){return["numeric","2-digit"].includes(e.partValue)}function Ut(e,t){let o=0;const n=e=>[e[o++],e[o]];let r=0;const s=[];let a;do{const[o,l]=n(t);a=l;let i=1;if("literal"===o.partName)i=o.partValue.length;else if(o.token in Pl)i=Pl[o.token];else if(l)if("literal"===l.partName){if(i=e.indexOf(l.partValue,r)-r,i<0)throw new Error}else if("dayPeriod"===l.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(r+t)))){i=t;break}}else{const t=e.substring(r).search(/\d/);-1!==t&&(i=r+t)}else i=e.length;s.push({...o,value:e.substring(r,r+i)}),r+=i}while(a);return s}function zt(e,t="en",o=!1){const n=(e,t)=>Array(e).fill("").map(((e,o)=>`${t(o)}`));if("M"===e)return n(12,(e=>e+1));if("MM"===e)return n(12,(e=>{const t=e+1;return t<10?`0${t}`:t}));if(e.startsWith("M"))return zt("MM").map((n=>Kt(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>Kt(`2022-10-${o}`,e,t)));if("a"===e)return[Nt("am",t).toLowerCase(),Nt("pm",t).toLowerCase()];if("A"===e)return[Nt("am",t).toUpperCase(),Nt("pm",t).toUpperCase()];if(e.startsWith("Y")){const o=(new Date).getFullYear();return n(120,(e=>e+1)).reduce(((n,r)=>("120"!==r&&n.push(Kt(`${o+Number(r)}-06-06`,e,t)),n.unshift(Kt(o-Number(r)+"-06-06",e,t)),n)),[Kt(`${o}-06-06`,e,t)])}return e.startsWith("D")?n(31,(t=>`${"DD"===e&&t<9?"0":""}${t+1}`)):e.startsWith("H")?n(24,(t=>`${"HH"===e&&t<10?"0":""}${t}`)):e.startsWith("h")?n(12,(t=>`${"hh"===e&&t<9?"0":""}${t+1}`)):e.startsWith("m")||e.startsWith("s")?n(60,(t=>`${e.length>1&&t<10?"0":""}${t}`)):[]}function Zt(e,t="ISO8601",o="en"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="en",dateOverflow:s="backward",partFilter:r=(()=>!0)}=e):n=e,!n)throw new Error("parse() requires a date string.");const a=()=>{throw new Error(`Date (${n}) does not match format (${Rt(t,o)})`)};if("ISO8601"===t)return Ot(n);const l=Kl.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in Pl||o.token in Pl||jt(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(Wt(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=Ut(n,i)}catch{return a()}const d=new Date,u=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let c=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(u.has(e.token))u.set(e.token,t);else if("YY"===e.token)u.set("YYYY",function(e){const t=(new Date).getFullYear(),o=t%100,n=Math.floor(t/100),r=Number(e);return 100*(n+(r>o+20?-1:0))+r}(e.value));else{const n=e.token;if(n.startsWith("d"))return;if("D"===n)u.set("DD",t);else if("H"===n||n.startsWith("h"))u.set("HH",t);else if("M"===n)u.set("MM",t);else if("a"===n||"A"===n)c=e.value.toLowerCase()===Nt("am",o).toLowerCase();else if("Z"===n)f=Xt(e.value);else{const t=zt(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":u.set("MM",t+1)}}}}));let v=u.get("HH")||0;!1===c?(v+=12===v?0:12,u.set("HH",24===v?0:v)):!0===c&&12===v&&u.set("HH",0),u.set("MM",(u.get("MM")||1)-1);let[h,m,g,$,y,b]=Array.from(u.values());const x=At(new Date(`${zl(h)}-${Ul(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${zl(h)}-${Ul(m+1)}-${Ul(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${zl(h)}-${Ul(m+1)}-${Ul(g)}T${Ul($)}:${Ul(y)}:${Ul(b)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function Xt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function qt(e,t="UTC",o="browser"){o="browser"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Ot(e),r=e=>{const t=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:e,hourCycle:"h23"}).formatToParts(n).map(Gt),o={};return t.forEach((e=>{o[e.type]=e.value})),new Date(`${o.year}-${o.month}-${o.day}T${o.hour}:${o.minute}:${o.second}Z`)},s=r(t);return Jt((r(o).getTime()-s.getTime())/1e3/60)}function Gt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Jt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Qt(e,t="+0000"){const o=Ot(e),n=function(e){Xt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function eo(e,t="+0000"){const o="+"===t.slice(0,1);return Qt(e,t.replace(o?"+":"-",o?"-":"+"))}function to(e,t,o=7){let n,r;const s=Ot(e);switch(o){case"month":r=s.getDate(),n=At(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Ot(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Ot(e);return Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5)}(s);r=t,n=e-t;break;default:n=r=o}for(let e=0;e<=n||e<r;e++){if(e<=n){const o=It(s,e);if(t(o))return o}if(e&&e<=r){const o=It(s,-e);if(t(o))return o}}return null}function oo(e){return"timeZoneName"!==e.partName}function no(e,t){const o=[],n=Ot(t);n.setDate(1);let r=Ct(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=Ct(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Et(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=It(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function ro(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>no(e,Bt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(Kt(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Vt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Ot(e.props.renderedDate);return t.setMonth(0),n(12,(e=>Bt(t,e)))}(e)}function so(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_panels`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ao(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:Zt(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,oo),o}function lo(e){return Array.isArray(e.props.sequence)?Yo(e.props.sequence):["day"]}function io(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?qt(t,e.props.timezone):"+0000";const s=Qt(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(Kt(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function po(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function uo(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Jl.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_panels`)?ti.add(e):ti.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===_l.get(t)&&(n=t.value),Ce(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!ul.has(e))return;const r=null!==(o=Sl.get(e))&&void 0!==o?o:"",s=null!==(n=Ll.get(e))&&void 0!==n?n:"";je(e,{type:"insert",selectionBefore:Ke(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ie(t)),10))}));const[r,s]=fo(e);Ae(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(co(e),Xl.has(e))return Xl.delete(e);n&&n===o?n="":(Ce(t),e.props.inputText=o,setTimeout((()=>Ie(t)),10))}})}function co(e){var t,o;if(e.props.overlay){const n=Jl.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||St(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=s(Lt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fo(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=Wt(e.props.format,t);return[Rt(e.props.format,t,!0,oo),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=zt(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=n(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return r.push(l),s.token.startsWith("D")&&Ql.set(e,a),r}),[])]}function vo(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function ho(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!ni.get(e)&&oi){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){ni.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function go(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=Wo(e.props.overlay),e.props.pickerOnly=Wo(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&Ro(`${e.props.id}`,mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function $o(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Ui.set(e,t),Ae(t,{...ji.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=s(o)}})}function yo(e){const t=Pp.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.addEventListener("dragstart",ko),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||e.addEventListener("dragenter",Mo))}function bo(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const o=[];for(const e of t.accepts)o.push(e);Wp.set(e,o)}}function xo(e){const t=[],o=Pp.get(e),n=Fp.get(e);for(let n=0;n<e.children.length;n++){const r=e.children[n];r instanceof HTMLElement&&(o&&o.childIsDraggable&&!o.childIsDraggable(r)||t.push(r))}for(let e=0;e<t.length;e++){const o=t[e];yo(o),Hp.set(o,{value:n()[e],index:e})}}function wo(e,t,o,n){if(Rp.has(e))Pp.set(e,o),bo(e,o),Fp.set(e,t),Np.set(e,n),xo(e);else{new MutationObserver(_o).observe(e,{childList:!0}),Pp.set(e,o),bo(e,o),Rp.add(e),Fp.set(e,t),Np.set(e,n),function(e){const t=Pp.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Eo),e.addEventListener("dragenter",Oo))}(e),xo(e)}}function _o(e){const t=[];for(const o of e){xo(o.target);for(const e of o.addedNodes)e instanceof HTMLElement&&Hp.has(e)&&t.push(e);for(const e of o.removedNodes)e instanceof HTMLElement&&Hp.has(e)}if(t.length&&Up)for(const e of t)for(const t of zp)Hp.get(e).value!==Hp.get(t).value||e.classList.add("dnd-placeholder");setTimeout((()=>{Zp=!1}),200)}function ko(e){if(So(e)&&Do(e.currentTarget.parentNode)){const t=Pp.get(e.currentTarget.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();if(Up=e.currentTarget,!Up.parentNode)return;const o=Np.get(e.currentTarget.parentNode)();o.includes(Up)||o.push(Up);const n=new DocumentFragment,r=document.createElement("div");r.id="dnd-selections",r.style.display="flex",r.style.flexDirection="column",o.map((e=>{zp.push(e);let t=null;if(Up===e){t=Up.cloneNode(!0);const e=Up.children;for(let t=0;t<e.length;t++){const o=e[t];o instanceof HTMLElement&&(o.style.display="none")}r.appendChild(t)}else t=e.cloneNode(!0),r.appendChild(t),e.style.display="none"})),n.appendChild(r),Up.appendChild(n),Up.classList.add("dnd-dragging"),Up.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Hp.get(Up)}));const s=Fp.get(Up.parentNode)();Yp.set(Up,s),Kp.set(Up,Up.parentNode)}}function So(e){return!!e.currentTarget}function Lo(e){return!!e&&e instanceof HTMLElement}function Do(e){return!!e&&e instanceof HTMLElement}function To(e){return Array.isArray(e)&&e.length>0}function Oo(e){if(So(e)&&Lo(Up)&&Do(Up.parentNode)&&To(zp)&&!Zp){const t=function(e,t){const o=Wp.get(e),n=Kp.get(t),r=t.parentNode;return n!==e&&r===e?{accepted:!0,draggedElementReturned:!0}:o.includes(t.parentNode)?n===e?{accepted:!1,draggedElementReturned:!1}:n!==e?{accepted:!0,draggedElementReturned:!1}:{accepted:!1,draggedElementReturned:!1}:{accepted:!1,draggedElementReturned:!1}}(e.currentTarget,Up);if(t.accepted&&!t.draggedElementReturned){Zp=!0;const t=[...Fp.get(e.currentTarget)()],o=[];for(const e of zp)o.push(Hp.get(e).value);const n=t.concat(o);Kp.set(Up,e.currentTarget),Up.style.display="none",e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}else if(t.accepted&&t.draggedElementReturned){Zp=!0;const t=Yp.get(Up);Kp.set(Up,e.currentTarget),Up.style.display="",Up.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t}))}}}function Mo(e){if(So(e)&&Do(e.currentTarget.parentNode)&&Lo(Up)&&Do(Up.parentNode)&&To(zp)&&function(e,t){const o=Wp.get(e);return o?o&&o.length?o.includes(t.parentNode):void 0:{accepted:!0,draggedElementReturned:!1}}(e.currentTarget.parentNode,Up)&&function(e,t){return Hp.get(t).value!==Hp.get(e).value}(e.currentTarget,Up)&&!Zp){Zp=!0;const t=[...Fp.get(e.currentTarget.parentNode)()],o=zp.map((e=>Hp.get(e).value)),n=[...t.filter((e=>!o.includes(e)))],r=Hp.get(e.currentTarget).index;n.splice(r,0,...o),"none"!==Up.style.display&&Up.parentNode!==e.currentTarget.parentNode?Up.style.display="none":"none"===Up.style.display&&Up.parentNode===e.currentTarget.parentNode&&(Up.style.display=""),Kp.set(Up,e.currentTarget.parentNode),e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}}function Eo(e){if(e.stopPropagation(),e.preventDefault(),Xp=!0,!e.currentTarget)return;const t=Fp.get(e.currentTarget)();e.currentTarget.dispatchEvent(new CustomEvent("dndDrop",{detail:t})),setTimeout((()=>{Ao()}),50)}function Ao(){Up&&(Yp.delete(Up),Kp.delete(Up)),document.querySelectorAll(".dnd-placeholder").forEach((e=>{e.classList.remove("dnd-placeholder")})),document.querySelectorAll(".dnd-dragging").forEach((e=>{e.classList.remove("dnd-dragging");for(let t=0;t<e.children.length;t++){const o=e.children[t];o instanceof HTMLElement&&("dnd-selections"===o.getAttribute("id")?o.remove():"none"===o.style.display&&(o.style.display=""))}})),Up=null,zp=[]}function Co(e,t){e.props.page++,qp.set(e,t),e.store.set(Uo({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function Io(e){return"__original"in e?e.__original:e.value}function Bo(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),Ho(e)}function Vo(e,t){t&&(e.props.showTargetEmptyMessage=0===t.length||!1===t,t=t||[],e.props.newTargetValue&&e.props.isSourceOption&&!e.props.dropped&&!e.props.forceUpdate||(e.props.sourceOptions=[...e.props.options.filter((e=>!t.find((t=>Io(e)===Io(t)))))]),(!e.props.newSourceValue||e.props.isSourceOption||e.props.dropped||e.props.forceUpdate)&&(e.props.targetOptions=t),e.props.targetOptionValues=t.map((e=>Io(e))),e.props.showSourceEmptyMessage=e.props.sourceOptions&&0===e.props.sourceOptions.length,e.props.selections=[],e.props.dropped=!1,e.props.forceUpdate=!1)}function Ho(e,t=!0){e.store.set(nd),e.props.loadingCounter++,e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,qp.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function Fo(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Nd.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:mn(13919),children:`${mn(451228594)}${mn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){xn[e]?xn[e].add(t):xn[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!dn.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Nd.add(o),o.define({...r,schema:n(e)})}Fd((()=>bn.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}import{isRecord as No,eq as Po,undefine as Wo,whenAvailable as Ro,clone as Yo}from"@formkit/utils";import{isDOM as Ko,isComponent as jo,createMessage as Uo,warn as zo,error as Zo}from"@formkit/core";import{icon as Xo,isSlotCondition as qo,isSchemaObject as Go,extendSchema as Jo,normalizeOptions as Qo,defaultIcon as en,localize as tn,options as on}from"@formkit/inputs";import"@formkit/vue";const nn=[988,24029,396,13078,980],rn=18806588,sn=502357,an=16217489;let ln=189024;const pn=()=>[30548127325,27022924,34729821653783].map(mn).join("y"),dn=/^[0-9a-f]+$/,un="undefined"!=typeof window,cn=n(32,(e=>e)).map((()=>{ln|=0,ln=ln+1831565813|0;let e=ln^ln>>>15|ln;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),fn=un?setTimeout:()=>0,vn=e=>{clearTimeout(hn[e])},hn={},mn=e=>e.toString(32),gn=e=>`${mn(cn[e]).substring(2)}.${mn(nn[e%(nn.length-1)])}`,$n={},yn={},bn=new Set(["",null,void 0]),xn={},wn=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined"}}),_n=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),kn=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Sn=()=>({$el:"ul",if:"$fns.length($messages)"}),Ln=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Dn=()=>({$el:"div",if:"$help"}),Tn=()=>({$el:null}),On=(e,t)=>()=>Xo(e,t),Mn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),En=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),An=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Cn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),In=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Bn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Vn=()=>({$el:null,for:["part","$_overlayParts"]}),Hn=p("dd"),{outer:Fn,wrapper:Nn,inner:Pn,icon:Wn,label:Rn,prefix:Yn,suffix:Kn,help:jn,messages:Un,message:zn}=d(Hn),Zn=Hn("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Xn=Hn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),qn=Hn("selection",(()=>({$el:"div"}))),Gn=Hn("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),Jn=Hn("optionLoading","span"),Qn=Hn("option",(()=>({$el:"div"}))),er=Hn("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),tr=Hn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),or=Hn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),nr=Hn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),rr=Hn("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),sr=Hn("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"0",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-active-selection":"$activeSelectionValue === $option.value"}}))),ar=Hn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"0"}}))),lr=Hn("tagLabel",(()=>({$el:"span"}))),ir=Hn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),pr=Hn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),dr=Hn("tagLoading","span"),ur=f(Hn),cr=new WeakMap,fr=Uo({key:"loading",type:"state",value:!0,visible:!1}),vr=Uo({key:"loading",type:"state",value:!1,visible:!1}),hr=Symbol(),mr="undefined"!=typeof window,gr=new WeakMap,$r=e=>{const t=(e=>{const t=[...e.props.options,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o=t.find((t=>Po(g(t),e)));o||(o={value:e,label:Array.isArray(e)?e.join(", "):e,isPlaceholder:!1,noOptionFound:!0}),n.push(o)}return n},yr=new WeakSet,br=new WeakMap,xr=new WeakMap,wr=new WeakMap,_r=new WeakSet,kr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Sr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Lr={overflow:"hidden",height:"100%"},Dr={},Tr={};let Or=0;const Mr={schema:Fn(Nn(Rn("$label"),Pn(Wn("prefix"),Yn(),Zn(c("$inputStd.length === 0 && $state.loading !== true",Gn('$placeholder || ""'),c("$multiple !== true",Xn(c("$state.loading && $selections.length === 0",Jn("$ui.isLoading.value"),qn(Qn("$option.label")))),c('$multiple && $selectionAppearance === "truncate"',tr(or(c("$state.loading && $selections.length === 0",Jn("$ui.isLoading.value"),rr()))),c('$multiple && $selectionAppearance === "tags"',ir(pr(c("$state.loading && $isLoadingOption !== true && $selections.length === 0",Jn("$ui.isLoading.value"),sr(ar(c("$state.loading && $currentOptionsLoading.includes($option.value)",dr("$ui.isLoading.value"),lr("$option.label")),er(Wn("close"))))))))))),c("$truncationCount && $state.loading !== true",nr("$truncationCount")),c("$state.loading",Wn("loader")),c("$value && $selectionRemovable",er(Wn("close")),Wn("select"))),ur(),Kn(),Wn("suffix"))),jn("$help"),Un(zn("$message.value"))),type:"input",family:"dropdown",props:[],features:[en("select","select"),en("close","close"),en("selected","check"),en("loader","spinner"),tn("isLoading"),tn("loadMore"),on,R.bind(null,(function(e){e.props.applyLoadedOptions=w,void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=Wo(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=Wo(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&Wo(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=te.bind(null,e),e.context.handlers.focus=oe.bind(null,e),e.context.handlers.keydown=Q.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>G.bind(null,e,t))}))}),(function(e){e.on("created",(()=>{e.context&&ne(e)})),e.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,re(e),e.on("prop:selections",(()=>{re(e)}))),!e.props.disableDragAndDrop&&e.props.multiple&&"tags"===e.props.selectionAppearance&&pe(e),e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],v(e))})),"overscroll"===e.props.behavior&&ce(e)}))]},Er=p("tg"),{outer:Ar,wrapper:Cr,label:Ir,prefix:Br,suffix:Vr,help:Hr,messages:Fr,message:Nr,icon:Pr}=d(Er),Wr=Er("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Rr=Er("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Yr=Er("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),Kr=Er("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),jr=Er("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),Ur=Er("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),zr=Er("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Zr=Er("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Xr={schema:Ar(Cr(Yr(),Ur(Br(),Wr(),zr(Kr(),Zr(c("$slots.default","$slots.default",Pr("thumb")))),Vr()),jr(),Rr()),Hr("$help"),Fr(Nr("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.props.altLabelPosition=Wo(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=Po(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=Po(t,e.props.onValue)}))}]},qr=p("rp"),{outer:Gr,inner:Jr,prefix:Qr,suffix:es,help:ts,messages:os,message:ns,icon:rs}=d(qr),ss=qr("empty",(()=>({$el:"div"}))),as=qr("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),ls=qr("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),is=qr("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),ps=qr("items",(()=>({$el:"ul",attrs:{role:"list"}}))),ds=qr("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),us=qr("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),cs=qr("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),fs=qr("content","div"),vs=qr("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),hs=qr("legend",(()=>({$el:"legend",if:"$label"}))),ms=qr("group",(()=>({$formkit:"group",index:"$index"}))),gs=qr("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),$s=qr("remove",(()=>({$el:"li",if:"$removeControl"}))),ys=qr("insert",(()=>({$el:"li",if:"$insertControl"}))),bs=qr("up",(()=>({$el:"li",if:"$upControl"}))),xs=qr("down",(()=>({$el:"li",if:"$downControl"}))),ws=qr("controlLabel","span"),_s={schema:Gr(vs(hs("$label"),ts("$help"),Jr(Qr(),c("$value.length === 0",c("$slots.empty",ss()),c("$slots.default",ps(ds(fs(ms("$slots.default")),gs(bs(cs(ws("$ui.moveUp.value"),rs("moveUp"))),$s(is(ws("$ui.remove.value"),rs("remove"))),ys(as(ws("$ui.add.value"),rs("add"))),xs(us(ws("$ui.moveDown.value"),rs("moveDown")))))),es()))),ls('$addLabel || ($ui.add.value + " " + ($label || ""))')),os(ns("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){e._c.sync=!0,e.on("created",fe.bind(null,e))},tn("remove"),tn("add"),tn("moveUp"),tn("moveDown"),en("remove","trash"),en("add","add"),en("moveUp","arrowUp"),en("moveDown","arrowDown")]},ks="undefined"!=typeof window,Ss=p("rt"),{outer:Ls,wrapper:Ds,inner:Ts,label:Os,prefix:Ms,suffix:Es,help:As,messages:Cs,message:Is,icon:Bs}=d(Ss),Vs=Ss("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),Hs=Ss("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Fs=Ss("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),Ns=Ss("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),Ps=Ss("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Ws=Ss("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Rs={schema:Ls(Ds(Os("$label"),Ts(Bs("prefix"),Ms(),Hs(Fs(Ps(c("$slots.onItem",(()=>()=>"$slots.onItem"),c("$slots.default",(()=>()=>"$slots.default"),Bs("rating"))))),Ns(Ws(c("$slots.offItem",(()=>()=>"$slots.offItem"),c("$slots.default",(()=>()=>"$slots.default"),Bs("rating")))))),Vs(),Es(),Bs("suffix"))),As("$help"),Cs(Is("$message.value"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.on("created",(()=>{ks&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=he.bind(null,e),e.context.handlers.ratingHoverOut=me.bind(null,e),e.context.handlers.handleClick=ve.bind(null,e),ks&&Ro(`${e.props.id}`,(()=>{$e(e),function(e){var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!o)return;const n=new ResizeObserver((()=>{$e(e)}));n.observe(o)}(e),setTimeout((()=>$e(e)),100)}),e.props.__root))})),e.on("input",(()=>ye(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)}))},en("rating","star")]},Ys=p("ac"),{outer:Ks,wrapper:js,inner:Us,icon:zs,label:Zs,prefix:Xs,suffix:qs,help:Gs,messages:Js,message:Qs}=d(Ys),ea=Ys("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),ta=Ys("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button",onClick:"$handlers.toggleListbox",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),oa=Ys("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 1',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-active-selection":"$activeSelectionValue === $option.value"}}))),na=Ys("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),ra=Ys("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),sa=Ys("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),aa=Ys("optionLoading","span"),la=Ys("option",(()=>({$el:"div",if:"$value !== undefined"}))),ia=f(Ys),pa=new WeakSet,da=new WeakMap,ua=new WeakMap,ca="undefined"!=typeof window,fa=new WeakMap;let va=!1;const ha={schema:Ks(js(Zs("$label"),Us(zs("prefix"),Xs(),ea(),c("$multiple !== true && $selectionAppearance === option && $expanded === false",ra(oa(na(la(c("$state.loading",aa("$ui.isLoading.value"),"$option.label"))),c("$state.loading && $isSingleOption !== true && $currentOptionsLoading.includes($option.value)",zs("loader")),c("$selectionRemovable && $isSingleOption",sa(zs("close")))))),c("$state.loading && ($isSingleOption !== true || $selections.length === 0)",zs("loader")),c('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',sa(zs("close")),c('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',ta(zs("select")))),c("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $currentOptionsLoading.length > 0)",ta(zs("select"))),ia(),qs(),zs("suffix")),c("$multiple && $selectionAppearance === option",ra(oa(na(la(c("$state.loading && $isLoadingOption",aa("$ui.isLoading.value"),"$option.label"))),sa(zs("close")))))),Gs("$help"),Js(Qs("$message.value"))),type:"input",family:"dropdown",props:[],features:[en("select","select"),en("close","close"),en("selected","check"),en("loader","spinner"),tn("isLoading"),tn("loadMore"),on,R.bind(null,(function(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=Wo(e.props.clearSearchOnOpen)),e.props.selectionRemovable=Wo(e.props.selectionRemovable),e.props.applyLoadedOptions=_,e.props.openOnClick=Wo(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=Wo(e.props.allowNewValues)}),be,(function(e){e.props.multiple?e.props.multiple&&"option"===e.props.selectionAppearance?(Me(e),e.props.disabledDragAndDrop||pe(e)):e.props.multiple&&"text-input"===e.props.selectionAppearance&&Le(e):Ee(e)}))]},ma=p("dp"),{outer:ga,wrapper:$a,inner:ya,icon:ba,label:xa,prefix:wa,suffix:_a,help:ka,messages:Sa,message:La}=d(ma),Da=ma("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),Ta=ma("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:"$id + _panels",role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1","aria-modal":"true","aria-label":"Choose date"}}))),Oa=ma("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ma=ma("nextLabel","span"),Ea=ma("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Aa=ma("prevLabel","span"),Ca=ma("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Ia=ma("calendarWeeks",(()=>({$el:"tbody"}))),Ba=ma("calendarHeader",(()=>({$el:"thead"}))),Va=ma("weekDays",(()=>({$el:"tr"}))),Ha=ma("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Fa=ma("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Na=ma("dayCell",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),Pa=ma("day","div"),Wa=ma("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Ra=ma("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Ya=ma("year",(()=>({for:["year","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),Ka=ma("months",(()=>({if:'$panel === "month"',$el:"ul"}))),ja=ma("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),Ua=ma("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),za=ma("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Za=ma("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Xa=ma("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),qa=ma("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Ga=ma("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Ja=ma("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Qa=ma("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),el=ma("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),tl=ma("time",(()=>({$el:"div",if:'$panel === "time"'}))),ol=ma("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),{overlayPlaceholder:nl,overlayLiteral:rl,overlayChar:sl,overlayEnum:al,overlay:ll,overlayParts:il,overlayInner:pl}=u(ma),dl=ma("panel","div"),ul=new WeakMap,cl=new WeakMap,fl=new WeakSet,vl=new WeakMap,hl=new WeakMap,ml=new WeakSet,gl=new WeakMap,$l=/[\uD800-\uDBFF]/,yl=new WeakMap,bl=new WeakMap,xl=new WeakMap,wl=new WeakMap,_l=new WeakMap,kl=new WeakSet,Sl=new WeakMap,Ll=new WeakMap,Dl=new WeakMap,Tl=new WeakMap;let Ol=!1;const Ml=()=>{Ol=!0,setTimeout((()=>{Ol=!1}),500)},El={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Al=new WeakMap,Cl="undefined"!=typeof window;let Il=!1;Cl&&document.addEventListener("selectionchange",(()=>{const e=a();if(!(e instanceof HTMLInputElement))return;if(Tl.has(e))return function(e){const t=Tl.get(e);if(t){const[o,n]=t,[r,s]=ht(e),a=s.indexOf(o);if(-1===a)return void Tl.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];Ye(Ke(e),i)||qe(e,i)}}(e);if("select"!==gl.get(e))return;const t=Ke(e);if(!Ye(t,Al.get(e))){if(Al.set(e,t),fl.has(e))return fl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:Ke(e)}))}}));const Bl="1999-03-04T02:05:01.000Z",Vl=new Map,Hl=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["Z",{timeZoneName:"short"}]],Fl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Nl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Pl={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Wl=["MMMM","MMM","dddd","ddd"],Rl=new Map([...Hl,...Fl,...Nl].map((e=>[e[0],e]))),Yl=new Map,Kl=["full","long","medium","short"],jl=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{4})?$/,Ul=e=>String(e).padStart(2,"0"),zl=e=>String(e).padStart(2,"0"),Zl="undefined"!=typeof window,Xl=new WeakSet,ql=new WeakSet,Gl=new WeakSet,Jl=new WeakMap,Ql=new WeakMap,ei=new WeakSet,ti=new WeakSet,oi="undefined"!=typeof window,ni=new WeakMap,ri={schema:ga($a(xa("$label"),ya(ba("prefix"),wa(),ll(pl(il(nl("$part.value"),rl("$part.value"),sl("$part.value"),al("$part.value")))),Da(),Ta(Ua(Ea(Aa("$ui.prev.value"),ba("prev")),za("$decade"),Za(Ga()),Xa(Ja(),Ga()),qa(Ja(),Qa(),Ga()),Oa(Ma("$ui.next.value"),ba("next"))),dl(Ra(Ya("$fns.format($year, $yearFormat)")),Ka(ja("$fns.format($month, $monthFormat)")),Ca(Ba(Va(Ha("$fns.format($day, $weekdayFormat)"))),Ia(Fa(Na(Pa("$fns.format($day, $dateFormat)"))))),tl(ol()))),el(ba("clear")),Wa(ba("calendar")),_a(),ba("suffix"))),ka("$help"),Sa(La("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[go,function(e){var t,o,r,s,a,l,i,p,d,u,c,f,v,h,m,g,$,y,b,x,w,_;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=qt(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(f=e.props).valueFormat)&&void 0!==t||(f.valueFormat="ISO8601"),null!==(o=(v=e.props).weekdayFormat)&&void 0!==o||(v.weekdayFormat="d"),null!==(r=(h=e.props).monthFormat)&&void 0!==r||(h.monthFormat="MMM"),null!==(s=(m=e.props).monthButtonFormat)&&void 0!==s||(m.monthButtonFormat="MMMM"),null!==(a=(g=e.props).dayButtonFormat)&&void 0!==a||(g.dayButtonFormat="D"),null!==(l=($=e.props).dateFormat)&&void 0!==l||($.dateFormat="D"),null!==(i=(y=e.props).yearFormat)&&void 0!==i||(y.yearFormat="YYYY"),null!==(p=(b=e.props).paginatedPanels)&&void 0!==p||(b.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(u=(w=e.props).format)&&void 0!==u||(w.format="long"),e.props.panels=lo(e),e.props.pickerOnly=Wo(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=Wo(e.props.clearable)),null!==(c=(_=e.props).maxScan)&&void 0!==c||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):vo.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Ot(t);else if("string"==typeof t)try{o=Ot(Zt(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${Rt(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?qt(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?Zt(e.props.minDate):e.props.minDate;e.props.minDate=eo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?Zt(e.props.maxDate):e.props.maxDate;e.props.maxDate=eo(t,e.props.offset)}o=o&&eo(o,e.props.offset),o&&io(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&Kt(o,"HH:mm")||"12:00"}(e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=Kt,e.on("created",(()=>{if(Ro(`${e.props.id}`,uo.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>Kt(t,o,e.props.locale||"en",!1,oo),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!to(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!to(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return Ht(t,eo(n instanceof Date?n:Zt(n,e.props.valueFormat,e.props.valueLocale),e.props.offset))},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_panels`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_panels`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Jl.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props._isFocused=!0,e.props.pickerOnly&&!ql.has(e)&&(Gl.add(e),e.props.expanded=!0,setTimeout((()=>Gl.delete(e)),200))},e.context.handlers.clear=()=>{var t,o;io(e,void 0,!0),ao(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(ei.has(e))return ei.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=Zt({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:oo});if(function(e){return Wt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Tl.get(t.target)&&Kt(n,e.props.format,e.props.locale,!1,oo)!==t.target.value){const r=zt("dddd",e.props.locale),s=Wt(e.props.format,e.props.locale),a=null===(o=Ut(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=Kt(n,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,n=It(n,t),Xl.add(e)}}io(e,n)}catch(t){io(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Vt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=Bt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Vt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=Bt(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),ao(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=to(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&Ht(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=function(e){const t=Ot(e);return t.setHours(0,0,0),t}(t).getTime();return o<Mt(e).getTime()||o>Et(e).getTime()||void 0}}}));const k=so.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),io(e,t))})),e.on("input",(({payload:t})=>{const o=new Date,n=t?ao(e,eo("string"==typeof t?Zt(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=Kt(n,"HH:mm"),function(e){const t=Ql.get(e);if(e._value&&t){const o=At(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",ro.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(ti.delete(e),e.props.panels=lo(e),e.props.panel=e.props.panels.shift(),"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=to(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}ro(e),Ro(`${e.props.id}_panels`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&(o.focus(),function(e,t){const o=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(e,t))}),e.props.__root),Zl&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){ei.add(e);const t="string"==typeof e._value?Zt(e._value,e.props.valueFormat,e.props.valueLocale):e._value;ao(e,eo(t,e.props.offset))}else ao(e,void 0);Zl&&(ql.add(e),document.removeEventListener("click",k),setTimeout((()=>ql.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=Mt(e.props.renderedDate),r=Et(Bt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=Bt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=Bt(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,o=t[0].getFullYear(),n=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>n?e.props.renderedDate=Vt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Vt(e.props.renderedDate,-10))}e.props.expanded&&ao(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||po(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=It(e.props.activeDate,r)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=r>0?1:-1;n(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=It(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=Vt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=Bt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=to(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Jl.get(e)&&co(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=Uo({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:ho(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},tn("next"),tn("prev"),tn("changeDate"),tn("chooseDate"),en("next","right"),en("clear","close"),en("prev","left"),en("calendar","date")]},si=p("tl"),{outer:ai,wrapper:li,inner:ii,icon:pi,label:di,prefix:ui,suffix:ci,help:fi,messages:vi,message:hi}=d(si),mi=si("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),gi=si("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),$i=si("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-active-selection":"$activeSelectionValue === $option.value"}}))),yi=si("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),bi=si("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),xi=si("tagLabel",(()=>({$el:"span"}))),wi=si("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),_i=si("tagLoading","span"),ki=f(si),Si={schema:ai(li(di("$label"),ii(pi("prefix"),ui(),wi($i(yi(c("$state.loading && $currentOptionsLoading.includes($option.value)",_i("$ui.isLoading.value"),xi("$option.label")),bi(pi("close")))),mi()),c("$state.loading",pi("loader")),gi(pi("select")),ki(),ci(),pi("suffix"))),fi("$help"),vi(hi("$message.value"))),type:"input",family:"dropdown",props:[],features:[on,R.bind(null,(function(e){e.props.multiple=!0,e.props.applyLoadedOptions=_,e.props.openOnClick=Wo(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=Wo(e.props.allowNewValues)}),be,(function(e){Me(e),e.props.disableDragAndDrop||pe(e)})),en("select","select"),en("close","close"),en("selected","check"),en("loader","spinner"),tn("isLoading"),tn("loadMore")]},Li=p("mk"),{outer:Di,wrapper:Ti,inner:Oi,label:Mi,prefix:Ei,suffix:Ai,help:Ci,messages:Ii,message:Bi,icon:Vi}=d(Li),{overlayPlaceholder:Hi,overlayLiteral:Fi,overlayChar:Ni,overlayEnum:Pi,overlay:Wi,overlayParts:Ri,overlayInner:Yi}=u(Li),Ki=Li("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),ji=new WeakMap,Ui=new WeakMap,zi=new WeakMap,Zi={schema:Di(Ti(Mi("$label"),Oi(Vi("prefix"),Ei(),Wi(Yi(Ri(Hi("$part.value"),Fi("$part.value"),Ni("$part.value"),Pi("$part.value")))),Ki(),Ai(),Vi("suffix"))),Ci("$help"),Ii(Bi("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[go,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,a;const l=Ve("string"==typeof e._value?e._value:"");Ui.set(e,l),zi.set(e,l),e.props.allowIncomplete=Wo(e.props.allowIncomplete),e.props.overlay=Wo(e.props.overlay);const i=!(void 0!==e.props.showMask&&!Wo(e.props.showMask));e.props.unmaskValue=Wo(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=Wo(e)),t(e))));const p={placeholder:i,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(r=e.props.prefix)&&void 0!==r?r:void 0,suffix:null!==(a=e.props.suffix)&&void 0!==a?a:void 0,reverse:Wo(e.props.reverse)};ji.set(e,p),e.hook.input(((t,o)=>{const n=function(e,t){const o=Ui.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=zi.get(e);r.value=Ue(r,t);const a=Be(r,ji.get(e)),l=St(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=l?l:"":null===l?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||a===e.props._maskValue||(o.value=a,e.props._maskValue=a,e.props._overlayParts=s(Lt(r)||[]));return null===l?"":e.props.unmaskValue?l:a}(e,t);return o(n)})),e.props._maskValue=Be(l,p),e.input(e.props._maskValue,!1),Ro(`${e.props.id}`,$o.bind(null,e),e.props.__root)}))}]},Xi=p("tf"),{outer:qi,wrapper:Gi,inner:Ji,icon:Qi,prefix:ep,suffix:tp,help:op,messages:np,message:rp}=d(Xi),sp=Xi("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),ap=Xi("legend",(()=>({if:"$label",$el:"legend"}))),lp=Xi("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),ip=Xi("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),pp=Xi("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),dp=Xi("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$fns.getOptionCount() + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'},children:"$fns.getOptionCount()"}))),up=Xi("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),cp=Xi("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$fns.getOptionCount(true) + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$fns.getOptionCount(true)"}))),fp=Xi("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),vp=Xi("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),hp=Xi("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.handleSourceSearchKeyDown",disabled:"$disabled","aria-label":"Search",role:"searchbox",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput'}}))),mp=Xi("sourceSearchClear",(()=>({$el:"button",if:"$inputText !== undefined",attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),gp=Xi("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(true)",onMouseout:"$handlers.onMouseLeave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceKeyDown",tabindex:"0",onFocus:"$handlers.sourceFocused"}}))),$p=Xi("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$selections && $selections.length > 0 && $fns.isSelected($option)","data-is-active":"$fns.isActive($option)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),yp=Xi("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),bp=Xi("sourceLoadMore",(()=>({$el:"li",if:"$targetLoading !== true && $state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.sourceLoadMore'}}))),xp=Xi("loadMoreInner","span"),wp=Xi("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),_p=Xi("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),kp=Xi("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(false)",onMouseout:"$handlers.onMouseLeave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"0",onKeydown:"$handlers.targetKeyDown",onFocus:"$handlers.targetFocused"}}))),Sp=Xi("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$selections && $selections.length && $fns.isSelected($option, $target)","data-is-active":"$fns.isActive($option)",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Lp=Xi("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Dp=Xi("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Tp=Xi("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Op=Xi("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selections.length === 0 || $sourceSelected === false || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),Mp=Xi("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$options.length === $targetOptions.length || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),Ep=Xi("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selections.length === 0 || $sourceSelected === true || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),Ap=Xi("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),Cp=Xi("controlLabel","span"),Ip=Xi("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Bp=Xi("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Vp=Xi("emptyMessageInner","span"),Hp=new WeakMap,Fp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,Wp=new WeakMap,Rp=new WeakSet,Yp=new WeakMap,Kp=new WeakMap,jp="undefined"!=typeof window;let Up=null,zp=[],Zp=!1,Xp=!1;jp&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("dragend",(()=>{Xp?Xp=!1:function(){if(Lo(Up)&&Do(Up.parentNode)){const e=Yp.get(Up);Up.parentNode.dispatchEvent(new CustomEvent("dndDrop",{detail:e}))}Ao()}()})));const qp=new WeakMap,Gp=new WeakSet,Jp=new WeakSet,Qp=new WeakMap,ed=new WeakMap,td="undefined"!=typeof window,od=new WeakMap,nd=Uo({key:"loading",type:"state",value:!0,visible:!1}),rd=Uo({key:"loading",type:"state",value:!1,visible:!1}),sd=Symbol(),ad={schema:qi(sp(ap("$label"),op("$help"),Gi(lp(ip(pp(),dp()),fp(vp(hp(),mp(Qi("close")))),gp(Ip(Vp("$sourceEmptyMessage")),$p(c("$transferOnSelect !== true && $fns.isSelected($option)",Qi("selected")),yp("$option.label")),bp(xp(c("$targetLoading !== true && $state.loading",Qi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Tp(Mp(Cp("$ui.addAllValues.value"),Qi("fastForward")),Op(Cp("$ui.addSelectedValues.value"),Qi("moveRight")),Ep(Cp("$ui.removeSelectedValues.value"),Qi("moveLeft")),Ap(Cp("$ui.removeAllValues.value"),Qi("rewind"))),wp(_p(up(),cp()),kp(Bp(c("$state.loading !== true",Vp("$targetEmptyMessage"))),Sp(c("$transferOnSelect !== true && $fns.isSelected($option)",Qi("selected")),Lp("$option.label")),Dp(xp(c("$targetLoading && $state.loading",Qi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),np(rp("$message.value")))),type:"input",props:["options","selections","activeValue","activeDescendant","sourceSelected","targetOptions","sourceOptions","optionLoader","filterOptions","inputText","hasNextPage","page","targetOptionValues","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","debounce"],features:[function(e){function t(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>Po(Io(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function o(e){const t=Array.isArray(e.props.options)?e.props.options:[],o=Array.isArray(e.props.memoOptions)?e.props.memoOptions:[],n=Array.isArray(e.props.targetOptions)?e.props.targetOptions:[];0===e.props.targetOptions.length&&(e.props.showTargetEmptyMessage=!0);const s=o.concat(t).concat(n);return!!s.length&&(!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const o=s.find((e=>Po(t,Io(e))));if(o)e.push(o);else{const o=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:No(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t};e.push(o(t))}return e}),[]))}function n(e,t,o,n){function r(){const o=p.findIndex((e=>Io(e)===Io(t))),n=p.findIndex((t=>Io(t)===Io(e.props.selections[0]))),r=Math.min(o,n),s=Math.max(o,n),a=p.slice(r,s+1);e.props.selections=a}if(e.props.disabled)return;if(e.props.isSourceOption!==o&&(e.props.isSourceOption=o,e.props.selections=[]),e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)return;const s=!!n&&(n.shiftKey&&e.props.selections.length);e.props.isSourceOption=o;const i=e.props.selections.map((e=>Io(e)));if(i.includes(Io(t))){const o=e.props.selections.findIndex((e=>Io(e)===Io(t)));return e.props.selections.splice(o,1),void(e.props.selections=[...e.props.selections])}const p=o?e.props.sourceOptions:e.props.targetOptions;e.props.sourceSelected===!o?s?r():(e.props.selections=[...e.props.selections,t],e.props.sourceSelected=o):s?r():e.props.selections=[...e.props.selections,t],e.props.transferOnSelect&&(o?a(e):l(e))}function s(e,t){const o=t.map((e=>Io(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.props.selections=[],e.input(t),e.props.activeValue=void 0}}function a(e){if(Array.isArray(e.value)){e.props.optionsLoader||!1===e.props.clearOnSelect||(e.props.inputText=void 0);const t=e.props.selections.map((e=>Io(e))),o=[...e.value,...t];e.props.forceUpdate=!0,e.input(o),e.props.selections=[]}}function l(e){if(Array.isArray(e.value)){const t=e.props.selections.map((e=>Io(e))),o=e.value.filter((e=>!t.includes(e)));if(e.props.forceUpdate=!0,e.input(o),e.props.optionsLoader){const t=[...e.props.options];e.props.options=[...t]}e.props.selections=[]}}function i(t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Gp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Jp.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Gp.add(e),e.props.mouseOnTarget&&Jp.add(e),a.length&&p(e,a,null,t)}function p(e,t,o,n){var r,s,a;const l=n,u=l?l.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>u.top&&e.props.mouseY<u.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?Io(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}else d(e);e.props.mouseOnSource||e.props.mouseOnTarget?(l&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&l.scrollTop+l.offsetHeight>l.scrollHeight-200&&e.props.mouseOnSource&&(e.props.allowAppendOptions=!0,null===(a=e.context)||void 0===a||a.handlers.loadMore(!1)),e.props.mouseOnSource&&Gp.has(e)||e.props.mouseOnTarget&&Jp.has(e)?requestAnimationFrame(p.bind(null,e,t,o,n)):i(n)):(Gp.delete(e),Jp.delete(e))}function d(e){var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.activeDescendant);o&&o.scrollIntoView({block:"nearest",inline:"start"})}e.addProps(["search"]),e.props.memoOptions=[],e.props.targetOptions=[],e.props.targetOptionValues=[],e.props.multiple=!0,e.props.loadingCounter=0,e.props.page=1,e.props.hasNextPage=Co.bind(null,e),e.props.applyLoadedOptions=function(e,o,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t,o){const n=Qo(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=Io(r))}(e,o,n);const r=Qo(n);e.props.options=r,e.props.options.length||(e.store.set(rd),e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}))),t(e),od.set(e,e.props.searchValue)},e.on("created",(()=>{if(e.value||e.input([],!1),e.props.options||(e.props.options=[]),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.props.searchable=Wo(e.props.searchable),void 0===e.props.clearOnSelect?e.props.clearOnSelect=!0:"false"===e.props.clearOnSelect&&(e.props.clearOnSelect=!1),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>Io(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.selections=[],e.props.sourceSelected=!1,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.props.optionsLoader&&0===e.props.options.length?Ho(e):e.props.optionsLoader||0!==e.props.options.length||(e.props.showSourceEmptyMessage=!0),e.context){function t(e){return e.value?e.value:[]}function o(e){return e.props.options.map((e=>Io(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function r(e){return td&&p(e)}function i(e){return td&&p(e,!1)}function p(e,t=!0){var o;if(!e.props.selections)return[];const n=e.props.selections.map((e=>e.value)),r=[];for(const s of n){const n=t?".formkit-source-list-items":".formkit-target-list-items",a=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-type="transferlist"] ${n} [data-value="${s}"]`);a&&r.push(a)}return r}function u(t){t.stopImmediatePropagation(),t.detail,e.props.trackHover=!1}function c(e){return"true"!==e.getAttribute("data-disabled")&&!e.classList.contains("formkit-source-empty-message")&&!e.classList.contains("formkit-target-empty-message")&&!e.classList.contains("formkit-transferlist-load-more")&&"none"!==e.style.display}function f(e){return e.props.disabled||e.props.max&&Array.isArray(e.value)&&e.value.length>=e.props.max}function v(e){return e.props.disabled}if(e.context.handlers.loadMore=Bo.bind(null,e),e.context.fns.isActive=t=>Po(e.props.activeValue,Io(t))||void 0,e.context.fns.optionValue=Io,e.context.fns.isSelected=t=>e.props.selections.map((e=>Io(e))).includes(Io(t)),e.context.fns.getOptionCount=(t=!1)=>{const o=t?e.props.targetOptions:e.props.options;let n;return n=t?o.length:o.filter((t=>!e.props.targetOptionValues.includes(Io(t)))).length,e.props.selections.length>0&&t!==e.props.isSourceOption?e.props.selections.length+"/"+n:n},e.context.handlers.clearSearch=()=>{e.props.inputText=void 0},e.context.handlers.selectOption=(t,o)=>n.bind(null,e,t,o),e.context.handlers.transferForward=a.bind(null,e),e.context.handlers.transferForwardAll=()=>{if(Array.isArray(e.value)){const t=e.props.options.filter((e=>!e.attrs||!e.attrs.disabled)).map((e=>Io(e)));e.props.max&&t.length>e.props.max&&(t.length=e.props.max);const o=[...t];e.props.forceUpdate=!0,e.input(o),e.props.selections=[]}},e.context.handlers.transferBackward=l.bind(null,e),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.props.forceUpdate=!0,e.input([]),e.props.selections=[])},e.context.handlers.onSearch=t=>{const o=t.target;e.props.inputText=""===o.value?void 0:o.value,function(e,t,o=!1){if("function"==typeof e.props.optionsLoader){if(o&&(e.props.options=[]),e.props.search=t,clearTimeout(Qp.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Qp.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else if(Array.isArray(e.props.initialOptions)&&"string"==typeof t){const o=[...e.props.initialOptions].filter((t=>Array.isArray(e.value)&&!e.value.includes(Io(t))));e.props.options=o.filter((o=>e.props.filter(o,t,e)))}}(e,o.value)},e.context.handlers.handleSourceSearchKeyDown=t=>function(e,t){var o;if("ArrowDown"===t.key||"Tab"===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_list_items`);n&&n.focus()}}(e,t),e.context.handlers.sourceKeyDown=t=>function(e,t){var o,r,a,l,i,p,u,c,f;if(e.props.trackHover=!1,!(t.currentTarget&&t.currentTarget instanceof HTMLElement))return;const v=e.props.options.filter((t=>!e.props.targetOptionValues.includes(Io(t))));if(["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(v)||!v.length)return;const n=v.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Io(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(sd);const s=n.indexOf(e.props.activeValue);if(-1===s&&n.length)e.props.activeValue=n[0];else if("ArrowDown"===t.key&&n.length>s+1)e.props.activeValue=n[s+1];else if("Tab"===t.key&&n.length<=s+1){const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_transfer_button_forward_all`);if(t)t.focus();else if(e.props.targetOptionValues.length&&(null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_target_list_item_0`))){const t=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`);t&&(t.focus(),setTimeout((()=>{e.props.activeValue=e.props.targetOptionValues[0]})))}e.props.activeValue=void 0}else if("ArrowUp"===t.key&&s>0)e.props.activeValue=n[s-1];else if("ArrowUp"===t.key&&0===s){const t=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}_source_search_input`);t&&t.focus(),e.props.activeValue=void 0}d(e)}else if("Enter"===t.key){if(t.preventDefault(),e.props.activeValue){const t=v.find((t=>Io(t)===e.props.activeValue));t&&n(e,t,!0)}e.props.transferOnSelect&&(e.props.activeValue=void 0)}else if("Backspace"===t.key)e.props.selections.length&&s(e,e.props.selections);else if("Tab"===t.key&&t.shiftKey){t.preventDefault();const o=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_source_search_input`);o&&(o.focus(),e.props.activeValue=void 0)}else if("Tab"===t.key){t.preventDefault();const o=null===(u=e.props.__root)||void 0===u?void 0:u.getElementById(`${e.props.id}_transfer_button_forward_all`);if(o)o.focus();else if(e.props.targetOptionValues.length&&(null===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_target_list_item_0`))){const t=null===(f=e.props.__root)||void 0===f?void 0:f.getElementById(`${e.props.id}`);t&&(t.focus(),setTimeout((()=>{e.props.activeValue=e.props.targetOptionValues[0]})))}e.props.activeValue=void 0}}(e,t),e.context.handlers.targetKeyDown=t=>function(e,t){var o,r;if(e.props.trackHover=!1,!(t.currentTarget&&t.currentTarget instanceof HTMLElement))return;const a=e.props.targetOptions;if(["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(a)||!a.length)return;const n=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Io(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(sd);const r=n.indexOf(e.props.activeValue);-1===r&&n.length?e.props.activeValue=n[0]:"ArrowDown"===t.key&&n.length>r+1?e.props.activeValue=n[r+1]:"ArrowUp"===t.key&&r>0&&(e.props.activeValue=n[r-1]),d(e)}else if("Enter"===t.key){if(t.preventDefault(),e.props.activeValue){const t=a.find((t=>Io(t)===e.props.activeValue));t&&n(e,t,!1)}e.props.transferOnSelect&&(e.props.activeValue=void 0)}else if("Backspace"===t.key)e.props.selections.length&&s(e,e.props.selections);else if("Tab"===t.key&&t.shiftKey){t.preventDefault();const o=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);o&&(e.props.activeValue=void 0,o.focus())}else"Tab"===t.key&&t.preventDefault()}(e,t),e.context.handlers.sourceFocused=()=>{const t=e.props.options.filter((t=>{var o;return!e.props.targetOptionValues.includes(Io(t))&&!(null===(o=t.attrs)||void 0===o?void 0:o.disabled)})),o=t[0];o&&(e.props.activeValue=Io(o))},e.context.handlers.targetFocused=()=>{const t=e.props.targetOptions[0];t&&(e.props.activeValue=Io(t))},e.context.handlers.onMouseEnter=t=>()=>{t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0},e.context.handlers.onMouseLeave=t=>()=>{t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1},td){Ro(e.props.id+"_source_list_items",(n=>{Ro(`${e.props.id}`,(s=>{n instanceof HTMLElement&&s instanceof HTMLElement&&(n.addEventListener("dndNewValue",(t=>{if(t.stopImmediatePropagation(),!Array.isArray(e.value))return;e.props.newTargetValue=!1,e.props.newSourceValue=!0;const o=e.value.filter((e=>!t.detail.includes(e)));e.input([...o])})),s.addEventListener("dndNewValue",(t=>{t.stopImmediatePropagation(),e.props.newSourceValue=!1,e.props.newTargetValue=!0,e.input([...t.detail])})),n.addEventListener("dndDrop",(t=>{if(e.props.dropped=!0,!Array.isArray(e.value))return;const o=e.value.filter((e=>!t.detail.includes(e)));e.input([...o])})),s.addEventListener("dndDrop",(t=>{Po(t.detail,e.value)||(e.props.dropped=!0,e.input([...t.detail]))})),n.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!0,u(t)})),s.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!1,u(t)})),document.addEventListener("dndDrop",(()=>{e.props.selections=[],e.props.trackHover=!0})),wo(n,o.bind(null,e),{accepts:[s],dropBehavior:"append",childIsDraggable:c,isDisabled:f.bind(null,e)},r.bind(null,e)),wo(s,t.bind(null,e),{accepts:[s,n],childIsDraggable:c,isDisabled:v.bind(null,e)},i.bind(null,e)))}),e.props.__root)}),e.props.__root);const h=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",h)}}})),e.on("commit",(({payload:t})=>{if(t===ed.get(e)&&void 0!==ed.get(e))return;if(ed.set(e,t),void 0===e.props.options&&(e.props.options=[]),void 0===e.props.sourceOptions&&(e.props.sourceOptions=[...e.props.options]),void 0!==t&&"function"==typeof e.props.optionLoader){const n=o(e);if(e.props.multiple&&Array.isArray(t))if(t.forEach((t=>{!function(e,t,o){const n=e.props.optionLoader(t,o),s=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:No(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},a=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);n instanceof Promise?("transferlist"===e.props.type&&(e.props.targetLoading=!0),e.props.loadingCounter++,e.store.set(nd),Vo(e),n.then((e=>{if("string"==typeof e||r(e))return a(s(e))})).finally((()=>{e.props.targetLoading=!1,e.props.loadingCounter--}))):a(s(n))}(e,t,Array.isArray(n)&&n.find((e=>Po(Io(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const t=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,Vo(e,o(e)),e.off(t))}))}else Vo(e,o(e));return}const n=o(e);if(!td||n||void 0===t||e.props.options&&e.props.options.length||"function"!=typeof e.props.optionsLoader)Vo(e,n);else{const t=Ho(e);Vo(e),t.then((()=>{Vo(e,o(e))}))}})),e.on("prop:options",(({payload:t})=>{e.props.sourceOptions=[...t].filter((t=>!e.props.targetOptionValues.includes(Io(t)))),Vo(e,o(e))})),e.on("prop:inputText",(({payload:t})=>{t||(e.props.initialOptions.length&&(e.props.options=[...e.props.initialOptions]),e.props.optionsLoader&&(e.props.page=1,e.props.options=[],e.props.search=void 0,Ho(e)))})),e.on("prop:activeValue",(({payload:t})=>{if(t===sd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Po(Io(e),t)));if(o>=0)e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`;else{const o=e.props.targetOptions.findIndex((e=>Po(Io(e),t)));if(!o)return void(e.props.activeDescendant=void 0);e.props.activeDescendant=o}})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,Gp.delete(e),i(t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,Jp.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(rd)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(rd)}))},on,en("moveRight","right"),en("moveLeft","left"),en("fastForward","fastForward"),en("rewind","rewind"),en("close","close"),en("loader","spinner"),en("selected","check"),tn("isLoading"),tn("loadMore"),tn("addAllValues"),tn("addSelectedValues"),tn("removeSelectedValues"),tn("removeAllValues")]},ld=p("sl"),{outer:id,wrapper:pd,inner:dd,icon:ud,label:cd,prefix:fd,suffix:vd,help:hd,messages:md,message:gd}=d(ld),$d=ld("chart",(()=>({$el:"div",if:"$chart"}))),yd=ld("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),bd=ld("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),xd=ld("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),wd=ld("trackWrapper",(()=>({$el:"div"}))),_d=ld("trackInner",(()=>({$el:"div"}))),kd=ld("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Sd=ld("linkedValues",(()=>({$el:"div"}))),Ld=ld("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Dd=ld("minValue",(()=>({$formkit:"number",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Td=ld("marks",(()=>({$el:"div",if:"$marks"}))),Od=ld("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:"$classes.mark",style:{left:'$step.at / ($max - $min) * 100 + "%"'}}}))),Md=ld("markLabel",(()=>({$el:"span",if:"$markLabels",children:"$step.label"}))),Ed=ld("handles",(()=>({$el:"ul"}))),Ad=ld("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Cd=ld("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Id=ld("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Bd=ld("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Vd={schema:id(pd(cd("$label"),hd("$help"),bd(ud("prefix"),fd(),xd($d(yd()),wd(_d(kd(),Td(Od(Md())),Ed(Cd(Bd()),Ad(Id()))))),vd(),ud("suffix"),c("$showInput && $isMulti === false",Ld())),c("$showInput && $isMulti",Sd(Dd(),Ld())),md(gd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart"],features:[function(e){function t(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,s=0;if(Array.isArray(e._value)){const t=[...e._value].sort(o);s=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:(r-t)/(n-t)*100+"%"},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:(s-t)/(n-t)*100+"%"},e.props.fillStyles={left:(s-t)/(n-t)*100+"%",width:(r-s)/(n-t)*100+"%"}):e.props.fillStyles={left:"0%",width:(r-t)/(n-t)*100+"%"}}function o(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function n(n){if(e.props.disabled)return;let s;if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(n)){const t="min"===e.props.lastHandleInteraction?0:1;e._value[t]=n;const[r,a]=[...e._value];if(r>=a){const t=null==p?void 0:p.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}s=l([...e._value].sort(o))}else Array.isArray(n)?s=l(n):(s=l(n),s=isNaN(s)?e.props.min:s);e.props.snapToMarks&&(s=i(s));const a=r(s);e.input(a),t(),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];d&&d.input(t),u&&u.input(o)}else u&&u.input(e._value)}()}function r(t){return e.props.isMulti&&Array.isArray(t)?[r(t[0]),r(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function s(t){const o=(e.props.max-e.props.min)/e.props.step,n=t*o;return a(Math.round(n)/o*(e.props.max-e.props.min)+e.props.min)}function a(t){return parseFloat(t.toFixed(e.props.decimals))}function l(t){return e.props.snapToMarks?t:Array.isArray(t)?t.map((t=>a(Math.round(t/e.props.step)*e.props.step))):a(Math.round(t/e.props.step)*e.props.step)}function i(t){if(Array.isArray(t))return t[0]=i(t[0]),t[1]=i(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}let p,d,u;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]),e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.on("created",(()=>{function a(t){var o;if(!p||!e.props.dragging)return;t.preventDefault();const r=t.clientX||(null===(o=t.touches)||void 0===o?void 0:o.length)&&t.touches[0].clientX,{left:a,width:l}=p.getBoundingClientRect();n(s((r-a)/l))}var l;e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const c=Wo(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":c;const f=Wo(e.props.marks);e.props.marks=!!f&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=Wo(e.props.markLabels),e.props.snapToMarks=Wo(e.props.snapToMarks),e.props.showInput=Wo(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const v={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(v,e.props.inputAttrs):v,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs,Ro(`track-${e.props.id}`,(()=>{var o;p=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),n(e.value),t()}),e.props.__root),e.context){let t=0,l="";const c=e.context.handlers.blur;e.context.handlers.blur=t=>{c(t),e.emit("blur")},e.context.handlers.clickTrack=t=>{if(!p)return;e.props.dragging=!1;const{left:o,width:r}=p.getBoundingClientRect(),a=(t.clientX-o)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,r=Math.abs(t-a*e.props.max)<Math.abs(o-a*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=s(a),n(e._value)}else n(s(a))},e.context.handlers.focus=t=>{if(!p)return;const o=t.target.dataset.handle;o&&(e.props.lastHandleInteraction=o)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1},e.context.handlers.startDrag=t=>{if(!p)return;e.props.dragging=!0;const o="touchstart"===t.type,n=o?"touchmove":"mousemove",r=o?"touchend":"mouseup";e.props.lastHandleInteraction=t.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(n,a,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,a),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=o=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(o.key)){o.preventDefault(),clearTimeout(t),l+=o.key;const e="-"===l?-1:1;t=window.setTimeout((()=>{"-"!==l?(n(parseFloat(l)*e),l=""):l=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp"].includes(o.key)){o.preventDefault();const t="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[t]:e._value;if(e.props.marks&&e.props.snapToMarks){const t=i(r),s=e.props.marks.find((e=>e.at===t)),a=e.props.marks.indexOf(s),l=["ArrowLeft","ArrowDown"].includes(o.key)?-1:1,p=Math.min(Math.max(0,a+l),e.props.marks.length-1);return void n(e.props.marks[p].at)}if(o.metaKey)return void("ArrowLeft"===o.key||"ArrowDown"===o.key?n(e.props.min):n(e.props.max));n(r+(o.shiftKey?10*e.props.step:e.props.step)*(["ArrowLeft","ArrowDown"].includes(o.key)?-1:1))}},e.context.handlers.maxNode=t=>{u=t,t.hook.commit(((o,s)=>{if(Po(t.value,o))return s(o);const a=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=a,n(e.value)):n(a),s(r(a))}))},e.context.handlers.minNode=t=>{d=t,t.hook.commit(((o,s)=>{if(Po(t.value,o))return s(o);const a=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=a,n(e.value)):n(a),s(r(a))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(o),d&&d.input(e.value[0]),u&&u.input(e.value[1]))}}n(e.value)}))}]};var Hd=Object.freeze({__proto__:null,dropdown:Mr,toggle:Xr,repeater:_s,rating:Rs,autocomplete:ha,datepicker:ri,taglist:Si,mask:Zi,transferlist:ad,slider:Vd});const Fd="undefined"!=typeof window?setInterval:()=>0,Nd=new WeakSet;export{c as $if,ha as autocomplete,d as createBaseSections,Fo as createProPlugin,p as createSectionFactory,ri as datepicker,Mr as dropdown,Hd as inputs,Zi as mask,Rs as rating,_s as repeater,Vd as slider,Si as taglist,Xr as toggle,ad as transferlist};
|
|
1
|
+
function e(e,o){e in $n||($n[e]={timer:0,inputs:new Set});const n=$n[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=fn((()=>{hn[e]||(hn[e]=fn((()=>bn.add(e)),2e3)),function(e){if(un){window.addEventListener(pn(),(o=>{const n=new URL(o.blockedURI).hostname;cn.some(((e,t)=>gn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=mn(rn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from($n[e].inputs),i=l.filter((t=>!(yn[e]&&yn[e].has(t)))).join("");if(vn(e),i){o++;try{const a=await window[mn(an)](`${n}${r}${gn((s+o)%cn.length)}/${function(e){const t=Math.round(9*Math.random());let o="";for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r>=48&&r<=57?r=48+(r+t)%58%48:r>=97&&r<=122&&(r=97+(r+t)%123%97),o+=String.fromCharCode(r)}return`${t}${o}`}(`${e.substring(3)}x${i}`)}`),p=await a.json();if(p[mn(sn)])return t(e,p.schema);if(a.ok)return yn[e]||(yn[e]=new Set),void l.forEach((t=>yn[e].add(t)))}catch(e){}o<2&&fn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){bn.add(e),function(e,t){xn[e]&&xn[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return bn.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e){return No(e)&&"value"in e&&"label"in e}function s(e){return e?e.reduce(((e,t)=>{var o;return(null===(o=e.at(-1))||void 0===o?void 0:o.type)===t.type?e.at(-1).value+=t.value:e.push({type:t.type,value:t.value}),e}),[]):[]}function a(){var e,t,o;const n=(null===(e=document.activeElement)||void 0===e?void 0:e.tagName.toLowerCase())||"";if(customElements.get(n)){const e=null===(o=null===(t=document.activeElement)||void 0===t?void 0:t.shadowRoot)||void 0===o?void 0:o.activeElement;if(e)return e}return document.activeElement}function l(e,t,n,r){return(...s)=>a=>l=>{const p=function(e,t,n,r,s,a){const l=a[n],p="function"==typeof r?r():{$el:r},d=s.map((e=>"string"==typeof e?e:e(t)(a)));let u=d.length&&p?Jo(p,{children:d}):p;if(u=Jo(u,l),"object"==typeof u){let s=u;if(!Ko(u)&&!jo(u)||u.meta||(u.meta={section:n,node:r}),Ko(u)){const{$el:r,...a}=u;a.attrs?"class"in a.attrs||"if"in a.attrs||(a.attrs={class:`$classes.${n}`,...a.attrs}):a.attrs={class:`$classes.${n}`},s=i(t,n,Object.defineProperty(a,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(jo(u)){const{$cmp:r,...a}=u;s=i(t,n,Object.defineProperty(a,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in u){u.outerClass=`$classes.${n}`;const{$formkit:r,...a}=u;s=i(t,n,Object.defineProperty(a,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return s}return i(t,n,u)}(e,a,t,n,s,l);return r&&No(p)&&(p.memo=e+JSON.stringify(l)),r?[p]:p}}function i(e,t,o){const n=o=>e?o||`$slots.${t}`:null;return Object.defineProperties({},{if:{enumerable:!1,get:n},then:{enumerable:!1,get:n},else:{enumerable:!1,get:n.bind(null,o)}})}function p(e){return(t,o,n=!1)=>l(e,t,o,n)}function d(e){return{outer:e("outer",wn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",_n,!1),icon:On,label:e("label",kn,!1),prefix:e("prefix",Tn,!1),suffix:e("suffix",Tn,!1),help:e("help",Dn,!1),messages:e("messages",Sn,!1),message:e("message",Ln,!1)}}function u(e){return{overlayPlaceholder:e("overlayPlaceholder",Mn),overlayLiteral:e("overlayLiteral",En),overlayChar:e("overlayChar",An),overlayEnum:e("overlayEnum",Cn),overlay:e("overlay",In),overlayParts:e("overlayParts",Vn),overlayInner:e("overlayInner",Bn)}}function c(e,t,o){return n=>r=>{const s="string"==typeof t?t:t(n)(r);return o?{if:e,then:s,else:"string"==typeof o?o:o(n)(r)}:(qo(s)?Object.assign(s.else,{if:e}):Go(s)&&Object.assign(s,{if:e}),s)}}function f(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",onBlur:"$handlers.blurListitem",role:"option","aria-selected":"$hidingValue === true && false || $fns.isSelected($option)","data-is-active":"$fns.isActive($option)",tabindex:"-1"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.selectOption($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),s=e("loadMoreInner","span"),a=e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=e("emptyMessageInner","span"),i=e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}})));return()=>t(o(a(l("$emptyMessage")),n(c("$fns.isSelected($option)",On("selected")),i("$option.label")),r(c("$state.loading && $isLoadingOptions || $state.hasNextPage",s(c("$state.loading",On("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}function v(e,t=!0){e.props.isLoadingOptions=!0,e.store.set(fr),e.props.loadingCounter++,e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,cr.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function h(e){e.props.allowAppendOptions=!0,v(e)}function m(e,t){e.props.page++,cr.set(e,t),e.store.set(Uo({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function g(e){return"__original"in e?e.__original:e.value}function $(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!Po(g(t),e)));e.input(o)}else e.input(void 0);e.props.openOnRemove&&!e.props.expanded&&e.isCreated&&(e.props.expanded=!0),setTimeout((()=>{var t;return e.emit("selectRange",[null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option])}),20)}async function y(e){const t=$r(e);e.props.isLoadingOption=!0;const o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>Po(g(e),t))))):e.props.inputStd;if(o.forEach((o=>{!function(e,t,o){if(e.props.multiple&&"truncate"!==e.props.selectionAppearance){const n=o||{label:String(t),value:t};e.props.selections.includes(n)||(e.props.selections=[...e.props.selections,n]),e.props.currentOptionsLoading.push(n.value)}const n=e.props.optionLoader(t,o),s=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:No(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},a=t=>{const o=e.props.memoOptions.findIndex((e=>e.value===t.value));return-1===o?e.props.memoOptions.push(t):e.props.memoOptions[o]=t,t};n instanceof Promise?(e.props.loadingCounter++,e.store.set(fr),n.then((e=>{if("string"==typeof e||r(e))return a(s(e))})).finally((()=>{e.props.currentOptionsLoading=e.props.currentOptionsLoading.filter((e=>e!==t)),e.props.loadingCounter--}))):a(s(n))}(e,o,Array.isArray(t)&&t.find((e=>Po(g(e),o)&&!e.noOptionFound)))})),e.props.loadingCounter){const t=e.on("prop:loadingCounter",(()=>{b(e),e.props.loadingCounter||(e.props.isLoadingOption=!1,e.off(t))}))}else b(e)}async function b(e){const t=$r(e);e.props.resetSearchOnCommit&&"function"===e.props.optionsLoader&&(e.props.searchValue=""),e.props.selections=[...t];const o=[...t,...e.props.memoOptions];e.props.memoOptions=[...new Set(o)],function(e){var t,o;e.props.firstCommit?e.props.firstCommit=!1:mr&&e.isCreated&&(e.props.optionRemoved?e.props.optionRemoved=!1:(e.props.expanded&&e.props.closeOnSelect&&(e.props.expanded=!1),e.props.userAction&&(e.props.openOnFocus&&(e.props.skipOpen=!0),"tagDelete"!==e.props.userAction.type&&(null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.userAction=void 0)))}(e)}function x(e){var t,o;if(e.props.options&&e.props.options.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=g(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.options.find((t=>Po(g(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}e.props.reloadOnCommit||e.props.searchValue?e.props.activeValue=g(e.props.options[0]):(e.props.inputStd.length>0&&!e.props.multiple||e.props.multiple&&(null===(o=e.context)||void 0===o?void 0:o.state.dirty))&&e.props.selections[e.props.selections.length-1]?e.props.activeValue=g(e.props.selections[e.props.selections.length-1]):e.props.activeValue=g(e.props.options[0])}}function w(e,t,o){const n=Qo(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=g(r))}function _(e,t,o){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,w(e,t,o);const n=Qo(o);e.props.options=n,e.props.options.length||(e.store.set(vr),e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}))),x(e),gr.set(e,e.props.searchValue)}function k(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(g(t)!==hr?(e.props.option=t,e.props.maxReached&&!D(e,t)||e.input(S(e,g(t)))):null===(n=e.context)||void 0===n||n.handlers.loadMore())}function S(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];return o.includes(t)?(e.props.optionRemoved=!0,o.filter((e=>e!==t))):[...o,t]}return t===e.value?void(e.props.optionRemoved=!0):t}function L(e,t){return Po(e.props.activeValue,g(t))||void 0}function D(e,t){return e.props.multiple?!!Array.isArray(e.value)&&e.value.includes(g(t)):Po(e.value,g(t))}function T(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","currentOptionsLoading","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll"]),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],e.props.options||(zo(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.props.selections=[],e.props.memoOptions=[],e.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},e.props.decrementCount=0,e.props.page=1,e.props.loadMoreOption={label:"Load more",value:hr},e.props.listboxStyles={},e.props.loadingCounter=0,e.props.searchable=Wo(e.props.searchable),e.props.loadOnScroll=Wo(e.props.loadOnScroll),e.props.multiple=Wo(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=Wo(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&Wo(e.props.openOnRemove),e.props.hasNextPage=m.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.currentOptionsLoading=[],e.props.loadOnCreated=Wo(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0)}function O(e){function t(e,t){var n;if(!e.props.expanded||!e.props.options||!e.props.options.length||yr.has(e))return;const r=e.props.options.reduce(((t,o,n)=>{var r,s;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}`);return a&&t.push([a,o]),t}),[]),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),yr.add(e),r.length&&o(e,r,t)}function o(e,n,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const t=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>t.top&&e.props.mouseY<t.bottom){let t=r||0,o=r;const s=(t,o)=>{var n;const s=o[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){r=t;const s=o[1];return e.props.activeValue=s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?g(s):void 0,!0}return!1};do{if(null!==t&&s(t,n[t]))break;if(null!==o&&s(o,n[o]))break;null!==t&&(t++,t>n.length-1&&(t=null)),null!==o&&(o--,o<0&&(o=null))}while(null!==t||null!==o)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||M(e),e.props.expanded?(p&&e.props.loadOnScroll&&!(null===(a=e.store.loading)||void 0===a?void 0:a.value)&&(null===(l=e.store.hasNextPage)||void 0===l?void 0:l.value)&&p.scrollTop+p.offsetHeight>p.scrollHeight-200&&(e.props.allowAppendOptions=!0,null===(i=e.context)||void 0===i||i.handlers.loadMore(!1)),yr.has(e)?requestAnimationFrame(o.bind(null,e,n,r)):t(e,r)):yr.delete(e)}if(!mr)return;e.props.positionListBox=function(e,t){var o,n;let r=null;if(e.props.activeDescendant){r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>Po(e.value,g(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&M(e)}if("undefined"==typeof window)return r;const s=t.getBoundingClientRect(),a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(a){const t=a.getBoundingClientRect();t.top+t.height+s.height>window.innerHeight&&t.top+t.height>s.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),Ro(`${e.props.id}_dropdown_wrapper`,function(e,o){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(o).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"}),new MutationObserver((()=>{const n=e.props.positionListBox(o);yr.delete(e),t(e,n);let r,s=null;const a=new ResizeObserver((()=>{clearTimeout(r),r=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(o),s||(s=e.on("prop:expanded",(()=>{a.disconnect(),e.off(s)})))}),100)}));a.observe(o)})).observe(o,{childList:!0,subtree:!0})}.bind(null,e),e.props.__root);const n=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_dropdown_wrapper`);if(n){const o=n.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}},r=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,s;mr&&(t?null===(s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_dropdown_wrapper`))||void 0===s||s.removeEventListener("scroll",r):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_dropdown_wrapper`))})),e.on("prop:expanded",(({payload:t})=>{e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:t||e.props.forceExpanded?"999":"-1",pointerEvents:t?"auto":"none"},t?(document.addEventListener("mousemove",n),e.props.styleWrapper(),x(e)):document.removeEventListener("mousemove",n)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;mr&&(t?null===(n=document.getElementById(`${e.props.id}_dropdown_wrapper`))||void 0===n||n.removeEventListener("scroll",r):null===(o=document.getElementById(`${e.props.id}_dropdown_wrapper`))||void 0===o||o.addEventListener("scroll",r))})),e.on("prop:activeValue",(({payload:t})=>{if(t===hr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Po(g(e),t)));e.props.activeDescendant=o>=0?`${e.props.id}_listitem_${o}`:void 0}))}function M(e){var t,o;if(!mr)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_dropdown_wrapper`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function E(){}function A(e){e.on("created",(()=>{if(!e.context||!mr)return;e.context.fns.isActive=L.bind(null,e),e.context.fns.isSelected=t=>D(e,t),e.context.handlers.selectOption=t=>o=>W.call(null,e,t,o),e.context.handlers.loadMore=h.bind(null,e),e.context.handlers.removeSelection=t=>o=>function(e,t,o){o&&o.stopPropagation();if(e.props.disabled)return;e.props.userAction={type:"handleRemoveSelection"},$(e,t)}(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?V.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.handlers.tagClick=t=>F.bind(null,e,t),e.context.handlers.tagFocus=t=>N.bind(null,e,t),e.context.handlers.tagBlur=()=>P.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){t(),o&&function(e,t){var o;if(e.props.disabled)return;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e,o)}.bind(null,e),e.context.handlers.touchmove=C.bind(null,e),e.context.handlers.touchend=I.bind(null,e)}))}function C(e,t){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(n instanceof HTMLInputElement){const o=br.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else br.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function I(e){br.delete(e)}function B(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function V(e,t,o){o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue!==g(t)?(e.props.activeSelectionValue=g(t),o.currentTarget.focus()):e.props.activeSelectionValue=void 0)}function H(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function F(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue!==g(t)?(e.props.activeSelectionValue=g(t),o.currentTarget.focus()):e.props.activeSelectionValue=void 0))}function N(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=g(t),e.props.justFocused=!0)}function P(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function W(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},k(e,t))}function R(e,t,o,n){T(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,g(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],o(void 0===t?void 0:[...e.props.inputStd]))))}(n):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],o(t))))}(n),e(n),function(e){e.props.firstCommit=!0;let t=null;e.on("commit",(async()=>{if(0===e.props.inputStd.length&&e.isCreated)return function(e){var t,o;e.props.selections=[],e.props.userAction&&(e.props.userAction=void 0,e.props.openOnFocus&&(e.props.skipOpen=!0),null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()),e.props.optionRemoved=!1}(e),void(t=e.props.inputStd);e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&await v(e),"function"!=typeof e.props.optionLoader||e.props.optionRemoved||function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?(t=e.props.inputStd,b(e)):(t=e.props.inputStd,await y(e))}))}(n),function(e){e.on("created",(()=>{e.context&&(e.props.trackHover=!0,void 0!==e.props.disabled||e.props.optionsLoader||!e.props.options||e.props.options.length||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||(e.props.disabledInternally=!0),O(e),e.props.loadOnCreated&&v(e),e.props.forceExpanded=Wo(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),A(n),t(n),function(e){e.on("prop:selections",(({payload:t})=>{e.props.max&&(e.props.maxReached=t.length>=e.props.max)})),e.on("prop:maxReached",(({payload:t})=>{t?(e.props.expanded=!1,e.props.disabledInternally=!0):e.props.disabledInternally=!1})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&(e.store.set(vr),e.props.isLoadingOptions=!1,e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length))})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.emptyMessage&&"function"!=typeof e.props.optionsLoader&&(e.props.showEmptyMessage=!t.length),t.length?e.props.disabledInternally=!1:t.length||e.props.optionsLoader||void 0!==e.props.emptyMessage||e.props.allowNewValues||0!==e.props.inputStd.length||e.props.searchValue||(e.props.disabledInternally=!0)})),e.on("prop:expanded",(({payload:o})=>{var n;if(mr)if(o){if(e.props.trackHover=!1,e.props.options&&!e.props.options.length&&"function"!=typeof e.props.optionsLoader&&e.props.emptyMessage&&(e.props.showEmptyMessage=!0),setTimeout((()=>document.addEventListener("click",t)),10),"text-input"===e.props.selectionAppearance&&e.props.multiple)return;const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);o instanceof HTMLInputElement&&(o.focus(),o.value="",o.value=e.props.inputText)}else document.removeEventListener("click",t),e.props.trackHover=!1,e.props.showEmptyMessage=!1}));const t=()=>{e.props.activeSelectionValue=void 0,e.props.expanded=!1}}(n),o(n)}function Y(e){var t,o;e.props.searchValue||null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===o||o.focus()}function K(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.options.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(g(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(hr);const a=o.indexOf(e.props.activeValue);-1===a&&o.length?e.props.activeValue=o[0]:"ArrowDown"===t&&o.length>a+1?e.props.activeValue=o[a+1]:"ArrowUp"===t&&a>0?e.props.activeValue=o[a-1]:"ArrowUp"===t&&0===a&&(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===s||s.focus(),e.props.expanded=!1)}else e.props.expanded||"ArrowDown"!==t||(e.props.expanded=!0)}function j(e,t){var o,n,r,s,a;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length){if("ArrowLeft"===t)return e.props.selections.length&&(null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_tag-wrapper_${e.props.selections.length-1}`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[e.props.selections.length-1])||void 0===r?void 0:r.value)||void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(s=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===s||s.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[0])||void 0===a?void 0:a.value)||void 0),e.props.expanded=!1}}function U(e){var t,o;e.props.expanded=!0,null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`))||void 0===o||o.focus()}function z(e,t,o,n=!0){var r,s,l,i,p,d;const u=o.key;if(o.altKey){const n=a(),r=e.props.selections.findIndex((e=>e.value===t.value)),s=[...e.props.selections];"ArrowRight"===o.key?r<e.props.selections.length-1&&(s.splice(r,1),s.splice(r+1,0,t)):"ArrowLeft"===o.key&&r>0&&(s.splice(r,1),s.splice(r-1,0,t)),e.props.activeSelectionValue=t.value,e.input([...s.map(g)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.map(g).indexOf(g(t));if(-1===o)return;const a="ArrowRight"===u?o+1:o-1;if(a>=e.props.selections.length){if(!n)return e.props.expanded=!0,e.props.activeSelectionValue=void 0,void(null===(s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}`))||void 0===s||s.focus());null===(i=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`))||void 0===i||i.focus()}else if(a<0)return;const c=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_tag-wrapper_${a}`);c&&c.focus(),e.props.activeSelectionValue=(null===(d=e.props.selections[a])||void 0===d?void 0:d.value)||void 0}}function Z(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.map(g).indexOf(g(t));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);o.currentTarget.style.display="none",a&&a.focus(),e.props.userAction={type:"tagDelete"},$(e,t)}function X(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(S(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===hr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Po(g(t),e.props.activeValue)));if(!t)return;k(e,t)}else e.props.expanded=!0}function q(e){e.props.expanded&&(e.props.expanded=!1)}function G(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":U(e);break;case"ArrowRight":case"ArrowLeft":z(e,t,o,!1);break;case"Delete":case"Backspace":Z(e,t,o);break;case"Tab":!function(e,t,o,n=!1){var r,s;o.preventDefault();const a=e.props.selections.map(g).indexOf(g(t));if(-1===a)return;const l=o.shiftKey?a-1:a+1;if(l>=e.props.selections.length)return n?(e.props.expanded=!0,void(e.props.activeSelectionValue=void 0)):void 0;if(l<0)return;const i=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_tag-wrapper_${l}`);i&&i.focus(),e.props.activeSelectionValue=(null===(s=e.props.selections[l])||void 0===s?void 0:s.value)||void 0}(e,t,o)}}function J(e,t,o){if(e.props.disabled)return;switch(o.key){case"ArrowUp":case"ArrowDown":!function(e,t,o){var n,r,s,a;o.preventDefault();const l=o.key,i=e.props.selections.map(g).indexOf(g(t));if(-1===i)return;const p="ArrowDown"===l?i+1:i-1;if(p<0&&(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus()),p<0||p>=e.props.selections.length)return;const d=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${p}`);d&&d.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[p])||void 0===a?void 0:a.value)||void 0}(e,t,o);break;case"Enter":break;case"Tab":!function(e,t,o){var n,r,s,a;if(t){const l=e.props.selections.map(g).indexOf(g(t));if(-1===l)return;const i=o.shiftKey?l-1:l+1;if(i>=e.props.selections.length)return;if(i<0)return void(null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`))||void 0===r||r.focus());const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_selection_wrapper_${i}`);p&&p.focus(),e.props.activeSelectionValue=(null===(a=e.props.selections[i])||void 0===a?void 0:a.value)||void 0}}(e,t,o);break;case"Delete":case"Backspace":!function(e,t){var o,n;if(t){const r=e.props.selections.map(g).indexOf(g(t));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${s}`);a&&a.focus(),e.props.activeSelectionValue=(null===(n=e.props.selections[s])||void 0===n?void 0:n.value)||void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),$(e,t)}(e,t)}}function Q(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e){e.props.expanded&&(e.props.expanded=!1)}(e);break;case"ArrowUp":case"ArrowDown":K(e,o,t);break;case"ArrowLeft":case"ArrowRight":j(e,o);break;case"Enter":X(e,t);break;case"Escape":q(e);break;case"Delete":case"Backspace":Y(e);break;default:e.emit("unusedKeydown",t)}}function ee(e,t){if(e.props.disabled)return;if(!(t.currentTarget instanceof HTMLElement)||e.props.id!==t.currentTarget.id)return;const o=t.key;switch(o){case"Tab":!function(e,t){var o,n,r;e.props.expanded=!1,e.props.multiple&&e.props.selections.length&&(t.preventDefault(),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_0`))||void 0===n||n.focus(),e.props.activeSelectionValue=(null===(r=e.props.selections[0])||void 0===r?void 0:r.value)||void 0)}(e,t);break;case"ArrowUp":case"ArrowDown":K(e,o,t);break;case"ArrowRight":case"ArrowLeft":j(e,o);break;case"Enter":X(e,t);break;case"Escape":q(e);break;case"Delete":case"Backspace":Y(e)}}function te(e,t){var o;if(t.stopPropagation(),0===t.detail)return;if(e.props.disabled)return;e.props.attrs.onClick&&e.props.attrs.onClick(t);const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);e.props.justOpened?e.props.justOpened=!1:e.props.expanded?e.props.expanded=!1:(n&&"mouse"!==t.pointerType?(e.props.mouseX=-1,e.props.mouseY=-1):(e.props.mouseX=t.clientX,e.props.mouseY=t.clientY),e.props.expanded=!0,null==n||n.focus())}function oe(e){e.props.disabled||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.justOpened=!0,e.props.expanded=!0))}function ne(e){let t,o="";e.on("unusedKeydown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){if(!o&&" "===n.key)return void function(e,t){var o;if(t.preventDefault(),e.props.expanded){if(e.props.activeValue===hr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Po(g(t),e.props.activeValue)));if(!t)return;k(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=g(r)),t=setTimeout((()=>{o=""}),400)}}))}function re(e){se(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,se(e)})),mr&&Ro(`${e.props.id}_selections`,le.bind(null,e),e.props.__root)}function se(e){e.isCreated&&(e.props.selections.length&&e.props.lastVisibleIndex&&e.props.selections.length-e.props.lastVisibleIndex>1?e.props.truncationCount="+ "+(e.props.selections.length-e.props.lastVisibleIndex-1).toString():e.props.truncationCount=void 0,e.props.formattedSelections=e.props.selections.map(((t,o)=>e.props.lastVisibleIndex&&o===e.props.lastVisibleIndex&&0!==o?e.props.lastTruncatedElText&&o===e.props.selections.length-1?e.props.lastTruncatedElText:o===e.props.selections.length-1?t.label:t.label+"...":o===e.props.selections.length-1?t.label:t.label+", ")))}function ae(e){var t,o;if(!mr||!e.context)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);if(!(n instanceof HTMLElement))return;const r=n.parentNode;if(!(r instanceof HTMLElement))return;let s=n.getBoundingClientRect().width;const a=.98*r.getBoundingClientRect().width,l=Array.prototype.slice.call(n.children),i=[...e.props.selections];if(s>a){const t=[];let n=0;for(let e=0;e<i.length;e++)t.push([i[e],l[e]]);for(let r=t.length-1;r>=0;r--){const l=t[r];if(!(l[1]instanceof HTMLElement))return;n+=l[1].getBoundingClientRect().width+parseFloat(window.getComputedStyle(l[1]).marginRight)+parseFloat(window.getComputedStyle(l[1]).marginLeft);const i=s-n;if(a>i){const t=l[0].label;e.props.skipFormatSelections=!0,l[1].textContent=t;let n=!1;for(let s=t.length;s>=0;s--){if(e.props.skipFormatSelections=!0,l[1].textContent=t.slice(0,s).trim()+"...",i+l[1].getBoundingClientRect().width<a){if(s<4){e.props.lastVisibleIndex=r-1,e.props.lastTruncatedElText=null;break}if(e.props.lastVisibleIndex=r,e.props.lastTruncatedElText&&l[1].textContent.slice(0,4)===e.props.lastTruncatedElText.slice(0,4))break;e.props.lastTruncatedElText=null===(o=l[1])||void 0===o?void 0:o.textContent;break}0===s&&(n=!0)}l[1].textContent=e.props.lastTruncatedElText&&!n&&0!==r?e.props.lastTruncatedElText:t,null===e.props.lastVisibleIndex&&(e.props.lastVisibleIndex=0===r?0:r-1,e.props.lastTruncatedElText=null),setTimeout((()=>{se(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,se(e)}function le(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:ae(e))})),n=new ResizeObserver((()=>{ae(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ie(e,t=[],o,n,r){function s(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const o=wr.get(t),s=e.currentTarget;s.id="dropZone";const a=t.children;if(a&&a instanceof HTMLCollection)for(let e=0;e<a.length;e++)if(a[e]instanceof HTMLElement){const t=a[e];if(n&&!n(t))continue;xr.set(t,{value:o[e],index:e})}const l=xr.get(s);p=l.index,d=l.value,setTimeout((function(){const e=r.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function a(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const o=xr.get(t.currentTarget),n=o.index,s=t.currentTarget;if(d===o.value)return;const a=r.getElementById("dropZone");s&&e&&a&&(n<p?e.insertBefore(a,s):e.insertBefore(a,s.nextSibling),p=n,d=o.value)}}function l(){const t=r.getElementById("dropZone"),s=null==t?void 0:t.parentNode;if(s&&e===s&&(s.removeEventListener("drop",l),t&&t.parentNode)){t.classList.remove("dropZone"),t.removeAttribute("id");const e=[],r=s.children;if(r&&r instanceof HTMLCollection){for(let t=0;t<r.length;t++)if(r[t]instanceof HTMLElement){const o=r[t];if(n&&!n(o))continue;const s=xr.get(o);e.push(s.value)}wr.set(s,e),o&&o(e)}}}function i(e){e.preventDefault(),l()}let p=0,d=null;if(null!=r||(r=document),_r.has(e))wr.set(e,t),e.addEventListener("drop",l);else{const o=new MutationObserver((function(){const o=e,r=[];for(let e=0;e<o.children.length;e++){const t=o.children[e];(n&&n(t)||!n)&&r.push(t)}r.forEach(((e,o)=>{const n=xr.get(e);t&&(n?xr.set(e,{value:n.value,index:o}):xr.set(e,{value:t[o],index:o})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","0"),e.addEventListener("dragstart",s),e.addEventListener("dragend",i),e.addEventListener("dragenter",a)}))}));o.observe(e,{childList:!0}),e.addEventListener("drop",l),document.addEventListener("drop",l),_r.add(e);const r=[];for(let t=0;t<e.children.length;t++){const o=e.children[t];(n&&n(o)||!n)&&r.push(o)}const p=[];for(let e=0;e<r.length;e++)r[e].setAttribute("draggable","true"),r[e].setAttribute("tabindex","0"),r[e].addEventListener("dragstart",s),r[e].addEventListener("dragend",i),r[e].addEventListener("dragenter",a),xr.set(r[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);wr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){S(e,t)}const o=t=>{const o="taglist"===e.props.type||"dropdown"===e.props.type?"formkit-tag-wrapper":"formkit-selection";return t.classList.contains(o)&&!e.props.disabled};e.on("prop:loadingCounter",(({payload:n})=>{0===n&&mr&&!e.props.disableDragAndDrop&&setTimeout((()=>{var n;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_selections`);r&&!0===e.props.multiple&&ie(r,e.value,t,o,e.props.__root)}))})),e.on("commit",(({payload:n})=>{var r;if(e.context&&mr&&!e.props.disableDragAndDrop){const s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_selections`);if(!s||!0!==e.props.multiple)return;ie(s,n,t,o,e.props.__root)}})),e.on("created",(()=>{Ro(`${e.props.id}_selections`,(n=>{n instanceof HTMLElement&&ie(n,e.value,t,o,e.props.__root)}),e.props.__root)}))}function de(e){var t,o;if("undefined"==typeof window)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_dropdown_wrapper`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!r||!n)return;const s=n.style.paddingTop,a=n.style.paddingBottom,l=n.style.paddingLeft;n.style.paddingTop="0",n.style.paddingBottom="0",n.style.paddingLeft="0";const i=r.getBoundingClientRect(),p=n.getBoundingClientRect(),d=Math.round(i.top-p.top)+"px",u=Math.round(i.left-p.left-5)+"px",c=Math.max(Math.round(Math.min(p.height-p.top,window.innerHeight)-(i.top+i.height)),0)+"px";n.style.paddingTop=s,n.style.paddingBottom=a,n.style.paddingLeft=l,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:d,paddingLeft:u,paddingBottom:c},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${i.width+"px"}, calc(100vw - 4em))`:i.width+"px",maxWidth:"calc(100vw - 4em)"}}function ue(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),u=s.offsetTop-p,c=Math.max(u-p,0),f=Math.max(t.scrollHeight-d-u-l.height,0),v=i.height-c-f;t.scrollTop=u;const h=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:c<d?0:u-d},m=Math.min(150,i.height);c>0&&f>0||0===c&&0===f||v>m?t.scrollTop=u:h();t.clientHeight/2<t.scrollTop&&(r=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>Po(e.value,g(t))))),-1===r&&(r=null)}return r}function ce(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&Zo(300,[e]),e.props.dropdownWrapperStyles=Yo(kr),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=de.bind(null,e),e.props.positionListBox=ue.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Or=document.documentElement.scrollTop;for(const e in Sr)Tr[e]=document.documentElement.style[e],document.documentElement.style[e]=Sr[e];for(const e in Lr)Dr[e]=document.body.style[e],document.body.style[e]=Lr[e];document.body.scrollTop=Or}():function(){for(const e in Sr)document.documentElement.style[e]=Tr[e];for(const e in Lr)document.body.style[e]=Dr[e];document.body.scrollTop=0,document.documentElement.scrollTop=Or}())}))}function fe(e){var t,o,r,s,a,l,i,p,d,u,c,f,v,h;if(null!==(t=(p=e.props).removeControl)&&void 0!==t||(p.removeControl=!0),null!==(o=(d=e.props).upControl)&&void 0!==o||(d.upControl=!0),null!==(r=(u=e.props).downControl)&&void 0!==r||(u.downControl=!0),null!==(s=(c=e.props).insertControl)&&void 0!==s||(c.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(v=e.props).addLabel)&&void 0!==l||(v.addLabel=!1),null!==(i=(h=e.props).addAttrs)&&void 0!==i||(h.addAttrs={}),e.props.min=void 0!==e.props.min?Number(e.props.min):1,e.props.max=void 0!==e.props.max?Number(e.props.max):1/0,e.props.min>e.props.max)throw Error("Repeater: min must be less than max");if("disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),Array.isArray(e.value))if(e.value.length<e.props.min){const t=n(e.props.min-e.value.length,(()=>({})));e.input(e.value.concat(t),!1)}else e.value.length>e.props.max&&e.input(e.value.slice(0,e.props.max),!1);else e.input(n(e.props.min,(()=>({}))),!1);e.context&&function(e,t){t.createShift=(t,o)=>()=>{const n=e._value;n.splice(t+o,0,n.splice(t,1)[0]),e.input(n,!1)},t.createInsert=t=>()=>{const o=e._value;o.splice(t+1,0,{}),e.input(o,!1)},t.createAppend=()=>()=>{const t=e._value;t.push({}),e.input(t,!1)},t.createRemover=t=>()=>{const o=e._value;o.splice(t,1),e.input(o,!1)}}(e,e.context.fns)}function ve(e,t){var o,n;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let r;t instanceof MouseEvent?r=t.clientX:(r=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let s=ge(e,r,t.currentTarget)||0;s=s>e.props.min?s:e.props.min,s=s<e.props.max?s:e.props.max,e.input(s),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()}}function he(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){ye(e,ge(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function me(e){ye(e)}function ge(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function $e(e){setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&(e.props.wrapperWidth=`0 0 ${o.offsetWidth/e.props.max}px`)}))}function ye(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function be(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=we.bind(null,e),e.props.reloadOnCommit=Wo(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=Wo(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&mr&&(e.context.handlers.focus=ke.bind(null,e),e.context.handlers.input=xe.bind(null,e),e.context.handlers.focus=ke.bind(null,e),e.context.handlers.click=_e.bind(null,e),e.context.handlers.toggleListbox=Se.bind(null,e),e.context.handlers.keydown=ee.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>J(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":U(e);break;case"ArrowRight":case"ArrowLeft":z(e,t,o);break;case"Delete":case"Backspace":Z(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>g(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||gr.delete(e)}))}function xe(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&we(e,!0)}function we(e,t=!1){if("function"==typeof e.props.optionsLoader){e.store.set(fr),t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(da.get(e));const o=e.props.searchValue?e.props.debounce:0;da.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),o))}else Array.isArray(e.props.options)&&(pa.add(e),e.props.options=[...e.props.initialOptions.filter((t=>{var o;return e.props.filter(t,null!==(o=e.props.searchValue)&&void 0!==o?o:"",e)}))]);x(e)}function _e(e,t){t.stopPropagation(),e.props.disabled||e.props.disabledInternally||(e.props.attrs.onClick&&e.props.attrs.onClick(t),(!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0))}function ke(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function Se(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function Le(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||De(e)})),e.on("created",(()=>{if(!e.context||!ca)return;e.on("handleSearchInput",(({payload:t})=>{""===t?(e.props.searchValue=null,e.input([])):t&&0===e.props.inputStd.length?e.props.searchValue=t:t&&e.props.inputStd.length>0&&(e.props.searchValue=function(e){var t;const o=Oe(e);if(e.props.highlightedRange){const[t,n]=Te(e,o);return e.props.inputText.slice(t,n)}return e.props.inputText.slice((null===(t=o[o.length-1])||void 0===t?void 0:t.end)+2)}(e)),!e.props.expanded&&t?e.props.expanded=!0:!t&&e.props.expanded&&(e.props.expanded=!1)})),function(e){Ro(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&fa.set(t,e)}),e.props.__root),ca&&!va&&(va=!0,document.addEventListener("selectionchange",(()=>{const e=a();if(e instanceof HTMLInputElement&&fa.has(e)){const t=fa.get(e);t&&function(e){clearTimeout(ua.get(e)),ua.set(e,setTimeout((()=>{var t,o,n,r;const s=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(s instanceof HTMLInputElement){const t=Oe(e),a=t.findIndex((e=>null!==s.selectionStart?s.selectionStart>=e.start&&s.selectionStart<=e.end:null!==s.selectionEnd&&(s.selectionEnd>=e.start&&s.selectionEnd<=e.end))),l=null===(o=t[t.length-1])||void 0===o?void 0:o.end;if(0===s.selectionStart&&s.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(t.length){const o=e.props.highlightedRange,[n,r]=Te(e,t);if(null!==s.selectionEnd&&(s.selectionEnd<n||s.selectionEnd>r)){const t=o.end-o.start-(r-n),a=s.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,s.value=e.props.inputText,s.selectionStart=s.selectionEnd=a+(a>n?t:0)}}}else if(a>=0&&null!==s.selectionStart&&(l!==(null===(r=e.props.inputText)||void 0===r?void 0:r.length)||s.selectionStart<l)){const o=t[a],n=e.props.inputText.substr(0,l),r=o.start+(o.index>0?1:0),i=o.end+(t.length-1>o.index?-1:0);n!==e.props.inputText&&(e.props.inputText=n,s.value=n),e.props.highlightedRange=o,s.selectionStart=r,s.selectionEnd=i}else e.props.highlightedRange=void 0,De(e);if(null!==s.selectionStart&&s.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)){let t=e.props.inputText.substring(0,l);t=e.props.multiple&&e.props.max&&Array.isArray(e.props.inputStd)&&e.props.inputStd.length>=e.props.max?t:`${t},`,e.props.inputText=`${t} ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}(t)}})))}(e);const o=e.context.handlers.keydown;e.context.handlers.keydown=n=>{o(n),function(e,o){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(o.key)&&o.target instanceof HTMLInputElement&&null!==o.target.selectionEnd&&null!==o.target.selectionStart){if(0===o.target.selectionStart&&o.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===o.key?t(0):t(-1);else if(!e.props.searchValue){e.props.searchValue=null;const t=Oe(e),n=null===(r=t[t.length-1])||void 0===r?void 0:r.end;o.target.selectionStart<n&&(o.target.selectionStart=Math.max(0,"ArrowLeft"===o.key?o.target.selectionStart-2:o.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(o.key))e.props.highlightedRange&&!e.props.searchValue?($(e,e.props.highlightedRange.option),0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault());else if(o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&(null===(a=e.props.inputText)||void 0===a?void 0:a.length)&&0===e.props.selections.length)o.preventDefault();else if("Tab"===o.key)return;"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault()}(e,n)};const n=e.context.handlers.focus;e.context.handlers.focus=t=>{n(e,t);const o=new Event("selectionchange");document.dispatchEvent(o)},e.on("blur",(()=>{e.props.selections.length?(e.props.inputText=e.props.selections.map((e=>e.label)).join(", "),e.props.searchValue=null):e.props.selections.length||(e.props.inputText="",e.props.searchValue="")}))})),e.on("prop:expanded",(({payload:t})=>{t||e.props.inputStd.length?t&&(e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],we(e))):(e.props.searchValue="",e.props.inputText="")})),e.on("prop:selections",(()=>{var t;const o=[...e.props.selections].map((e=>e.label)).join(", ");let n="";if(ca&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),a()===o&&Array.isArray(e._value)&&e._value.length){if(e.props.max&&e._value.length>=Number(e.props.max))return;n=", "}}e.props.inputText=`${o}${n}`,e.props.reloadOnCommit&&(e.props.searchValue="",we(e,!0))}));const t=(t,o=!1)=>{var n,r;const s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=Oe(e),l=t>=0?t:a.length-1;if(void 0===a[l])return!1;const i=null===(r=a[l])||void 0===r?void 0:r.end;return null!==s.selectionStart&&(!o||s.selectionStart>=i&&s.selectionStart<=i+2)&&(s.selectionStart=a[l].start+(l>0?1:0),s.selectionEnd=a[l].end+(l<a.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("prop:highlightedRange",(({payload:t})=>{e.props.hasHighlightedRange=!!t,t&&e.props.expanded&&o!==t.option&&(o=t.option,x(e))}))}function De(e){var t;if(!ca)return;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&o.scrollTo({left:o.scrollWidth,behavior:"smooth"})}function Te(e,t){var o;const n=e.props.highlightedRange,r=n.index,s=n.start+(r?1:0),a=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[s,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-a+(t.length-1>n.index?-1:0)]}function Oe(e){const t=$r(e);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const s=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let a=0;return t.length-1!==n&&a++,0!==n&&a++,e.push({option:o,index:n,start:s,end:s+o.label.length+a}),e}),[]):[]}function Me(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],we(e))):(e.props.searchValue="",e.props.inputText="")}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{t&&!e.props.expanded?(e.props.searchExpand=!0,e.props.expanded=!0):!t&&e.props.expanded&&(e.props.expanded=!1),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(()=>{e.isCreated&&(e.props.inputText="",e.props.searchValue="",e.props.optionRemoved||e.props.reloadOnCommit&&we(e,!0))}))}(e)}function Ee(e){!function(e){function t(e){0===e.props.inputStd.length?(e.props.inputText="",e.props.searchValue=""):(e.props.inputText=e.props.selections[0].label,e.props.searchValue=e.props.selections[0].label)}function o(e){e.props.clearSearchOnOpen&&!e.props.searchExpand?(e.props.inputText="",e.props.searchValue=""):e.props.searchExpand&&(e.props.searchExpand=!1),e.props.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],we(e))}e.on("prop:expanded",(({payload:n})=>{n?o(e):t(e)}))}(e),function(e){e.on("handleSearchInput",(({payload:t})=>{""===t?(0===e.props.inputStd.length&&(e.props.expanded=!1),e.input(void 0)):t&&!e.props.expanded&&(e.props.searchExpand=!0,e.props.expanded=!0),e.props.searchValue=e.props.inputText}))}(e),function(e){e.on("prop:selections",(({payload:t})=>{e.props.inputText=t.length?t[0].label:"",e.props.searchValue=t.length?t[0].label:"",e.isCreated&&e.props.expanded&&0===t.length&&we(e,!0)}))}(e)}function Ae(e,t){var o;if(ul.has(e))return;ul.set(e,[]),t.reverse&&kl.add(e),t.prefix&&Sl.set(e,t.prefix),t.suffix&&Ll.set(e,t.suffix),He(e,t.pattern,t.partOverrides,t.explicitParts);const n=hl.get(e),r=null==n?void 0:n.some((e=>Pe(e))),s=null==n?void 0:n.some((e=>function(e){return!!e&&("group"===e.type&&Array.isArray(e.parts))}(e)));if(r&&s)throw new Error("Cannot use enums and groups in the same mask.");const l=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===l)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===l)&&ml.add(e),gl.set(e,l),t.onChange&&wl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Il)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=ul.get(e);if(null==r?void 0:r.length){const o=(null!==(n=cl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;Ge(e,s),e.setSelectionRange(...s.selectionAfter),cl.set(e,o),wl.has(e)&&wl.get(e)(s,e)}}),{once:!0})}(e,o.inputType);o.preventDefault();const n=(r=o.inputType).startsWith("insert")?"insert":!!r.startsWith("delete")&&("deleteContentForward"===r?"deleteContentForward":"deleteContentBackward");var r;const s=Ke(e),a=e.value;n&&je(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===l&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),bt(e);case"ArrowLeft":return t.preventDefault(),bt(e,-1);case"ArrowUp":return void(xt(e,1)&&t.preventDefault());case"ArrowDown":return void(xt(e,-1)&&t.preventDefault());case"Tab":return Ol?void t.preventDefault():void(bt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=ml.has(e),n=gl.get(e);if(o){let o=null,r=null,s=!1;const l="shift"===n?0:1,i=e.value;lt(e,{type:"insert",data:i,selectionBefore:[0,0,"none"],valueBefore:i},"shift"===n?"":i,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-l),(Ne(t)||Pe(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-l,!1):("char"===t.type&&(s=!0),!0))));const p=null!==(t=null!=r?r:s?i.length:o)&&void 0!==t?t:null;if(null!==p){let t=[p,p,"none"];if("select"===gl.get(e)){const[o]=ht(e),n=_t(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){yl.set(e,ze(e,t));const n=async()=>{if(!Cl||a()!==e)return;"select"===gl.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=Ke(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Ze(e,t);const[o]=ht(e),n=_t(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&yl.set(e,ze(e,o[n]))}(e));const t=yl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),yl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(yl.get(e))return;Tt(e),t=Ze(e,t);const[o]=ht(e),n=_t(e,t),r=void 0!==n&&ze(e,o[n]);r&&!Ye(t,r)&&qe(e,r,!0)}(e,t.detail))),je(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ce(e){var t,o;if(Tl.has(e))return;const n=null!==(t=ul.get(e))&&void 0!==t?t:[],r=n[null!==(o=cl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=ht(e,r.valueAfter),s=_t(e,t,[o,n]);if(void 0!==s&&s in o){const r=n[s],a=o[s],l=[t[0]-a[0],t[1]-a[0],"none"];Tl.set(e,[r,l])}}}function Ie(e){Tl.delete(e)}function Be(e,t){const o="string"==typeof e||!ul.has(e),n="string"==typeof e?Ve(e):e;if(o)t.prefix&&Sl.set(n,t.prefix),t.suffix&&Ll.set(n,t.suffix),n.value=Ue(n,n.value),Ae(n,t);else{const e=kt(n),o=n.value;n.value="",je(n,{type:"insert",selectionBefore:[0,e?e.valueAfter.length:0,"none"],valueBefore:e?e.valueAfter:"",data:o,suffix:t.suffix,prefix:t.prefix})}return n.value}function Ve(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function He(e,t,o,n,r){r=e&&kl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(El);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Re(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Fe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Fe(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=Je(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=He(null,r,void 0,t,o);a=a.map((e=>{const t={...e};if("char"===t.type&&s.placeholder)t.placeholder=s.placeholder;else if("enum"===t.type)throw new Error("Groups cannot contain enums.");return t}));const l={type:"group",parts:a,...s};return e.push(l),e}),[])}(a,s,r).concat(s),p=/\{\$\d+\}/g,d=t.match(p),u=t.split(p).reduce(((e,t,o)=>{if(t&&(t=t.replaceAll("\\",""),e.push({type:"literal",value:r?[...t].reverse().join(""):t})),d&&d[o]){const t=d[o],n=Number(t.substring(2,t.length-1));!isNaN(n)&&i[n]&&e.push(i[n])}return e}),[]);return r&&u.reverse(),e&&hl.set(e,u),u}function Fe(e){return!!e&&(Re(e)||Ne(e)||Pe(e))}function Ne(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&We(e))}function Pe(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&We(e))}function We(e){return!!e&&("placeholder"in e&&"token"in e)}function Re(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Ye(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Ke(e){var t,o;return[null!==(t=e.selectionStart)&&void 0!==t?t:e.value.length,null!==(o=e.selectionEnd)&&void 0!==o?o:e.value.length,"none"]}function je(e,t){var o;kl.has(e)&&Dt(t);let n=!1;switch(_l.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Xe(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===gl.get(e)){const[s,a]=ht(e),l=s.findIndex((e=>Ye(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(Ne(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=st(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=Je(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(Pe(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=lt(e,t,o);return vl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:at(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Xe(t),n=t.selectionBefore,r=kl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=Qe(o,s):s-=Qe(o,s,"backward"));const l=gl.get(e);let i="";if("select"===l){const[o,n]=ht(e),r=_t(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];Ne(l)?i=l.placeholder.repeat(a-s):Pe(l)&&([i,s]=Ye(p,Ke(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=Qe(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=gt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&$t(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=lt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:ct(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(kl.has(e)&&n&&Dt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=ze(e,t.selectionAfter));t.suffix&&(t.valueAfter+=t.suffix)}(e,n),n&&function(e){return e.valueBefore!==e.valueAfter||e.selectionBefore[0]!==e.selectionAfter[0]||e.selectionBefore[1]!==e.selectionAfter[1]}(n)){wl.has(e)&&Dl.set(e,(()=>{Dl.delete(e),n&&wl.get(e)(n,e)})),_l.set(e,"beforeCallback");let t=null!==(o=ul.get(e))&&void 0!==o?o:[];const r=cl.get(e);r&&(t=t.slice(0,r),cl.delete(e)),t.push(n),ul.set(e,t),Cl&&a()===e&&"function"==typeof document.execCommand&&!Il?(qe(e,[0,e.value.length,"forward"],!0),Il=!0,document.execCommand("insertText",void 0,n.valueAfter),Il=!1):Ge(e,n),Cl&&a()===e&&qe(e,n.selectionAfter);const s=Dl.get(e);s&&s(),Tt(e)}_l.set(e,"complete")}function Ue(e,t){var o,n;const r=null!==(o=Sl.get(e))&&void 0!==o?o:"",s=null!==(n=Ll.get(e))&&void 0!==n?n:"";return r&&t.startsWith(r)&&(t=t.substring(r.length)),s&&t.endsWith(s)&&(t=t.substring(0,t.length-s.length)),t}function ze(e,t){const o=Sl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Ze(e,t){const o=Sl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Xe(e){let t=e.valueBefore;const o=e.selectionBefore;if(e.suffix&&t.endsWith(e.suffix)&&(t=t.substring(0,t.length-e.suffix.length),e.valueBefore=t,o[0]>=t.length&&(o[0]=t.length),o[1]>=t.length&&(o[1]=t.length)),e.prefix&&t.startsWith(e.prefix)){const n=e.prefix.length;t=t.substring(n),e.valueBefore=t,o[0]=Math.max(o[0]-n,0),o[1]=Math.max(o[1]-n,0)}return t}function qe(e,t,o=!1){o&&(fl.add(e),setTimeout((()=>fl.delete(e)),5)),yl.get(e)&&yl.set(e,t),e.setSelectionRange(...t)}function Ge(e,t,o="After"){if(e.value=t[`value${o}`],Cl){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function Je(e){if(null==e)return"";const t=$l.test(e.charAt(0))&&$l.test(e.charAt(1))?2:1;return e.substring(0,t)}function Qe(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:$l.test(e.charAt(t))&&$l.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:Je(e.substring(t)).length}function et(e,t){const o=Je(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function tt(e){const t=Je(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ot(e,t){const o=Je(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function nt(e,t){for(;t.buffer;){const o=Je(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function rt(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(Qe(t.buffer,0))}return null}function st(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function at(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=Ke(e);o=[n[0],t.endPos,"none"];const[r,s]=ht(e,t.value),a=_t(e,o,[r,s]);if(void 0===a)return o;if(!(a in r)||!(a in s))return o;const l=r[a],i=s[a],p=t.value.slice(l[0],l[1]);if(Ne(i)&&st(p,i).length===p.length&&a<r.length-1)return Ml(),r[a+1];if(Pe(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=gt(o.values,r);if(s)return vt(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return $t(i.values,p)?[l[1],l[1],"forward"]:(Ml(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return Ye(s,n)||(fl.add(e),setTimeout((()=>fl.delete(e)),5)),s}return l}function lt(e,t,o,n){var r,s;const a=null!==(r=hl.get(e))&&void 0!==r?r:[],l={pos:0,insertPos:null!==(s=t.insertPos)&&void 0!==s?s:t.selectionBefore[0],range:t.selectionBefore,chars:0,placeholder:ml.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:gl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:ht(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return it(a,l,void 0,n),l}function it(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":dt(o,t,e.at(-1)===o);break;case"char":ut(o,t,l);break;case"enum":pt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};it(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Re(r)&&i+2===e.length&&d!==t.chars;if(!(t.buffer||t.data||t.placeholder||a))break;i++}if(t.chars<p&&(t.complete=!1),o){const r=t.chars-d,s=r===p,i=!(!t.data||l&&t.data.startsWith(l)&&t.insertPos<=t.pos),u=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&u&&s)return o.repeats++,it(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Re(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function pt(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=gt(e.values.concat([e.placeholder]),n);if(r){const s=vt(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):rt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=rt(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function dt(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?Je(t.data):"",s=Je(n);if(e===s)n=et(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ot(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function ut(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=Je(t.data);if(e.pattern.test(n))return et(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void nt(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=Je(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,tt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return tt(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function ct(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=ht(e),a=_t(e,r,s),[l,i]=ht(e,t.value),p=void 0!==a&&ft(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>ft(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function ft(e,t,o){if(Re(o))return!1;if(Ne(o)){let n=t[0];for(;n<t[1];){const t=Je(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Pe(o)||e.substring(t[0],t[1])===o.placeholder}function vt(e,t){let o="";do{const n=Je(e).toLowerCase(),r=Je(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function ht(e,t){const o=hl.get(e);if(!o)return[[],[]];if(bl.has(e))return bl.get(e);const n=null!=t?t:Ue(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Re(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(Ne(a)&&Ne(e)&&e.token===a.token)i++;else if(Ne(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Pe(e)){l&&r.push([l,i,"none"]),yt(e)||(p=!1);const t=mt(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&bl.set(e,d),d}function mt(e,t,o){if(yt(t))return t.values[0].length;const n=e.slice(o),r=gt(t.values.concat([t.placeholder]),n);return r?r.length:0}function gt(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=Je(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=gt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function $t(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function yt(e){if(!xl.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;xl.set(e,e.values.every((e=>e.length===t)))}return xl.get(e)}function bt(e,t=1){const[o]=ht(e),n=_t(e,Ze(e,Ke(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...ze(e,o[n+t])),!0)}function xt(e,t=1){const[o,n]=ht(e),r=_t(e,Ke(e));if(void 0!==r&&r in n){const s=n[r];if(Pe(s)){const n=o[r],a=e.value.slice(n[0],n[1]);let l=null,i=s.values.indexOf(a);const p=s.values.length-1;if(-1!==i){const e=i+t;i=e<0?p:e>p?0:e,l=s.values[i]}else a===s.placeholder&&(l=t>0?s.values[0]:s.values[p]);if(null!==l){const t={selectionBefore:n,insertPos:n[0],type:"insert",data:l,valueBefore:e.value,cycle:!0};return setTimeout((()=>je(e,t)),0),!0}}}return!1}function wt(e,t){if(!e.length)return-1;if(1===e.length)return e[0];const o=e.length/2,n=Number.isInteger(o)?o:Math.floor(o),r=Math.abs(t-e[n-1])<Math.abs(t-e[n])?[0,n]:[n];return wt(e.slice(...r),t)}function _t(e,t,o){const[n]=null!=o?o:ht(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!Ye(e,t)||t[1]>e[0]&&t[1]<e[1])));if(-1!==r)return r;const[s,a]=n.reduce(((e,t,o)=>(e[0].add(t[0]),e[0].add(t[1]),e[1][t[0]]=o,e[1][t[1]]=o,e)),[new Set,{}]),l=wt([...s],t[1]);return l in a?a[l]:void 0}function kt(e){var t,o;const n=null!==(t=ul.get(e))&&void 0!==t?t:[];return n[null!==(o=cl.get(e))&&void 0!==o?o:n.length-1]}function St(e,t=!1){const o=kt(e);return o&&(o.complete||t)?kl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Lt(e){var t;const o=kt(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Dt(e){const t=e=>[...e].reverse().join(""),o=(e,t)=>[t-e[1],t-e[0],e[2]];e.data&&(e.data=t(e.data)),e.valueBefore=t(e.valueBefore),"valueAfter"in e&&(e.valueAfter=t(e.valueAfter)),"selectionAfter"in e&&(e.selectionAfter=o(e.selectionBefore,e.valueAfter.length)),e.selectionBefore=o(e.selectionBefore,e.valueBefore.length)}function Tt(e){if(e.scrollWidth>e.clientWidth&&null!==e.selectionStart&&null!==e.selectionEnd){const t=e.selectionStart/e.value.length,o=e.selectionEnd/e.value.length;e.scrollLeft=o>.9?e.scrollWidth:t*e.scrollWidth-20,e.dispatchEvent(new CustomEvent("input-scroll",{bubbles:!1,detail:e.scrollLeft}))}}function Ot(e){if(e||(e=new Date),e instanceof Date){const t=new Date(e);return t.setMilliseconds(0),t}if(function(e){const t=e.match(jl);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(jl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Mt(e){const t=Ot(e);return t.setDate(1),t.setHours(0,0,0),t}function Et(e){const t=Ot(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function At(e){return Et(e).getDate()}function Ct(e,t=0){const o=Ot(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function It(e,t=1){const o=Ot(e);return o.setDate(o.getDate()+t),o}function Bt(e,t=1,o=!1){const n=Ot(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=At(n);n.setDate(e<r?e:r)}return n}function Vt(e,t=1,o=!1){const n=Ot(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=At(n);n.setDate(e<r?e:r)}return n}function Ht(e,t){const o=Ot(e),n=Ot(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function Ft(e,t,o){if(!Vl.has(e)){const t=new Date(Bl),o=[3,8,9,7,6,4,3],n=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in o&&t.setDate(o[a]),t.setUTCHours(8+a);for(const o of r){const r=new Intl.DateTimeFormat(e,n.reduce(((e,t)=>Object.assign(e,{[t]:o})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(Gt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Gt).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&n&&(r[s]=n)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:o})}))}}Vl.set(e,s)}const n=Vl.get(e);return n?n[t][o]:void 0}function Nt(e,t){const o=Yl.get(t);if(o&&o[e])return o[e];const n=new Date(Bl);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Gt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Yl.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function Pt(e,t){const o={timeZone:"UTC"};"string"==typeof e?o.dateStyle=e:("date"in e&&(o.dateStyle=e.date),"time"in e&&(o.timeStyle=e.time));const n=new Intl.DateTimeFormat(t,o),r=n.formatToParts(new Date(Bl)).map(Gt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Gt).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const o=e.type,n=function(e,t,o,n){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?Rl.get("YY"):Rl.get("YYYY");case"month":return s?1===r?Rl.get("M"):Rl.get("MM"):(a=Ft(o,e,t),"long"===a?Rl.get("MMMM"):Rl.get("MMM"));case"day":return 1===r?Rl.get("D"):Rl.get("DD");case"weekday":switch(a=Ft(o,e,t),a){case"narrow":return Rl.get("d");case"short":return Rl.get("ddd");default:return Rl.get("dddd")}case"hour":return 12===n?1===r?Rl.get("h"):Rl.get("hh"):1===r?Rl.get("H"):Rl.get("HH");case"minute":return 1===r?Rl.get("m"):Rl.get("mm");case"second":return 1===r?Rl.get("s"):Rl.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Rl.get("A"):Rl.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Rl.get("ZZ"):Rl.get("Z");default:return}}(e.type,e.value,t,"hour"===e.type?a:void 0);if(void 0===n)return;const r=n[1][o];return r?(n[2]||(n[2]=new RegExp(`${n[0]}`,"g")),{option:{[o]:r},partName:o,partValue:r,token:n[0],pattern:n[2],hour12:12===a}):void 0})).filter((e=>!!e))}function Wt(e,t){function o(e,[t,o,n]){const r=Object.keys(o)[0];return{option:o,partName:r,partValue:o[r],token:t,pattern:n,hour12:e}}if(Kl.includes(e)||"object"==typeof e)return Pt(e,t);let n=e,r=0;const s=e=>{if(e[2]||(e[2]=new RegExp(`(.)?(${e[0]})`,"g")),e[2].test(n)){let t=0;return n=n.replace(e[2],((e,o,n)=>"\\"===o?n:`${"string"==typeof o?o:""}{!${t++?r:r++}!}`)),!!t}return!1},a=function(e){const t=e.map((e=>e.partName)),o=new Set(t);if(t.length>o.size)throw new Error("Cannot reuse format tokens.");return e}(Hl.filter(s).concat(Fl.filter(s)).map(o.bind(null,!1)).concat(Nl.filter(s).map(o.bind(null,!0)))),l=/^\{!(\d+)!\}$/;return n.split(/(\{!\d+!\})/).map((e=>{const t=e.match(l);return t?a[Number(t[1])]:{option:{literal:e},partName:"literal",partValue:e,token:e,pattern:new RegExp(""),hour12:!1}})).filter((e=>!("literal"===e.partName&&""===e.partValue)))}function Rt(e,t="en",o=!1,n=(()=>!0)){return Wt(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Hl.concat(Fl).concat(Nl).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],((e,t,o)=>"\\"===o[t-1]?e:`\\${e}`))),e)}(t.token):t.token)),"").normalize("NFKC")}function Yt(e,t,o,n=!1){function r({partName:e,partValue:t,token:n}){if("literal"===e)return t;const r=s[e];if("hour"===e&&"H"===n)return r.replace(/^0/,"");if(!("minute"!==e&&"second"!==e||"mm"!==n&&"ss"!==n||1!==r.length))return`0${r}`;if("dayPeriod"===e){const e=Nt(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Jt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&Wl.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Gt)),n&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(Gt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Gt)}const o=t.find((t=>t.type===e.partName)),n=i.findIndex((t=>t.type===e.partName));o&&n>-1&&(i[n]=o)}}const s=Ot(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];return a.length&&r(a,!0),l.length&&r(l),i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Ot(e);return t.map((e=>({...e,value:r(e)})))}function Kt(e,t="long",o="en",n=!1,r=(()=>!0)){return"ISO8601"===t?Ot(e).toISOString():Yt(e,Wt(t,o).filter(r),o,n).map((e=>e.value)).join("")}function jt(e){return["numeric","2-digit"].includes(e.partValue)}function Ut(e,t){let o=0;const n=e=>[e[o++],e[o]];let r=0;const s=[];let a;do{const[o,l]=n(t);a=l;let i=1;if("literal"===o.partName)i=o.partValue.length;else if(o.token in Pl)i=Pl[o.token];else if(l)if("literal"===l.partName){if(i=e.indexOf(l.partValue,r)-r,i<0)throw new Error}else if("dayPeriod"===l.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(r+t)))){i=t;break}}else{const t=e.substring(r).search(/\d/);-1!==t&&(i=r+t)}else i=e.length;s.push({...o,value:e.substring(r,r+i)}),r+=i}while(a);return s}function zt(e,t="en",o=!1){const n=(e,t)=>Array(e).fill("").map(((e,o)=>`${t(o)}`));if("M"===e)return n(12,(e=>e+1));if("MM"===e)return n(12,(e=>{const t=e+1;return t<10?`0${t}`:t}));if(e.startsWith("M"))return zt("MM").map((n=>Kt(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>Kt(`2022-10-${o}`,e,t)));if("a"===e)return[Nt("am",t).toLowerCase(),Nt("pm",t).toLowerCase()];if("A"===e)return[Nt("am",t).toUpperCase(),Nt("pm",t).toUpperCase()];if(e.startsWith("Y")){const o=(new Date).getFullYear();return n(120,(e=>e+1)).reduce(((n,r)=>("120"!==r&&n.push(Kt(`${o+Number(r)}-06-06`,e,t)),n.unshift(Kt(o-Number(r)+"-06-06",e,t)),n)),[Kt(`${o}-06-06`,e,t)])}return e.startsWith("D")?n(31,(t=>`${"DD"===e&&t<9?"0":""}${t+1}`)):e.startsWith("H")?n(24,(t=>`${"HH"===e&&t<10?"0":""}${t}`)):e.startsWith("h")?n(12,(t=>`${"hh"===e&&t<9?"0":""}${t+1}`)):e.startsWith("m")||e.startsWith("s")?n(60,(t=>`${e.length>1&&t<10?"0":""}${t}`)):[]}function Zt(e,t="ISO8601",o="en"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="en",dateOverflow:s="backward",partFilter:r=(()=>!0)}=e):n=e,!n)throw new Error("parse() requires a date string.");const a=()=>{throw new Error(`Date (${n}) does not match format (${Rt(t,o)})`)};if("ISO8601"===t)return Ot(n);const l=Kl.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in Pl||o.token in Pl||jt(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(Wt(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=Ut(n,i)}catch{return a()}const d=new Date,u=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let c=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(u.has(e.token))u.set(e.token,t);else if("YY"===e.token)u.set("YYYY",function(e){const t=(new Date).getFullYear(),o=t%100,n=Math.floor(t/100),r=Number(e);return 100*(n+(r>o+20?-1:0))+r}(e.value));else{const n=e.token;if(n.startsWith("d"))return;if("D"===n)u.set("DD",t);else if("H"===n||n.startsWith("h"))u.set("HH",t);else if("M"===n)u.set("MM",t);else if("a"===n||"A"===n)c=e.value.toLowerCase()===Nt("am",o).toLowerCase();else if("Z"===n)f=Xt(e.value);else{const t=zt(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":u.set("MM",t+1)}}}}));let v=u.get("HH")||0;!1===c?(v+=12===v?0:12,u.set("HH",24===v?0:v)):!0===c&&12===v&&u.set("HH",0),u.set("MM",(u.get("MM")||1)-1);let[h,m,g,$,y,b]=Array.from(u.values());const x=At(new Date(`${zl(h)}-${Ul(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${zl(h)}-${Ul(m+1)}-${Ul(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${zl(h)}-${Ul(m+1)}-${Ul(g)}T${Ul($)}:${Ul(y)}:${Ul(b)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function Xt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function qt(e,t="UTC",o="browser"){o="browser"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Ot(e),r=e=>{const t=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:e,hourCycle:"h23"}).formatToParts(n).map(Gt),o={};return t.forEach((e=>{o[e.type]=e.value})),new Date(`${o.year}-${o.month}-${o.day}T${o.hour}:${o.minute}:${o.second}Z`)},s=r(t);return Jt((r(o).getTime()-s.getTime())/1e3/60)}function Gt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Jt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Qt(e,t="+0000"){const o=Ot(e),n=function(e){Xt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function eo(e,t="+0000"){const o="+"===t.slice(0,1);return Qt(e,t.replace(o?"+":"-",o?"-":"+"))}function to(e,t,o=7){let n,r;const s=Ot(e);switch(o){case"month":r=s.getDate(),n=At(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Ot(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Ot(e);return Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5)}(s);r=t,n=e-t;break;default:n=r=o}for(let e=0;e<=n||e<r;e++){if(e<=n){const o=It(s,e);if(t(o))return o}if(e&&e<=r){const o=It(s,-e);if(t(o))return o}}return null}function oo(e){return"timeZoneName"!==e.partName}function no(e,t){const o=[],n=Ot(t);n.setDate(1);let r=Ct(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=Ct(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Et(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=It(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function ro(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>no(e,Bt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(Kt(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Vt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Ot(e.props.renderedDate);return t.setMonth(0),n(12,(e=>Bt(t,e)))}(e)}function so(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_panels`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ao(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:Zt(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,oo),o}function lo(e){return Array.isArray(e.props.sequence)?Yo(e.props.sequence):["day"]}function io(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?qt(t,e.props.timezone):"+0000";const s=Qt(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(Kt(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function po(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function uo(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Jl.set(e,t),null===(o=e.props.__root)||void 0===o||o.addEventListener("click",(t=>{e.props.expanded&&t.target instanceof HTMLElement&&t.target.closest(`#${e.props.id}_panels`)?ti.add(e):ti.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===_l.get(t)&&(n=t.value),Ce(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!ul.has(e))return;const r=null!==(o=Sl.get(e))&&void 0!==o?o:"",s=null!==(n=Ll.get(e))&&void 0!==n?n:"";je(e,{type:"insert",selectionBefore:Ke(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ie(t)),10))}));const[r,s]=fo(e);Ae(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(co(e),Xl.has(e))return Xl.delete(e);n&&n===o?n="":(Ce(t),e.props.inputText=o,setTimeout((()=>Ie(t)),10))}})}function co(e){var t,o;if(e.props.overlay){const n=Jl.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||St(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=s(Lt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fo(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=Wt(e.props.format,t);return[Rt(e.props.format,t,!0,oo),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=zt(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=n(e.props.maxDate.getFullYear()-t+1,(e=>String(t+e)))}const l={type:"enum",token:s.token,values:a,placeholder:"A"===s.token?"A/P":s.token,selectDirection:"left"};return r.push(l),s.token.startsWith("D")&&Ql.set(e,a),r}),[])]}function vo(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function ho(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!ni.get(e)&&oi){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){ni.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function go(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=Wo(e.props.overlay),e.props.pickerOnly=Wo(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&Ro(`${e.props.id}`,mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function $o(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Ui.set(e,t),Ae(t,{...ji.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=s(o)}})}function yo(e){const t=Pp.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.addEventListener("dragstart",ko),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||e.addEventListener("dragenter",Mo))}function bo(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const o=[];for(const e of t.accepts)o.push(e);Wp.set(e,o)}}function xo(e){const t=[],o=Pp.get(e),n=Fp.get(e);for(let n=0;n<e.children.length;n++){const r=e.children[n];r instanceof HTMLElement&&(o&&o.childIsDraggable&&!o.childIsDraggable(r)||t.push(r))}for(let e=0;e<t.length;e++){const o=t[e];yo(o),Hp.set(o,{value:n()[e],index:e})}}function wo(e,t,o,n){if(Rp.has(e))Pp.set(e,o),bo(e,o),Fp.set(e,t),Np.set(e,n),xo(e);else{new MutationObserver(_o).observe(e,{childList:!0}),Pp.set(e,o),bo(e,o),Rp.add(e),Fp.set(e,t),Np.set(e,n),function(e){const t=Pp.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Eo),e.addEventListener("dragenter",Oo))}(e),xo(e)}}function _o(e){const t=[];for(const o of e){xo(o.target);for(const e of o.addedNodes)e instanceof HTMLElement&&Hp.has(e)&&t.push(e);for(const e of o.removedNodes)e instanceof HTMLElement&&Hp.has(e)}if(t.length&&Up)for(const e of t)for(const t of zp)Hp.get(e).value!==Hp.get(t).value||e.classList.add("dnd-placeholder");setTimeout((()=>{Zp=!1}),200)}function ko(e){if(So(e)&&Do(e.currentTarget.parentNode)){const t=Pp.get(e.currentTarget.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();if(Up=e.currentTarget,!Up.parentNode)return;const o=Np.get(e.currentTarget.parentNode)();o.includes(Up)||o.push(Up);const n=new DocumentFragment,r=document.createElement("div");r.id="dnd-selections",r.style.display="flex",r.style.flexDirection="column",o.map((e=>{zp.push(e);let t=null;if(Up===e){t=Up.cloneNode(!0);const e=Up.children;for(let t=0;t<e.length;t++){const o=e[t];o instanceof HTMLElement&&(o.style.display="none")}r.appendChild(t)}else t=e.cloneNode(!0),r.appendChild(t),e.style.display="none"})),n.appendChild(r),Up.appendChild(n),Up.classList.add("dnd-dragging"),Up.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Hp.get(Up)}));const s=Fp.get(Up.parentNode)();Yp.set(Up,s),Kp.set(Up,Up.parentNode)}}function So(e){return!!e.currentTarget}function Lo(e){return!!e&&e instanceof HTMLElement}function Do(e){return!!e&&e instanceof HTMLElement}function To(e){return Array.isArray(e)&&e.length>0}function Oo(e){if(So(e)&&Lo(Up)&&Do(Up.parentNode)&&To(zp)&&!Zp){const t=function(e,t){const o=Wp.get(e),n=Kp.get(t),r=t.parentNode;return n!==e&&r===e?{accepted:!0,draggedElementReturned:!0}:o.includes(t.parentNode)?n===e?{accepted:!1,draggedElementReturned:!1}:n!==e?{accepted:!0,draggedElementReturned:!1}:{accepted:!1,draggedElementReturned:!1}:{accepted:!1,draggedElementReturned:!1}}(e.currentTarget,Up);if(t.accepted&&!t.draggedElementReturned){Zp=!0;const t=[...Fp.get(e.currentTarget)()],o=[];for(const e of zp)o.push(Hp.get(e).value);const n=t.concat(o);Kp.set(Up,e.currentTarget),Up.style.display="none",e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}else if(t.accepted&&t.draggedElementReturned){Zp=!0;const t=Yp.get(Up);Kp.set(Up,e.currentTarget),Up.style.display="",Up.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t}))}}}function Mo(e){if(So(e)&&Do(e.currentTarget.parentNode)&&Lo(Up)&&Do(Up.parentNode)&&To(zp)&&function(e,t){const o=Wp.get(e);return o?o&&o.length?o.includes(t.parentNode):void 0:{accepted:!0,draggedElementReturned:!1}}(e.currentTarget.parentNode,Up)&&function(e,t){return Hp.get(t).value!==Hp.get(e).value}(e.currentTarget,Up)&&!Zp){Zp=!0;const t=[...Fp.get(e.currentTarget.parentNode)()],o=zp.map((e=>Hp.get(e).value)),n=[...t.filter((e=>!o.includes(e)))],r=Hp.get(e.currentTarget).index;n.splice(r,0,...o),"none"!==Up.style.display&&Up.parentNode!==e.currentTarget.parentNode?Up.style.display="none":"none"===Up.style.display&&Up.parentNode===e.currentTarget.parentNode&&(Up.style.display=""),Kp.set(Up,e.currentTarget.parentNode),e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}}function Eo(e){if(e.stopPropagation(),e.preventDefault(),Xp=!0,!e.currentTarget)return;const t=Fp.get(e.currentTarget)();e.currentTarget.dispatchEvent(new CustomEvent("dndDrop",{detail:t})),setTimeout((()=>{Ao()}),50)}function Ao(){Up&&(Yp.delete(Up),Kp.delete(Up)),document.querySelectorAll(".dnd-placeholder").forEach((e=>{e.classList.remove("dnd-placeholder")})),document.querySelectorAll(".dnd-dragging").forEach((e=>{e.classList.remove("dnd-dragging");for(let t=0;t<e.children.length;t++){const o=e.children[t];o instanceof HTMLElement&&("dnd-selections"===o.getAttribute("id")?o.remove():"none"===o.style.display&&(o.style.display=""))}})),Up=null,zp=[]}function Co(e,t){e.props.page++,qp.set(e,t),e.store.set(Uo({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function Io(e){return"__original"in e?e.__original:e.value}function Bo(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),Ho(e)}function Vo(e,t){t&&(e.props.showTargetEmptyMessage=0===t.length||!1===t,t=t||[],e.props.newTargetValue&&e.props.isSourceOption&&!e.props.dropped&&!e.props.forceUpdate||(e.props.sourceOptions=[...e.props.options.filter((e=>!t.find((t=>Io(e)===Io(t)))))]),(!e.props.newSourceValue||e.props.isSourceOption||e.props.dropped||e.props.forceUpdate)&&(e.props.targetOptions=t),e.props.targetOptionValues=t.map((e=>Io(e))),e.props.showSourceEmptyMessage=e.props.sourceOptions&&0===e.props.sourceOptions.length,e.props.selections=[],e.props.dropped=!1,e.props.forceUpdate=!1)}function Ho(e,t=!0){e.store.set(nd),e.props.loadingCounter++,e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,qp.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function Fo(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Nd.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:mn(13919),children:`${mn(451228594)}${mn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){xn[e]?xn[e].add(t):xn[e]=new Set([t])}(e,o)}}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!dn.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Nd.add(o),o.define({...r,schema:n(e)})}Fd((()=>bn.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}import{isRecord as No,eq as Po,undefine as Wo,whenAvailable as Ro,clone as Yo}from"@formkit/utils";import{isDOM as Ko,isComponent as jo,createMessage as Uo,warn as zo,error as Zo}from"@formkit/core";import{icon as Xo,isSlotCondition as qo,isSchemaObject as Go,extendSchema as Jo,normalizeOptions as Qo,defaultIcon as en,localize as tn,options as on}from"@formkit/inputs";import"@formkit/vue";const nn=[988,24029,396,13078,980],rn=18806588,sn=502357,an=16217489;let ln=189024;const pn=()=>[30548127325,27022924,34729821653783].map(mn).join("y"),dn=/^[0-9a-f]+$/,un="undefined"!=typeof window,cn=n(32,(e=>e)).map((()=>{ln|=0,ln=ln+1831565813|0;let e=ln^ln>>>15|ln;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),fn=un?setTimeout:()=>0,vn=e=>{clearTimeout(hn[e])},hn={},mn=e=>e.toString(32),gn=e=>`${mn(cn[e]).substring(2)}.${mn(nn[e%(nn.length-1)])}`,$n={},yn={},bn=new Set(["",null,void 0]),xn={},wn=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple || $multiple || undefined","data-disabled":"$disabled || $disabledInternally || undefined","data-empty":"$state.empty || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined"}}),_n=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),kn=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Sn=()=>({$el:"ul",if:"$fns.length($messages)"}),Ln=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Dn=()=>({$el:"div",if:"$help"}),Tn=()=>({$el:null}),On=(e,t)=>()=>Xo(e,t),Mn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),En=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),An=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Cn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),In=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Bn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Vn=()=>({$el:null,for:["part","$_overlayParts"]}),Hn=p("dd"),{outer:Fn,wrapper:Nn,inner:Pn,icon:Wn,label:Rn,prefix:Yn,suffix:Kn,help:jn,messages:Un,message:zn}=d(Hn),Zn=Hn("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Xn=Hn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),qn=Hn("selection",(()=>({$el:"div"}))),Gn=Hn("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),Jn=Hn("optionLoading","span"),Qn=Hn("option",(()=>({$el:"div"}))),er=Hn("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),tr=Hn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),or=Hn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),nr=Hn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),rr=Hn("selectionsItem",(()=>({$el:"div",for:["selectionLabel","index","$formattedSelections"],attrs:{id:'$id + "_selections_item_" + $index',"data-check":"$selectionLabel",key:"$selectionLabel","aria-hidden":'$lastVisibleIndex && $index > $lastVisibleIndex && "true" || undefined',style:{visibility:'$lastVisibleIndex && $index > $lastVisibleIndex && "hidden" || undefined'}},children:'$selectionLabel || ""'}))),sr=Hn("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"0",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-active-selection":"$activeSelectionValue === $option.value"}}))),ar=Hn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"0"}}))),lr=Hn("tagLabel",(()=>({$el:"span"}))),ir=Hn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),pr=Hn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),dr=Hn("tagLoading","span"),ur=f(Hn),cr=new WeakMap,fr=Uo({key:"loading",type:"state",value:!0,visible:!1}),vr=Uo({key:"loading",type:"state",value:!1,visible:!1}),hr=Symbol(),mr="undefined"!=typeof window,gr=new WeakMap,$r=e=>{const t=(e=>{const t=[...e.props.options,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o=t.find((t=>Po(g(t),e)));o||(o={value:e,label:Array.isArray(e)?e.join(", "):e,isPlaceholder:!1,noOptionFound:!0}),n.push(o)}return n},yr=new WeakSet,br=new WeakMap,xr=new WeakMap,wr=new WeakMap,_r=new WeakSet,kr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Sr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Lr={overflow:"hidden",height:"100%"},Dr={},Tr={};let Or=0;const Mr={schema:Fn(Nn(Rn("$label"),Pn(Wn("prefix"),Yn(),Zn(c("$inputStd.length === 0 && $state.loading !== true",Gn('$placeholder || ""'),c("$multiple !== true",Xn(c("$state.loading && $selections.length === 0",Jn("$ui.isLoading.value"),qn(Qn("$option.label")))),c('$multiple && $selectionAppearance === "truncate"',tr(or(c("$state.loading && $selections.length === 0",Jn("$ui.isLoading.value"),rr()))),c('$multiple && $selectionAppearance === "tags"',ir(pr(c("$state.loading && $isLoadingOption !== true && $selections.length === 0",Jn("$ui.isLoading.value"),sr(ar(c("$state.loading && $currentOptionsLoading.includes($option.value)",dr("$ui.isLoading.value"),lr("$option.label")),er(Wn("close"))))))))))),c("$truncationCount && $state.loading !== true",nr("$truncationCount")),c("$state.loading",Wn("loader")),c("$value && $selectionRemovable",er(Wn("close")),Wn("select"))),ur(),Kn(),Wn("suffix"))),jn("$help"),Un(zn("$message.value"))),type:"input",family:"dropdown",props:[],features:[en("select","select"),en("close","close"),en("selected","check"),en("loader","spinner"),tn("isLoading"),tn("loadMore"),on,R.bind(null,(function(e){e.props.applyLoadedOptions=w,void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=Wo(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=Wo(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&Wo(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=te.bind(null,e),e.context.handlers.focus=oe.bind(null,e),e.context.handlers.keydown=Q.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>G.bind(null,e,t))}))}),(function(e){e.on("created",(()=>{e.context&&ne(e)})),e.props.multiple||function(e){e.on("prop:selections",(({payload:t})=>{var o;e.props.firstSelectionLabel=(null===(o=t[0])||void 0===o?void 0:o.label)||"",e.props.option=t[0]}))}(e),"truncate"===e.props.selectionAppearance&&(e.props.lastVisibleIndex=null,re(e),e.on("prop:selections",(()=>{re(e)}))),!e.props.disableDragAndDrop&&e.props.multiple&&"tags"===e.props.selectionAppearance&&pe(e),e.on("prop:expanded",(({payload:t})=>{t&&e.props.optionsLoader&&"function"==typeof e.props.optionsLoader&&(!e.props.options.length||e.props.alwaysLoadOnOpen)&&(e.props.options=[],v(e))})),"overscroll"===e.props.behavior&&ce(e)}))]},Er=p("tg"),{outer:Ar,wrapper:Cr,label:Ir,prefix:Br,suffix:Vr,help:Hr,messages:Fr,message:Nr,icon:Pr}=d(Er),Wr=Er("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Rr=Er("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Yr=Er("altLabel",(()=>({$el:"label",if:"($label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner) || $altLabelPosition === true",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),Kr=Er("innerLabel",(()=>({$el:"div",if:"$valueLabelDisplay === inner && ($checked && $onValueLabel || $offValueLabel)",attrs:{style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:{if:"$checked",then:"$onValueLabel",else:"$offValueLabel"}}))),jr=Er("valueLabel",(()=>({$el:"label",if:"$valueLabelDisplay !== hidden && $valueLabelDisplay !== inner && (($checked === true && $onValueLabel) || ($checked === false && $offValueLabel))",attrs:{for:"$id"},children:{if:"$checked && $onValueLabel",then:"$onValueLabel",else:{if:"$offValueLabel",then:"$offValueLabel"}}}))),Ur=Er("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),zr=Er("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Zr=Er("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Xr={schema:Ar(Cr(Yr(),Ur(Br(),Wr(),zr(Kr(),Zr(c("$slots.default","$slots.default",Pr("thumb")))),Vr()),jr(),Rr()),Hr("$help"),Fr(Nr("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(e){function t(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}e.on("created",(()=>{"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.props.altLabelPosition=Wo(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=Po(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=Po(t,e.props.onValue)}))}]},qr=p("rp"),{outer:Gr,inner:Jr,prefix:Qr,suffix:es,help:ts,messages:os,message:ns,icon:rs}=d(qr),ss=qr("empty",(()=>({$el:"div"}))),as=qr("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),ls=qr("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),is=qr("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),ps=qr("items",(()=>({$el:"ul",attrs:{role:"list"}}))),ds=qr("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),us=qr("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),cs=qr("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),fs=qr("content","div"),vs=qr("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),hs=qr("legend",(()=>({$el:"legend",if:"$label"}))),ms=qr("group",(()=>({$formkit:"group",index:"$index"}))),gs=qr("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),$s=qr("remove",(()=>({$el:"li",if:"$removeControl"}))),ys=qr("insert",(()=>({$el:"li",if:"$insertControl"}))),bs=qr("up",(()=>({$el:"li",if:"$upControl"}))),xs=qr("down",(()=>({$el:"li",if:"$downControl"}))),ws=qr("controlLabel","span"),_s={schema:Gr(vs(hs("$label"),ts("$help"),Jr(Qr(),c("$value.length === 0",c("$slots.empty",ss()),c("$slots.default",ps(ds(fs(ms("$slots.default")),gs(bs(cs(ws("$ui.moveUp.value"),rs("moveUp"))),$s(is(ws("$ui.remove.value"),rs("remove"))),ys(as(ws("$ui.add.value"),rs("add"))),xs(us(ws("$ui.moveDown.value"),rs("moveDown")))))),es()))),ls('$addLabel || ($ui.add.value + " " + ($label || ""))')),os(ns("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){e._c.sync=!0,e.on("created",fe.bind(null,e))},tn("remove"),tn("add"),tn("moveUp"),tn("moveDown"),en("remove","trash"),en("add","add"),en("moveUp","arrowUp"),en("moveDown","arrowDown")]},ks="undefined"!=typeof window,Ss=p("rt"),{outer:Ls,wrapper:Ds,inner:Ts,label:Os,prefix:Ms,suffix:Es,help:As,messages:Cs,message:Is,icon:Bs}=d(Ss),Vs=Ss("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),Hs=Ss("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Fs=Ss("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),Ns=Ss("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),Ps=Ss("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Ws=Ss("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Rs={schema:Ls(Ds(Os("$label"),Ts(Bs("prefix"),Ms(),Hs(Fs(Ps(c("$slots.onItem",(()=>()=>"$slots.onItem"),c("$slots.default",(()=>()=>"$slots.default"),Bs("rating"))))),Ns(Ws(c("$slots.offItem",(()=>()=>"$slots.offItem"),c("$slots.default",(()=>()=>"$slots.default"),Bs("rating")))))),Vs(),Es(),Bs("suffix"))),As("$help"),Cs(Is("$message.value"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.on("created",(()=>{ks&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=he.bind(null,e),e.context.handlers.ratingHoverOut=me.bind(null,e),e.context.handlers.handleClick=ve.bind(null,e),ks&&Ro(`${e.props.id}`,(()=>{$e(e),function(e){var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!o)return;const n=new ResizeObserver((()=>{$e(e)}));n.observe(o)}(e),setTimeout((()=>$e(e)),100)}),e.props.__root))})),e.on("input",(()=>ye(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)}))},en("rating","star")]},Ys=p("ac"),{outer:Ks,wrapper:js,inner:Us,icon:zs,label:Zs,prefix:Xs,suffix:qs,help:Gs,messages:Js,message:Qs}=d(Ys),ea=Ys("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText || undefined",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || $multiple && $max && $value && $value.length >= $max && $hasHighlightedRange !== true || undefined","data-selection-appearance":"$selectionAppearance",disabled:"$disabled || $disabledInternally || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),ta=Ys("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button",onClick:"$handlers.toggleListbox",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),oa=Ys("selectionWrapper",(()=>({for:["option","index","$selections"],$el:"div",attrs:{id:'$id + "_selection_wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:'$disabled && "-1" || 1',onKeydown:"$handlers.selectionKeydown && $handlers.selectionKeydown($multiple && $option || undefined)",onClick:"$handlers.selectionClick && $handlers.selectionClick($multiple && $option || undefined)",onFocus:"$handlers.selectionFocus && $handlers.selectionFocus($multiple && $option || undefined)",onBlur:"$handlers.selectionBlur && $handlers.selectionBlur($multiple && $option || undefined)","data-active-selection":"$activeSelectionValue === $option.value"}}))),na=Ys("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),ra=Ys("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),sa=Ys("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),aa=Ys("optionLoading","span"),la=Ys("option",(()=>({$el:"div",if:"$value !== undefined"}))),ia=f(Ys),pa=new WeakSet,da=new WeakMap,ua=new WeakMap,ca="undefined"!=typeof window,fa=new WeakMap;let va=!1;const ha={schema:Ks(js(Zs("$label"),Us(zs("prefix"),Xs(),ea(),c("$multiple !== true && $selectionAppearance === option && $expanded === false",ra(oa(na(la(c("$state.loading",aa("$ui.isLoading.value"),"$option.label"))),c("$state.loading && $isSingleOption !== true && $currentOptionsLoading.includes($option.value)",zs("loader")),c("$selectionRemovable && $isSingleOption",sa(zs("close")))))),c("$state.loading && ($isSingleOption !== true || $selections.length === 0)",zs("loader")),c('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',sa(zs("close")),c('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',ta(zs("select")))),c("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $currentOptionsLoading.length > 0)",ta(zs("select"))),ia(),qs(),zs("suffix")),c("$multiple && $selectionAppearance === option",ra(oa(na(la(c("$state.loading && $isLoadingOption",aa("$ui.isLoading.value"),"$option.label"))),sa(zs("close")))))),Gs("$help"),Js(Qs("$message.value"))),type:"input",family:"dropdown",props:[],features:[en("select","select"),en("close","close"),en("selected","check"),en("loader","spinner"),tn("isLoading"),tn("loadMore"),on,R.bind(null,(function(e){"option"!==e.props.selectionAppearance||e.props.multiple||!1===e.props.selectionRemovable||"false"===e.props.selectionRemovable||(e.props.selectionRemovable=!0),e.props.multiple||(e.props.clearSearchOnOpen=Wo(e.props.clearSearchOnOpen)),e.props.selectionRemovable=Wo(e.props.selectionRemovable),e.props.applyLoadedOptions=_,e.props.openOnClick=Wo(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=Wo(e.props.allowNewValues)}),be,(function(e){e.props.multiple?e.props.multiple&&"option"===e.props.selectionAppearance?(Me(e),e.props.disabledDragAndDrop||pe(e)):e.props.multiple&&"text-input"===e.props.selectionAppearance&&Le(e):Ee(e)}))]},ma=p("dp"),{outer:ga,wrapper:$a,inner:ya,icon:ba,label:xa,prefix:wa,suffix:_a,help:ka,messages:Sa,message:La}=d(ma),Da=ma("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",id:"$id",onKeydown:"$handlers.inputKeydown",value:"$inputText",onInput:"$handlers.dateInput",onClick:"$pickerOnly && $handlers.open",onBlur:"$handlers._blur",onFocus:"$handlers.focus",readonly:"$pickerOnly || $expanded",disabled:"$disabled"}}))),Ta=ma("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:"$id + _panels",role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1","aria-modal":"true","aria-label":"Choose date"}}))),Oa=ma("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ma=ma("nextLabel","span"),Ea=ma("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Aa=ma("prevLabel","span"),Ca=ma("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Ia=ma("calendarWeeks",(()=>({$el:"tbody"}))),Ba=ma("calendarHeader",(()=>({$el:"thead"}))),Va=ma("weekDays",(()=>({$el:"tr"}))),Ha=ma("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Fa=ma("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Na=ma("dayCell",(()=>({$el:"td",for:["day","$week"],attrs:{key:'$: "day" + $fns.format($day, "D")',onClick:"$handlers.setDate($day)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($day)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(day)",tabindex:'$fns.sameDay($day) && "0" || "-1"',"data-is-extra":"$fns.notInMonth($month.monthDay, $day)","data-disabled":"$fns.isDisabled($day)","aria-selected":"$fns.isSelected($day)","aria-label":'$fns.format($day, "long")'}}))),Pa=ma("day","div"),Wa=ma("openButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"div",role:"button",onClick:"$handlers.open",onKeydown:"$handlers.openKeydown",tabIndex:'$pickerOnly && "-1" || "0"',"data-disabled":"$disabled","aria-disabled":"$disabled","aria-label":'$value && ($ui.changeDate.value + ", " + $inputText) || $ui.chooseDate.value',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Ra=ma("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Ya=ma("year",(()=>({for:["year","$years"],$el:"li",attrs:{key:'$: "year" + $fns.format($year, "YYYY")',onClick:"$handlers.setDate($year)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($year)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(year)",tabindex:'$fns.sameYear($year) && "0" || "-1"',"aria-selected":"$fns.isSelected($year)","data-disabled":"$fns.isDisabledYear($year)"}}))),Ka=ma("months",(()=>({if:'$panel === "month"',$el:"ul"}))),ja=ma("month",(()=>({$el:"li",for:["month","$months"],attrs:{key:'$: "month" + $fns.format($month, "M")',onClick:"$handlers.setDate($month)",onKeydown:"$handlers.keyDown",onMouseenter:"$handlers.mouseEnter($month)",onMouseleave:"$handlers.mouseLeave",onBlur:"$handlers._blurOut(month)",tabindex:'$fns.sameMonth($month) && "0" || "-1"',"aria-selected":"$fns.isSelected($month)","data-disabled":"$fns.isDisabledMonth($month)"}}))),Ua=ma("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),za=ma("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Za=ma("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Xa=ma("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),qa=ma("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Ga=ma("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Ja=ma("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Qa=ma("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),el=ma("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),tl=ma("time",(()=>({$el:"div",if:'$panel === "time"'}))),ol=ma("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),{overlayPlaceholder:nl,overlayLiteral:rl,overlayChar:sl,overlayEnum:al,overlay:ll,overlayParts:il,overlayInner:pl}=u(ma),dl=ma("panel","div"),ul=new WeakMap,cl=new WeakMap,fl=new WeakSet,vl=new WeakMap,hl=new WeakMap,ml=new WeakSet,gl=new WeakMap,$l=/[\uD800-\uDBFF]/,yl=new WeakMap,bl=new WeakMap,xl=new WeakMap,wl=new WeakMap,_l=new WeakMap,kl=new WeakSet,Sl=new WeakMap,Ll=new WeakMap,Dl=new WeakMap,Tl=new WeakMap;let Ol=!1;const Ml=()=>{Ol=!0,setTimeout((()=>{Ol=!1}),500)},El={"#":{type:"char",pattern:/\d/,token:"#",placeholder:"_",selectDirection:"right"},a:{type:"char",pattern:/[a-zA-Z]/,token:"a",placeholder:"_",selectDirection:"left"},h:{type:"char",pattern:/[0-9a-fA-F]/,token:"h",placeholder:"_",selectDirection:"left"},"*":{type:"char",pattern:/./,token:"*",placeholder:"_",selectDirection:"left"}},Al=new WeakMap,Cl="undefined"!=typeof window;let Il=!1;Cl&&document.addEventListener("selectionchange",(()=>{const e=a();if(!(e instanceof HTMLInputElement))return;if(Tl.has(e))return function(e){const t=Tl.get(e);if(t){const[o,n]=t,[r,s]=ht(e),a=s.indexOf(o);if(-1===a)return void Tl.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];Ye(Ke(e),i)||qe(e,i)}}(e);if("select"!==gl.get(e))return;const t=Ke(e);if(!Ye(t,Al.get(e))){if(Al.set(e,t),fl.has(e))return fl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:Ke(e)}))}}));const Bl="1999-03-04T02:05:01.000Z",Vl=new Map,Hl=[["YYYY",{year:"numeric"}],["YY",{year:"2-digit"}],["MMMM",{month:"long"}],["MMM",{month:"short"}],["MM",{month:"2-digit"}],["M",{month:"numeric"}],["DD",{day:"2-digit"}],["D",{day:"numeric"}],["dddd",{weekday:"long"}],["ddd",{weekday:"short"}],["d",{weekday:"narrow"}],["mm",{minute:"2-digit"}],["m",{minute:"numeric"}],["ss",{second:"2-digit"}],["s",{second:"numeric"}],["Z",{timeZoneName:"short"}]],Fl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Nl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Pl={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Wl=["MMMM","MMM","dddd","ddd"],Rl=new Map([...Hl,...Fl,...Nl].map((e=>[e[0],e]))),Yl=new Map,Kl=["full","long","medium","short"],jl=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{4})?$/,Ul=e=>String(e).padStart(2,"0"),zl=e=>String(e).padStart(2,"0"),Zl="undefined"!=typeof window,Xl=new WeakSet,ql=new WeakSet,Gl=new WeakSet,Jl=new WeakMap,Ql=new WeakMap,ei=new WeakSet,ti=new WeakSet,oi="undefined"!=typeof window,ni=new WeakMap,ri={schema:ga($a(xa("$label"),ya(ba("prefix"),wa(),ll(pl(il(nl("$part.value"),rl("$part.value"),sl("$part.value"),al("$part.value")))),Da(),Ta(Ua(Ea(Aa("$ui.prev.value"),ba("prev")),za("$decade"),Za(Ga()),Xa(Ja(),Ga()),qa(Ja(),Qa(),Ga()),Oa(Ma("$ui.next.value"),ba("next"))),dl(Ra(Ya("$fns.format($year, $yearFormat)")),Ka(ja("$fns.format($month, $monthFormat)")),Ca(Ba(Va(Ha("$fns.format($day, $weekdayFormat)"))),Ia(Fa(Na(Pa("$fns.format($day, $dateFormat)"))))),tl(ol()))),el(ba("clear")),Wa(ba("calendar")),_a(),ba("suffix"))),ka("$help"),Sa(La("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[go,function(e){var t,o,r,s,a,l,i,p,d,u,c,f,v,h,m,g,$,y,b,x,w,_;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale"]),e.hook.prop(((t,o)=>("expanded"===t.prop&&e.props.disabled&&(t.value=!1),"weekStart"===t.prop&&(t.value=Number(t.value||0)),"showMonths"===t.prop&&(t.value=Number(t.value||1)),"maxScan"===t.prop&&(t.value=Number(t.value||7)),"timezone"===t.prop&&("string"==typeof e._value||e._value instanceof Date)&&(e.props.offset=qt(e._value,t.value)),o(t)))),e.props._isFocused=!1,e.props._isPlaceholder=!1,null!==(t=(f=e.props).valueFormat)&&void 0!==t||(f.valueFormat="ISO8601"),null!==(o=(v=e.props).weekdayFormat)&&void 0!==o||(v.weekdayFormat="d"),null!==(r=(h=e.props).monthFormat)&&void 0!==r||(h.monthFormat="MMM"),null!==(s=(m=e.props).monthButtonFormat)&&void 0!==s||(m.monthButtonFormat="MMMM"),null!==(a=(g=e.props).dayButtonFormat)&&void 0!==a||(g.dayButtonFormat="D"),null!==(l=($=e.props).dateFormat)&&void 0!==l||($.dateFormat="D"),null!==(i=(y=e.props).yearFormat)&&void 0!==i||(y.yearFormat="YYYY"),null!==(p=(b=e.props).paginatedPanels)&&void 0!==p||(b.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(u=(w=e.props).format)&&void 0!==u||(w.format="long"),e.props.panels=lo(e),e.props.pickerOnly=Wo(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=Wo(e.props.clearable)),null!==(c=(_=e.props).maxScan)&&void 0!==c||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):vo.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Ot(t);else if("string"==typeof t)try{o=Ot(Zt(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${Rt(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?qt(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?Zt(e.props.minDate):e.props.minDate;e.props.minDate=eo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?Zt(e.props.maxDate):e.props.maxDate;e.props.maxDate=eo(t,e.props.offset)}o=o&&eo(o,e.props.offset),o&&io(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&Kt(o,"HH:mm")||"12:00"}(e),e.props.calendar=[],e.props.inputText="",e.props.showMonths=e.props.showMonths||1,"function"==typeof e.props.format?(e.props.formatDate=e.props.format,e.props.format=null):e.props.formatDate=Kt,e.on("created",(()=>{if(Ro(`${e.props.id}`,uo.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>Kt(t,o,e.props.locale||"en",!1,oo),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!to(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!to(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return Ht(t,eo(n instanceof Date?n:Zt(n,e.props.valueFormat,e.props.valueLocale),e.props.offset))},e.context.handlers._blur=t=>{var o,n;e.props._isFocused=!1,"function"==typeof(null===(o=e.context)||void 0===o?void 0:o.handlers.blur)&&(null===(n=e.context)||void 0===n||n.handlers.blur(t))},e.context.handlers._blurOut=t=>o=>{var n;o.preventDefault(),t&&t!==e.props.panel||e.props.pickerOnly&&o.relatedTarget instanceof Element&&(o.relatedTarget===document.getElementById(`${e.props.id}_inner`)||o.relatedTarget.closest(`#${e.props.id}_inner`))||o.relatedTarget&&o.relatedTarget instanceof Element&&(o.relatedTarget.closest(`#${e.props.id}_panels`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_panels`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Jl.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!ql.has(e)&&(Gl.add(e),e.props.expanded=!0,setTimeout((()=>Gl.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;io(e,void 0,!0),ao(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(ei.has(e))return ei.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=Zt({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:oo});if(function(e){return Wt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Tl.get(t.target)&&Kt(n,e.props.format,e.props.locale,!1,oo)!==t.target.value){const r=zt("dddd",e.props.locale),s=Wt(e.props.format,e.props.locale),a=null===(o=Ut(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=Kt(n,"dddd",e.props.locale);if(a&&r.includes(a)&&l!==a){let t=r.indexOf(a)-r.indexOf(l);t=t<-1?7+t:t,n=It(n,t),Xl.add(e)}}io(e,n)}catch(t){io(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Vt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=Bt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Vt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=Bt(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),ao(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=to(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&Ht(t,e.context.activeDate)},e.context.fns.sameMonth=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getMonth()===e.context.activeDate.getMonth()},e.context.fns.sameYear=t=>{var o,n;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&t.getFullYear()===(null===(n=e.context)||void 0===n?void 0:n.activeDate.getFullYear())},e.context.fns.notInMonth=(e,t)=>{const o=function(e){const t=Ot(e);return t.setHours(0,0,0),t}(t).getTime();return o<Mt(e).getTime()||o>Et(e).getTime()||void 0}}}));const k=so.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),io(e,t))})),e.on("input",(({payload:t})=>{const o=new Date,n=t?ao(e,eo("string"==typeof t?Zt(t,e.props.valueFormat,e.props.valueLocale):t,e.props.offset)):o;e.props.activeDate=!t&&e.props.activeDate?e.props.activeDate:n,e.props.renderedDate=!t&&e.props.renderedDate?e.props.renderedDate:n,e.props.localTime=Kt(n,"HH:mm"),function(e){const t=Ql.get(e);if(e._value&&t){const o=At(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",ro.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(ti.delete(e),e.props.panels=lo(e),e.props.panel=e.props.panels.shift(),"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=to(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}ro(e),Ro(`${e.props.id}_panels`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&(o.focus(),function(e,t){const o=new MutationObserver((e=>{for(const t of e)"attributes"===t.type&&t.target instanceof HTMLElement&&"0"===t.target.getAttribute("tabindex")?t.target.focus():t.addedNodes.length&&t.addedNodes.forEach((e=>{var t;if(e instanceof HTMLElement&&"0"===e.getAttribute("tabindex"))e.focus();else if(e instanceof HTMLElement&&e.querySelector('[tabindex="0"]')){const t=e.querySelector('[tabindex="0"]');t instanceof HTMLElement&&t.focus()}else e instanceof HTMLElement&&e.querySelector('input[type="time"]')&&(null===(t=e.querySelector('input[type="time"]'))||void 0===t||t.focus())}))}));o.observe(t,{attributes:!0,attributeFilter:["tabindex"],childList:!0,subtree:!0});const n=e.on("prop:expanded",(({payload:t})=>{t||(e.off(n),o.disconnect())}))}(e,t))}),e.props.__root),Zl&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){ei.add(e);const t="string"==typeof e._value?Zt(e._value,e.props.valueFormat,e.props.valueLocale):e._value;ao(e,eo(t,e.props.offset))}else ao(e,void 0);Zl&&(ql.add(e),document.removeEventListener("click",k),setTimeout((()=>ql.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=Mt(e.props.renderedDate),r=Et(Bt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=Bt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=Bt(e.props.renderedDate))}else if("year"===e.props.panel){const t=e.props.years,o=t[0].getFullYear(),n=t[t.length-1].getFullYear(),r=e.props.activeDate.getFullYear();r>n?e.props.renderedDate=Vt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Vt(e.props.renderedDate,-10))}e.props.expanded&&ao(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||po(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=It(e.props.activeDate,r)),o&&!e.props._isDisabled(o))e.props.activeDate=o;else if(o&&e.props._isDisabled(o)){const t=r>0?1:-1;n(Number(e.props.maxScan),(e=>t*e)).some((t=>{const n=It(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=Vt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=Bt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=to(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Jl.get(e)&&co(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=Uo({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:ho(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},tn("next"),tn("prev"),tn("changeDate"),tn("chooseDate"),en("next","right"),en("clear","close"),en("prev","left"),en("calendar","date")]},si=p("tl"),{outer:ai,wrapper:li,inner:ii,icon:pi,label:di,prefix:ui,suffix:ci,help:fi,messages:vi,message:hi}=d(si),mi=si("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",onFocus:"$handlers.focus",value:"$inputText",tabindex:"0",placeholder:"$state.loading && $inputStd.length === 0 && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined || $multiple && $max && $value && $value.length >= $max",disabled:"$disabled || $disabledInternally || undefined",onTouchmove:"$handlers.touchmove",onTouchstart:"$handlers.touchmove",onTouchend:"$handlers.touchend","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),gi=si("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),$i=si("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.tagClick && $handlers.tagClick($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)",onKeydown:"$handlers.searchInputTagKeydown && $handlers.searchInputTagKeydown($option)","data-active-selection":"$activeSelectionValue === $option.value"}}))),yi=si("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),bi=si("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),xi=si("tagLabel",(()=>({$el:"span"}))),wi=si("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),_i=si("tagLoading","span"),ki=f(si),Si={schema:ai(li(di("$label"),ii(pi("prefix"),ui(),wi($i(yi(c("$state.loading && $currentOptionsLoading.includes($option.value)",_i("$ui.isLoading.value"),xi("$option.label")),bi(pi("close")))),mi()),c("$state.loading",pi("loader")),gi(pi("select")),ki(),ci(),pi("suffix"))),fi("$help"),vi(hi("$message.value"))),type:"input",family:"dropdown",props:[],features:[on,R.bind(null,(function(e){e.props.multiple=!0,e.props.applyLoadedOptions=_,e.props.openOnClick=Wo(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=Wo(e.props.allowNewValues)}),be,(function(e){Me(e),e.props.disableDragAndDrop||pe(e)})),en("select","select"),en("close","close"),en("selected","check"),en("loader","spinner"),tn("isLoading"),tn("loadMore")]},Li=p("mk"),{outer:Di,wrapper:Ti,inner:Oi,label:Mi,prefix:Ei,suffix:Ai,help:Ci,messages:Ii,message:Bi,icon:Vi}=d(Li),{overlayPlaceholder:Hi,overlayLiteral:Fi,overlayChar:Ni,overlayEnum:Pi,overlay:Wi,overlayParts:Ri,overlayInner:Yi}=u(Li),Ki=Li("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),ji=new WeakMap,Ui=new WeakMap,zi=new WeakMap,Zi={schema:Di(Ti(Mi("$label"),Oi(Vi("prefix"),Ei(),Wi(Yi(Ri(Hi("$part.value"),Fi("$part.value"),Ni("$part.value"),Pi("$part.value")))),Ki(),Ai(),Vi("suffix"))),Ci("$help"),Ii(Bi("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[go,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,a;const l=Ve("string"==typeof e._value?e._value:"");Ui.set(e,l),zi.set(e,l),e.props.allowIncomplete=Wo(e.props.allowIncomplete),e.props.overlay=Wo(e.props.overlay);const i=!(void 0!==e.props.showMask&&!Wo(e.props.showMask));e.props.unmaskValue=Wo(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=Wo(e)),t(e))));const p={placeholder:i,pattern:null!==(t=e.props.mask)&&void 0!==t?t:"",mode:null!==(o=e.props.mode)&&void 0!==o?o:"shift",partOverrides:null!==(n=e.props.tokens)&&void 0!==n?n:{},prefix:null!==(r=e.props.prefix)&&void 0!==r?r:void 0,suffix:null!==(a=e.props.suffix)&&void 0!==a?a:void 0,reverse:Wo(e.props.reverse)};ji.set(e,p),e.hook.input(((t,o)=>{const n=function(e,t){const o=Ui.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=zi.get(e);r.value=Ue(r,t);const a=Be(r,ji.get(e)),l=St(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=l?l:"":null===l?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||a===e.props._maskValue||(o.value=a,e.props._maskValue=a,e.props._overlayParts=s(Lt(r)||[]));return null===l?"":e.props.unmaskValue?l:a}(e,t);return o(n)})),e.props._maskValue=Be(l,p),e.input(e.props._maskValue,!1),Ro(`${e.props.id}`,$o.bind(null,e),e.props.__root)}))}]},Xi=p("tf"),{outer:qi,wrapper:Gi,inner:Ji,icon:Qi,prefix:ep,suffix:tp,help:op,messages:np,message:rp}=d(Xi),sp=Xi("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),ap=Xi("legend",(()=>({if:"$label",$el:"legend"}))),lp=Xi("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),ip=Xi("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),pp=Xi("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),dp=Xi("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$fns.getOptionCount() + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'},children:"$fns.getOptionCount()"}))),up=Xi("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),cp=Xi("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$fns.getOptionCount(true) + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$fns.getOptionCount(true)"}))),fp=Xi("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),vp=Xi("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),hp=Xi("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.handleSourceSearchKeyDown",disabled:"$disabled","aria-label":"Search",role:"searchbox",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput'}}))),mp=Xi("sourceSearchClear",(()=>({$el:"button",if:"$inputText !== undefined",attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),gp=Xi("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(true)",onMouseout:"$handlers.onMouseLeave(true)",role:"listbox","aria-multiselectable":"true","aria-roledescription":"List of options to choose from.",class:'$classes.transferlistListItems + " " + $classes.sourceListItems',onKeydown:"$handlers.sourceKeyDown",tabindex:"0",onFocus:"$handlers.sourceFocused"}}))),$p=Xi("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$selections && $selections.length > 0 && $fns.isSelected($option)","data-is-active":"$fns.isActive($option)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),yp=Xi("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),bp=Xi("sourceLoadMore",(()=>({$el:"li",if:"$targetLoading !== true && $state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.sourceLoadMore'}}))),xp=Xi("loadMoreInner","span"),wp=Xi("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),_p=Xi("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),kp=Xi("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseover:"$handlers.onMouseEnter(false)",onMouseout:"$handlers.onMouseLeave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"0",onKeydown:"$handlers.targetKeyDown",onFocus:"$handlers.targetFocused"}}))),Sp=Xi("targetListItem",(()=>({for:["option","index","$targetOptions"],$el:"li",attrs:{id:'$id + "_target_list_item_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value","aria-selected":"$selections && $selections.length && $fns.isSelected($option, $target)","data-is-active":"$fns.isActive($option)",role:"option",onClick:"$option.attrs.disabled !== true && $handlers.selectOption($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),Lp=Xi("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Dp=Xi("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Tp=Xi("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Op=Xi("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selections.length === 0 || $sourceSelected === false || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),Mp=Xi("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$options.length === $targetOptions.length || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),Ep=Xi("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selections.length === 0 || $sourceSelected === true || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),Ap=Xi("transferButtonBackwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_backward_all"',onClick:"$handlers.transferBackwardAll",type:"button",disabled:"$targetOptions.length === 0 || $disabled","aria-label":"$ui.removeAllValues.value",title:"$ui.removeAllValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackwardAll'}}))),Cp=Xi("controlLabel","span"),Ip=Xi("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Bp=Xi("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Vp=Xi("emptyMessageInner","span"),Hp=new WeakMap,Fp=new WeakMap,Np=new WeakMap,Pp=new WeakMap,Wp=new WeakMap,Rp=new WeakSet,Yp=new WeakMap,Kp=new WeakMap,jp="undefined"!=typeof window;let Up=null,zp=[],Zp=!1,Xp=!1;jp&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("dragend",(()=>{Xp?Xp=!1:function(){if(Lo(Up)&&Do(Up.parentNode)){const e=Yp.get(Up);Up.parentNode.dispatchEvent(new CustomEvent("dndDrop",{detail:e}))}Ao()}()})));const qp=new WeakMap,Gp=new WeakSet,Jp=new WeakSet,Qp=new WeakMap,ed=new WeakMap,td="undefined"!=typeof window,od=new WeakMap,nd=Uo({key:"loading",type:"state",value:!0,visible:!1}),rd=Uo({key:"loading",type:"state",value:!1,visible:!1}),sd=Symbol(),ad={schema:qi(sp(ap("$label"),op("$help"),Gi(lp(ip(pp(),dp()),fp(vp(hp(),mp(Qi("close")))),gp(Ip(Vp("$sourceEmptyMessage")),$p(c("$transferOnSelect !== true && $fns.isSelected($option)",Qi("selected")),yp("$option.label")),bp(xp(c("$targetLoading !== true && $state.loading",Qi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Tp(Mp(Cp("$ui.addAllValues.value"),Qi("fastForward")),Op(Cp("$ui.addSelectedValues.value"),Qi("moveRight")),Ep(Cp("$ui.removeSelectedValues.value"),Qi("moveLeft")),Ap(Cp("$ui.removeAllValues.value"),Qi("rewind"))),wp(_p(up(),cp()),kp(Bp(c("$state.loading !== true",Vp("$targetEmptyMessage"))),Sp(c("$transferOnSelect !== true && $fns.isSelected($option)",Qi("selected")),Lp("$option.label")),Dp(xp(c("$targetLoading && $state.loading",Qi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),np(rp("$message.value")))),type:"input",props:["options","selections","activeValue","activeDescendant","sourceSelected","targetOptions","sourceOptions","optionLoader","filterOptions","inputText","hasNextPage","page","targetOptionValues","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","debounce"],features:[function(e){function t(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>Po(Io(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function o(e){const t=Array.isArray(e.props.options)?e.props.options:[],o=Array.isArray(e.props.memoOptions)?e.props.memoOptions:[],n=Array.isArray(e.props.targetOptions)?e.props.targetOptions:[];0===e.props.targetOptions.length&&(e.props.showTargetEmptyMessage=!0);const s=o.concat(t).concat(n);return!!s.length&&(!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const o=s.find((e=>Po(t,Io(e))));if(o)e.push(o);else{const o=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:No(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t};e.push(o(t))}return e}),[]))}function n(e,t,o,n){function r(){const o=p.findIndex((e=>Io(e)===Io(t))),n=p.findIndex((t=>Io(t)===Io(e.props.selections[0]))),r=Math.min(o,n),s=Math.max(o,n),a=p.slice(r,s+1);e.props.selections=a}if(e.props.disabled)return;if(e.props.isSourceOption!==o&&(e.props.isSourceOption=o,e.props.selections=[]),e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)return;const s=!!n&&(n.shiftKey&&e.props.selections.length);e.props.isSourceOption=o;const i=e.props.selections.map((e=>Io(e)));if(i.includes(Io(t))){const o=e.props.selections.findIndex((e=>Io(e)===Io(t)));return e.props.selections.splice(o,1),void(e.props.selections=[...e.props.selections])}const p=o?e.props.sourceOptions:e.props.targetOptions;e.props.sourceSelected===!o?s?r():(e.props.selections=[...e.props.selections,t],e.props.sourceSelected=o):s?r():e.props.selections=[...e.props.selections,t],e.props.transferOnSelect&&(o?a(e):l(e))}function s(e,t){const o=t.map((e=>Io(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.props.selections=[],e.input(t),e.props.activeValue=void 0}}function a(e){if(Array.isArray(e.value)){e.props.optionsLoader||!1===e.props.clearOnSelect||(e.props.inputText=void 0);const t=e.props.selections.map((e=>Io(e))),o=[...e.value,...t];e.props.forceUpdate=!0,e.input(o),e.props.selections=[]}}function l(e){if(Array.isArray(e.value)){const t=e.props.selections.map((e=>Io(e))),o=e.value.filter((e=>!t.includes(e)));if(e.props.forceUpdate=!0,e.input(o),e.props.optionsLoader){const t=[...e.props.options];e.props.options=[...t]}e.props.selections=[]}}function i(t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Gp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Jp.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Gp.add(e),e.props.mouseOnTarget&&Jp.add(e),a.length&&p(e,a,null,t)}function p(e,t,o,n){var r,s,a;const l=n,u=l?l.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>u.top&&e.props.mouseY<u.bottom){let n=o||0,r=o;const s=(t,n)=>{var r;const s=n[0],{y:a,height:l,x:i,width:p}=s.getBoundingClientRect();if(e.props.mouseX>i&&e.props.mouseX<i+p&&e.props.mouseY>a&&e.props.mouseY<a+l){o=t;const s=n[1];return e.props.activeValue=s&&!(null===(r=s.attrs)||void 0===r?void 0:r.disabled)?Io(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}else d(e);e.props.mouseOnSource||e.props.mouseOnTarget?(l&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&l.scrollTop+l.offsetHeight>l.scrollHeight-200&&e.props.mouseOnSource&&(e.props.allowAppendOptions=!0,null===(a=e.context)||void 0===a||a.handlers.loadMore(!1)),e.props.mouseOnSource&&Gp.has(e)||e.props.mouseOnTarget&&Jp.has(e)?requestAnimationFrame(p.bind(null,e,t,o,n)):i(n)):(Gp.delete(e),Jp.delete(e))}function d(e){var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.activeDescendant);o&&o.scrollIntoView({block:"nearest",inline:"start"})}e.addProps(["search"]),e.props.memoOptions=[],e.props.targetOptions=[],e.props.targetOptionValues=[],e.props.multiple=!0,e.props.loadingCounter=0,e.props.page=1,e.props.hasNextPage=Co.bind(null,e),e.props.applyLoadedOptions=function(e,o,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t,o){const n=Qo(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=Io(r))}(e,o,n);const r=Qo(n);e.props.options=r,e.props.options.length||(e.store.set(rd),e.store.set(Uo({key:"hasNextPage",type:"state",value:!1,visible:!1}))),t(e),od.set(e,e.props.searchValue)},e.on("created",(()=>{if(e.value||e.input([],!1),e.props.options||(e.props.options=[]),"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.props.searchable=Wo(e.props.searchable),void 0===e.props.clearOnSelect?e.props.clearOnSelect=!0:"false"===e.props.clearOnSelect&&(e.props.clearOnSelect=!1),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>Io(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.selections=[],e.props.sourceSelected=!1,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.props.optionsLoader&&0===e.props.options.length?Ho(e):e.props.optionsLoader||0!==e.props.options.length||(e.props.showSourceEmptyMessage=!0),e.context){function t(e){return e.value?e.value:[]}function o(e){return e.props.options.map((e=>Io(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function r(e){return td&&p(e)}function i(e){return td&&p(e,!1)}function p(e,t=!0){var o;if(!e.props.selections)return[];const n=e.props.selections.map((e=>e.value)),r=[];for(const s of n){const n=t?".formkit-source-list-items":".formkit-target-list-items",a=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-type="transferlist"] ${n} [data-value="${s}"]`);a&&r.push(a)}return r}function u(t){t.stopImmediatePropagation(),t.detail,e.props.trackHover=!1}function c(e){return"true"!==e.getAttribute("data-disabled")&&!e.classList.contains("formkit-source-empty-message")&&!e.classList.contains("formkit-target-empty-message")&&!e.classList.contains("formkit-transferlist-load-more")&&"none"!==e.style.display}function f(e){return e.props.disabled||e.props.max&&Array.isArray(e.value)&&e.value.length>=e.props.max}function v(e){return e.props.disabled}if(e.context.handlers.loadMore=Bo.bind(null,e),e.context.fns.isActive=t=>Po(e.props.activeValue,Io(t))||void 0,e.context.fns.optionValue=Io,e.context.fns.isSelected=t=>e.props.selections.map((e=>Io(e))).includes(Io(t)),e.context.fns.getOptionCount=(t=!1)=>{const o=t?e.props.targetOptions:e.props.options;let n;return n=t?o.length:o.filter((t=>!e.props.targetOptionValues.includes(Io(t)))).length,e.props.selections.length>0&&t!==e.props.isSourceOption?e.props.selections.length+"/"+n:n},e.context.handlers.clearSearch=()=>{e.props.inputText=void 0},e.context.handlers.selectOption=(t,o)=>n.bind(null,e,t,o),e.context.handlers.transferForward=a.bind(null,e),e.context.handlers.transferForwardAll=()=>{if(Array.isArray(e.value)){const t=e.props.options.filter((e=>!e.attrs||!e.attrs.disabled)).map((e=>Io(e)));e.props.max&&t.length>e.props.max&&(t.length=e.props.max);const o=[...t];e.props.forceUpdate=!0,e.input(o),e.props.selections=[]}},e.context.handlers.transferBackward=l.bind(null,e),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.props.forceUpdate=!0,e.input([]),e.props.selections=[])},e.context.handlers.onSearch=t=>{const o=t.target;e.props.inputText=""===o.value?void 0:o.value,function(e,t,o=!1){if("function"==typeof e.props.optionsLoader){if(o&&(e.props.options=[]),e.props.search=t,clearTimeout(Qp.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Qp.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else if(Array.isArray(e.props.initialOptions)&&"string"==typeof t){const o=[...e.props.initialOptions].filter((t=>Array.isArray(e.value)&&!e.value.includes(Io(t))));e.props.options=o.filter((o=>e.props.filter(o,t,e)))}}(e,o.value)},e.context.handlers.handleSourceSearchKeyDown=t=>function(e,t){var o;if("ArrowDown"===t.key||"Tab"===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_list_items`);n&&n.focus()}}(e,t),e.context.handlers.sourceKeyDown=t=>function(e,t){var o,r,a,l,i,p,u,c,f;if(e.props.trackHover=!1,!(t.currentTarget&&t.currentTarget instanceof HTMLElement))return;const v=e.props.options.filter((t=>!e.props.targetOptionValues.includes(Io(t))));if(["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(v)||!v.length)return;const n=v.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Io(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(sd);const s=n.indexOf(e.props.activeValue);if(-1===s&&n.length)e.props.activeValue=n[0];else if("ArrowDown"===t.key&&n.length>s+1)e.props.activeValue=n[s+1];else if("Tab"===t.key&&n.length<=s+1){const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_transfer_button_forward_all`);if(t)t.focus();else if(e.props.targetOptionValues.length&&(null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_target_list_item_0`))){const t=null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`);t&&(t.focus(),setTimeout((()=>{e.props.activeValue=e.props.targetOptionValues[0]})))}e.props.activeValue=void 0}else if("ArrowUp"===t.key&&s>0)e.props.activeValue=n[s-1];else if("ArrowUp"===t.key&&0===s){const t=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}_source_search_input`);t&&t.focus(),e.props.activeValue=void 0}d(e)}else if("Enter"===t.key){if(t.preventDefault(),e.props.activeValue){const t=v.find((t=>Io(t)===e.props.activeValue));t&&n(e,t,!0)}e.props.transferOnSelect&&(e.props.activeValue=void 0)}else if("Backspace"===t.key)e.props.selections.length&&s(e,e.props.selections);else if("Tab"===t.key&&t.shiftKey){t.preventDefault();const o=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_source_search_input`);o&&(o.focus(),e.props.activeValue=void 0)}else if("Tab"===t.key){t.preventDefault();const o=null===(u=e.props.__root)||void 0===u?void 0:u.getElementById(`${e.props.id}_transfer_button_forward_all`);if(o)o.focus();else if(e.props.targetOptionValues.length&&(null===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_target_list_item_0`))){const t=null===(f=e.props.__root)||void 0===f?void 0:f.getElementById(`${e.props.id}`);t&&(t.focus(),setTimeout((()=>{e.props.activeValue=e.props.targetOptionValues[0]})))}e.props.activeValue=void 0}}(e,t),e.context.handlers.targetKeyDown=t=>function(e,t){var o,r;if(e.props.trackHover=!1,!(t.currentTarget&&t.currentTarget instanceof HTMLElement))return;const a=e.props.targetOptions;if(["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(a)||!a.length)return;const n=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Io(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(sd);const r=n.indexOf(e.props.activeValue);-1===r&&n.length?e.props.activeValue=n[0]:"ArrowDown"===t.key&&n.length>r+1?e.props.activeValue=n[r+1]:"ArrowUp"===t.key&&r>0&&(e.props.activeValue=n[r-1]),d(e)}else if("Enter"===t.key){if(t.preventDefault(),e.props.activeValue){const t=a.find((t=>Io(t)===e.props.activeValue));t&&n(e,t,!1)}e.props.transferOnSelect&&(e.props.activeValue=void 0)}else if("Backspace"===t.key)e.props.selections.length&&s(e,e.props.selections);else if("Tab"===t.key&&t.shiftKey){t.preventDefault();const o=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);o&&(e.props.activeValue=void 0,o.focus())}else"Tab"===t.key&&t.preventDefault()}(e,t),e.context.handlers.sourceFocused=()=>{const t=e.props.options.filter((t=>{var o;return!e.props.targetOptionValues.includes(Io(t))&&!(null===(o=t.attrs)||void 0===o?void 0:o.disabled)})),o=t[0];o&&(e.props.activeValue=Io(o))},e.context.handlers.targetFocused=()=>{const t=e.props.targetOptions[0];t&&(e.props.activeValue=Io(t))},e.context.handlers.onMouseEnter=t=>()=>{t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0},e.context.handlers.onMouseLeave=t=>()=>{t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1},td){Ro(e.props.id+"_source_list_items",(n=>{Ro(`${e.props.id}`,(s=>{n instanceof HTMLElement&&s instanceof HTMLElement&&(n.addEventListener("dndNewValue",(t=>{if(t.stopImmediatePropagation(),!Array.isArray(e.value))return;e.props.newTargetValue=!1,e.props.newSourceValue=!0;const o=e.value.filter((e=>!t.detail.includes(e)));e.input([...o])})),s.addEventListener("dndNewValue",(t=>{t.stopImmediatePropagation(),e.props.newSourceValue=!1,e.props.newTargetValue=!0,e.input([...t.detail])})),n.addEventListener("dndDrop",(t=>{if(e.props.dropped=!0,!Array.isArray(e.value))return;const o=e.value.filter((e=>!t.detail.includes(e)));e.input([...o])})),s.addEventListener("dndDrop",(t=>{Po(t.detail,e.value)||(e.props.dropped=!0,e.input([...t.detail]))})),n.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!0,u(t)})),s.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!1,u(t)})),document.addEventListener("dndDrop",(()=>{e.props.selections=[],e.props.trackHover=!0})),wo(n,o.bind(null,e),{accepts:[s],dropBehavior:"append",childIsDraggable:c,isDisabled:f.bind(null,e)},r.bind(null,e)),wo(s,t.bind(null,e),{accepts:[s,n],childIsDraggable:c,isDisabled:v.bind(null,e)},i.bind(null,e)))}),e.props.__root)}),e.props.__root);const h=t=>{var o;e.props.mouseX=t.clientX,e.props.mouseY=t.clientY;const n=e.props.mouseOnSource?`${e.props.id}_source_list_items`:`${e.props.id}`,r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();t.clientX>o.x&&t.clientX<o.x+o.width&&t.clientY>o.y&&t.clientY<o.y+o.height&&(e.props.trackHover=!0)}};document.addEventListener("mousemove",h)}}})),e.on("commit",(({payload:t})=>{if(t===ed.get(e)&&void 0!==ed.get(e))return;if(ed.set(e,t),void 0===e.props.options&&(e.props.options=[]),void 0===e.props.sourceOptions&&(e.props.sourceOptions=[...e.props.options]),void 0!==t&&"function"==typeof e.props.optionLoader){const n=o(e);if(e.props.multiple&&Array.isArray(t))if(t.forEach((t=>{!function(e,t,o){const n=e.props.optionLoader(t,o),s=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:No(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},a=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);n instanceof Promise?("transferlist"===e.props.type&&(e.props.targetLoading=!0),e.props.loadingCounter++,e.store.set(nd),Vo(e),n.then((e=>{if("string"==typeof e||r(e))return a(s(e))})).finally((()=>{e.props.targetLoading=!1,e.props.loadingCounter--}))):a(s(n))}(e,t,Array.isArray(n)&&n.find((e=>Po(Io(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const t=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,Vo(e,o(e)),e.off(t))}))}else Vo(e,o(e));return}const n=o(e);if(!td||n||void 0===t||e.props.options&&e.props.options.length||"function"!=typeof e.props.optionsLoader)Vo(e,n);else{const t=Ho(e);Vo(e),t.then((()=>{Vo(e,o(e))}))}})),e.on("prop:options",(({payload:t})=>{e.props.sourceOptions=[...t].filter((t=>!e.props.targetOptionValues.includes(Io(t)))),Vo(e,o(e))})),e.on("prop:inputText",(({payload:t})=>{t||(e.props.initialOptions.length&&(e.props.options=[...e.props.initialOptions]),e.props.optionsLoader&&(e.props.page=1,e.props.options=[],e.props.search=void 0,Ho(e)))})),e.on("prop:activeValue",(({payload:t})=>{if(t===sd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Po(Io(e),t)));if(o>=0)e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`;else{const o=e.props.targetOptions.findIndex((e=>Po(Io(e),t)));if(!o)return void(e.props.activeDescendant=void 0);e.props.activeDescendant=o}})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,Gp.delete(e),i(t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,Jp.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(rd)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(rd)}))},on,en("moveRight","right"),en("moveLeft","left"),en("fastForward","fastForward"),en("rewind","rewind"),en("close","close"),en("loader","spinner"),en("selected","check"),tn("isLoading"),tn("loadMore"),tn("addAllValues"),tn("addSelectedValues"),tn("removeSelectedValues"),tn("removeAllValues")]},ld=p("sl"),{outer:id,wrapper:pd,inner:dd,icon:ud,label:cd,prefix:fd,suffix:vd,help:hd,messages:md,message:gd}=d(ld),$d=ld("chart",(()=>({$el:"div",if:"$chart"}))),yd=ld("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),bd=ld("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),xd=ld("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),wd=ld("trackWrapper",(()=>({$el:"div"}))),_d=ld("trackInner",(()=>({$el:"div"}))),kd=ld("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Sd=ld("linkedValues",(()=>({$el:"div"}))),Ld=ld("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Dd=ld("minValue",(()=>({$formkit:"number",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Td=ld("marks",(()=>({$el:"div",if:"$marks"}))),Od=ld("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:"$classes.mark",style:{left:'$step.at / ($max - $min) * 100 + "%"'}}}))),Md=ld("markLabel",(()=>({$el:"span",if:"$markLabels",children:"$step.label"}))),Ed=ld("handles",(()=>({$el:"ul"}))),Ad=ld("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Cd=ld("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Id=ld("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Bd=ld("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Vd={schema:id(pd(cd("$label"),hd("$help"),bd(ud("prefix"),fd(),xd($d(yd()),wd(_d(kd(),Td(Od(Md())),Ed(Cd(Bd()),Ad(Id()))))),vd(),ud("suffix"),c("$showInput && $isMulti === false",Ld())),c("$showInput && $isMulti",Sd(Dd(),Ld())),md(gd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart"],features:[function(e){function t(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,s=0;if(Array.isArray(e._value)){const t=[...e._value].sort(o);s=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:(r-t)/(n-t)*100+"%"},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:(s-t)/(n-t)*100+"%"},e.props.fillStyles={left:(s-t)/(n-t)*100+"%",width:(r-s)/(n-t)*100+"%"}):e.props.fillStyles={left:"0%",width:(r-t)/(n-t)*100+"%"}}function o(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function n(n){if(e.props.disabled)return;let s;if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(n)){const t="min"===e.props.lastHandleInteraction?0:1;e._value[t]=n;const[r,a]=[...e._value];if(r>=a){const t=null==p?void 0:p.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}s=l([...e._value].sort(o))}else Array.isArray(n)?s=l(n):(s=l(n),s=isNaN(s)?e.props.min:s);e.props.snapToMarks&&(s=i(s));const a=r(s);e.input(a),t(),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];d&&d.input(t),u&&u.input(o)}else u&&u.input(e._value)}()}function r(t){return e.props.isMulti&&Array.isArray(t)?[r(t[0]),r(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function s(t){const o=(e.props.max-e.props.min)/e.props.step,n=t*o;return a(Math.round(n)/o*(e.props.max-e.props.min)+e.props.min)}function a(t){return parseFloat(t.toFixed(e.props.decimals))}function l(t){return e.props.snapToMarks?t:Array.isArray(t)?t.map((t=>a(Math.round(t/e.props.step)*e.props.step))):a(Math.round(t/e.props.step)*e.props.step)}function i(t){if(Array.isArray(t))return t[0]=i(t[0]),t[1]=i(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}let p,d,u;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]),e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=Wo(e.props.disabled)),e.on("created",(()=>{function a(t){var o;if(!p||!e.props.dragging)return;t.preventDefault();const r=t.clientX||(null===(o=t.touches)||void 0===o?void 0:o.length)&&t.touches[0].clientX,{left:a,width:l}=p.getBoundingClientRect();n(s((r-a)/l))}var l;e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const c=Wo(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":c;const f=Wo(e.props.marks);e.props.marks=!!f&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=Wo(e.props.markLabels),e.props.snapToMarks=Wo(e.props.snapToMarks),e.props.showInput=Wo(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const v={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(v,e.props.inputAttrs):v,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs,Ro(`track-${e.props.id}`,(()=>{var o;p=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),n(e.value),t()}),e.props.__root),e.context){let t=0,l="";const c=e.context.handlers.blur;e.context.handlers.blur=t=>{c(t),e.emit("blur")},e.context.handlers.clickTrack=t=>{if(!p)return;e.props.dragging=!1;const{left:o,width:r}=p.getBoundingClientRect(),a=(t.clientX-o)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,r=Math.abs(t-a*e.props.max)<Math.abs(o-a*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=s(a),n(e._value)}else n(s(a))},e.context.handlers.focus=t=>{if(!p)return;const o=t.target.dataset.handle;o&&(e.props.lastHandleInteraction=o)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1},e.context.handlers.startDrag=t=>{if(!p)return;e.props.dragging=!0;const o="touchstart"===t.type,n=o?"touchmove":"mousemove",r=o?"touchend":"mouseup";e.props.lastHandleInteraction=t.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(n,a,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,a),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=o=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(o.key)){o.preventDefault(),clearTimeout(t),l+=o.key;const e="-"===l?-1:1;t=window.setTimeout((()=>{"-"!==l?(n(parseFloat(l)*e),l=""):l=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp"].includes(o.key)){o.preventDefault();const t="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[t]:e._value;if(e.props.marks&&e.props.snapToMarks){const t=i(r),s=e.props.marks.find((e=>e.at===t)),a=e.props.marks.indexOf(s),l=["ArrowLeft","ArrowDown"].includes(o.key)?-1:1,p=Math.min(Math.max(0,a+l),e.props.marks.length-1);return void n(e.props.marks[p].at)}if(o.metaKey)return void("ArrowLeft"===o.key||"ArrowDown"===o.key?n(e.props.min):n(e.props.max));n(r+(o.shiftKey?10*e.props.step:e.props.step)*(["ArrowLeft","ArrowDown"].includes(o.key)?-1:1))}},e.context.handlers.maxNode=t=>{u=t,t.hook.commit(((o,s)=>{if(Po(t.value,o))return s(o);const a=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=a,n(e.value)):n(a),s(r(a))}))},e.context.handlers.minNode=t=>{d=t,t.hook.commit(((o,s)=>{if(Po(t.value,o))return s(o);const a=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=a,n(e.value)):n(a),s(r(a))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(o),d&&d.input(e.value[0]),u&&u.input(e.value[1]))}}n(e.value)}))}]};var Hd=Object.freeze({__proto__:null,dropdown:Mr,toggle:Xr,repeater:_s,rating:Rs,autocomplete:ha,datepicker:ri,taglist:Si,mask:Zi,transferlist:ad,slider:Vd});const Fd="undefined"!=typeof window?setInterval:()=>0,Nd=new WeakSet;export{c as $if,ha as autocomplete,d as createBaseSections,Fo as createProPlugin,p as createSectionFactory,ri as datepicker,Mr as dropdown,Hd as inputs,Zi as mask,Rs as rating,_s as repeater,Vd as slider,Si as taglist,Xr as toggle,ad as transferlist};
|