@formkit/pro 0.117.7 → 0.118.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";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((()=>{vn[e]||(vn[e]=fn((()=>bn.add(e)),2e3)),function(e){if(cn){window.addEventListener(pn(),(o=>{const n=new URL(o.blockedURI).hostname;un.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(hn(e),i){o++;try{const a=await window[mn(an)](`${n}${r}${gn((s+o)%un.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){wn[e]&&wn[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 en.isRecord(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 c=d.length&&p?on.extendSchema(p,{children:d}):p;if(c=on.extendSchema(c,l),"object"==typeof c){let s=c;if(!tn.isDOM(c)&&!tn.isComponent(c)||c.meta||(c.meta={section:n,node:r}),tn.isDOM(c)){const{$el:r,...a}=c;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(tn.isComponent(c)){const{$cmp:r,...a}=c;s=i(t,n,Object.defineProperty(a,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...a}=c;s=i(t,n,Object.defineProperty(a,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return s}return i(t,n,c)}(e,a,t,n,s,l);return r&&en.isRecord(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",xn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",kn,!1),icon:An,label:e("label",_n,!1),prefix:e("prefix",Dn,!1),suffix:e("suffix",Dn,!1),help:e("help",Mn,!1),messages:e("messages",Ln,!1),message:e("message",Sn,!1)}}function c(e){return{overlayPlaceholder:e("overlayPlaceholder",En),overlayLiteral:e("overlayLiteral",On),overlayChar:e("overlayChar",Tn),overlayEnum:e("overlayEnum",In),overlay:e("overlay",Cn),overlayParts:e("overlayParts",Bn),overlayInner:e("overlayInner",Fn)}}function u(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)}:(on.isSlotCondition(s)?Object.assign(s.else,{if:e}):on.isSchemaObject(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(u("$fns.isSelected($option)",An("selected")),i("$option.label")),r(u("$state.loading && $isLoadingOptions || $state.hasNextPage",s(u("$state.loading",An("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}function h(e,t=!0){e.props.isLoadingOptions=!0,e.store.set(fr),e.props.loadingCounter++,e.store.set(tn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,ur.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.loadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.loadingCounter--}))}function v(e){e.props.allowAppendOptions=!0,h(e)}function m(e,t){e.props.page++,ur.set(e,t),e.store.set(tn.createMessage({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=>!en.eq(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=>en.eq(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:en.isRecord(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=>en.eq(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 w(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=>en.eq(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 x(e,t,o){const n=on.normalizeOptions(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 k(e,t,o){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,x(e,t,o);const n=on.normalizeOptions(o);e.props.options=n,e.props.options.length||(e.store.set(hr),e.store.set(tn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),w(e),gr.set(e,e.props.searchValue)}function _(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(g(t)!==vr?(e.props.option=t,e.props.maxReached&&!M(e,t)||e.input(L(e,g(t)))):null===(n=e.context)||void 0===n||n.handlers.loadMore())}function L(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 S(e,t){return en.eq(e.props.activeValue,g(t))||void 0}function M(e,t){return e.props.multiple?!!Array.isArray(e.value)&&e.value.includes(g(t)):en.eq(e.value,g(t))}function D(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||(tn.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=en.undefine(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:vr},e.props.listboxStyles={},e.props.loadingCounter=0,e.props.searchable=en.undefine(e.props.searchable),e.props.loadOnScroll=en.undefine(e.props.loadOnScroll),e.props.multiple=en.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=en.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&en.undefine(e.props.openOnRemove),e.props.hasNextPage=m.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.currentOptionsLoading=[],e.props.loadOnCreated=en.undefine(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 A(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||E(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=>en.eq(e.value,g(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&E(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=O.bind(null),en.whenAvailable(`${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(),w(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===vr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>en.eq(g(e),t)));e.props.activeDescendant=o>=0?`${e.props.id}_listitem_${o}`:void 0}))}function E(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 O(){}function T(e){e.on("created",(()=>{if(!e.context||!mr)return;e.context.fns.isActive=S.bind(null,e),e.context.fns.isSelected=t=>M(e,t),e.context.handlers.selectOption=t=>o=>R.call(null,e,t,o),e.context.handlers.loadMore=v.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?B.bind(null,e,t):F.bind(null,e),e.context.handlers.selectionBlur=()=>V.bind(null,e),e.context.handlers.tagClick=t=>P.bind(null,e,t),e.context.handlers.tagFocus=t=>H.bind(null,e,t),e.context.handlers.tagBlur=()=>N.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=I.bind(null,e),e.context.handlers.touchend=C.bind(null,e)}))}function I(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 C(e){br.delete(e)}function F(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 B(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 V(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 P(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 H(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=g(t),e.props.justFocused=!0)}function N(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 R(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},_(e,t))}function W(e,t,o,n){D(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",(()=>{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);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&!e.props.isLoadingOptions){e.props.optionsLoaded=!0;const t=h(e);t instanceof Promise&&t.then((()=>{b(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)?e.props.isLoadingOptions||b(e):(t=e.props.inputStd,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),A(e),e.props.loadOnCreated&&!e.props.optionsLoaded?h(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=en.undefine(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),T(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(hr),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 K(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 Y(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(vr);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 U(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 z(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 j(e,t,o,n=!0){var r,s,l,i,p,d;const c=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"===c?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 u=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_tag-wrapper_${a}`);u&&u.focus(),e.props.activeSelectionValue=(null===(d=e.props.selections[a])||void 0===d?void 0:d.value)||void 0}}function q(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}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},$(e,t)}function G(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===vr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>en.eq(g(t),e.props.activeValue)));if(!t)return;_(e,t)}else e.props.expanded=!0}function Z(e){e.props.expanded&&(e.props.expanded=!1)}function X(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":z(e);break;case"ArrowRight":case"ArrowLeft":j(e,t,o,!1);break;case"Delete":case"Backspace":q(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":Y(e,o,t);break;case"ArrowLeft":case"ArrowRight":U(e,o);break;case"Enter":G(e,t);break;case"Escape":Z(e);break;case"Delete":case"Backspace":K(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":Y(e,o,t);break;case"ArrowRight":case"ArrowLeft":U(e,o);break;case"Enter":G(e,t);break;case"Escape":Z(e);break;case"Delete":case"Backspace":K(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===vr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>en.eq(g(t),e.props.activeValue)));if(!t)return;_(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&&en.whenAvailable(`${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=xr.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;wr.set(t,{value:o[e],index:e})}const l=wr.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=wr.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=wr.get(o);e.push(s.value)}xr.set(s,e),o&&o(e)}}}function i(e){e.preventDefault(),l()}let p=0,d=null;if(null!=r||(r=document),kr.has(e))xr.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=wr.get(e);t&&(n?wr.set(e,{value:n.value,index:o}):wr.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),kr.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),wr.set(r[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);xr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){L(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",(()=>{en.whenAvailable(`${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",c=Math.round(i.left-p.left-5)+"px",u=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:c,paddingBottom:u},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 ce(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),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),h=i.height-u-f;t.scrollTop=c;const v=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},m=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||h>m?t.scrollTop=c:v();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=>en.eq(e.value,g(t))))),-1===r&&(r=null)}return r}function ue(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&tn.error(300,[e]),e.props.dropdownWrapperStyles=en.clone(_r),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=de.bind(null,e),e.props.positionListBox=ce.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Ar=document.documentElement.scrollTop;for(const e in Lr)Dr[e]=document.documentElement.style[e],document.documentElement.style[e]=Lr[e];for(const e in Sr)Mr[e]=document.body.style[e],document.body.style[e]=Sr[e];document.body.scrollTop=Ar}():function(){for(const e in Lr)document.documentElement.style[e]=Dr[e];for(const e in Sr)document.body.style[e]=Mr[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ar}())}))}function fe(e){e.addProps(["multiLine"]),e.on("created",(()=>{mr&&(e.props.multiLineHeight=void 0,en.whenAvailable(`${e.props.id}_selections`,he.bind(null,e),e.props.__root))}))}function he(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),ve(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function ve(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function me(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v;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=(c=e.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=e.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(h=e.props).addLabel)&&void 0!==l||(h.addLabel=!1),null!==(i=(v=e.props).addAttrs)&&void 0!==i||(v.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=en.undefine(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 ge(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=be(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 $e(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){xe(e,be(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function ye(e){xe(e)}function be(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 we(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 xe(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 ke(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=Le.bind(null,e),e.props.reloadOnCommit=en.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=en.undefine(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=Me.bind(null,e),e.context.handlers.input=_e.bind(null,e),e.context.handlers.focus=Me.bind(null,e),e.context.handlers.click=Se.bind(null,e),e.context.handlers.toggleListbox=De.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":z(e);break;case"ArrowRight":case"ArrowLeft":j(e,t,o);break;case"Delete":case"Backspace":q(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 _e(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&Le(e,!0)}function Le(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)}))]);w(e)}function Se(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 Me(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 De(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 Ae(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Ee(e)})),e.on("created",(()=>{if(!e.context||!ua)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=Te(e);if(e.props.highlightedRange){const[t,n]=Oe(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){en.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&fa.set(t,e)}),e.props.__root),ua&&!ha&&(ha=!0,document.addEventListener("selectionchange",(()=>{const e=a();if(e instanceof HTMLInputElement&&fa.has(e)){const t=fa.get(e);t&&function(e){clearTimeout(ca.get(e)),ca.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=Te(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]=Oe(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,Ee(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=Te(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=[],Le(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(ua&&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="",Le(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=Te(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,w(e))}))}function Ee(e){var t;if(!ua)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 Oe(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 Te(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 Ie(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Le(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&&Le(e,!0))}))}(e)}function Ce(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=[],Le(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&&Le(e,!0)}))}(e)}function Fe(e,t){var o;if(ul.has(e))return;ul.set(e,[]),t.reverse&&Ll.add(e),t.prefix&&Sl.set(e,t.prefix),t.suffix&&Ml.set(e,t.suffix),Ne(e,t.pattern,t.partOverrides,t.explicitParts);const n=ml.get(e),r=null==n?void 0:n.some((e=>Ke(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)&&gl.add(e),$l.set(e,l),t.onChange&&kl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Fl)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=fl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;et(e,s),e.setSelectionRange(...s.selectionAfter),fl.set(e,o),kl.has(e)&&kl.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=je(e),a=e.value;n&&qe(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(),kt(e);case"ArrowLeft":return t.preventDefault(),kt(e,-1);case"ArrowUp":return void(_t(e,1)&&t.preventDefault());case"ArrowDown":return void(_t(e,-1)&&t.preventDefault());case"Tab":return El?void t.preventDefault():void(kt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=gl.has(e),n=$l.get(e);if(o){let o=null,r=null,s=!1;const l="shift"===n?0:1,i=e.value;dt(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),(We(t)||Ke(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"===$l.get(e)){const[o]=$t(e),n=St(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){bl.set(e,Ze(e,t));const n=async()=>{if(!Cl||a()!==e)return;"select"===$l.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=je(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Xe(e,t);const[o]=$t(e),n=St(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&bl.set(e,Ze(e,o[n]))}(e));const t=bl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),bl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(bl.get(e))return;Ot(e),t=Xe(e,t);const[o]=$t(e),n=St(e,t),r=void 0!==n&&Ze(e,o[n]);r&&!ze(t,r)&&Qe(e,r,!0)}(e,t.detail))),qe(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Be(e){var t,o;if(Al.has(e))return;const n=null!==(t=ul.get(e))&&void 0!==t?t:[],r=n[null!==(o=fl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=$t(e,r.valueAfter),s=St(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"];Al.set(e,[r,l])}}}function Ve(e){Al.delete(e)}function Pe(e,t){const o="string"==typeof e||!ul.has(e),n="string"==typeof e?He(e):e;if(o)t.prefix&&Sl.set(n,t.prefix),t.suffix&&Ml.set(n,t.suffix),n.value=Ge(n,n.value),Fe(n,t);else{const e=Mt(n),o=n.value;n.value="",qe(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 He(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ne(e,t,o,n,r){r=e&&Ll.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Tl);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Ue(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Re(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Re(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=tt(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=Ne(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),c=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&&c.reverse(),e&&ml.set(e,c),c}function Re(e){return!!e&&(Ue(e)||We(e)||Ke(e))}function We(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Ye(e))}function Ke(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Ye(e))}function Ye(e){return!!e&&("placeholder"in e&&"token"in e)}function Ue(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function ze(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function je(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 qe(e,t){var o;Ll.has(e)&&Et(t);let n=!1;switch(_l.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Je(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===$l.get(e)){const[s,a]=$t(e),l=s.findIndex((e=>ze(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(We(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=it(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=tt(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(Ke(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=dt(e,t,o);return vl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:pt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Je(t),n=t.selectionBefore,r=Ll.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ot(o,s):s-=ot(o,s,"backward"));const l=$l.get(e);let i="";if("select"===l){const[o,n]=$t(e),r=St(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];We(l)?i=l.placeholder.repeat(a-s):Ke(l)&&([i,s]=ze(p,je(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ot(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=bt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&wt(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=dt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:vt(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Ll.has(e)&&n&&Et(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)){kl.has(e)&&Dl.set(e,(()=>{Dl.delete(e),n&&kl.get(e)(n,e)})),_l.set(e,"beforeCallback");let t=null!==(o=ul.get(e))&&void 0!==o?o:[];const r=fl.get(e);r&&(t=t.slice(0,r),fl.delete(e)),t.push(n),ul.set(e,t),Cl&&a()===e&&"function"==typeof document.execCommand&&!Fl?(Qe(e,[0,e.value.length,"forward"],!0),Fl=!0,document.execCommand("insertText",void 0,n.valueAfter),Fl=!1):et(e,n),Cl&&a()===e&&Qe(e,n.selectionAfter);const s=Dl.get(e);s&&s(),Ot(e)}_l.set(e,"complete")}function Ge(e,t){var o,n;const r=null!==(o=Sl.get(e))&&void 0!==o?o:"",s=null!==(n=Ml.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 Xe(e,t){const o=Sl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Je(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&&(hl.add(e),setTimeout((()=>hl.delete(e)),5)),bl.get(e)&&bl.set(e,t),e.setSelectionRange(...t)}function et(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 tt(e){if(null==e)return"";const t=yl.test(e.charAt(0))&&yl.test(e.charAt(1))?2:1;return e.substring(0,t)}function ot(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:yl.test(e.charAt(t))&&yl.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:tt(e.substring(t)).length}function nt(e,t){const o=tt(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 rt(e){const t=tt(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function st(e,t){const o=tt(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function at(e,t){for(;t.buffer;){const o=tt(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 lt(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(ot(t.buffer,0))}return null}function it(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 pt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=je(e);o=[n[0],t.endPos,"none"];const[r,s]=$t(e,t.value),a=St(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(We(i)&&it(p,i).length===p.length&&a<r.length-1)return Ol(),r[a+1];if(Ke(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=bt(o.values,r);if(s)return gt(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return wt(i.values,p)?[l[1],l[1],"forward"]:(Ol(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return ze(s,n)||(hl.add(e),setTimeout((()=>hl.delete(e)),5)),s}return l}function dt(e,t,o,n){var r,s;const a=null!==(r=ml.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:gl.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:$l.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:$t(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return ct(a,l,void 0,n),l}function ct(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":ft(o,t,e.at(-1)===o);break;case"char":ht(o,t,l);break;case"enum":ut(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};ct(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Ue(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),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&c&&s)return o.repeats++,ct(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Ue(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 ut(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=bt(e.values.concat([e.placeholder]),n);if(r){const s=gt(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):lt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=lt(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 ft(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?tt(t.data):"",s=tt(n);if(e===s)n=nt(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=st(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 ht(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=tt(t.data);if(e.pattern.test(n))return nt(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void at(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=tt(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,rt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return rt(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 vt(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=$t(e),a=St(e,r,s),[l,i]=$t(e,t.value),p=void 0!==a&&mt(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)=>mt(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 mt(e,t,o){if(Ue(o))return!1;if(We(o)){let n=t[0];for(;n<t[1];){const t=tt(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Ke(o)||e.substring(t[0],t[1])===o.placeholder}function gt(e,t){let o="";do{const n=tt(e).toLowerCase(),r=tt(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 $t(e,t){const o=ml.get(e);if(!o)return[[],[]];if(wl.has(e))return wl.get(e);const n=null!=t?t:Ge(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Ue(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(We(a)&&We(e)&&e.token===a.token)i++;else if(We(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Ke(e)){l&&r.push([l,i,"none"]),xt(e)||(p=!1);const t=yt(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&&wl.set(e,d),d}function yt(e,t,o){if(xt(t))return t.values[0].length;const n=e.slice(o),r=bt(t.values.concat([t.placeholder]),n);return r?r.length:0}function bt(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=tt(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=bt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function wt(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function xt(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 kt(e,t=1){const[o]=$t(e),n=St(e,Xe(e,je(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...Ze(e,o[n+t])),!0)}function _t(e,t=1){const[o,n]=$t(e),r=St(e,je(e));if(void 0!==r&&r in n){const s=n[r];if(Ke(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((()=>qe(e,t)),0),!0}}}return!1}function Lt(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 Lt(e.slice(...r),t)}function St(e,t,o){const[n]=null!=o?o:$t(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!ze(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=Lt([...s],t[1]);return l in a?a[l]:void 0}function Mt(e){var t,o;const n=null!==(t=ul.get(e))&&void 0!==t?t:[];return n[null!==(o=fl.get(e))&&void 0!==o?o:n.length-1]}function Dt(e,t=!1){const o=Mt(e);return o&&(o.complete||t)?Ll.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function At(e){var t;const o=Mt(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Et(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 Ot(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 Tt(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(zl);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(zl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function It(e){const t=Tt(e);return t.setDate(1),t.setHours(0,0,0),t}function Ct(e){const t=Tt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function Ft(e){return Ct(e).getDate()}function Bt(e,t=0){const o=Tt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function Vt(e,t=1){const o=Tt(e);return o.setDate(o.getDate()+t),o}function Pt(e,t=1,o=!1){const n=Tt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=Ft(n);n.setDate(e<r?e:r)}return n}function Ht(e,t=1,o=!1){const n=Tt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=Ft(n);n.setDate(e<r?e:r)}return n}function Nt(e,t){const o=Tt(e),n=Tt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function Rt(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(eo);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(eo).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 Wt(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(eo).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 Kt(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(eo),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(eo).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?Kl.get("YY"):Kl.get("YYYY");case"month":return s?1===r?Kl.get("M"):Kl.get("MM"):(a=Rt(o,e,t),"long"===a?Kl.get("MMMM"):Kl.get("MMM"));case"day":return 1===r?Kl.get("D"):Kl.get("DD");case"weekday":switch(a=Rt(o,e,t),a){case"narrow":return Kl.get("d");case"short":return Kl.get("ddd");default:return Kl.get("dddd")}case"hour":return 12===n?1===r?Kl.get("h"):Kl.get("hh"):1===r?Kl.get("H"):Kl.get("HH");case"minute":return 1===r?Kl.get("m"):Kl.get("mm");case"second":return 1===r?Kl.get("s"):Kl.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Kl.get("A"):Kl.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Kl.get("ZZ"):Kl.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 Yt(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(Ul.includes(e)||"object"==typeof e)return Kt(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}(Pl.filter(s).concat(Hl.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 Ut(e,t="en",o=!1,n=(()=>!0)){return Yt(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Pl.concat(Hl).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 zt(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=Wt(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?to(-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(eo)),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(eo);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(eo)}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=Tt(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=Tt(e);return t.map((e=>({...e,value:r(e)})))}function jt(e,t="long",o="en",n=!1,r=(()=>!0)){return"ISO8601"===t?Tt(e).toISOString():zt(e,Yt(t,o).filter(r),o,n).map((e=>e.value)).join("")}function qt(e){return["numeric","2-digit"].includes(e.partValue)}function Gt(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 Rl)i=Rl[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=>jt(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>jt(`2022-10-${o}`,e,t)));if("a"===e)return[Wt("am",t).toLowerCase(),Wt("pm",t).toLowerCase()];if("A"===e)return[Wt("am",t).toUpperCase(),Wt("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(jt(`${o+Number(r)}-06-06`,e,t)),n.unshift(jt(o-Number(r)+"-06-06",e,t)),n)),[jt(`${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 Xt(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 (${Ut(t,o)})`)};if("ISO8601"===t)return Tt(n);const l=Ul.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 Rl||o.token in Rl||qt(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(Yt(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=Gt(n,i)}catch{return a()}const d=new Date,c=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let u=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(c.has(e.token))c.set(e.token,t);else if("YY"===e.token)c.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)c.set("DD",t);else if("H"===n||n.startsWith("h"))c.set("HH",t);else if("M"===n)c.set("MM",t);else if("a"===n||"A"===n)u=e.value.toLowerCase()===Wt("am",o).toLowerCase();else if("Z"===n)f=Jt(e.value);else{const t=Zt(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":c.set("MM",t+1)}}}}));let h=c.get("HH")||0;!1===u?(h+=12===h?0:12,c.set("HH",24===h?0:h)):!0===u&&12===h&&c.set("HH",0),c.set("MM",(c.get("MM")||1)-1);let[v,m,g,$,y,b]=Array.from(c.values());const w=Ft(new Date(`${ql(v)}-${jl(m+1)}-10`));if(w<g&&"throw"===s)throw new Error(`Invalid date ${ql(v)}-${jl(m+1)}-${jl(g)}`);g="backward"===s?Math.min(g,w):g;const x=`${ql(v)}-${jl(m+1)}-${jl(g)}T${jl($)}:${jl(y)}:${jl(b)}${f}`,k=new Date(x);return isFinite(+k)?k:a()}function Jt(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=Tt(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(eo),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 to((r(o).getTime()-s.getTime())/1e3/60)}function eo(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function to(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function oo(e,t="+0000"){const o=Tt(e),n=function(e){Jt(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 no(e,t="+0000"){const o="+"===t.slice(0,1);return oo(e,t.replace(o?"+":"-",o?"-":"+"))}function ro(e,t,o=7){let n,r;const s=Tt(e);switch(o){case"month":r=s.getDate(),n=Ft(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Tt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Tt(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=Vt(s,e);if(t(o))return o}if(e&&e<=r){const o=Vt(s,-e);if(t(o))return o}}return null}function so(e){return"timeZoneName"!==e.partName}function ao(e,t){const o=[],n=Tt(t);n.setDate(1);let r=Bt(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=Bt(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Ct(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Vt(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function lo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>ao(e,Pt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(jt(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Ht(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Tt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>Pt(t,e)))}(e)}function io(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 po(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:Xt(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,so),o}function co(e){return Array.isArray(e.props.sequence)?en.clone(e.props.sequence):["day"]}function uo(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=oo(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(jt(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function fo(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 ho(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Ql.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`)?oi.add(e):oi.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===_l.get(t)&&(n=t.value),Be(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=Ml.get(e))&&void 0!==n?n:"";qe(e,{type:"insert",selectionBefore:je(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ve(t)),10))}));const[r,s]=mo(e);Fe(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(vo(e),Zl.has(e))return Zl.delete(e);n&&n===o?n="":(Be(t),e.props.inputText=o,setTimeout((()=>Ve(t)),10))}})}function vo(e){var t,o;if(e.props.overlay){const n=Ql.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Dt(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=s(At(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function mo(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=Yt(e.props.format,t);return[Ut(e.props.format,t,!0,so),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")&&ei.set(e,a),r}),[])]}function go(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function $o(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function yo(e,t){var o,n;if(t instanceof HTMLInputElement&&!ri.get(e)&&ni){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){ri.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 bo(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=en.undefine(e.props.overlay),e.props.pickerOnly=en.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&en.whenAvailable(`${e.props.id}`,yo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function wo(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);ji.set(e,t),Fe(t,{...zi.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=s(o)}})}function xo(e){const t=Rp.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.addEventListener("dragstart",Mo),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||e.addEventListener("dragenter",Io))}function ko(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 _o(e){const t=[],o=Rp.get(e),n=Hp.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];xo(o),Pp.set(o,{value:n()[e],index:e})}}function Lo(e,t,o,n){if(Kp.has(e))Rp.set(e,o),ko(e,o),Hp.set(e,t),Np.set(e,n),_o(e);else{new MutationObserver(So).observe(e,{childList:!0}),Rp.set(e,o),ko(e,o),Kp.add(e),Hp.set(e,t),Np.set(e,n),function(e){const t=Rp.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Co),e.addEventListener("dragenter",To))}(e),_o(e)}}function So(e){const t=[];for(const o of e){_o(o.target);for(const e of o.addedNodes)e instanceof HTMLElement&&Pp.has(e)&&t.push(e);for(const e of o.removedNodes)e instanceof HTMLElement&&Pp.has(e)}if(t.length&&jp)for(const e of t)for(const t of qp)Pp.get(e).value!==Pp.get(t).value||e.classList.add("dnd-placeholder");setTimeout((()=>{Gp=!1}),200)}function Mo(e){if(Do(e)&&Eo(e.currentTarget.parentNode)){const t=Rp.get(e.currentTarget.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();if(jp=e.currentTarget,!jp.parentNode)return;const o=Np.get(e.currentTarget.parentNode)();o.includes(jp)||o.push(jp);const n=new DocumentFragment,r=document.createElement("div");r.id="dnd-selections",r.style.display="flex",r.style.flexDirection="column",o.map((e=>{qp.push(e);let t=null;if(jp===e){t=jp.cloneNode(!0);const e=jp.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),jp.appendChild(n),jp.classList.add("dnd-dragging"),jp.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Pp.get(jp)}));const s=Hp.get(jp.parentNode)();Yp.set(jp,s),Up.set(jp,jp.parentNode)}}function Do(e){return!!e.currentTarget}function Ao(e){return!!e&&e instanceof HTMLElement}function Eo(e){return!!e&&e instanceof HTMLElement}function Oo(e){return Array.isArray(e)&&e.length>0}function To(e){if(Do(e)&&Ao(jp)&&Eo(jp.parentNode)&&Oo(qp)&&!Gp){const t=function(e,t){const o=Wp.get(e),n=Up.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,jp);if(t.accepted&&!t.draggedElementReturned){Gp=!0;const t=[...Hp.get(e.currentTarget)()],o=[];for(const e of qp)o.push(Pp.get(e).value);const n=t.concat(o);Up.set(jp,e.currentTarget),jp.style.display="none",e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}else if(t.accepted&&t.draggedElementReturned){Gp=!0;const t=Yp.get(jp);Up.set(jp,e.currentTarget),jp.style.display="",jp.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t}))}}}function Io(e){if(Do(e)&&Eo(e.currentTarget.parentNode)&&Ao(jp)&&Eo(jp.parentNode)&&Oo(qp)&&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,jp)&&function(e,t){return Pp.get(t).value!==Pp.get(e).value}(e.currentTarget,jp)&&!Gp){Gp=!0;const t=[...Hp.get(e.currentTarget.parentNode)()],o=qp.map((e=>Pp.get(e).value)),n=[...t.filter((e=>!o.includes(e)))],r=Pp.get(e.currentTarget).index;n.splice(r,0,...o),"none"!==jp.style.display&&jp.parentNode!==e.currentTarget.parentNode?jp.style.display="none":"none"===jp.style.display&&jp.parentNode===e.currentTarget.parentNode&&(jp.style.display=""),Up.set(jp,e.currentTarget.parentNode),e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}}function Co(e){if(e.stopPropagation(),e.preventDefault(),Zp=!0,!e.currentTarget)return;const t=Hp.get(e.currentTarget)();e.currentTarget.dispatchEvent(new CustomEvent("dndDrop",{detail:t})),setTimeout((()=>{Fo()}),50)}function Fo(){jp&&(Yp.delete(jp),Up.delete(jp)),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=""))}})),jp=null,qp=[]}function Bo(e,t){e.props.page++,Xp.set(e,t),e.store.set(tn.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function Vo(e){return"__original"in e?e.__original:e.value}function Po(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),No(e)}function Ho(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=>Vo(e)===Vo(t)))))]),(!e.props.newSourceValue||e.props.isSourceOption||e.props.dropped||e.props.forceUpdate)&&(e.props.targetOptions=t),e.props.targetOptionValues=t.map((e=>Vo(e))),e.props.showSourceEmptyMessage=e.props.sourceOptions&&0===e.props.sourceOptions.length,e.props.selections=[],e.props.dropped=!1,e.props.forceUpdate=!1)}function No(e,t=!0){e.store.set(rd),e.props.loadingCounter++,e.store.set(tn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Xp.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 Ro(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Wo(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Yo(t,o,n,r)]}function Ko(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Ro(255*t,2),Ro(255*a,2),n]}function Yo(e,t,o,n=1){const r=Ro(t/255,4),s=Ro(o/255,4);if(1===s)return[e,0,100,n];const a=Ro(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Ro(l,2),Ro(100*a,2),n]}function Uo(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function zo(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function jo(e,t,o,n=1){const[r,s,a,l]=Uo(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function qo(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Go(e){if(e){if(qo(e))return Wo(e);if(e.startsWith("rgb")){const t=e.match(Dc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return zo(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Ac);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Yo(o,Ro(255*n,2),Ro(255*r,2),s)}}}function Zo(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Xo(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Jo(e){return!1!==e&&"false"!==e}function Qo(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}Object.defineProperty(exports,"__esModule",{value:!0});var en=require("@formkit/utils"),tn=require("@formkit/core"),on=require("@formkit/inputs");require("@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]+$/,cn="undefined"!=typeof window,un=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=cn?setTimeout:()=>0,hn=e=>{clearTimeout(vn[e])},vn={},mn=e=>e.toString(32),gn=e=>`${mn(un[e]).substring(2)}.${mn(nn[e%(nn.length-1)])}`,$n={},yn={},bn=new Set(["",null,void 0]),wn={},xn=()=>({$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-inline":"$inline || undefined","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","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined"}}),kn=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),_n=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Ln=()=>({$el:"ul",if:"$fns.length($messages)"}),Sn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Mn=()=>({$el:"div",if:"$help"}),Dn=()=>({$el:null}),An=(e,t)=>()=>on.icon(e,t),En=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),On=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Tn=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),In=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Cn=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Fn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Bn=()=>({$el:null,for:["part","$_overlayParts"]}),Vn=p("dd"),{outer:Pn,wrapper:Hn,inner:Nn,icon:Rn,label:Wn,prefix:Kn,suffix:Yn,help:Un,messages:zn,message:jn}=d(Vn),qn=Vn("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"}}))),Gn=Vn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Zn=Vn("selection",(()=>({$el:"div"}))),Xn=Vn("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),Jn=Vn("optionLoading","span"),Qn=Vn("option",(()=>({$el:"div"}))),er=Vn("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=Vn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),or=Vn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),nr=Vn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),rr=Vn("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=Vn("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=Vn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"0"}}))),lr=Vn("tagLabel",(()=>({$el:"span"}))),ir=Vn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),pr=Vn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),dr=Vn("tagLoading","span"),cr=f(Vn),ur=new WeakMap,fr=tn.createMessage({key:"loading",type:"state",value:!0,visible:!1}),hr=tn.createMessage({key:"loading",type:"state",value:!1,visible:!1}),vr=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=>en.eq(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,wr=new WeakMap,xr=new WeakMap,kr=new WeakSet,_r={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Lr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Sr={overflow:"hidden",height:"100%"},Mr={},Dr={};let Ar=0;const Er={schema:Pn(Hn(Wn("$label"),Nn(Rn("prefix"),Kn(),qn(u("$inputStd.length === 0 && $state.loading !== true",Xn('$placeholder || "placeholder"'),u("$multiple !== true",Gn(u("$state.loading && $selections.length === 0",Jn("$ui.isLoading.value"),Zn(Qn("$option.label")))),u('$multiple && $selectionAppearance === "truncate"',tr(or(u("$state.loading && $selections.length === 0",Jn("$ui.isLoading.value"),rr()))),u('$multiple && $selectionAppearance === "tags"',ir(pr(u("$state.loading && $isLoadingOption !== true && $selections.length === 0",Jn("$ui.isLoading.value"),sr(ar(u("$state.loading && $currentOptionsLoading.includes($option.value)",dr("$ui.isLoading.value"),lr("$option.label")),er(Rn("close"))))))))))),u("$truncationCount && $state.loading !== true",nr("$truncationCount")),u("$state.loading",Rn("loader")),u("$inputStd.length !== 0 && $selectionRemovable",er(Rn("close")),Rn("select"))),cr(),Yn(),Rn("suffix"))),Un("$help"),zn(jn("$message.value"))),type:"input",family:"dropdown",props:[],features:[on.defaultIcon("select","select"),on.defaultIcon("close","close"),on.defaultIcon("selected","check"),on.defaultIcon("loader","spinner"),on.localize("isLoading"),on.localize("loadMore"),on.options,W.bind(null,(function(e){e.props.applyLoadedOptions=x,void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=en.undefine(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=en.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&en.undefine(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=>X.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)}))),"tags"===e.props.selectionAppearance&&fe(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=[],h(e))})),"overscroll"===e.props.behavior&&ue(e)}))]},Or=p("tg"),{outer:Tr,wrapper:Ir,label:Cr,prefix:Fr,suffix:Br,help:Vr,messages:Pr,message:Hr,icon:Nr}=d(Or),Rr=Or("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Wr=Or("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Kr=Or("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"}))),Yr=Or("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"}}))),Ur=Or("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"}}}))),zr=Or("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),jr=Or("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),qr=Or("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Gr={schema:Tr(Ir(Kr(),zr(Fr(),Rr(),jr(Yr(),qr(u("$slots.default","$slots.default",Nr("thumb")))),Br()),Ur(),Wr()),Vr("$help"),Pr(Hr("$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=en.undefine(e.props.disabled)),e.props.altLabelPosition=en.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=en.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=en.eq(t,e.props.onValue)}))}]},Zr=p("rp"),{outer:Xr,inner:Jr,prefix:Qr,suffix:es,help:ts,messages:os,message:ns,icon:rs}=d(Zr),ss=Zr("empty",(()=>({$el:"div"}))),as=Zr("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),ls=Zr("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),is=Zr("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),ps=Zr("items",(()=>({$el:"ul",attrs:{role:"list"}}))),ds=Zr("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),cs=Zr("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),us=Zr("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),fs=Zr("content","div"),hs=Zr("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),vs=Zr("legend",(()=>({$el:"legend",if:"$label"}))),ms=Zr("group",(()=>({$formkit:"group",index:"$index"}))),gs=Zr("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),$s=Zr("remove",(()=>({$el:"li",if:"$removeControl"}))),ys=Zr("insert",(()=>({$el:"li",if:"$insertControl"}))),bs=Zr("up",(()=>({$el:"li",if:"$upControl"}))),ws=Zr("down",(()=>({$el:"li",if:"$downControl"}))),xs=Zr("controlLabel","span"),ks={schema:Xr(hs(vs("$label"),ts("$help"),Jr(Qr(),u("$value.length === 0",u("$slots.empty",ss()),u("$slots.default",ps(ds(fs(ms("$slots.default")),gs(bs(us(xs("$ui.moveUp.value"),rs("moveUp"))),$s(is(xs("$ui.remove.value"),rs("remove"))),ys(as(xs("$ui.add.value"),rs("add"))),ws(cs(xs("$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",me.bind(null,e))},on.localize("remove"),on.localize("add"),on.localize("moveUp"),on.localize("moveDown"),on.defaultIcon("remove","trash"),on.defaultIcon("add","add"),on.defaultIcon("moveUp","arrowUp"),on.defaultIcon("moveDown","arrowDown")]},_s="undefined"!=typeof window,Ls=p("rt"),{outer:Ss,wrapper:Ms,inner:Ds,label:As,prefix:Es,suffix:Os,help:Ts,messages:Is,message:Cs,icon:Fs}=d(Ls),Bs=Ls("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"}}}))),Vs=Ls("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"}}))),Ps=Ls("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"}}}))),Hs=Ls("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"}}}))),Ns=Ls("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Rs=Ls("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Ws={schema:Ss(Ms(As("$label"),Ds(Fs("prefix"),Es(),Vs(Ps(Ns(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),Fs("rating"))))),Hs(Rs(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),Fs("rating")))))),Bs(),Os(),Fs("suffix"))),Ts("$help"),Is(Cs("$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=en.undefine(e.props.disabled)),e.on("created",(()=>{_s&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=$e.bind(null,e),e.context.handlers.ratingHoverOut=ye.bind(null,e),e.context.handlers.handleClick=ge.bind(null,e),_s&&en.whenAvailable(`${e.props.id}`,(()=>{we(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((()=>{we(e)}));n.observe(o)}(e),setTimeout((()=>we(e)),100)}),e.props.__root))})),e.on("input",(()=>xe(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)}))},on.defaultIcon("rating","star")]},Ks=p("ac"),{outer:Ys,wrapper:Us,inner:zs,icon:js,label:qs,prefix:Gs,suffix:Zs,help:Xs,messages:Js,message:Qs}=d(Ks),ea=Ks("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=Ks("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=Ks("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=Ks("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),ra=Ks("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),sa=Ks("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=Ks("optionLoading","span"),la=Ks("option",(()=>({$el:"div",if:"$value !== undefined"}))),ia=f(Ks),pa=new WeakSet,da=new WeakMap,ca=new WeakMap,ua="undefined"!=typeof window,fa=new WeakMap;let ha=!1;const va={schema:Ys(Us(qs("$label"),zs(js("prefix"),Gs(),ea(),u("$multiple !== true && $selectionAppearance === option && $expanded === false",ra(oa(na(la(u("$state.loading",aa("$ui.isLoading.value"),"$option.label"))),u("$state.loading && $isSingleOption !== true && $currentOptionsLoading.includes($option.value)",js("loader")),u("$selectionRemovable && $isSingleOption",sa(js("close")))))),u("$state.loading && ($isSingleOption !== true || $selections.length === 0)",js("loader")),u('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',sa(js("close")),u('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',ta(js("select")))),u("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $currentOptionsLoading.length > 0)",ta(js("select"))),ia(),Zs(),js("suffix")),u("$multiple && $selectionAppearance === option",ra(oa(na(la(u("$state.loading && $isLoadingOption",aa("$ui.isLoading.value"),"$option.label"))),sa(js("close")))))),Xs("$help"),Js(Qs("$message.value"))),type:"input",family:"dropdown",props:[],features:[on.defaultIcon("select","select"),on.defaultIcon("close","close"),on.defaultIcon("selected","check"),on.defaultIcon("loader","spinner"),on.localize("isLoading"),on.localize("loadMore"),on.options,W.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=en.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=en.undefine(e.props.selectionRemovable),e.props.applyLoadedOptions=k,e.props.openOnClick=en.undefine(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=en.undefine(e.props.allowNewValues)}),ke,(function(e){e.props.multiple?e.props.multiple&&"option"===e.props.selectionAppearance?(Ie(e),e.props.disabledDragAndDrop||pe(e)):e.props.multiple&&"text-input"===e.props.selectionAppearance&&Ae(e):Ce(e)}))]},ma=p("dp"),{outer:ga,wrapper:$a,inner:ya,icon:ba,label:wa,prefix:xa,suffix:ka,help:_a,messages:La,message:Sa}=d(ma),Ma=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"}}))),Da=ma("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:"$id + _panels",role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel"}}))),Aa=ma("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ea=ma("nextLabel","span"),Oa=ma("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Ta=ma("prevLabel","span"),Ia=ma("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Ca=ma("calendarWeeks",(()=>({$el:"tbody"}))),Fa=ma("calendarHeader",(()=>({$el:"thead"}))),Ba=ma("weekDays",(()=>({$el:"tr"}))),Va=ma("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Pa=ma("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Ha=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")'}}))),Na=ma("day","div"),Ra=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'}}))),Wa=ma("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Ka=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)"}}))),Ya=ma("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Ua=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)"}}))),za=ma("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),ja=ma("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),qa=ma("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Ga=ma("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Za=ma("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Xa=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)"}}))),nl=ma("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:rl,overlayLiteral:sl,overlayChar:al,overlayEnum:ll,overlay:il,overlayParts:pl,overlayInner:dl}=c(ma),cl=ma("panel","div"),ul=new WeakMap,fl=new WeakMap,hl=new WeakSet,vl=new WeakMap,ml=new WeakMap,gl=new WeakSet,$l=new WeakMap,yl=/[\uD800-\uDBFF]/,bl=new WeakMap,wl=new WeakMap,xl=new WeakMap,kl=new WeakMap,_l=new WeakMap,Ll=new WeakSet,Sl=new WeakMap,Ml=new WeakMap,Dl=new WeakMap,Al=new WeakMap;let El=!1;const Ol=()=>{El=!0,setTimeout((()=>{El=!1}),500)},Tl={"#":{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"}},Il=new WeakMap,Cl="undefined"!=typeof window;let Fl=!1;Cl&&document.addEventListener("selectionchange",(()=>{const e=a();if(!(e instanceof HTMLInputElement))return;if(Al.has(e))return function(e){const t=Al.get(e);if(t){const[o,n]=t,[r,s]=$t(e),a=s.indexOf(o);if(-1===a)return void Al.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];ze(je(e),i)||Qe(e,i)}}(e);if("select"!==$l.get(e))return;const t=je(e);if(!ze(t,Il.get(e))){if(Il.set(e,t),hl.has(e))return hl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:je(e)}))}}));const Bl="1999-03-04T02:05:01.000Z",Vl=new Map,Pl=[["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"}]],Hl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Nl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Rl={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Wl=["MMMM","MMM","dddd","ddd"],Kl=new Map([...Pl,...Hl,...Nl].map((e=>[e[0],e]))),Yl=new Map,Ul=["full","long","medium","short"],zl=/^([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})?$/,jl=e=>String(e).padStart(2,"0"),ql=e=>String(e).padStart(2,"0"),Gl="undefined"!=typeof window,Zl=new WeakSet,Xl=new WeakSet,Jl=new WeakSet,Ql=new WeakMap,ei=new WeakMap,ti=new WeakSet,oi=new WeakSet,ni="undefined"!=typeof window,ri=new WeakMap,si={schema:ga($a(wa("$label"),ya(ba("prefix"),xa(),il(dl(pl(rl("$part.value"),sl("$part.value"),al("$part.value"),ll("$part.value")))),Ma(),Da(za(Oa(Ta("$ui.prev.value"),ba("prev")),ja("$decade"),qa(Xa()),Ga(Ja(),Xa()),Za(Ja(),Qa(),Xa()),Aa(Ea("$ui.next.value"),ba("next")),nl(ba("close"))),cl(Wa(Ka("$fns.format($year, $yearFormat)")),Ya(Ua("$fns.format($month, $monthFormat)")),Ia(Fa(Ba(Va("$fns.format($day, $weekdayFormat)"))),Ca(Pa(Ha(Na("$fns.format($day, $dateFormat)"))))),tl(ol()))),el(ba("clear")),Ra(ba("calendar")),ka(),ba("suffix"))),_a("$help"),La(Sa("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[bo,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v,m,g,$,y,b,w,x,k;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","showPanelClose"]),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=(h=e.props).weekdayFormat)&&void 0!==o||(h.weekdayFormat="d"),null!==(r=(v=e.props).monthFormat)&&void 0!==r||(v.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=(w=e.props).valueLocale)&&void 0!==d||(w.valueLocale=e.props.locale),null!==(c=(x=e.props).format)&&void 0!==c||(x.format="long"),e.props.panels=co(e),e.props.pickerOnly=en.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=en.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=en.undefine(e.props.clearable)),null!==(u=(k=e.props).maxScan)&&void 0!==u||(k.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):go.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Tt(t);else if("string"==typeof t)try{o=Tt(Xt(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${Ut(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?Xt(e.props.minDate):e.props.minDate;e.props.minDate=no(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?Xt(e.props.maxDate):e.props.maxDate;e.props.maxDate=no(t,e.props.offset)}o=o&&no(o,e.props.offset),o&&uo(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&&jt(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=jt,e.on("created",(()=>{if(en.whenAvailable(`${e.props.id}`,ho.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>jt(t,o,e.props.locale||"en",!1,so),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!ro(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!ro(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 Nt(t,no(n instanceof Date?n:Xt(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.closePanel=()=>{e.props.expanded=!1},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=Ql.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Xl.has(e)&&(Jl.add(e),e.props.expanded=!0,setTimeout((()=>Jl.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;uo(e,void 0,!0),po(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(ti.has(e))return ti.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=Xt({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:so});if(function(e){return Yt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Al.get(t.target)&&jt(n,e.props.format,e.props.locale,!1,so)!==t.target.value){const r=Zt("dddd",e.props.locale),s=Yt(e.props.format,e.props.locale),a=null===(o=Gt(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=jt(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=Vt(n,t),Zl.add(e)}}uo(e,n)}catch(t){uo(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=Ht(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=Pt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Ht(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=Pt(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),po(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=ro(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&&Nt(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=Tt(e);return t.setHours(0,0,0),t}(t).getTime();return o<It(e).getTime()||o>Ct(e).getTime()||void 0}}}));const _=io.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()),uo(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void po(e,void 0);const o=new Date,n=t?po(e,no("string"==typeof t?Xt(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=jt(n,"HH:mm"),function(e){const t=ei.get(e);if(e._value&&t){const o=Ft(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",lo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(oi.delete(e),e.props.panels=co(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=ro(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}lo(e),en.whenAvailable(`${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),Gl&&setTimeout((()=>{document.addEventListener("click",_)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){ti.add(e);const t="string"==typeof e._value?Xt(e._value,e.props.valueFormat,e.props.valueLocale):e._value;po(e,no(t,e.props.offset))}else po(e,void 0);Gl&&(Xl.add(e),document.removeEventListener("click",_),setTimeout((()=>Xl.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=It(e.props.renderedDate),r=Ct(Pt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=Pt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=Pt(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=Ht(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Ht(e.props.renderedDate,-10))}e.props.expanded&&po(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||fo(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Vt(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=Vt(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||fo(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=Ht(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||fo(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=Pt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=ro(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",(()=>{Ql.get(e)&&vo(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=tn.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:$o(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},on.localize("next"),on.localize("prev"),on.localize("changeDate"),on.localize("chooseDate"),on.defaultIcon("close","close"),on.defaultIcon("next","right"),on.defaultIcon("clear","close"),on.defaultIcon("prev","left"),on.defaultIcon("calendar","date")]},ai=p("tl"),{outer:li,wrapper:ii,inner:pi,icon:di,label:ci,prefix:ui,suffix:fi,help:hi,messages:vi,message:mi}=d(ai),gi=ai("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"}}))),$i=ai("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'}}))),yi=ai("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"}}))),bi=ai("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),wi=ai("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=ai("tagLabel",(()=>({$el:"span"}))),ki=ai("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),_i=ai("tagLoading","span"),Li=f(ai),Si={schema:li(ii(ci("$label"),pi(di("prefix"),ui(),ki(yi(bi(u("$state.loading && $currentOptionsLoading.includes($option.value)",_i("$ui.isLoading.value"),xi("$option.label")),wi(di("close")))),gi()),u("$state.loading",di("loader")),$i(di("select")),Li(),fi(),di("suffix"))),hi("$help"),vi(mi("$message.value"))),type:"input",family:"dropdown",props:[],features:[on.options,W.bind(null,(function(e){e.props.multiple=!0,e.props.applyLoadedOptions=k,e.props.openOnClick=en.undefine(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=en.undefine(e.props.allowNewValues)}),ke,(function(e){Ie(e),fe(e),e.props.disableDragAndDrop||pe(e)})),on.defaultIcon("select","select"),on.defaultIcon("close","close"),on.defaultIcon("selected","check"),on.defaultIcon("loader","spinner"),on.localize("isLoading"),on.localize("loadMore")]},Mi=p("mk"),{outer:Di,wrapper:Ai,inner:Ei,label:Oi,prefix:Ti,suffix:Ii,help:Ci,messages:Fi,message:Bi,icon:Vi}=d(Mi),{overlayPlaceholder:Pi,overlayLiteral:Hi,overlayChar:Ni,overlayEnum:Ri,overlay:Wi,overlayParts:Ki,overlayInner:Yi}=c(Mi),Ui=Mi("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),zi=new WeakMap,ji=new WeakMap,qi=new WeakMap,Gi={schema:Di(Ai(Oi("$label"),Ei(Vi("prefix"),Ti(),Wi(Yi(Ki(Pi("$part.value"),Hi("$part.value"),Ni("$part.value"),Ri("$part.value")))),Ui(),Ii(),Vi("suffix"))),Ci("$help"),Fi(Bi("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[bo,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,a;const l=He("string"==typeof e._value?e._value:"");ji.set(e,l),qi.set(e,l),e.props.allowIncomplete=en.undefine(e.props.allowIncomplete),e.props.overlay=en.undefine(e.props.overlay);const i=!(void 0!==e.props.showMask&&!en.undefine(e.props.showMask));e.props.unmaskValue=en.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=en.undefine(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:en.undefine(e.props.reverse)};zi.set(e,p),e.hook.input(((t,o)=>{const n=function(e,t){const o=ji.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=qi.get(e);r.value=Ge(r,t);const a=Pe(r,zi.get(e)),l=Dt(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(At(r)||[]));return null===l?"":e.props.unmaskValue?l:a}(e,t);return o(n)})),e.props._maskValue=Pe(l,p),e.input(e.props._maskValue,!1),en.whenAvailable(`${e.props.id}`,wo.bind(null,e),e.props.__root)}))}]},Zi=p("tf"),{outer:Xi,wrapper:Ji,inner:Qi,icon:ep,prefix:tp,suffix:op,help:np,messages:rp,message:sp}=d(Zi),ap=Zi("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),lp=Zi("legend",(()=>({if:"$label",$el:"legend"}))),ip=Zi("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),pp=Zi("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),dp=Zi("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),cp=Zi("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=Zi("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),fp=Zi("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)"}))),hp=Zi("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),vp=Zi("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),mp=Zi("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'}}))),gp=Zi("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'}}))),$p=Zi("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"}}))),yp=Zi("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'}}))),bp=Zi("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),wp=Zi("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=Zi("loadMoreInner","span"),kp=Zi("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),_p=Zi("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Lp=Zi("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=Zi("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'}}))),Mp=Zi("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Dp=Zi("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Ap=Zi("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Ep=Zi("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'}}))),Op=Zi("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'}}))),Tp=Zi("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'}}))),Ip=Zi("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=Zi("controlLabel","span"),Fp=Zi("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Bp=Zi("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Vp=Zi("emptyMessageInner","span"),Pp=new WeakMap,Hp=new WeakMap,Np=new WeakMap,Rp=new WeakMap,Wp=new WeakMap,Kp=new WeakSet,Yp=new WeakMap,Up=new WeakMap,zp="undefined"!=typeof window;let jp=null,qp=[],Gp=!1,Zp=!1;zp&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("dragend",(()=>{Zp?Zp=!1:function(){if(Ao(jp)&&Eo(jp.parentNode)){const e=Yp.get(jp);jp.parentNode.dispatchEvent(new CustomEvent("dndDrop",{detail:e}))}Fo()}()})));const Xp=new WeakMap,Jp=new WeakSet,Qp=new WeakSet,ed=new WeakMap,td=new WeakMap,od="undefined"!=typeof window,nd=new WeakMap,rd=tn.createMessage({key:"loading",type:"state",value:!0,visible:!1}),sd=tn.createMessage({key:"loading",type:"state",value:!1,visible:!1}),ad=Symbol(),ld={schema:Xi(ap(lp("$label"),np("$help"),Ji(ip(pp(dp(),cp()),hp(vp(mp(),gp(ep("close")))),$p(Fp(Vp("$sourceEmptyMessage")),yp(u("$transferOnSelect !== true && $fns.isSelected($option)",ep("selected")),bp("$option.label")),wp(xp(u("$targetLoading !== true && $state.loading",ep("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Ap(Op(Cp("$ui.addAllValues.value"),ep("fastForward")),Ep(Cp("$ui.addSelectedValues.value"),ep("moveRight")),Tp(Cp("$ui.removeSelectedValues.value"),ep("moveLeft")),Ip(Cp("$ui.removeAllValues.value"),ep("rewind"))),kp(_p(up(),fp()),Lp(Bp(u("$state.loading !== true",Vp("$targetEmptyMessage"))),Sp(u("$transferOnSelect !== true && $fns.isSelected($option)",ep("selected")),Mp("$option.label")),Dp(xp(u("$targetLoading && $state.loading",ep("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),rp(sp("$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=>en.eq(Vo(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=>en.eq(t,Vo(e))));if(o)e.push(o);else{const o=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:en.isRecord(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=>Vo(e)===Vo(t))),n=p.findIndex((t=>Vo(t)===Vo(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=>Vo(e)));if(i.includes(Vo(t))){const o=e.props.selections.findIndex((e=>Vo(e)===Vo(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=>Vo(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=>Vo(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=>Vo(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=Jp.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=Qp.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&&Jp.add(e),e.props.mouseOnTarget&&Qp.add(e),a.length&&p(e,a,null,t)}function p(e,t,o,n){var r,s,a;const l=n,c=l?l.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>c.top&&e.props.mouseY<c.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)?Vo(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&&Jp.has(e)||e.props.mouseOnTarget&&Qp.has(e)?requestAnimationFrame(p.bind(null,e,t,o,n)):i(n)):(Jp.delete(e),Qp.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=Bo.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=on.normalizeOptions(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=Vo(r))}(e,o,n);const r=on.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(sd),e.store.set(tn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),t(e),nd.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=en.undefine(e.props.disabled)),e.props.searchable=en.undefine(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=>Vo(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?No(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=>Vo(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function r(e){return od&&p(e)}function i(e){return od&&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 c(t){t.stopImmediatePropagation(),t.detail,e.props.trackHover=!1}function u(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 h(e){return e.props.disabled}if(e.context.handlers.loadMore=Po.bind(null,e),e.context.fns.isActive=t=>en.eq(e.props.activeValue,Vo(t))||void 0,e.context.fns.optionValue=Vo,e.context.fns.isSelected=t=>e.props.selections.map((e=>Vo(e))).includes(Vo(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(Vo(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=>Vo(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(ed.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);ed.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(Vo(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,c,u,f;if(e.props.trackHover=!1,!(t.currentTarget&&t.currentTarget instanceof HTMLElement))return;const h=e.props.options.filter((t=>!e.props.targetOptionValues.includes(Vo(t))));if(["ArrowDown","ArrowUp"].includes(t.key)){if(t.preventDefault(),!Array.isArray(h)||!h.length)return;const n=h.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(Vo(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(ad);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=h.find((t=>Vo(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===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_transfer_button_forward_all`);if(o)o.focus();else if(e.props.targetOptionValues.length&&(null===(u=e.props.__root)||void 0===u?void 0:u.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(Vo(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(ad);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=>Vo(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(Vo(t))&&!(null===(o=t.attrs)||void 0===o?void 0:o.disabled)})),o=t[0];o&&(e.props.activeValue=Vo(o))},e.context.handlers.targetFocused=()=>{const t=e.props.targetOptions[0];t&&(e.props.activeValue=Vo(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},od){en.whenAvailable(e.props.id+"_source_list_items",(n=>{en.whenAvailable(`${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=>{en.eq(t.detail,e.value)||(e.props.dropped=!0,e.input([...t.detail]))})),n.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!0,c(t)})),s.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!1,c(t)})),document.addEventListener("dndDrop",(()=>{e.props.selections=[],e.props.trackHover=!0})),Lo(n,o.bind(null,e),{accepts:[s],dropBehavior:"append",childIsDraggable:u,isDisabled:f.bind(null,e)},r.bind(null,e)),Lo(s,t.bind(null,e),{accepts:[s,n],childIsDraggable:u,isDisabled:h.bind(null,e)},i.bind(null,e)))}),e.props.__root)}),e.props.__root);const v=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",v)}}})),e.on("commit",(({payload:t})=>{if(t===td.get(e)&&void 0!==td.get(e))return;if(td.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:en.isRecord(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(rd),Ho(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=>en.eq(Vo(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const t=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,Ho(e,o(e)),e.off(t))}))}else Ho(e,o(e));return}const n=o(e);if(!od||n||void 0===t||e.props.options&&e.props.options.length||"function"!=typeof e.props.optionsLoader)Ho(e,n);else{const t=No(e);Ho(e),t.then((()=>{Ho(e,o(e))}))}})),e.on("prop:options",(({payload:t})=>{e.props.sourceOptions=[...t].filter((t=>!e.props.targetOptionValues.includes(Vo(t)))),Ho(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,No(e)))})),e.on("prop:activeValue",(({payload:t})=>{if(t===ad)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>en.eq(Vo(e),t)));if(o>=0)e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`;else{const o=e.props.targetOptions.findIndex((e=>en.eq(Vo(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,Jp.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,Qp.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(sd)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(sd)}))},on.options,on.defaultIcon("moveRight","right"),on.defaultIcon("moveLeft","left"),on.defaultIcon("fastForward","fastForward"),on.defaultIcon("rewind","rewind"),on.defaultIcon("close","close"),on.defaultIcon("loader","spinner"),on.defaultIcon("selected","check"),on.localize("isLoading"),on.localize("loadMore"),on.localize("addAllValues"),on.localize("addSelectedValues"),on.localize("removeSelectedValues"),on.localize("removeAllValues")]},id=p("sl"),{outer:pd,wrapper:dd,inner:cd,icon:ud,label:fd,prefix:hd,suffix:vd,help:md,messages:gd,message:$d}=d(id),yd=id("chart",(()=>({$el:"div",if:"$chart"}))),bd=id("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 + "%"'}}}}))),wd=id("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),xd=id("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),kd=id("trackWrapper",(()=>({$el:"div"}))),_d=id("trackInner",(()=>({$el:"div"}))),Ld=id("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Sd=id("linkedValues",(()=>({$el:"div"}))),Md=id("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=id("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"}))),Ad=id("marks",(()=>({$el:"div",if:"$marks"}))),Ed=id("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:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Od=id("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Td=id("handles",(()=>({$el:"ul"}))),Id=id("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=id("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"}}))),Fd=id("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Bd=id("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Vd=id("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"}}))),Pd=id("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"}}))),Hd={schema:pd(dd(fd("$label"),md("$help"),wd(ud("prefix"),hd(),xd(yd(bd()),kd(_d(Ld(),Ad(Ed(Od())),Td(Cd(Pd(),Fd()),Id(Vd(),Bd()))))),vd(),ud("suffix"),u("$showInput && $isMulti === false",Md())),u("$showInput && $isMulti",Sd(Dd(),Md())),gd($d("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){function t(t){const{min:o,max:r,intervals:s}=e.props;if(t=Math.min(Math.max(t,0),100),!s||0===s.length){const n=o+t/100*(r-o);return e.props.scalingFunction.reverse(n,o,r)}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:r,width:s,stepsInInterval:l}=a[e];if(t>=r&&t<=r+s){const e=o+(t-r)/s*l*n,a=e%n;return i(a<n/2?e-a:e+(n-a))}}return t>100?r:t<0?o:void 0}function o(t,o=e.props.min,r=e.props.max){const s=e.props.intervals;if(!s||0===s.length){return(e.props.scalingFunction.forward(t,o,r)-o)/(r-o)*100}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:s,width:l,stepsInInterval:i}=a[e],p=e<a.length-1?a[e+1].value:r;if(t>=o&&t<=p){return 100*((s+(t-o)/n/i*l)/100)}}return 100}function n(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function r(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,a=0;if(Array.isArray(e._value)){const t=[...e._value].sort(s);a=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${o(r,t,n)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${o(a,t,n)}%`},e.props.fillStyles={left:`${o(a,t,n)}%`,width:o(r,t,n)-o(a,t,n)+"%"}):e.props.fillStyles={left:"0%",width:`${o(r,t,n)}%`}}function s(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function a(t,o=!0){if(e.props.disabled)return;let n;if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(t)){const o="min"===e.props.lastHandleInteraction?0:1;e._value[o]=t;const[r,a]=[...e._value];if(r>=a){const t=null==c?void 0:c.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=p([...e._value].sort(s))}else Array.isArray(t)?n=p(t):(n=p(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=d(n));const a=l(n);o&&e.input(a),r(),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];u&&u.input(t),f&&f.input(o)}else f&&f.input(e._value)}()}function l(t){return e.props.isMulti&&Array.isArray(t)?[l(t[0]),l(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function i(t){return parseFloat(t.toFixed(e.props.decimals))}function p(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>i(Math.round(t/e.props.step)*e.props.step))):i(Math.round(t/e.props.step)*e.props.step);const o=n(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return i(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return i(n.value+Math.round((t-n.value)/n.step)*n.step)}}function d(t){if(Array.isArray(t))return t[0]=d(t[0]),t[1]=d(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 c,u,f;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const h={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};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=en.undefine(e.props.disabled)),e.on("created",(()=>{function i(o){var n;if(!c||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:l}=c.getBoundingClientRect();a(t((r-s)/l*100))}var p;en.undefine(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=h[e.props.scalingFunction]||h.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...h.linear,...e.props.scalingFunction}):e.props.scalingFunction=h.linear,e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(p=e.props.step.toString().split(".")[1])||void 0===p?void 0:p.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const v=en.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":v;const m=en.undefine(e.props.marks);e.props.marks=!!m&&(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=en.undefine(e.props.markLabels),e.props.snapToMarks=en.undefine(e.props.snapToMarks),e.props.showInput=en.undefine(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 g={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(g,e.props.inputAttrs):g,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,en.whenAvailable(`track-${e.props.id}`,(()=>{var t;c=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value),r()}),e.props.__root),e.context){let r=0,p="";const h=e.context.handlers.blur;e.context.handlers.blur=t=>{h(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!c)return;e.props.dragging=!1;const{left:n,width:r}=c.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[o,n]=e.value,r=Math.abs(o-s*e.props.max)<Math.abs(n-s*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=t(100*s),a(e._value)}else a(t(100*s))},e.context.handlers.focus=t=>{if(!c)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(!c)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,i,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,i),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),p+=t.key;const e="-"===p?-1:1;r=window.setTimeout((()=>{"-"!==p?(a(parseFloat(p)*e),p=""):p=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[o]:e._value,s=function(t,o){if(!e.props.intervals)return e.props.step;const r=n(e.props.intervals);if(t>=e.props.max)return r[r.length-1].step;let s=r.find(((o,n)=>{var s;return t>=o.value&&t<((null===(s=r[n+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!s)return e.props.step;-1===o&&t-s.step<s.value&&(s=r[r.indexOf(s)-1]||s);return s.step}(r,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=d(r),n=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(n),l=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,i=Math.min(Math.max(0,s+l),e.props.marks.length-1);return void a(e.props.marks[i].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?a(e.props.min):a(e.props.max));if("Home"===t.key)return void a(e.props.min);if("End"===t.key)return void a(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){a(r+(t.shiftKey?10*s:s)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?a(r+10*s):"PageDown"===t.key&&a(r-10*s)}},e.context.handlers.maxNode=t=>{f=t,t.hook.commit(((o,n)=>{if(en.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,a(e.value)):a(r),n(l(r))}))},e.context.handlers.minNode=t=>{u=t,t.hook.commit(((o,n)=>{if(en.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,a(e.value)):a(r),n(l(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),u&&u.input(e.value[0]),f&&f.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||a(t,!1):e.value!==t&&a(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),a(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),a(e.value)}))}]},Nd=p("cp"),{outer:Rd,wrapper:Wd,inner:Kd,label:Yd,prefix:Ud,suffix:zd,help:jd,messages:qd,message:Gd,icon:Zd}=d(Nd),Xd=Nd("swatchPreview",(()=>({$el:"div",attrs:{class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Jd=Nd("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),Qd=Nd("panel",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",style:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}))),ec=Nd("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),tc=Nd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),oc=Nd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),nc=Nd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),rc=Nd("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),sc=Nd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),ac=Nd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),lc=Nd("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),ic=Nd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),pc=Nd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),dc=Nd("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),cc=Nd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),uc=Nd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),fc=Nd("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),hc=Nd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),vc=Nd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),mc=Nd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),gc=Nd("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),$c=Nd("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),yc=Nd("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),bc=Nd("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),wc=Nd("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),xc=Nd("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),kc=Nd("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),_c=Nd("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Lc=Nd("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Sc=Nd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Mc=Nd("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Dc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Ac=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Ec={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},Oc={schema:Rd(Wd(Yd("$label"),u("$inline && $help",jd("$help")),Kd(u("($inline === undefined || $inline === false) && $prefixIcon !== undefined",Zd("prefix","label")),u("$inline === undefined || $inline === false",Ud()),u("$inline === undefined || $inline === false",Xd(fc(),u("$showValue",Jd()))),u("$inline || $panelIsOpen)",Qd(u("$showPanelClose && ($inline === undefined || $inline === false)",ec(Zd("close"))),u("$panelControls",tc(oc(nc(),rc()),cc(uc()),sc(ac(),lc()),ic(pc(),dc()),u("$eyeDropper && $hasNativeEyeDropper",hc(Zd("eyeDropper"))))),u("$panelFormat",vc(mc(u('$panelActiveFormat === "hex"',gc()),u('$panelActiveFormat === "rgba"',$c()),u('$panelActiveFormat === "rgba"',yc()),u('$panelActiveFormat === "rgba"',bc()),u('$panelActiveFormat === "hsla"',xc()),u('$panelActiveFormat === "hsla"',kc()),u('$panelActiveFormat === "hsla"',_c()),u('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',wc())),Lc(Zd("switch")))),u("$options",Sc(Mc())))),u("$inline === undefined || $inline === false",zd()),u("($inline === undefined || $inline === false) && $suffixIcon !== undefined",Zd("suffix"))),u("$: ($inline === undefined || $inline === false) && $help",jd("$help"))),qd(Gd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){function t(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(_&&_.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!qo(n)&&!Dc.test(n)&&!Ac.test(n))return;(qo(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=Go(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Ro(o,2)===e.props.h&&Ro(r,2)===e.props.s&&Ro(s,2)===e.props.v&&Ro(a,2)===e.props.alpha)||(e.props.alpha=Ro(a,2),w(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=Go(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=Ro(s,2),w(o,n,r)}else w(e.props.h,e.props.s,e.props.v)}else w(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!E)return;const o=E[t];o&&(e.props.focusedSwatch=o.dataset.color)}function r(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function s(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),en.whenAvailable(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=Wo(t.sRGBHex);e.props.alpha=1,w(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{L=e}),I,v),l("canvas-hue",(e=>{S=e}),d,m),l("canvas-alpha",(e=>{M=e}),C,g),i(`canvas-preview-${e.props.id}`,(e=>{D=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{A=e,u()}),B),p()}function l(t,o,n,r){let s=!1;const a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},l=e=>{1===e.buttons&&k&&r(e)},p=e=>{k&&r(e)},d=()=>{k=void 0,a()},c=()=>{k=void 0,a()};i(`${t}-${e.props.id}`,(e=>{const a=e.nextElementSibling;o(e),n(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,r),s||function(e,t){s=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(a,e),e.addEventListener("mousedown",(e=>{a.focus(),a.setAttribute("data-prevent-focus-style","true"),k=Ec[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),k=Ec[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){en.whenAvailable(t,(()=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);a&&(o(a),n&&r(a,n))}),e.props.__root)}function p(){en.whenAvailable(`swatches-${e.props.id}`,(()=>{var t,o,n;E=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),E.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=E[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,y()}),e.props.__root)}function d(){if(!S)return;const e=S.getContext("2d");if(!e)return;const t=S.width,o=S.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function c(){if(!D)return;const t=D.getContext("2d");if(!t)return;$(D,D.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,D.width,D.height)}function u(){if(!A)return;const t=A.getContext("2d");if(!t)return;$(A,A.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,A.width,A.height)}function f(e){if(!e)return;const t=e.getContext("2d");if(!t)return;$(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Zo(o),[l,i,p,d]=Ko(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function h(e,t,o){let n=null;const r=e=>{null!==n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{if(!t)return;const n=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-n.left,s=e.touches[0].clientY-n.top):(r=e.clientX-n.left,s=e.clientY-n.top),r=Math.min(Math.max(r,0),n.width),s=Math.min(Math.max(s,0),n.height),o(r,s)}))};r(e);const s=e=>{e.preventDefault(),r(e)},a=e=>{e.preventDefault(),r(e)},l=()=>{k=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{k=void 0,document.removeEventListener("touchmove",a),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",a),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",s),document.addEventListener("mouseup",l))}function v(t){h(t,L,((t,o)=>{const n=t/L.width*100,r=100-o/L.height*100;V(e.props.hue,n,r)}))}function m(t){h(t,S,((t,o)=>{if(!S)return;const n=S.width,r=Math.floor(t/n*360);e.props.h=r,V(e.props.h,e.props.s,e.props.v)}))}function g(t){h(t,M,((t,o)=>{const n=t/M.width*100/100;e.props.alpha=n,V(e.props.hue,e.props.s,e.props.v)}))}function $(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function y(){var t,o;if(!e.context||!e.props.options||!E)return;const{h:r,s:s,v:a,alpha:l}=e.props,i=function(e,t,o,n=1){const r=0===o?0:t;return`${Ro(0===o||100===o&&0===t?0:e,0)}-${Ro(r,0)}-${Ro(o,0)}-${Ro(n,2)}`}(r,s,a,l);let p=!1,d=!1;E.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,r,s,c]=t.split("-");"0"===s&&0===a&&c===`${l}`&&(d=!0);const u=e.parentElement;d||t===i?(u.dataset.active="true",e.ariaSelected="true",d=!1,!p&&E&&(n(E.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=E[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function b(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function w(t,o,n){e.props.h=void 0===t||isNaN(t)?e.props.h:Ro(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:Ro(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:Ro(Math.max(Math.min(n,100),0),2);const{h:r,s:s,v:a,alpha:l}=e.props,[i,p,d]=Ko(r,s,a),[c,u,f]=Uo(r,s,a),h=e.props.hexInputFocused?e.props.hex:jo(r,s,a,l),v=Ro(l,2);e.props.hsla={h:r,s:p,l:d,a:v},e.props.hslaPercent={h:Ro(r,0),s:100===a&&0===s?0:Ro(0===a?p/255:Math.max(Math.min(p/255*100,100),0),0),l:Ro(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:v},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${v})`,e.props.hslaStringPrecise=`hsla(${r}, ${Ro(0===a?p/255:p/255*100,2)}%, ${Ro(d/255*100,2)}%, ${v})`,e.props.rgba={r:c,g:u,b:f,a:v},e.props.rgbaString=`rgba(${c}, ${u}, ${f}, ${v})`,b(h),setTimeout((()=>{var t;x(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),_||"undefined"==typeof window||(_=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const m=e.props.valueFormat?e.props.valueFormat:e.props.format;"hex"===m?e.input(e.props.hex):"rgba"===m?e.input(e.props.rgbaString):"hsla"===m&&e.input(e.props.hslaStringPrecise)}function x(){I(),C(),F(),B()}let k,_=null,L=null,S=null,M=null,D=null,A=null,E=null,O=0;const T=["hex","rgba","hsla"],I=Xo((function(){if(!L)return;const t=L.getContext("2d");if(!t)return;const{width:o,height:n}=L,r=e.props.h||0;t.fillStyle=`hsl(${r}, 100%, 50%)`,t.fillRect(0,0,o,n);const s=t.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=s,t.fillRect(0,0,o,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,o,n)}),2),C=Xo((function(){if(!M)return;const t=M.getContext("2d");if(!t)return;const o=Math.round(M.width),n=Math.round(M.height);t.clearRect(0,0,o,n),$(M,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=Xo(c,2),B=Xo(u,2),V=Xo(w,2),P=Xo(y,10,!1);e.addProps(["panelIsOpen","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.panelIsOpen=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=Jo(e.props.panelControls),e.props.eyeDropper=Jo(e.props.eyeDropper),e.props.panelFormat=Jo(e.props.panelFormat),e.props.showValue=Jo(e.props.showValue),e.props.allowPaste=Jo(e.props.allowPaste),e.props.inline=en.undefine(e.props.inline),e.props.disabled=en.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=en.undefine(e.props.closeOnSelect),e.props.focusedSwatch=void 0,o(`${e.value}`),e.on("input",(({payload:t})=>{_&&void 0!==e.props.__root&&!_.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:panelIsOpen",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.panelIsOpen=!1)}var o;if(e.props.panelIsOpen)s(),a(),p(),document.addEventListener("keydown",t),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",t);(null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=Go(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Ro(n,t)}-${Ro(r,t)}-${Ro(s,t)}-${Ro(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.panelIsOpen=!e.props.panelIsOpen},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.panelIsOpen=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.panelIsOpen=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.panelIsOpen=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.panelIsOpen=!e.props.panelIsOpen)},e.context.handlers.closePanel=()=>{e.props.panelIsOpen=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.panelIsOpen=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(T.indexOf(e.props.panelActiveFormat)+t+T.length)%T.length;e.props.panelActiveFormat=T[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.panelIsOpen){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Qo),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":w(o,n-s,r);break;case"ArrowRight":w(o,n+s,r);break;case"ArrowUp":w(o,n,r+s);break;case"ArrowDown":w(o,n,r-s);break;case"PageUp":w(o,n,r+10);break;case"PageDown":w(o,n,r-10);break;case"Home":w(o,n-10,r);break;case"End":w(o,n+10,r)}x()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":w(o-s,n,r);break;case"ArrowRight":case"ArrowUp":w(o+s,n,r);break;case"PageUp":w(o+10,n,r);break;case"PageDown":w(o-10,n,r);break;case"Home":w(0,n,r);break;case"End":w(360,n,r)}x()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=Ro(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=Ro(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=Ro(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=Ro(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}w(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,qo(r)){const[t,o,n,s]=Wo(r);e.props.alpha=s,b(r),w(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!qo(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;qo(o)&&b(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Yo(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);w(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=zo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);w(t,o,n)}else"alpha"==t&&(e.props.alpha=i,w())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Zo(o.dataset.colorPrecise);e.props.alpha=s,w(t,n,r),e.props.closeOnSelect&&(e.props.panelIsOpen=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!E||!E.length)return;const l=E.indexOf(t.currentTarget);let i=null;const p=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(E),d=E.length;let c=0,u=d,f=!1;const h=E[l].dataset.group;if(void 0!==h){const e=E.filter((e=>e.dataset.group===h));c=E.indexOf(e[0]),u=E.indexOf(e[e.length-1])}const v=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,O=v,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void E.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),O=v,e.context.handlers.swatchClick(t),void n(l);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":i=Math.max(l-p,l-(p-(O-v))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(O-v))),f=!0;break;case"ArrowLeft":i=l-1,O=(i-c)%p;break;case"ArrowRight":i=l+1,O=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=E[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=E[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=E.filter((e=>e.dataset.group===h)),n=E.filter((t=>t.dataset.group===e)),d=(l-c)%p,f=t.length%p||p,v=l>=c+t.length-f;if(i<c){const e=n.length%p||p;i=c-e+Math.min(Math.max(d,O),e-1)}else i>u&&(i=v?Math.min(u+Math.max(d,O)+1,E.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),E.forEach((e=>{delete e.parentElement.dataset.focused}));const e=E[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},on.options,on.defaultIcon("eyeDropper","color"),on.defaultIcon("close","close"),on.localize("close"),on.localize("next")]};var Tc=Object.freeze({__proto__:null,dropdown:Er,toggle:Gr,repeater:ks,rating:Ws,autocomplete:va,datepicker:si,taglist:Si,mask:Gi,transferlist:ld,slider:Hd,colorpicker:Oc});const Ic="undefined"!=typeof window?setInterval:()=>0,Cc=new WeakSet;exports.$if=u,exports.autocomplete=va,exports.colorpicker=Oc,exports.createBaseSections=d,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Cc.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){wn[e]?wn[e].add(t):wn[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];Cc.add(o),o.define({...r,schema:n(e)})}Ic((()=>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}},exports.createSectionFactory=p,exports.datepicker=si,exports.dropdown=Er,exports.inputs=Tc,exports.mask=Gi,exports.rating=Ws,exports.repeater=ks,exports.slider=Hd,exports.taglist=Si,exports.toggle=Gr,exports.transferlist=ld;
1
+ "use strict";function e(e,o){e in yn||(yn[e]={timer:0,inputs:new Set});const n=yn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=vn((()=>{$n[e]||($n[e]=vn((()=>wn.add(e)),2e3)),function(e){if(un){window.addEventListener(dn(),(o=>{const n=new URL(o.blockedURI).hostname;fn.some(((e,t)=>gn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=mn(sn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(yn[e].inputs),i=l.filter((t=>!(bn[e]&&bn[e].has(t)))).join("");if(hn(e),i){o++;try{const a=await window[mn(ln)](`${n}${r}${gn((s+o)%fn.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(an)])return t(e,p.schema);if(a.ok)return bn[e]||(bn[e]=new Set),void l.forEach((t=>bn[e].add(t)))}catch(e){}o<2&&vn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){wn.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 wn.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e){return tn.isRecord(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 c=d.length&&p?nn.extendSchema(p,{children:d}):p;if(c=nn.extendSchema(c,l),"object"==typeof c){let s=c;if(!on.isDOM(c)&&!on.isComponent(c)||c.meta||(c.meta={section:n,node:r}),on.isDOM(c)){const{$el:r,...a}=c;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(on.isComponent(c)){const{$cmp:r,...a}=c;s=i(t,n,Object.defineProperty(a,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...a}=c;s=i(t,n,Object.defineProperty(a,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return s}return i(t,n,c)}(e,a,t,n,s,l);return r&&tn.isRecord(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",kn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",_n,!1),icon:En,label:e("label",Ln,!1),prefix:e("prefix",An,!1),suffix:e("suffix",An,!1),help:e("help",Mn,!1),messages:e("messages",Sn,!1),message:e("message",Dn,!1)}}function c(e){return{overlayPlaceholder:e("overlayPlaceholder",On),overlayLiteral:e("overlayLiteral",Tn),overlayChar:e("overlayChar",In),overlayEnum:e("overlayEnum",Cn),overlay:e("overlay",Fn),overlayParts:e("overlayParts",Vn),overlayInner:e("overlayInner",Bn)}}function u(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)}:(nn.isSlotCondition(s)?Object.assign(s.else,{if:e}):nn.isSchemaObject(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(u("$fns.isSelected($option)",En("selected")),i("$option.label")),r(u("$state.loading && $isLoadingOptions || $state.hasNextPage",s(u("$state.loading",En("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}function v(e,t=!0){e.props.isLoadingOptions=!0,e.store.set(vr),e.props.loadingCounter++,e.store.set(on.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,fr.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.loadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.loadingCounter--}))}function h(e){e.props.allowAppendOptions=!0,v(e)}function $(e,t){e.props.page++,fr.set(e,t),e.store.set(on.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function m(e){return"__original"in e?e.__original:e.value}function g(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!tn.eq(m(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=yr(e);e.props.isLoadingOption=!0;const o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>tn.eq(m(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:tn.isRecord(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(vr),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=>tn.eq(m(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=yr(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 w(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=m(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.options.find((t=>tn.eq(m(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}e.props.reloadOnCommit||e.props.searchValue?e.props.activeValue=m(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=m(e.props.selections[e.props.selections.length-1]):e.props.activeValue=m(e.props.options[0])}}function x(e,t,o){const n=nn.normalizeOptions(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=m(r))}function k(e,t,o){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,x(e,t,o);const n=nn.normalizeOptions(o);e.props.options=n,e.props.options.length||(e.store.set(hr),e.store.set(on.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),w(e),gr.set(e,e.props.searchValue)}function _(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(m(t)!==$r?(e.props.option=t,e.props.maxReached&&!D(e,t)||e.input(L(e,m(t)))):null===(n=e.context)||void 0===n||n.handlers.loadMore())}function L(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 S(e,t){return tn.eq(e.props.activeValue,m(t))||void 0}function D(e,t){return e.props.multiple?!!Array.isArray(e.value)&&e.value.includes(m(t)):tn.eq(e.value,m(t))}function M(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||(on.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=tn.undefine(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:$r},e.props.listboxStyles={},e.props.loadingCounter=0,e.props.searchable=tn.undefine(e.props.searchable),e.props.loadOnScroll=tn.undefine(e.props.loadOnScroll),e.props.multiple=tn.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=tn.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&tn.undefine(e.props.openOnRemove),e.props.hasNextPage=$.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.currentOptionsLoading=[],e.props.loadOnCreated=tn.undefine(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 A(e){function t(e,t){var n;if(!e.props.expanded||!e.props.options||!e.props.options.length||br.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]),br.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)?m(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||E(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)),br.has(e)?requestAnimationFrame(o.bind(null,e,n,r)):t(e,r)):br.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=>tn.eq(e.value,m(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&E(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=O.bind(null),tn.whenAvailable(`${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);br.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(),w(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===$r)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>tn.eq(m(e),t)));e.props.activeDescendant=o>=0?`${e.props.id}_listitem_${o}`:void 0}))}function E(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 O(){}function T(e){e.on("created",(()=>{if(!e.context||!mr)return;e.context.fns.isActive=S.bind(null,e),e.context.fns.isSelected=t=>D(e,t),e.context.handlers.selectOption=t=>o=>R.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"},g(e,t)}(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?B.bind(null,e,t):F.bind(null,e),e.context.handlers.selectionBlur=()=>V.bind(null,e),e.context.handlers.tagClick=t=>P.bind(null,e,t),e.context.handlers.tagFocus=t=>H.bind(null,e,t),e.context.handlers.tagBlur=()=>N.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=I.bind(null,e),e.context.handlers.touchend=C.bind(null,e)}))}function I(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=wr.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else wr.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function C(e){wr.delete(e)}function F(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 B(e,t,o){o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue!==m(t)?(e.props.activeSelectionValue=m(t),o.currentTarget.focus()):e.props.activeSelectionValue=void 0)}function V(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 P(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue!==m(t)?(e.props.activeSelectionValue=m(t),o.currentTarget.focus()):e.props.activeSelectionValue=void 0))}function H(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=m(t),e.props.justFocused=!0)}function N(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 R(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},_(e,t))}function W(e,t,o,n){M(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,m(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",(()=>{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);if(e.props.inputStd.length&&"function"==typeof e.props.optionsLoader&&0===e.props.options.length&&"function"!=typeof e.props.optionLoader&&!e.props.isLoadingOptions){e.props.optionsLoaded=!0;const t=v(e);t instanceof Promise&&t.then((()=>{b(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)?e.props.isLoadingOptions||b(e):(t=e.props.inputStd,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),A(e),e.props.loadOnCreated&&!e.props.optionsLoaded?v(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=tn.undefine(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),T(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(hr),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 K(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 Y(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(m(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push($r);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 U(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 z(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 q(e,t,o,n=!0){var r,s,l,i,p,d;const c=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(m)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.map(m).indexOf(m(t));if(-1===o)return;const a="ArrowRight"===c?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 u=null===(p=e.props.__root)||void 0===p?void 0:p.getElementById(`${e.props.id}_tag-wrapper_${a}`);u&&u.focus(),e.props.activeSelectionValue=(null===(d=e.props.selections[a])||void 0===d?void 0:d.value)||void 0}}function j(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.map(m).indexOf(m(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}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},g(e,t)}function G(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===$r)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>tn.eq(m(t),e.props.activeValue)));if(!t)return;_(e,t)}else e.props.expanded=!0}function Z(e){e.props.expanded&&(e.props.expanded=!1)}function X(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":z(e);break;case"ArrowRight":case"ArrowLeft":q(e,t,o,!1);break;case"Delete":case"Backspace":j(e,t,o);break;case"Tab":!function(e,t,o,n=!1){var r,s;o.preventDefault();const a=e.props.selections.map(m).indexOf(m(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(m).indexOf(m(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(m).indexOf(m(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(m).indexOf(m(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"}),g(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":Y(e,o,t);break;case"ArrowLeft":case"ArrowRight":U(e,o);break;case"Enter":G(e,t);break;case"Escape":Z(e);break;case"Delete":case"Backspace":K(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":Y(e,o,t);break;case"ArrowRight":case"ArrowLeft":U(e,o);break;case"Enter":G(e,t);break;case"Escape":Z(e);break;case"Delete":case"Backspace":K(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===$r)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>tn.eq(m(t),e.props.activeValue)));if(!t)return;_(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=m(r)),t=setTimeout((()=>{o=""}),400)}}))}function re(e){se(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,se(e)})),mr&&tn.whenAvailable(`${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=kr.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)}kr.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))kr.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);kr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){L(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",(()=>{tn.whenAvailable(`${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",c=Math.round(i.left-p.left-5)+"px",u=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:c,paddingBottom:u},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 ce(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),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),v=i.height-u-f;t.scrollTop=c;const h=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},$=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||v>$?t.scrollTop=c: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=>tn.eq(e.value,m(t))))),-1===r&&(r=null)}return r}function ue(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&on.error(300,[e]),e.props.dropdownWrapperStyles=tn.clone(Lr),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=de.bind(null,e),e.props.positionListBox=ce.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Er=document.documentElement.scrollTop;for(const e in Sr)Ar[e]=document.documentElement.style[e],document.documentElement.style[e]=Sr[e];for(const e in Dr)Mr[e]=document.body.style[e],document.body.style[e]=Dr[e];document.body.scrollTop=Er}():function(){for(const e in Sr)document.documentElement.style[e]=Ar[e];for(const e in Dr)document.body.style[e]=Mr[e];document.body.scrollTop=0,document.documentElement.scrollTop=Er}())}))}function fe(e){e.addProps(["multiLine"]),e.on("created",(()=>{mr&&(e.props.multiLineHeight=void 0,tn.whenAvailable(`${e.props.id}_selections`,ve.bind(null,e),e.props.__root))}))}function ve(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),he(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function he(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function $e(e){var t,o,r,s,a,l,i,p,d,c,u,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=(c=e.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=e.props).insertControl)&&void 0!==s||(u.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=tn.undefine(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 me(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=be(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 ge(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){xe(e,be(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function ye(e){xe(e)}function be(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 we(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 xe(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 ke(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=Le.bind(null,e),e.props.reloadOnCommit=tn.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=tn.undefine(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=De.bind(null,e),e.context.handlers.input=_e.bind(null,e),e.context.handlers.focus=De.bind(null,e),e.context.handlers.click=Se.bind(null,e),e.context.handlers.toggleListbox=Me.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":z(e);break;case"ArrowRight":case"ArrowLeft":q(e,t,o);break;case"Delete":case"Backspace":j(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=>m(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||gr.delete(e)}))}function _e(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&Le(e,!0)}function Le(e,t=!1){if("function"==typeof e.props.optionsLoader){e.store.set(vr),t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(ca.get(e));const o=e.props.searchValue?e.props.debounce:0;ca.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)&&(da.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)}))]);w(e)}function Se(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 De(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 Me(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 Ae(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Ee(e)})),e.on("created",(()=>{if(!e.context||!fa)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=Te(e);if(e.props.highlightedRange){const[t,n]=Oe(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){tn.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&va.set(t,e)}),e.props.__root),fa&&!ha&&(ha=!0,document.addEventListener("selectionchange",(()=>{const e=a();if(e instanceof HTMLInputElement&&va.has(e)){const t=va.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=Te(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]=Oe(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,Ee(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=Te(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?(g(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=[],Le(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(fa&&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="",Le(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=Te(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,w(e))}))}function Ee(e){var t;if(!fa)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 Oe(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 Te(e){const t=yr(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 Ie(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Le(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&&Le(e,!0))}))}(e)}function Ce(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=[],Le(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&&Le(e,!0)}))}(e)}function Fe(e,t){var o;if(fl.has(e))return;fl.set(e,[]),t.reverse&&Sl.add(e),t.prefix&&Dl.set(e,t.prefix),t.suffix&&Ml.set(e,t.suffix),Ne(e,t.pattern,t.partOverrides,t.explicitParts);const n=ml.get(e),r=null==n?void 0:n.some((e=>Ke(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)&&gl.add(e),yl.set(e,l),t.onChange&&_l.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Bl)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=fl.get(e);if(null==r?void 0:r.length){const o=(null!==(n=vl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;et(e,s),e.setSelectionRange(...s.selectionAfter),vl.set(e,o),_l.has(e)&&_l.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=qe(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(),kt(e);case"ArrowLeft":return t.preventDefault(),kt(e,-1);case"ArrowUp":return void(_t(e,1)&&t.preventDefault());case"ArrowDown":return void(_t(e,-1)&&t.preventDefault());case"Tab":return Ol?void t.preventDefault():void(kt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=gl.has(e),n=yl.get(e);if(o){let o=null,r=null,s=!1;const l="shift"===n?0:1,i=e.value;dt(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),(We(t)||Ke(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"===yl.get(e)){const[o]=gt(e),n=St(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){wl.set(e,Ze(e,t));const n=async()=>{if(!Fl||a()!==e)return;"select"===yl.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=qe(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Xe(e,t);const[o]=gt(e),n=St(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&wl.set(e,Ze(e,o[n]))}(e));const t=wl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),wl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(wl.get(e))return;Ot(e),t=Xe(e,t);const[o]=gt(e),n=St(e,t),r=void 0!==n&&Ze(e,o[n]);r&&!ze(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 Be(e){var t,o;if(El.has(e))return;const n=null!==(t=fl.get(e))&&void 0!==t?t:[],r=n[null!==(o=vl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=gt(e,r.valueAfter),s=St(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"];El.set(e,[r,l])}}}function Ve(e){El.delete(e)}function Pe(e,t){const o="string"==typeof e||!fl.has(e),n="string"==typeof e?He(e):e;if(o)t.prefix&&Dl.set(n,t.prefix),t.suffix&&Ml.set(n,t.suffix),n.value=Ge(n,n.value),Fe(n,t);else{const e=Dt(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 He(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ne(e,t,o,n,r){r=e&&Sl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Il);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Ue(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Re(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Re(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=tt(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=Ne(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),c=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&&c.reverse(),e&&ml.set(e,c),c}function Re(e){return!!e&&(Ue(e)||We(e)||Ke(e))}function We(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Ye(e))}function Ke(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Ye(e))}function Ye(e){return!!e&&("placeholder"in e&&"token"in e)}function Ue(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function ze(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function qe(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;Sl.has(e)&&Et(t);let n=!1;switch(Ll.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Je(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===yl.get(e)){const[s,a]=gt(e),l=s.findIndex((e=>ze(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(We(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=it(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=tt(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(Ke(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=dt(e,t,o);return $l.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:pt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Je(t),n=t.selectionBefore,r=Sl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ot(o,s):s-=ot(o,s,"backward"));const l=yl.get(e);let i="";if("select"===l){const[o,n]=gt(e),r=St(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];We(l)?i=l.placeholder.repeat(a-s):Ke(l)&&([i,s]=ze(p,qe(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ot(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=bt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&wt(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=dt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:ht(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(Sl.has(e)&&n&&Et(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)){_l.has(e)&&Al.set(e,(()=>{Al.delete(e),n&&_l.get(e)(n,e)})),Ll.set(e,"beforeCallback");let t=null!==(o=fl.get(e))&&void 0!==o?o:[];const r=vl.get(e);r&&(t=t.slice(0,r),vl.delete(e)),t.push(n),fl.set(e,t),Fl&&a()===e&&"function"==typeof document.execCommand&&!Bl?(Qe(e,[0,e.value.length,"forward"],!0),Bl=!0,document.execCommand("insertText",void 0,n.valueAfter),Bl=!1):et(e,n),Fl&&a()===e&&Qe(e,n.selectionAfter);const s=Al.get(e);s&&s(),Ot(e)}Ll.set(e,"complete")}function Ge(e,t){var o,n;const r=null!==(o=Dl.get(e))&&void 0!==o?o:"",s=null!==(n=Ml.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=Dl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Xe(e,t){const o=Dl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Je(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&&(hl.add(e),setTimeout((()=>hl.delete(e)),5)),wl.get(e)&&wl.set(e,t),e.setSelectionRange(...t)}function et(e,t,o="After"){if(e.value=t[`value${o}`],Fl){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function tt(e){if(null==e)return"";const t=bl.test(e.charAt(0))&&bl.test(e.charAt(1))?2:1;return e.substring(0,t)}function ot(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:bl.test(e.charAt(t))&&bl.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:tt(e.substring(t)).length}function nt(e,t){const o=tt(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 rt(e){const t=tt(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function st(e,t){const o=tt(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function at(e,t){for(;t.buffer;){const o=tt(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 lt(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(ot(t.buffer,0))}return null}function it(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 pt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=qe(e);o=[n[0],t.endPos,"none"];const[r,s]=gt(e,t.value),a=St(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(We(i)&&it(p,i).length===p.length&&a<r.length-1)return Tl(),r[a+1];if(Ke(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=bt(o.values,r);if(s)return mt(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return wt(i.values,p)?[l[1],l[1],"forward"]:(Tl(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return ze(s,n)||(hl.add(e),setTimeout((()=>hl.delete(e)),5)),s}return l}function dt(e,t,o,n){var r,s;const a=null!==(r=ml.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:gl.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:yl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:gt(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return ct(a,l,void 0,n),l}function ct(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":ft(o,t,e.at(-1)===o);break;case"char":vt(o,t,l);break;case"enum":ut(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};ct(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Ue(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),c=!(t.buffer&&l&&t.buffer.startsWith(l)&&t.insertPos>=t.pos+l.length)&&(t.buffer||i);if(o.repeat&&c&&s)return o.repeats++,ct(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Ue(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 ut(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=bt(e.values.concat([e.placeholder]),n);if(r){const s=mt(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):lt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=lt(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 ft(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?tt(t.data):"",s=tt(n);if(e===s)n=nt(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=st(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 vt(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=tt(t.data);if(e.pattern.test(n))return nt(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void at(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=tt(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,rt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return rt(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 ht(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=gt(e),a=St(e,r,s),[l,i]=gt(e,t.value),p=void 0!==a&&$t(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)=>$t(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 $t(e,t,o){if(Ue(o))return!1;if(We(o)){let n=t[0];for(;n<t[1];){const t=tt(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Ke(o)||e.substring(t[0],t[1])===o.placeholder}function mt(e,t){let o="";do{const n=tt(e).toLowerCase(),r=tt(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 gt(e,t){const o=ml.get(e);if(!o)return[[],[]];if(xl.has(e))return xl.get(e);const n=null!=t?t:Ge(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Ue(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(We(a)&&We(e)&&e.token===a.token)i++;else if(We(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Ke(e)){l&&r.push([l,i,"none"]),xt(e)||(p=!1);const t=yt(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&&xl.set(e,d),d}function yt(e,t,o){if(xt(t))return t.values[0].length;const n=e.slice(o),r=bt(t.values.concat([t.placeholder]),n);return r?r.length:0}function bt(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=tt(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=bt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function wt(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function xt(e){if(!kl.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;kl.set(e,e.values.every((e=>e.length===t)))}return kl.get(e)}function kt(e,t=1){const[o]=gt(e),n=St(e,Xe(e,qe(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...Ze(e,o[n+t])),!0)}function _t(e,t=1){const[o,n]=gt(e),r=St(e,qe(e));if(void 0!==r&&r in n){const s=n[r];if(Ke(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 Lt(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 Lt(e.slice(...r),t)}function St(e,t,o){const[n]=null!=o?o:gt(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!ze(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=Lt([...s],t[1]);return l in a?a[l]:void 0}function Dt(e){var t,o;const n=null!==(t=fl.get(e))&&void 0!==t?t:[];return n[null!==(o=vl.get(e))&&void 0!==o?o:n.length-1]}function Mt(e,t=!1){const o=Dt(e);return o&&(o.complete||t)?Sl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function At(e){var t;const o=Dt(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Et(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 Ot(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 Tt(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(ql);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(ql);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function It(e){const t=Tt(e);return t.setDate(1),t.setHours(0,0,0),t}function Ct(e){const t=Tt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function Ft(e){return Ct(e).getDate()}function Bt(e,t=0){const o=Tt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function Vt(e,t=1){const o=Tt(e);return o.setDate(o.getDate()+t),o}function Pt(e,t=1,o=!1){const n=Tt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=Ft(n);n.setDate(e<r?e:r)}return n}function Ht(e,t=1,o=!1){const n=Tt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=Ft(n);n.setDate(e<r?e:r)}return n}function Nt(e,t){const o=Tt(e),n=Tt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function Rt(e,t,o){if(!Pl.has(e)){const t=new Date(Vl),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(eo);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(eo).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})}))}}Pl.set(e,s)}const n=Pl.get(e);return n?n[t][o]:void 0}function Wt(e,t){const o=Ul.get(t);if(o&&o[e])return o[e];const n=new Date(Vl);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(eo).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Ul.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function Kt(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(Vl)).map(eo),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(eo).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?Yl.get("YY"):Yl.get("YYYY");case"month":return s?1===r?Yl.get("M"):Yl.get("MM"):(a=Rt(o,e,t),"long"===a?Yl.get("MMMM"):Yl.get("MMM"));case"day":return 1===r?Yl.get("D"):Yl.get("DD");case"weekday":switch(a=Rt(o,e,t),a){case"narrow":return Yl.get("d");case"short":return Yl.get("ddd");default:return Yl.get("dddd")}case"hour":return 12===n?1===r?Yl.get("h"):Yl.get("hh"):1===r?Yl.get("H"):Yl.get("HH");case"minute":return 1===r?Yl.get("m"):Yl.get("mm");case"second":return 1===r?Yl.get("s"):Yl.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Yl.get("A"):Yl.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Yl.get("ZZ"):Yl.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 Yt(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(zl.includes(e)||"object"==typeof e)return Kt(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(Nl.filter(s)).map(o.bind(null,!1)).concat(Rl.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 Ut(e,t="en",o=!1,n=(()=>!0)){return Yt(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Hl.concat(Nl).concat(Rl).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 zt(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=Wt(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?to(-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&&Kl.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(eo)),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(eo);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(eo)}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=Tt(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=Tt(e);return t.map((e=>({...e,value:r(e)})))}function qt(e,t="long",o="en",n=!1,r=(()=>!0)){return"ISO8601"===t?Tt(e).toISOString():zt(e,Yt(t,o).filter(r),o,n).map((e=>e.value)).join("")}function jt(e){return["numeric","2-digit"].includes(e.partValue)}function Gt(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 Wl)i=Wl[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=>qt(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>qt(`2022-10-${o}`,e,t)));if("a"===e)return[Wt("am",t).toLowerCase(),Wt("pm",t).toLowerCase()];if("A"===e)return[Wt("am",t).toUpperCase(),Wt("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(qt(`${o+Number(r)}-06-06`,e,t)),n.unshift(qt(o-Number(r)+"-06-06",e,t)),n)),[qt(`${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 Xt(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 (${Ut(t,o)})`)};if("ISO8601"===t)return Tt(n);const l=zl.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 Wl||o.token in Wl||jt(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(Yt(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=Gt(n,i)}catch{return a()}const d=new Date,c=new Map([["YYYY",d.getFullYear()],["MM",d.getMonth()+1],["DD",d.getDate()],["HH",0],["mm",0],["ss",0]]);let u=null,f="";p.forEach((e=>{if("literal"===e.partName)return;if(e.token===e.value)return a();const t=Number(e.value);if(c.has(e.token))c.set(e.token,t);else if("YY"===e.token)c.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)c.set("DD",t);else if("H"===n||n.startsWith("h"))c.set("HH",t);else if("M"===n)c.set("MM",t);else if("a"===n||"A"===n)u=e.value.toLowerCase()===Wt("am",o).toLowerCase();else if("Z"===n)f=Jt(e.value);else{const t=Zt(n,o,l).indexOf(e.value);if(-1!==t)switch(n){case"MMM":case"MMMM":c.set("MM",t+1)}}}}));let v=c.get("HH")||0;!1===u?(v+=12===v?0:12,c.set("HH",24===v?0:v)):!0===u&&12===v&&c.set("HH",0),c.set("MM",(c.get("MM")||1)-1);let[h,$,m,g,y,b]=Array.from(c.values());const w=Ft(new Date(`${Gl(h)}-${jl($+1)}-10`));if(w<m&&"throw"===s)throw new Error(`Invalid date ${Gl(h)}-${jl($+1)}-${jl(m)}`);m="backward"===s?Math.min(m,w):m;const x=`${Gl(h)}-${jl($+1)}-${jl(m)}T${jl(g)}:${jl(y)}:${jl(b)}${f}`,k=new Date(x);return isFinite(+k)?k:a()}function Jt(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=Tt(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(eo),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 to((r(o).getTime()-s.getTime())/1e3/60)}function eo(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function to(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function oo(e,t="+0000"){const o=Tt(e),n=function(e){Jt(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 no(e,t="+0000"){const o="+"===t.slice(0,1);return oo(e,t.replace(o?"+":"-",o?"-":"+"))}function ro(e,t,o=7){let n,r;const s=Tt(e);switch(o){case"month":r=s.getDate(),n=Ft(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Tt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Tt(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=Vt(s,e);if(t(o))return o}if(e&&e<=r){const o=Vt(s,-e);if(t(o))return o}}return null}function so(e){return"timeZoneName"!==e.partName}function ao(e,t){const o=[],n=Tt(t);n.setDate(1);let r=Bt(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=Bt(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Ct(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Vt(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function lo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>ao(e,Pt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(qt(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Ht(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Tt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>Pt(t,e)))}(e)}function io(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 po(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:Xt(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,so),o}function co(e){return Array.isArray(e.props.sequence)?tn.clone(e.props.sequence):["day"]}function uo(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=oo(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(qt(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function fo(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 vo(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;ei.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`)?ni.add(e):ni.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===Ll.get(t)&&(n=t.value),Be(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!fl.has(e))return;const r=null!==(o=Dl.get(e))&&void 0!==o?o:"",s=null!==(n=Ml.get(e))&&void 0!==n?n:"";je(e,{type:"insert",selectionBefore:qe(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ve(t)),10))}));const[r,s]=$o(e);Fe(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(ho(e),Xl.has(e))return Xl.delete(e);n&&n===o?n="":(Be(t),e.props.inputText=o,setTimeout((()=>Ve(t)),10))}})}function ho(e){var t,o;if(e.props.overlay){const n=ei.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Mt(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=s(At(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function $o(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=Yt(e.props.format,t);return[Ut(e.props.format,t,!0,so),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")&&ti.set(e,a),r}),[])]}function mo(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function go(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function yo(e,t){var o,n;if(t instanceof HTMLInputElement&&!si.get(e)&&ri){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){si.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 bo(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=tn.undefine(e.props.overlay),e.props.pickerOnly=tn.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&tn.whenAvailable(`${e.props.id}`,yo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function wo(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);ji.set(e,t),Fe(t,{...qi.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=s(o)}})}function xo(e){const t=Wp.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.addEventListener("dragstart",Do),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||e.addEventListener("dragenter",Io))}function ko(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const o=[];for(const e of t.accepts)o.push(e);Kp.set(e,o)}}function _o(e){const t=[],o=Wp.get(e),n=Np.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];xo(o),Hp.set(o,{value:n()[e],index:e})}}function Lo(e,t,o,n){if(Yp.has(e))Wp.set(e,o),ko(e,o),Np.set(e,t),Rp.set(e,n),_o(e);else{new MutationObserver(So).observe(e,{childList:!0}),Wp.set(e,o),ko(e,o),Yp.add(e),Np.set(e,t),Rp.set(e,n),function(e){const t=Wp.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Co),e.addEventListener("dragenter",To))}(e),_o(e)}}function So(e){const t=[];for(const o of e){_o(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&&jp)for(const e of t)for(const t of Gp)Hp.get(e).value!==Hp.get(t).value||e.classList.add("dnd-placeholder");setTimeout((()=>{Zp=!1}),200)}function Do(e){if(Mo(e)&&Eo(e.currentTarget.parentNode)){const t=Wp.get(e.currentTarget.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();if(jp=e.currentTarget,!jp.parentNode)return;const o=Rp.get(e.currentTarget.parentNode)();o.includes(jp)||o.push(jp);const n=new DocumentFragment,r=document.createElement("div");r.id="dnd-selections",r.style.display="flex",r.style.flexDirection="column",o.map((e=>{Gp.push(e);let t=null;if(jp===e){t=jp.cloneNode(!0);const e=jp.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),jp.appendChild(n),jp.classList.add("dnd-dragging"),jp.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Hp.get(jp)}));const s=Np.get(jp.parentNode)();Up.set(jp,s),zp.set(jp,jp.parentNode)}}function Mo(e){return!!e.currentTarget}function Ao(e){return!!e&&e instanceof HTMLElement}function Eo(e){return!!e&&e instanceof HTMLElement}function Oo(e){return Array.isArray(e)&&e.length>0}function To(e){if(Mo(e)&&Ao(jp)&&Eo(jp.parentNode)&&Oo(Gp)&&!Zp){const t=function(e,t){const o=Kp.get(e),n=zp.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,jp);if(t.accepted&&!t.draggedElementReturned){Zp=!0;const t=[...Np.get(e.currentTarget)()],o=[];for(const e of Gp)o.push(Hp.get(e).value);const n=t.concat(o);zp.set(jp,e.currentTarget),jp.style.display="none",e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}else if(t.accepted&&t.draggedElementReturned){Zp=!0;const t=Up.get(jp);zp.set(jp,e.currentTarget),jp.style.display="",jp.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t}))}}}function Io(e){if(Mo(e)&&Eo(e.currentTarget.parentNode)&&Ao(jp)&&Eo(jp.parentNode)&&Oo(Gp)&&function(e,t){const o=Kp.get(e);return o?o&&o.length?o.includes(t.parentNode):void 0:{accepted:!0,draggedElementReturned:!1}}(e.currentTarget.parentNode,jp)&&function(e,t){return Hp.get(t).value!==Hp.get(e).value}(e.currentTarget,jp)&&!Zp){Zp=!0;const t=[...Np.get(e.currentTarget.parentNode)()],o=Gp.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"!==jp.style.display&&jp.parentNode!==e.currentTarget.parentNode?jp.style.display="none":"none"===jp.style.display&&jp.parentNode===e.currentTarget.parentNode&&(jp.style.display=""),zp.set(jp,e.currentTarget.parentNode),e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}}function Co(e){if(e.stopPropagation(),e.preventDefault(),Xp=!0,!e.currentTarget)return;const t=Np.get(e.currentTarget)();e.currentTarget.dispatchEvent(new CustomEvent("dndDrop",{detail:t})),setTimeout((()=>{Fo()}),50)}function Fo(){jp&&(Up.delete(jp),zp.delete(jp)),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=""))}})),jp=null,Gp=[]}function Bo(e,t){e.props.page++,Jp.set(e,t),e.store.set(on.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function Vo(e){return"__original"in e?e.__original:e.value}function Po(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),No(e)}function Ho(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=>Vo(e)===Vo(t)))))]),(!e.props.newSourceValue||e.props.isSourceOption||e.props.dropped||e.props.forceUpdate)&&(e.props.targetOptions=t),e.props.targetOptionValues=t.map((e=>Vo(e))),e.props.showSourceEmptyMessage=e.props.sourceOptions&&0===e.props.sourceOptions.length,e.props.selections=[],e.props.dropped=!1,e.props.forceUpdate=!1)}function No(e,t=!0){e.store.set(sd),e.props.loadingCounter++,e.store.set(on.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Jp.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 Ro(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Wo(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Yo(t,o,n,r)]}function Ko(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Ro(255*t,2),Ro(255*a,2),n]}function Yo(e,t,o,n=1){const r=Ro(t/255,4),s=Ro(o/255,4);if(1===s)return[e,0,100,n];const a=Ro(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Ro(l,2),Ro(100*a,2),n]}function Uo(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function zo(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function qo(e,t,o,n=1){const[r,s,a,l]=Uo(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function jo(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Go(e){if(e){if(jo(e))return Wo(e);if(e.startsWith("rgb")){const t=e.match(Ac);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return zo(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Ec);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Yo(o,Ro(255*n,2),Ro(255*r,2),s)}}}function Zo(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Xo(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Jo(e){return!1!==e&&"false"!==e}function Qo(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}function en(e,t){var o;return t=null!==(o=null==t?void 0:t.__original)&&void 0!==o?o:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>tn.eq(e,t))).length>0:void 0!==t?tn.eq(e.value,t):(e.props._isChecked=tn.eq(e.value,e.props.onValue),e.props._isChecked)}Object.defineProperty(exports,"__esModule",{value:!0});var tn=require("@formkit/utils"),on=require("@formkit/core"),nn=require("@formkit/inputs");require("@formkit/vue");const rn=[988,24029,396,13078,980],sn=18806588,an=502357,ln=16217489;let pn=189024;const dn=()=>[30548127325,27022924,34729821653783].map(mn).join("y"),cn=/^[0-9a-f]+$/,un="undefined"!=typeof window,fn=n(32,(e=>e)).map((()=>{pn|=0,pn=pn+1831565813|0;let e=pn^pn>>>15|pn;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),vn=un?setTimeout:()=>0,hn=e=>{clearTimeout($n[e])},$n={},mn=e=>e.toString(32),gn=e=>`${mn(fn[e]).substring(2)}.${mn(rn[e%(rn.length-1)])}`,yn={},bn={},wn=new Set(["",null,void 0]),xn={},kn=()=>({$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-inline":"$inline || undefined","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","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined"}}),_n=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),Ln=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Sn=()=>({$el:"ul",if:"$fns.length($messages)"}),Dn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Mn=()=>({$el:"div",if:"$help"}),An=()=>({$el:null}),En=(e,t)=>()=>nn.icon(e,t),On=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Tn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),In=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Cn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Fn=()=>({$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"]}),Pn=p("dd"),{outer:Hn,wrapper:Nn,inner:Rn,icon:Wn,label:Kn,prefix:Yn,suffix:Un,help:zn,messages:qn,message:jn}=d(Pn),Gn=Pn("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"}}))),Zn=Pn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Xn=Pn("selection",(()=>({$el:"div"}))),Jn=Pn("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),Qn=Pn("optionLoading","span"),er=Pn("option",(()=>({$el:"div"}))),tr=Pn("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"}}))),or=Pn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),nr=Pn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),rr=Pn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),sr=Pn("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 || ""'}))),ar=Pn("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"}}))),lr=Pn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"0"}}))),ir=Pn("tagLabel",(()=>({$el:"span"}))),pr=Pn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),dr=Pn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),cr=Pn("tagLoading","span"),ur=f(Pn),fr=new WeakMap,vr=on.createMessage({key:"loading",type:"state",value:!0,visible:!1}),hr=on.createMessage({key:"loading",type:"state",value:!1,visible:!1}),$r=Symbol(),mr="undefined"!=typeof window,gr=new WeakMap,yr=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=>tn.eq(m(t),e)));o||(o={value:e,label:Array.isArray(e)?e.join(", "):e,isPlaceholder:!1,noOptionFound:!0}),n.push(o)}return n},br=new WeakSet,wr=new WeakMap,xr=new WeakMap,kr=new WeakMap,_r=new WeakSet,Lr={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%"},Dr={overflow:"hidden",height:"100%"},Mr={},Ar={};let Er=0;const Or={schema:Hn(Nn(Kn("$label"),Rn(Wn("prefix"),Yn(),Gn(u("$inputStd.length === 0 && $state.loading !== true",Jn('$placeholder || "placeholder"'),u("$multiple !== true",Zn(u("$state.loading && $selections.length === 0",Qn("$ui.isLoading.value"),Xn(er("$option.label")))),u('$multiple && $selectionAppearance === "truncate"',or(nr(u("$state.loading && $selections.length === 0",Qn("$ui.isLoading.value"),sr()))),u('$multiple && $selectionAppearance === "tags"',pr(dr(u("$state.loading && $isLoadingOption !== true && $selections.length === 0",Qn("$ui.isLoading.value"),ar(lr(u("$state.loading && $currentOptionsLoading.includes($option.value)",cr("$ui.isLoading.value"),ir("$option.label")),tr(Wn("close"))))))))))),u("$truncationCount && $state.loading !== true",rr("$truncationCount")),u("$state.loading",Wn("loader")),u("$inputStd.length !== 0 && $selectionRemovable",tr(Wn("close")),Wn("select"))),ur(),Un(),Wn("suffix"))),zn("$help"),qn(jn("$message.value"))),type:"input",family:"dropdown",props:[],features:[nn.defaultIcon("select","select"),nn.defaultIcon("close","close"),nn.defaultIcon("selected","check"),nn.defaultIcon("loader","spinner"),nn.localize("isLoading"),nn.localize("loadMore"),nn.options,W.bind(null,(function(e){e.props.applyLoadedOptions=x,void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=tn.undefine(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=tn.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&tn.undefine(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=>X.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)}))),"tags"===e.props.selectionAppearance&&fe(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&&ue(e)}))]},Tr=p("tg"),{outer:Ir,wrapper:Cr,label:Fr,prefix:Br,suffix:Vr,help:Pr,messages:Hr,message:Nr,icon:Rr}=d(Tr),Wr=Tr("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Kr=Tr("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Yr=Tr("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"}))),Ur=Tr("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"}}))),zr=Tr("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"}}}))),qr=Tr("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),jr=Tr("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Gr=Tr("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Zr={schema:Ir(Cr(Yr(),qr(Br(),Wr(),jr(Ur(),Gr(u("$slots.default","$slots.default",Rr("thumb")))),Vr()),zr(),Kr()),Pr("$help"),Hr(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=tn.undefine(e.props.disabled)),e.props.altLabelPosition=tn.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=tn.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=tn.eq(t,e.props.onValue)}))}]},Xr=p("rp"),{outer:Jr,inner:Qr,prefix:es,suffix:ts,help:os,messages:ns,message:rs,icon:ss}=d(Xr),as=Xr("empty",(()=>({$el:"div"}))),ls=Xr("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),is=Xr("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ps=Xr("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),ds=Xr("items",(()=>({$el:"ul",attrs:{role:"list"}}))),cs=Xr("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),us=Xr("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),fs=Xr("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),vs=Xr("content","div"),hs=Xr("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),$s=Xr("legend",(()=>({$el:"legend",if:"$label"}))),ms=Xr("group",(()=>({$formkit:"group",index:"$index"}))),gs=Xr("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),ys=Xr("remove",(()=>({$el:"li",if:"$removeControl"}))),bs=Xr("insert",(()=>({$el:"li",if:"$insertControl"}))),ws=Xr("up",(()=>({$el:"li",if:"$upControl"}))),xs=Xr("down",(()=>({$el:"li",if:"$downControl"}))),ks=Xr("controlLabel","span"),_s={schema:Jr(hs($s("$label"),os("$help"),Qr(es(),u("$value.length === 0",u("$slots.empty",as()),u("$slots.default",ds(cs(vs(ms("$slots.default")),gs(ws(fs(ks("$ui.moveUp.value"),ss("moveUp"))),ys(ps(ks("$ui.remove.value"),ss("remove"))),bs(ls(ks("$ui.add.value"),ss("add"))),xs(us(ks("$ui.moveDown.value"),ss("moveDown")))))),ts()))),is('$addLabel || ($ui.add.value + " " + ($label || ""))')),ns(rs("$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",$e.bind(null,e))},nn.localize("remove"),nn.localize("add"),nn.localize("moveUp"),nn.localize("moveDown"),nn.defaultIcon("remove","trash"),nn.defaultIcon("add","add"),nn.defaultIcon("moveUp","arrowUp"),nn.defaultIcon("moveDown","arrowDown")]},Ls="undefined"!=typeof window,Ss=p("rt"),{outer:Ds,wrapper:Ms,inner:As,label:Es,prefix:Os,suffix:Ts,help:Is,messages:Cs,message:Fs,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"}}}))),Ps=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"}}))),Hs=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"}}}))),Rs=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"}}}))),Ks={schema:Ds(Ms(Es("$label"),As(Bs("prefix"),Os(),Ps(Hs(Rs(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),Bs("rating"))))),Ns(Ws(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),Bs("rating")))))),Vs(),Ts(),Bs("suffix"))),Is("$help"),Cs(Fs("$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=tn.undefine(e.props.disabled)),e.on("created",(()=>{Ls&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=ge.bind(null,e),e.context.handlers.ratingHoverOut=ye.bind(null,e),e.context.handlers.handleClick=me.bind(null,e),Ls&&tn.whenAvailable(`${e.props.id}`,(()=>{we(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((()=>{we(e)}));n.observe(o)}(e),setTimeout((()=>we(e)),100)}),e.props.__root))})),e.on("input",(()=>xe(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)}))},nn.defaultIcon("rating","star")]},Ys=p("ac"),{outer:Us,wrapper:zs,inner:qs,icon:js,label:Gs,prefix:Zs,suffix:Xs,help:Js,messages:Qs,message:ea}=d(Ys),ta=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"}}))),oa=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"}}))),na=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"}}))),ra=Ys("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),sa=Ys("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),aa=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"}}))),la=Ys("optionLoading","span"),ia=Ys("option",(()=>({$el:"div",if:"$value !== undefined"}))),pa=f(Ys),da=new WeakSet,ca=new WeakMap,ua=new WeakMap,fa="undefined"!=typeof window,va=new WeakMap;let ha=!1;const $a={schema:Us(zs(Gs("$label"),qs(js("prefix"),Zs(),ta(),u("$multiple !== true && $selectionAppearance === option && $expanded === false",sa(na(ra(ia(u("$state.loading",la("$ui.isLoading.value"),"$option.label"))),u("$state.loading && $isSingleOption !== true && $currentOptionsLoading.includes($option.value)",js("loader")),u("$selectionRemovable && $isSingleOption",aa(js("close")))))),u("$state.loading && ($isSingleOption !== true || $selections.length === 0)",js("loader")),u('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',aa(js("close")),u('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',oa(js("select")))),u("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $currentOptionsLoading.length > 0)",oa(js("select"))),pa(),Xs(),js("suffix")),u("$multiple && $selectionAppearance === option",sa(na(ra(ia(u("$state.loading && $isLoadingOption",la("$ui.isLoading.value"),"$option.label"))),aa(js("close")))))),Js("$help"),Qs(ea("$message.value"))),type:"input",family:"dropdown",props:[],features:[nn.defaultIcon("select","select"),nn.defaultIcon("close","close"),nn.defaultIcon("selected","check"),nn.defaultIcon("loader","spinner"),nn.localize("isLoading"),nn.localize("loadMore"),nn.options,W.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=tn.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=tn.undefine(e.props.selectionRemovable),e.props.applyLoadedOptions=k,e.props.openOnClick=tn.undefine(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=tn.undefine(e.props.allowNewValues)}),ke,(function(e){e.props.multiple?e.props.multiple&&"option"===e.props.selectionAppearance?(Ie(e),e.props.disabledDragAndDrop||pe(e)):e.props.multiple&&"text-input"===e.props.selectionAppearance&&Ae(e):Ce(e)}))]},ma=p("dp"),{outer:ga,wrapper:ya,inner:ba,icon:wa,label:xa,prefix:ka,suffix:_a,help:La,messages:Sa,message:Da}=d(ma),Ma=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"}}))),Aa=ma("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:"$id + _panels",role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel"}}))),Ea=ma("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Oa=ma("nextLabel","span"),Ta=ma("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Ia=ma("prevLabel","span"),Ca=ma("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Fa=ma("calendarWeeks",(()=>({$el:"tbody"}))),Ba=ma("calendarHeader",(()=>({$el:"thead"}))),Va=ma("weekDays",(()=>({$el:"tr"}))),Pa=ma("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Ha=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")'}}))),Ra=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'}}))),Ka=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)"}}))),Ua=ma("months",(()=>({if:'$panel === "month"',$el:"ul"}))),za=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)"}}))),qa=ma("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),ja=ma("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Ga=ma("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Za=ma("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Xa=ma("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Ja=ma("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Qa=ma("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),el=ma("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),tl=ma("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),ol=ma("time",(()=>({$el:"div",if:'$panel === "time"'}))),nl=ma("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),rl=ma("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:sl,overlayLiteral:al,overlayChar:ll,overlayEnum:il,overlay:pl,overlayParts:dl,overlayInner:cl}=c(ma),ul=ma("panel","div"),fl=new WeakMap,vl=new WeakMap,hl=new WeakSet,$l=new WeakMap,ml=new WeakMap,gl=new WeakSet,yl=new WeakMap,bl=/[\uD800-\uDBFF]/,wl=new WeakMap,xl=new WeakMap,kl=new WeakMap,_l=new WeakMap,Ll=new WeakMap,Sl=new WeakSet,Dl=new WeakMap,Ml=new WeakMap,Al=new WeakMap,El=new WeakMap;let Ol=!1;const Tl=()=>{Ol=!0,setTimeout((()=>{Ol=!1}),500)},Il={"#":{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"}},Cl=new WeakMap,Fl="undefined"!=typeof window;let Bl=!1;Fl&&document.addEventListener("selectionchange",(()=>{const e=a();if(!(e instanceof HTMLInputElement))return;if(El.has(e))return function(e){const t=El.get(e);if(t){const[o,n]=t,[r,s]=gt(e),a=s.indexOf(o);if(-1===a)return void El.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];ze(qe(e),i)||Qe(e,i)}}(e);if("select"!==yl.get(e))return;const t=qe(e);if(!ze(t,Cl.get(e))){if(Cl.set(e,t),hl.has(e))return hl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:qe(e)}))}}));const Vl="1999-03-04T02:05:01.000Z",Pl=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"}]],Nl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Rl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Wl={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Kl=["MMMM","MMM","dddd","ddd"],Yl=new Map([...Hl,...Nl,...Rl].map((e=>[e[0],e]))),Ul=new Map,zl=["full","long","medium","short"],ql=/^([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})?$/,jl=e=>String(e).padStart(2,"0"),Gl=e=>String(e).padStart(2,"0"),Zl="undefined"!=typeof window,Xl=new WeakSet,Jl=new WeakSet,Ql=new WeakSet,ei=new WeakMap,ti=new WeakMap,oi=new WeakSet,ni=new WeakSet,ri="undefined"!=typeof window,si=new WeakMap,ai={schema:ga(ya(xa("$label"),ba(wa("prefix"),ka(),pl(cl(dl(sl("$part.value"),al("$part.value"),ll("$part.value"),il("$part.value")))),Ma(),Aa(qa(Ta(Ia("$ui.prev.value"),wa("prev")),ja("$decade"),Ga(Ja()),Za(Qa(),Ja()),Xa(Qa(),el(),Ja()),Ea(Oa("$ui.next.value"),wa("next")),rl(wa("close"))),ul(Ka(Ya("$fns.format($year, $yearFormat)")),Ua(za("$fns.format($month, $monthFormat)")),Ca(Ba(Va(Pa("$fns.format($day, $weekdayFormat)"))),Fa(Ha(Na(Ra("$fns.format($day, $dateFormat)"))))),ol(nl()))),tl(wa("clear")),Wa(wa("calendar")),_a(),wa("suffix"))),La("$help"),Sa(Da("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[bo,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,v,h,$,m,g,y,b,w,x,k;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","showPanelClose"]),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=($=e.props).monthButtonFormat)&&void 0!==s||($.monthButtonFormat="MMMM"),null!==(a=(m=e.props).dayButtonFormat)&&void 0!==a||(m.dayButtonFormat="D"),null!==(l=(g=e.props).dateFormat)&&void 0!==l||(g.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=(w=e.props).valueLocale)&&void 0!==d||(w.valueLocale=e.props.locale),null!==(c=(x=e.props).format)&&void 0!==c||(x.format="long"),e.props.panels=co(e),e.props.pickerOnly=tn.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=tn.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=tn.undefine(e.props.clearable)),null!==(u=(k=e.props).maxScan)&&void 0!==u||(k.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):mo.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Tt(t);else if("string"==typeof t)try{o=Tt(Xt(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${Ut(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?Xt(e.props.minDate):e.props.minDate;e.props.minDate=no(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?Xt(e.props.maxDate):e.props.maxDate;e.props.maxDate=no(t,e.props.offset)}o=o&&no(o,e.props.offset),o&&uo(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&&qt(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=qt,e.on("created",(()=>{if(tn.whenAvailable(`${e.props.id}`,vo.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>qt(t,o,e.props.locale||"en",!1,so),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!ro(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!ro(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 Nt(t,no(n instanceof Date?n:Xt(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.closePanel=()=>{e.props.expanded=!1},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=ei.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Jl.has(e)&&(Ql.add(e),e.props.expanded=!0,setTimeout((()=>Ql.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;uo(e,void 0,!0),po(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(oi.has(e))return oi.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=Xt({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:so});if(function(e){return Yt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!El.get(t.target)&&qt(n,e.props.format,e.props.locale,!1,so)!==t.target.value){const r=Zt("dddd",e.props.locale),s=Yt(e.props.format,e.props.locale),a=null===(o=Gt(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=qt(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=Vt(n,t),Xl.add(e)}}uo(e,n)}catch(t){uo(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=Ht(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=Pt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Ht(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=Pt(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),po(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=ro(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&&Nt(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=Tt(e);return t.setHours(0,0,0),t}(t).getTime();return o<It(e).getTime()||o>Ct(e).getTime()||void 0}}}));const _=io.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()),uo(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void po(e,void 0);const o=new Date,n=t?po(e,no("string"==typeof t?Xt(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=qt(n,"HH:mm"),function(e){const t=ti.get(e);if(e._value&&t){const o=Ft(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",lo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(ni.delete(e),e.props.panels=co(e),e.props.panel=e.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,"day"===e.props.panel){const t=e.props.activeDate;e.props.activeDate=ro(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}lo(e),tn.whenAvailable(`${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",_)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){oi.add(e);const t="string"==typeof e._value?Xt(e._value,e.props.valueFormat,e.props.valueLocale):e._value;po(e,no(t,e.props.offset))}else po(e,void 0);Zl&&(Jl.add(e),document.removeEventListener("click",_),setTimeout((()=>Jl.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=It(e.props.renderedDate),r=Ct(Pt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=Pt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=Pt(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=Ht(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Ht(e.props.renderedDate,-10))}e.props.expanded&&po(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||fo(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Vt(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=Vt(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||fo(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=Ht(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||fo(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=Pt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=ro(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",(()=>{ei.get(e)&&ho(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=on.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:go(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},nn.localize("next"),nn.localize("prev"),nn.localize("changeDate"),nn.localize("chooseDate"),nn.defaultIcon("close","close"),nn.defaultIcon("next","right"),nn.defaultIcon("clear","close"),nn.defaultIcon("prev","left"),nn.defaultIcon("calendar","date")]},li=p("tl"),{outer:ii,wrapper:pi,inner:di,icon:ci,label:ui,prefix:fi,suffix:vi,help:hi,messages:$i,message:mi}=d(li),gi=li("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"}}))),yi=li("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'}}))),bi=li("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"}}))),wi=li("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),xi=li("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"}}))),ki=li("tagLabel",(()=>({$el:"span"}))),_i=li("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),Li=li("tagLoading","span"),Si=f(li),Di={schema:ii(pi(ui("$label"),di(ci("prefix"),fi(),_i(bi(wi(u("$state.loading && $currentOptionsLoading.includes($option.value)",Li("$ui.isLoading.value"),ki("$option.label")),xi(ci("close")))),gi()),u("$state.loading",ci("loader")),yi(ci("select")),Si(),vi(),ci("suffix"))),hi("$help"),$i(mi("$message.value"))),type:"input",family:"dropdown",props:[],features:[nn.options,W.bind(null,(function(e){e.props.multiple=!0,e.props.applyLoadedOptions=k,e.props.openOnClick=tn.undefine(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=tn.undefine(e.props.allowNewValues)}),ke,(function(e){Ie(e),fe(e),e.props.disableDragAndDrop||pe(e)})),nn.defaultIcon("select","select"),nn.defaultIcon("close","close"),nn.defaultIcon("selected","check"),nn.defaultIcon("loader","spinner"),nn.localize("isLoading"),nn.localize("loadMore")]},Mi=p("mk"),{outer:Ai,wrapper:Ei,inner:Oi,label:Ti,prefix:Ii,suffix:Ci,help:Fi,messages:Bi,message:Vi,icon:Pi}=d(Mi),{overlayPlaceholder:Hi,overlayLiteral:Ni,overlayChar:Ri,overlayEnum:Wi,overlay:Ki,overlayParts:Yi,overlayInner:Ui}=c(Mi),zi=Mi("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),qi=new WeakMap,ji=new WeakMap,Gi=new WeakMap,Zi={schema:Ai(Ei(Ti("$label"),Oi(Pi("prefix"),Ii(),Ki(Ui(Yi(Hi("$part.value"),Ni("$part.value"),Ri("$part.value"),Wi("$part.value")))),zi(),Ci(),Pi("suffix"))),Fi("$help"),Bi(Vi("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[bo,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,a;const l=He("string"==typeof e._value?e._value:"");ji.set(e,l),Gi.set(e,l),e.props.allowIncomplete=tn.undefine(e.props.allowIncomplete),e.props.overlay=tn.undefine(e.props.overlay);const i=!(void 0!==e.props.showMask&&!tn.undefine(e.props.showMask));e.props.unmaskValue=tn.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=tn.undefine(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:tn.undefine(e.props.reverse)};qi.set(e,p),e.hook.input(((t,o)=>{const n=function(e,t){const o=ji.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Gi.get(e);r.value=Ge(r,t);const a=Pe(r,qi.get(e)),l=Mt(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(At(r)||[]));return null===l?"":e.props.unmaskValue?l:a}(e,t);return o(n)})),e.props._maskValue=Pe(l,p),e.input(e.props._maskValue,!1),tn.whenAvailable(`${e.props.id}`,wo.bind(null,e),e.props.__root)}))}]},Xi=p("tf"),{outer:Ji,wrapper:Qi,inner:ep,icon:tp,prefix:op,suffix:np,help:rp,messages:sp,message:ap}=d(Xi),lp=Xi("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),ip=Xi("legend",(()=>({if:"$label",$el:"legend"}))),pp=Xi("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),dp=Xi("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),cp=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"}))),up=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()"}))),fp=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"}))),vp=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)"}))),hp=Xi("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),$p=Xi("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),mp=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'}}))),gp=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'}}))),yp=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"}}))),bp=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'}}))),wp=Xi("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),xp=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'}}))),kp=Xi("loadMoreInner","span"),_p=Xi("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Lp=Xi("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Sp=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"}}))),Dp=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'}}))),Mp=Xi("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Ap=Xi("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Ep=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'}}))),Tp=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'}}))),Ip=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'}}))),Cp=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'}}))),Fp=Xi("controlLabel","span"),Bp=Xi("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Vp=Xi("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Pp=Xi("emptyMessageInner","span"),Hp=new WeakMap,Np=new WeakMap,Rp=new WeakMap,Wp=new WeakMap,Kp=new WeakMap,Yp=new WeakSet,Up=new WeakMap,zp=new WeakMap,qp="undefined"!=typeof window;let jp=null,Gp=[],Zp=!1,Xp=!1;qp&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("dragend",(()=>{Xp?Xp=!1:function(){if(Ao(jp)&&Eo(jp.parentNode)){const e=Up.get(jp);jp.parentNode.dispatchEvent(new CustomEvent("dndDrop",{detail:e}))}Fo()}()})));const Jp=new WeakMap,Qp=new WeakSet,ed=new WeakSet,td=new WeakMap,od=new WeakMap,nd="undefined"!=typeof window,rd=new WeakMap,sd=on.createMessage({key:"loading",type:"state",value:!0,visible:!1}),ad=on.createMessage({key:"loading",type:"state",value:!1,visible:!1}),ld=Symbol(),id={schema:Ji(lp(ip("$label"),rp("$help"),Qi(pp(dp(cp(),up()),hp($p(mp(),gp(tp("close")))),yp(Bp(Pp("$sourceEmptyMessage")),bp(u("$transferOnSelect !== true && $fns.isSelected($option)",tp("selected")),wp("$option.label")),xp(kp(u("$targetLoading !== true && $state.loading",tp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Ep(Tp(Fp("$ui.addAllValues.value"),tp("fastForward")),Op(Fp("$ui.addSelectedValues.value"),tp("moveRight")),Ip(Fp("$ui.removeSelectedValues.value"),tp("moveLeft")),Cp(Fp("$ui.removeAllValues.value"),tp("rewind"))),_p(Lp(fp(),vp()),Sp(Vp(u("$state.loading !== true",Pp("$targetEmptyMessage"))),Dp(u("$transferOnSelect !== true && $fns.isSelected($option)",tp("selected")),Mp("$option.label")),Ap(kp(u("$targetLoading && $state.loading",tp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),sp(ap("$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=>tn.eq(Vo(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=>tn.eq(t,Vo(e))));if(o)e.push(o);else{const o=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:tn.isRecord(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=>Vo(e)===Vo(t))),n=p.findIndex((t=>Vo(t)===Vo(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=>Vo(e)));if(i.includes(Vo(t))){const o=e.props.selections.findIndex((e=>Vo(e)===Vo(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=>Vo(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=>Vo(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=>Vo(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=Qp.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=ed.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&&Qp.add(e),e.props.mouseOnTarget&&ed.add(e),a.length&&p(e,a,null,t)}function p(e,t,o,n){var r,s,a;const l=n,c=l?l.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>c.top&&e.props.mouseY<c.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)?Vo(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&&Qp.has(e)||e.props.mouseOnTarget&&ed.has(e)?requestAnimationFrame(p.bind(null,e,t,o,n)):i(n)):(Qp.delete(e),ed.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=Bo.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=nn.normalizeOptions(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=Vo(r))}(e,o,n);const r=nn.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(ad),e.store.set(on.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),t(e),rd.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=tn.undefine(e.props.disabled)),e.props.searchable=tn.undefine(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=>Vo(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?No(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=>Vo(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function r(e){return nd&&p(e)}function i(e){return nd&&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 c(t){t.stopImmediatePropagation(),t.detail,e.props.trackHover=!1}function u(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=Po.bind(null,e),e.context.fns.isActive=t=>tn.eq(e.props.activeValue,Vo(t))||void 0,e.context.fns.optionValue=Vo,e.context.fns.isSelected=t=>e.props.selections.map((e=>Vo(e))).includes(Vo(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(Vo(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=>Vo(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(td.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);td.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(Vo(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,c,u,f;if(e.props.trackHover=!1,!(t.currentTarget&&t.currentTarget instanceof HTMLElement))return;const v=e.props.options.filter((t=>!e.props.targetOptionValues.includes(Vo(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(Vo(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(ld);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=>Vo(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===(c=e.props.__root)||void 0===c?void 0:c.getElementById(`${e.props.id}_transfer_button_forward_all`);if(o)o.focus();else if(e.props.targetOptionValues.length&&(null===(u=e.props.__root)||void 0===u?void 0:u.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(Vo(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(ld);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=>Vo(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(Vo(t))&&!(null===(o=t.attrs)||void 0===o?void 0:o.disabled)})),o=t[0];o&&(e.props.activeValue=Vo(o))},e.context.handlers.targetFocused=()=>{const t=e.props.targetOptions[0];t&&(e.props.activeValue=Vo(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},nd){tn.whenAvailable(e.props.id+"_source_list_items",(n=>{tn.whenAvailable(`${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=>{tn.eq(t.detail,e.value)||(e.props.dropped=!0,e.input([...t.detail]))})),n.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!0,c(t)})),s.addEventListener("dndDragStart",(t=>{e.props.isSourceOption=!1,c(t)})),document.addEventListener("dndDrop",(()=>{e.props.selections=[],e.props.trackHover=!0})),Lo(n,o.bind(null,e),{accepts:[s],dropBehavior:"append",childIsDraggable:u,isDisabled:f.bind(null,e)},r.bind(null,e)),Lo(s,t.bind(null,e),{accepts:[s,n],childIsDraggable:u,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===od.get(e)&&void 0!==od.get(e))return;if(od.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:tn.isRecord(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(sd),Ho(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=>tn.eq(Vo(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const t=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,Ho(e,o(e)),e.off(t))}))}else Ho(e,o(e));return}const n=o(e);if(!nd||n||void 0===t||e.props.options&&e.props.options.length||"function"!=typeof e.props.optionsLoader)Ho(e,n);else{const t=No(e);Ho(e),t.then((()=>{Ho(e,o(e))}))}})),e.on("prop:options",(({payload:t})=>{e.props.sourceOptions=[...t].filter((t=>!e.props.targetOptionValues.includes(Vo(t)))),Ho(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,No(e)))})),e.on("prop:activeValue",(({payload:t})=>{if(t===ld)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>tn.eq(Vo(e),t)));if(o>=0)e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`;else{const o=e.props.targetOptions.findIndex((e=>tn.eq(Vo(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,Qp.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,ed.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(ad)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(ad)}))},nn.options,nn.defaultIcon("moveRight","right"),nn.defaultIcon("moveLeft","left"),nn.defaultIcon("fastForward","fastForward"),nn.defaultIcon("rewind","rewind"),nn.defaultIcon("close","close"),nn.defaultIcon("loader","spinner"),nn.defaultIcon("selected","check"),nn.localize("isLoading"),nn.localize("loadMore"),nn.localize("addAllValues"),nn.localize("addSelectedValues"),nn.localize("removeSelectedValues"),nn.localize("removeAllValues")]},pd=p("sl"),{outer:dd,wrapper:cd,inner:ud,icon:fd,label:vd,prefix:hd,suffix:$d,help:md,messages:gd,message:yd}=d(pd),bd=pd("chart",(()=>({$el:"div",if:"$chart"}))),wd=pd("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 + "%"'}}}}))),xd=pd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),kd=pd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),_d=pd("trackWrapper",(()=>({$el:"div"}))),Ld=pd("trackInner",(()=>({$el:"div"}))),Sd=pd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Dd=pd("linkedValues",(()=>({$el:"div"}))),Md=pd("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"}))),Ad=pd("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"}))),Ed=pd("marks",(()=>({$el:"div",if:"$marks"}))),Od=pd("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:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Td=pd("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Id=pd("handles",(()=>({$el:"ul"}))),Cd=pd("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"}}))),Fd=pd("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"}}))),Bd=pd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Vd=pd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Pd=pd("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"}}))),Hd=pd("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"}}))),Nd={schema:dd(cd(vd("$label"),md("$help"),xd(fd("prefix"),hd(),kd(bd(wd()),_d(Ld(Sd(),Ed(Od(Td())),Id(Fd(Hd(),Bd()),Cd(Pd(),Vd()))))),$d(),fd("suffix"),u("$showInput && $isMulti === false",Md())),u("$showInput && $isMulti",Dd(Ad(),Md())),gd(yd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){function t(t){const{min:o,max:r,intervals:s}=e.props;if(t=Math.min(Math.max(t,0),100),!s||0===s.length){const n=o+t/100*(r-o);return e.props.scalingFunction.reverse(n,o,r)}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:r,width:s,stepsInInterval:l}=a[e];if(t>=r&&t<=r+s){const e=o+(t-r)/s*l*n,a=e%n;return i(a<n/2?e-a:e+(n-a))}}return t>100?r:t<0?o:void 0}function o(t,o=e.props.min,r=e.props.max){const s=e.props.intervals;if(!s||0===s.length){return(e.props.scalingFunction.forward(t,o,r)-o)/(r-o)*100}const a=n(s,o,r);for(let e=0;e<a.length;e++){const{value:o,step:n,left:s,width:l,stepsInInterval:i}=a[e],p=e<a.length-1?a[e+1].value:r;if(t>=o&&t<=p){return 100*((s+(t-o)/n/i*l)/100)}}return 100}function n(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function r(){const t=parseFloat(`${e.props.min}`),n=parseFloat(`${e.props.max}`);let r,a=0;if(Array.isArray(e._value)){const t=[...e._value].sort(s);a=parseFloat(`${t[0]}`),r=parseFloat(`${t[1]}`)}else r=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${o(r,t,n)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${o(a,t,n)}%`},e.props.fillStyles={left:`${o(a,t,n)}%`,width:o(r,t,n)-o(a,t,n)+"%"}):e.props.fillStyles={left:"0%",width:`${o(r,t,n)}%`}}function s(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function a(t,o=!0){if(e.props.disabled)return;let n;if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(t)){const o="min"===e.props.lastHandleInteraction?0:1;e._value[o]=t;const[r,a]=[...e._value];if(r>=a){const t=null==c?void 0:c.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=p([...e._value].sort(s))}else Array.isArray(t)?n=p(t):(n=p(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=d(n));const a=l(n);o&&e.input(a),r(),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];u&&u.input(t),f&&f.input(o)}else f&&f.input(e._value)}()}function l(t){return e.props.isMulti&&Array.isArray(t)?[l(t[0]),l(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function i(t){return parseFloat(t.toFixed(e.props.decimals))}function p(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>i(Math.round(t/e.props.step)*e.props.step))):i(Math.round(t/e.props.step)*e.props.step);const o=n(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return i(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return i(n.value+Math.round((t-n.value)/n.step)*n.step)}}function d(t){if(Array.isArray(t))return t[0]=d(t[0]),t[1]=d(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 c,u,f;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const v={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};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=tn.undefine(e.props.disabled)),e.on("created",(()=>{function i(o){var n;if(!c||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:l}=c.getBoundingClientRect();a(t((r-s)/l*100))}var p;tn.undefine(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=v[e.props.scalingFunction]||v.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...v.linear,...e.props.scalingFunction}):e.props.scalingFunction=v.linear,e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(p=e.props.step.toString().split(".")[1])||void 0===p?void 0:p.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const h=tn.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":h;const $=tn.undefine(e.props.marks);e.props.marks=!!$&&(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=tn.undefine(e.props.markLabels),e.props.snapToMarks=tn.undefine(e.props.snapToMarks),e.props.showInput=tn.undefine(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 m={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(m,e.props.inputAttrs):m,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,tn.whenAvailable(`track-${e.props.id}`,(()=>{var t;c=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value),r()}),e.props.__root),e.context){let r=0,p="";const v=e.context.handlers.blur;e.context.handlers.blur=t=>{v(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!c)return;e.props.dragging=!1;const{left:n,width:r}=c.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[o,n]=e.value,r=Math.abs(o-s*e.props.max)<Math.abs(n-s*e.props.max)?"min":"max",l="min"===r?0:1;e.props.lastHandleInteraction=r,e.value[l]=t(100*s),a(e._value)}else a(t(100*s))},e.context.handlers.focus=t=>{if(!c)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(!c)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,i,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,i),o&&t.target instanceof HTMLElement&&t.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),p+=t.key;const e="-"===p?-1:1;r=window.setTimeout((()=>{"-"!==p?(a(parseFloat(p)*e),p=""):p=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,r=Array.isArray(e._value)?e._value[o]:e._value,s=function(t,o){if(!e.props.intervals)return e.props.step;const r=n(e.props.intervals);if(t>=e.props.max)return r[r.length-1].step;let s=r.find(((o,n)=>{var s;return t>=o.value&&t<((null===(s=r[n+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!s)return e.props.step;-1===o&&t-s.step<s.value&&(s=r[r.indexOf(s)-1]||s);return s.step}(r,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=d(r),n=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(n),l=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,i=Math.min(Math.max(0,s+l),e.props.marks.length-1);return void a(e.props.marks[i].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?a(e.props.min):a(e.props.max));if("Home"===t.key)return void a(e.props.min);if("End"===t.key)return void a(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){a(r+(t.shiftKey?10*s:s)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?a(r+10*s):"PageDown"===t.key&&a(r-10*s)}},e.context.handlers.maxNode=t=>{f=t,t.hook.commit(((o,n)=>{if(tn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,a(e.value)):a(r),n(l(r))}))},e.context.handlers.minNode=t=>{u=t,t.hook.commit(((o,n)=>{if(tn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,a(e.value)):a(r),n(l(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),u&&u.input(e.value[0]),f&&f.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||a(t,!1):e.value!==t&&a(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),a(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),a(e.value)}))}]},Rd=p("cp"),{outer:Wd,wrapper:Kd,inner:Yd,label:Ud,prefix:zd,suffix:qd,help:jd,messages:Gd,message:Zd,icon:Xd}=d(Rd),Jd=Rd("swatchPreview",(()=>({$el:"div",attrs:{class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Qd=Rd("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),ec=Rd("panel",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",style:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}))),tc=Rd("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),oc=Rd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),nc=Rd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),rc=Rd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),sc=Rd("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),ac=Rd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),lc=Rd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),ic=Rd("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),pc=Rd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),dc=Rd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),cc=Rd("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),uc=Rd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),fc=Rd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),vc=Rd("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),hc=Rd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),$c=Rd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),mc=Rd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),gc=Rd("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),yc=Rd("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),bc=Rd("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),wc=Rd("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),xc=Rd("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),kc=Rd("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),_c=Rd("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),Lc=Rd("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Sc=Rd("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Dc=Rd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Mc=Rd("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Ac=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Ec=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Oc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},Tc={schema:Wd(Kd(Ud("$label"),u("$inline && $help",jd("$help")),Yd(u("($inline === undefined || $inline === false) && $prefixIcon !== undefined",Xd("prefix","label")),u("$inline === undefined || $inline === false",zd()),u("$inline === undefined || $inline === false",Jd(vc(),u("$showValue",Qd()))),u("$inline || $panelIsOpen)",ec(u("$showPanelClose && ($inline === undefined || $inline === false)",tc(Xd("close"))),u("$panelControls",oc(nc(rc(),sc()),uc(fc()),ac(lc(),ic()),pc(dc(),cc()),u("$eyeDropper && $hasNativeEyeDropper",hc(Xd("eyeDropper"))))),u("$panelFormat",$c(mc(u('$panelActiveFormat === "hex"',gc()),u('$panelActiveFormat === "rgba"',yc()),u('$panelActiveFormat === "rgba"',bc()),u('$panelActiveFormat === "rgba"',wc()),u('$panelActiveFormat === "hsla"',kc()),u('$panelActiveFormat === "hsla"',_c()),u('$panelActiveFormat === "hsla"',Lc()),u('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',xc())),Sc(Xd("switch")))),u("$options",Dc(Mc())))),u("$inline === undefined || $inline === false",qd()),u("($inline === undefined || $inline === false) && $suffixIcon !== undefined",Xd("suffix"))),u("$: ($inline === undefined || $inline === false) && $help",jd("$help"))),Gd(Zd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){function t(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(_&&_.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!jo(n)&&!Ac.test(n)&&!Ec.test(n))return;(jo(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=Go(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Ro(o,2)===e.props.h&&Ro(r,2)===e.props.s&&Ro(s,2)===e.props.v&&Ro(a,2)===e.props.alpha)||(e.props.alpha=Ro(a,2),w(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=Go(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=Ro(s,2),w(o,n,r)}else w(e.props.h,e.props.s,e.props.v)}else w(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!E)return;const o=E[t];o&&(e.props.focusedSwatch=o.dataset.color)}function r(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function s(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),tn.whenAvailable(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=Wo(t.sRGBHex);e.props.alpha=1,w(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{L=e}),I,h),l("canvas-hue",(e=>{S=e}),d,$),l("canvas-alpha",(e=>{D=e}),C,m),i(`canvas-preview-${e.props.id}`,(e=>{M=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{A=e,u()}),B),p()}function l(t,o,n,r){let s=!1;const a=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},l=e=>{1===e.buttons&&k&&r(e)},p=e=>{k&&r(e)},d=()=>{k=void 0,a()},c=()=>{k=void 0,a()};i(`${t}-${e.props.id}`,(e=>{const a=e.nextElementSibling;o(e),n(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,r),s||function(e,t){s=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(a,e),e.addEventListener("mousedown",(e=>{a.focus(),a.setAttribute("data-prevent-focus-style","true"),k=Oc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),k=Oc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){tn.whenAvailable(t,(()=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);a&&(o(a),n&&r(a,n))}),e.props.__root)}function p(){tn.whenAvailable(`swatches-${e.props.id}`,(()=>{var t,o,n;E=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),E.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=E[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,y()}),e.props.__root)}function d(){if(!S)return;const e=S.getContext("2d");if(!e)return;const t=S.width,o=S.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function c(){if(!M)return;const t=M.getContext("2d");if(!t)return;g(M,M.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,M.width,M.height)}function u(){if(!A)return;const t=A.getContext("2d");if(!t)return;g(A,A.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,A.width,A.height)}function f(e){if(!e)return;const t=e.getContext("2d");if(!t)return;g(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Zo(o),[l,i,p,d]=Ko(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function v(e,t,o){let n=null;const r=e=>{null!==n&&cancelAnimationFrame(n),n=requestAnimationFrame((()=>{if(!t)return;const n=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-n.left,s=e.touches[0].clientY-n.top):(r=e.clientX-n.left,s=e.clientY-n.top),r=Math.min(Math.max(r,0),n.width),s=Math.min(Math.max(s,0),n.height),o(r,s)}))};r(e);const s=e=>{e.preventDefault(),r(e)},a=e=>{e.preventDefault(),r(e)},l=()=>{k=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{k=void 0,document.removeEventListener("touchmove",a),document.removeEventListener("touchend",i)};"touches"in e?(document.addEventListener("touchmove",a),document.addEventListener("touchend",i)):(document.addEventListener("mousemove",s),document.addEventListener("mouseup",l))}function h(t){v(t,L,((t,o)=>{const n=t/L.width*100,r=100-o/L.height*100;V(e.props.hue,n,r)}))}function $(t){v(t,S,((t,o)=>{if(!S)return;const n=S.width,r=Math.floor(t/n*360);e.props.h=r,V(e.props.h,e.props.s,e.props.v)}))}function m(t){v(t,D,((t,o)=>{const n=t/D.width*100/100;e.props.alpha=n,V(e.props.hue,e.props.s,e.props.v)}))}function g(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function y(){var t,o;if(!e.context||!e.props.options||!E)return;const{h:r,s:s,v:a,alpha:l}=e.props,i=function(e,t,o,n=1){const r=0===o?0:t;return`${Ro(0===o||100===o&&0===t?0:e,0)}-${Ro(r,0)}-${Ro(o,0)}-${Ro(n,2)}`}(r,s,a,l);let p=!1,d=!1;E.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,r,s,c]=t.split("-");"0"===s&&0===a&&c===`${l}`&&(d=!0);const u=e.parentElement;d||t===i?(u.dataset.active="true",e.ariaSelected="true",d=!1,!p&&E&&(n(E.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=E[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function b(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function w(t,o,n){e.props.h=void 0===t||isNaN(t)?e.props.h:Ro(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:Ro(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:Ro(Math.max(Math.min(n,100),0),2);const{h:r,s:s,v:a,alpha:l}=e.props,[i,p,d]=Ko(r,s,a),[c,u,f]=Uo(r,s,a),v=e.props.hexInputFocused?e.props.hex:qo(r,s,a,l),h=Ro(l,2);e.props.hsla={h:r,s:p,l:d,a:h},e.props.hslaPercent={h:Ro(r,0),s:100===a&&0===s?0:Ro(0===a?p/255:Math.max(Math.min(p/255*100,100),0),0),l:Ro(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:h},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${h})`,e.props.hslaStringPrecise=`hsla(${r}, ${Ro(0===a?p/255:p/255*100,2)}%, ${Ro(d/255*100,2)}%, ${h})`,e.props.rgba={r:c,g:u,b:f,a:h},e.props.rgbaString=`rgba(${c}, ${u}, ${f}, ${h})`,b(v),setTimeout((()=>{var t;x(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),_||"undefined"==typeof window||(_=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const $=e.props.valueFormat?e.props.valueFormat:e.props.format;"hex"===$?e.input(e.props.hex):"rgba"===$?e.input(e.props.rgbaString):"hsla"===$&&e.input(e.props.hslaStringPrecise)}function x(){I(),C(),F(),B()}let k,_=null,L=null,S=null,D=null,M=null,A=null,E=null,O=0;const T=["hex","rgba","hsla"],I=Xo((function(){if(!L)return;const t=L.getContext("2d");if(!t)return;const{width:o,height:n}=L,r=e.props.h||0;t.fillStyle=`hsl(${r}, 100%, 50%)`,t.fillRect(0,0,o,n);const s=t.createLinearGradient(0,0,o,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=s,t.fillRect(0,0,o,n);const a=t.createLinearGradient(0,0,0,n);a.addColorStop(0,"rgba(0,0,0,0)"),a.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=a,t.fillRect(0,0,o,n)}),2),C=Xo((function(){if(!D)return;const t=D.getContext("2d");if(!t)return;const o=Math.round(D.width),n=Math.round(D.height);t.clearRect(0,0,o,n),g(D,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=Xo(c,2),B=Xo(u,2),V=Xo(w,2),P=Xo(y,10,!1);e.addProps(["panelIsOpen","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.panelIsOpen=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=Jo(e.props.panelControls),e.props.eyeDropper=Jo(e.props.eyeDropper),e.props.panelFormat=Jo(e.props.panelFormat),e.props.showValue=Jo(e.props.showValue),e.props.allowPaste=Jo(e.props.allowPaste),e.props.inline=tn.undefine(e.props.inline),e.props.disabled=tn.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=tn.undefine(e.props.closeOnSelect),e.props.focusedSwatch=void 0,o(`${e.value}`),e.on("input",(({payload:t})=>{_&&void 0!==e.props.__root&&!_.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:panelIsOpen",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.panelIsOpen=!1)}var o;if(e.props.panelIsOpen)s(),a(),p(),document.addEventListener("keydown",t),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",t);(null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=Go(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Ro(n,t)}-${Ro(r,t)}-${Ro(s,t)}-${Ro(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.panelIsOpen=!e.props.panelIsOpen},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.panelIsOpen=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.panelIsOpen=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.panelIsOpen=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.panelIsOpen=!e.props.panelIsOpen)},e.context.handlers.closePanel=()=>{e.props.panelIsOpen=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.panelIsOpen=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(T.indexOf(e.props.panelActiveFormat)+t+T.length)%T.length;e.props.panelActiveFormat=T[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.panelIsOpen){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Qo),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":w(o,n-s,r);break;case"ArrowRight":w(o,n+s,r);break;case"ArrowUp":w(o,n,r+s);break;case"ArrowDown":w(o,n,r-s);break;case"PageUp":w(o,n,r+10);break;case"PageDown":w(o,n,r-10);break;case"Home":w(o,n-10,r);break;case"End":w(o,n+10,r)}x()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":w(o-s,n,r);break;case"ArrowRight":case"ArrowUp":w(o+s,n,r);break;case"PageUp":w(o+10,n,r);break;case"PageDown":w(o-10,n,r);break;case"Home":w(0,n,r);break;case"End":w(360,n,r)}x()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=Ro(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=Ro(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=Ro(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=Ro(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}w(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,jo(r)){const[t,o,n,s]=Wo(r);e.props.alpha=s,b(r),w(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!jo(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;jo(o)&&b(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Yo(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);w(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=zo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);w(t,o,n)}else"alpha"==t&&(e.props.alpha=i,w())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Zo(o.dataset.colorPrecise);e.props.alpha=s,w(t,n,r),e.props.closeOnSelect&&(e.props.panelIsOpen=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!E||!E.length)return;const l=E.indexOf(t.currentTarget);let i=null;const p=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(E),d=E.length;let c=0,u=d,f=!1;const v=E[l].dataset.group;if(void 0!==v){const e=E.filter((e=>e.dataset.group===v));c=E.indexOf(e[0]),u=E.indexOf(e[e.length-1])}const h=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,O=h,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void E.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),O=h,e.context.handlers.swatchClick(t),void n(l);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":i=Math.max(l-p,l-(p-(O-h))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(O-h))),f=!0;break;case"ArrowLeft":i=l-1,O=(i-c)%p;break;case"ArrowRight":i=l+1,O=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=E[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=E[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=E.filter((e=>e.dataset.group===v)),n=E.filter((t=>t.dataset.group===e)),d=(l-c)%p,f=t.length%p||p,h=l>=c+t.length-f;if(i<c){const e=n.length%p||p;i=c-e+Math.min(Math.max(d,O),e-1)}else i>u&&(i=h?Math.min(u+Math.max(d,O)+1,E.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),E.forEach((e=>{delete e.parentElement.dataset.focused}));const e=E[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},nn.options,nn.defaultIcon("eyeDropper","color"),nn.defaultIcon("close","close"),nn.localize("close"),nn.localize("next")]},Ic=p("tb"),{outer:Cc,inner:Fc,wrapper:Bc,label:Vc,prefix:Pc,suffix:Hc,help:Nc,messages:Rc,message:Wc,icon:Kc}=d(Ic),Yc=Ic("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",role:"checkbox",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),Uc=Ic("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",role:'$multiple && "checkbox" || "radio"',onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),zc=Ic("inputInner",(()=>({bind:"$attrs",$el:"span"}))),qc=Ic("options",(()=>({$el:"ul",attrs:{id:"$id",role:"group","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),jc=Ic("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{role:"listitem",key:"$option.value","data-index":"$index"}}))),Gc={schema:Cc(u("$options",Bc(Vc("$label"),qc(jc(Uc(u("$fns.isChecked($option) === true",zc("$slots.default || $slots.on || $option.onLabel || $option.label"),zc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Bc(u("$label && ($slots.default || $slots.on || $onLabel)",Vc("$label")),Yc(Kc("prefix"),Pc(),u("$_isChecked === true",zc("$slots.default || $slots.on || $onLabel || $label"),zc("$slots.default || $slots.off || $offLabel || $label")),Hc(),Kc("suffix")))),Nc("$help"),Rc(Wc("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,n,r;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=tn.undefine(e.props.enforced),e.props.multiple=tn.undefine(e.props.multiple),e.props.vertical=tn.undefine(e.props.vertical),e.props.disabled=tn.undefine(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=en(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>en(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){var n;if(o.preventDefault(),t=null!==(n=null==t?void 0:t.__original)&&void 0!==n?n:null==t?void 0:t.value,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],n=o.findIndex((e=>tn.eq(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else tn.eq(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(tn.eq(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},nn.options]};var Zc=Object.freeze({__proto__:null,dropdown:Or,toggle:Zr,repeater:_s,rating:Ks,autocomplete:$a,datepicker:ai,taglist:Di,mask:Zi,transferlist:id,slider:Nd,colorpicker:Tc,togglebuttons:Gc});const Xc="undefined"!=typeof window?setInterval:()=>0,Jc=new WeakSet;exports.$if=u,exports.autocomplete=$a,exports.colorpicker=Tc,exports.createBaseSections=d,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Jc.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(!cn.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];Jc.add(o),o.define({...r,schema:n(e)})}Xc((()=>wn.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}},exports.createSectionFactory=p,exports.datepicker=ai,exports.dropdown=Or,exports.inputs=Zc,exports.mask=Zi,exports.rating=Ks,exports.repeater=_s,exports.slider=Nd,exports.taglist=Di,exports.toggle=Zr,exports.togglebuttons=Gc,exports.transferlist=id;