@formkit/pro 0.117.4 → 0.117.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e,o){e in vn||(vn[e]={timer:0,inputs:new Set});const n=vn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=dn((()=>{un[e]||(un[e]=dn((()=>gn.add(e)),2e3)),function(e){if(ln){window.addEventListener(sn(),(o=>{const n=new URL(o.blockedURI).hostname;pn.some(((e,t)=>hn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=fn(tn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(vn[e].inputs),i=l.filter((t=>!(mn[e]&&mn[e].has(t)))).join("");if(cn(e),i){o++;try{const a=await window[fn(nn)](`${n}${r}${hn((s+o)%pn.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[fn(on)])return t(e,p.schema);if(a.ok)return mn[e]||(mn[e]=new Set),void l.forEach((t=>mn[e].add(t)))}catch(e){}o<2&&dn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){gn.add(e),function(e,t){$n[e]&&$n[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return gn.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e){return Xo.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?Qo.extendSchema(p,{children:d}):p;if(c=Qo.extendSchema(c,l),"object"==typeof c){let s=c;if(!Jo.isDOM(c)&&!Jo.isComponent(c)||c.meta||(c.meta={section:n,node:r}),Jo.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(Jo.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&&Xo.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",yn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",bn,!1),icon:Ln,label:e("label",wn,!1),prefix:e("prefix",Sn,!1),suffix:e("suffix",Sn,!1),help:e("help",_n,!1),messages:e("messages",xn,!1),message:e("message",kn,!1)}}function c(e){return{overlayPlaceholder:e("overlayPlaceholder",Mn),overlayLiteral:e("overlayLiteral",Dn),overlayChar:e("overlayChar",An),overlayEnum:e("overlayEnum",En),overlay:e("overlay",On),overlayParts:e("overlayParts",In),overlayInner:e("overlayInner",Tn)}}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)}:(Qo.isSlotCondition(s)?Object.assign(s.else,{if:e}):Qo.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)",Ln("selected")),i("$option.label")),r(u("$state.loading && $isLoadingOptions || $state.hasNextPage",s(u("$state.loading",Ln("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}function h(e,t=!0){e.props.isLoadingOptions=!0,e.store.set(dr),e.props.loadingCounter++,e.store.set(Jo.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,pr.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++,pr.set(e,t),e.store.set(Jo.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=>!Xo.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=vr(e);e.props.isLoadingOption=!0;const o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>Xo.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:Xo.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(dr),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=>Xo.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=vr(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:fr&&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=>Xo.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=Qo.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=Qo.normalizeOptions(o);e.props.options=n,e.props.options.length||(e.store.set(cr),e.store.set(Jo.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),w(e),hr.set(e,e.props.searchValue)}function _(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(g(t)!==ur?(e.props.option=t,e.props.maxReached&&!M(e,t)||e.input(S(e,g(t)))):null===(n=e.context)||void 0===n||n.handlers.loadMore())}function S(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];return o.includes(t)?(e.props.optionRemoved=!0,o.filter((e=>e!==t))):[...o,t]}return t===e.value?void(e.props.optionRemoved=!0):t}function L(e,t){return Xo.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)):Xo.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||(Jo.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=Xo.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:ur},e.props.listboxStyles={},e.props.loadingCounter=0,e.props.searchable=Xo.undefine(e.props.searchable),e.props.loadOnScroll=Xo.undefine(e.props.loadOnScroll),e.props.multiple=Xo.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=Xo.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&Xo.undefine(e.props.openOnRemove),e.props.hasNextPage=m.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.currentOptionsLoading=[],e.props.loadOnCreated=Xo.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||mr.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]),mr.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)),mr.has(e)?requestAnimationFrame(o.bind(null,e,n,r)):t(e,r)):mr.delete(e)}if(!fr)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=>Xo.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),Xo.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);mr.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;fr&&(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;fr&&(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===ur)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Xo.eq(g(e),t)));e.props.activeDescendant=o>=0?`${e.props.id}_listitem_${o}`:void 0}))}function E(e){var t,o;if(!fr)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||!fr)return;e.context.fns.isActive=L.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=gr.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else gr.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function C(e){gr.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=Xo.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(cr),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(fr)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(ur);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}`);o.currentTarget.style.display="none",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(S(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===ur)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Xo.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===ur)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Xo.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)})),fr&&Xo.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(!fr||!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=yr.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;$r.set(t,{value:o[e],index:e})}const l=$r.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=$r.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=$r.get(o);e.push(s.value)}yr.set(s,e),o&&o(e)}}}function i(e){e.preventDefault(),l()}let p=0,d=null;if(null!=r||(r=document),br.has(e))yr.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=$r.get(e);t&&(n?$r.set(e,{value:n.value,index:o}):$r.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),br.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),$r.set(r[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);yr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){S(e,t)}const o=t=>{const o="taglist"===e.props.type||"dropdown"===e.props.type?"formkit-tag-wrapper":"formkit-selection";return t.classList.contains(o)&&!e.props.disabled};e.on("prop:loadingCounter",(({payload:n})=>{0===n&&fr&&!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&&fr&&!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",(()=>{Xo.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=>Xo.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&&Jo.error(300,[e]),e.props.dropdownWrapperStyles=Xo.clone(wr),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(){Lr=document.documentElement.scrollTop;for(const e in xr)Sr[e]=document.documentElement.style[e],document.documentElement.style[e]=xr[e];for(const e in kr)_r[e]=document.body.style[e],document.body.style[e]=kr[e];document.body.scrollTop=Lr}():function(){for(const e in xr)document.documentElement.style[e]=Sr[e];for(const e in kr)document.body.style[e]=_r[e];document.body.scrollTop=0,document.documentElement.scrollTop=Lr}())}))}function fe(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=Xo.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 he(e,t){var o,n;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let r;t instanceof MouseEvent?r=t.clientX:(r=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let s=ge(e,r,t.currentTarget)||0;s=s>e.props.min?s:e.props.min,s=s<e.props.max?s:e.props.max,e.input(s),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()}}function ve(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){ye(e,ge(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function me(e){ye(e)}function ge(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function $e(e){setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&(e.props.wrapperWidth=`0 0 ${o.offsetWidth/e.props.max}px`)}))}function ye(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function be(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=xe.bind(null,e),e.props.reloadOnCommit=Xo.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=Xo.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&&fr&&(e.context.handlers.focus=_e.bind(null,e),e.context.handlers.input=we.bind(null,e),e.context.handlers.focus=_e.bind(null,e),e.context.handlers.click=ke.bind(null,e),e.context.handlers.toggleListbox=Se.bind(null,e),e.context.handlers.keydown=ee.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>J(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":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||hr.delete(e)}))}function we(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&xe(e,!0)}function xe(e,t=!1){if("function"==typeof e.props.optionsLoader){e.store.set(dr),t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(la.get(e));const o=e.props.searchValue?e.props.debounce:0;la.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)&&(aa.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 ke(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 _e(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function Se(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function Le(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Me(e)})),e.on("created",(()=>{if(!e.context||!pa)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=Ae(e);if(e.props.highlightedRange){const[t,n]=De(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){Xo.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&da.set(t,e)}),e.props.__root),pa&&!ca&&(ca=!0,document.addEventListener("selectionchange",(()=>{const e=a();if(e instanceof HTMLInputElement&&da.has(e)){const t=da.get(e);t&&function(e){clearTimeout(ia.get(e)),ia.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=Ae(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]=De(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,Me(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=Ae(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=[],xe(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(pa&&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="",xe(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=Ae(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 Me(e){var t;if(!pa)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 De(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 Ae(e){const t=vr(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 Ee(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],xe(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&&xe(e,!0))}))}(e)}function Oe(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=[],xe(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&&xe(e,!0)}))}(e)}function Te(e,t){var o;if(pl.has(e))return;pl.set(e,[]),t.reverse&&xl.add(e),t.prefix&&kl.set(e,t.prefix),t.suffix&&_l.set(e,t.suffix),Ve(e,t.pattern,t.partOverrides,t.explicitParts);const n=fl.get(e),r=null==n?void 0:n.some((e=>Ne(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)&&hl.add(e),vl.set(e,l),t.onChange&&bl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Tl)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=pl.get(e);if(null==r?void 0:r.length){const o=(null!==(n=dl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;Xe(e,s),e.setSelectionRange(...s.selectionAfter),dl.set(e,o),bl.has(e)&&bl.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=Ye(e),a=e.value;n&&Ue(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===l&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),bt(e);case"ArrowLeft":return t.preventDefault(),bt(e,-1);case"ArrowUp":return void(wt(e,1)&&t.preventDefault());case"ArrowDown":return void(wt(e,-1)&&t.preventDefault());case"Tab":return Ml?void t.preventDefault():void(bt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=hl.has(e),n=vl.get(e);if(o){let o=null,r=null,s=!1;const l="shift"===n?0:1,i=e.value;lt(e,{type:"insert",data:i,selectionBefore:[0,0,"none"],valueBefore:i},"shift"===n?"":i,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-l),(He(t)||Ne(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"===vl.get(e)){const[o]=vt(e),n=kt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){gl.set(e,je(e,t));const n=async()=>{if(!Ol||a()!==e)return;"select"===vl.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=Ye(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=qe(e,t);const[o]=vt(e),n=kt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&gl.set(e,je(e,o[n]))}(e));const t=gl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),gl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(gl.get(e))return;Dt(e),t=qe(e,t);const[o]=vt(e),n=kt(e,t),r=void 0!==n&&je(e,o[n]);r&&!Ke(t,r)&&Ze(e,r,!0)}(e,t.detail))),Ue(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ie(e){var t,o;if(Ll.has(e))return;const n=null!==(t=pl.get(e))&&void 0!==t?t:[],r=n[null!==(o=dl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=vt(e,r.valueAfter),s=kt(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"];Ll.set(e,[r,l])}}}function Ce(e){Ll.delete(e)}function Fe(e,t){const o="string"==typeof e||!pl.has(e),n="string"==typeof e?Be(e):e;if(o)t.prefix&&kl.set(n,t.prefix),t.suffix&&_l.set(n,t.suffix),n.value=ze(n,n.value),Te(n,t);else{const e=_t(n),o=n.value;n.value="",Ue(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 Be(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ve(e,t,o,n,r){r=e&&xl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Al);if(!e)return t;const o={...e},n=[];for(const r of t)if(!We(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Pe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Pe(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=Je(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Ve(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&&fl.set(e,c),c}function Pe(e){return!!e&&(We(e)||He(e)||Ne(e))}function He(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Re(e))}function Ne(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Re(e))}function Re(e){return!!e&&("placeholder"in e&&"token"in e)}function We(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Ke(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Ye(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 Ue(e,t){var o;xl.has(e)&&Mt(t);let n=!1;switch(wl.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Ge(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===vl.get(e)){const[s,a]=vt(e),l=s.findIndex((e=>Ke(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(He(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=st(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=Je(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(Ne(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=lt(e,t,o);return ul.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:at(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Ge(t),n=t.selectionBefore,r=xl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=Qe(o,s):s-=Qe(o,s,"backward"));const l=vl.get(e);let i="";if("select"===l){const[o,n]=vt(e),r=kt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];He(l)?i=l.placeholder.repeat(a-s):Ne(l)&&([i,s]=Ke(p,Ye(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=Qe(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=gt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&$t(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=lt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:ut(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(xl.has(e)&&n&&Mt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=je(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)){bl.has(e)&&Sl.set(e,(()=>{Sl.delete(e),n&&bl.get(e)(n,e)})),wl.set(e,"beforeCallback");let t=null!==(o=pl.get(e))&&void 0!==o?o:[];const r=dl.get(e);r&&(t=t.slice(0,r),dl.delete(e)),t.push(n),pl.set(e,t),Ol&&a()===e&&"function"==typeof document.execCommand&&!Tl?(Ze(e,[0,e.value.length,"forward"],!0),Tl=!0,document.execCommand("insertText",void 0,n.valueAfter),Tl=!1):Xe(e,n),Ol&&a()===e&&Ze(e,n.selectionAfter);const s=Sl.get(e);s&&s(),Dt(e)}wl.set(e,"complete")}function ze(e,t){var o,n;const r=null!==(o=kl.get(e))&&void 0!==o?o:"",s=null!==(n=_l.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 je(e,t){const o=kl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function qe(e,t){const o=kl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Ge(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 Ze(e,t,o=!1){o&&(cl.add(e),setTimeout((()=>cl.delete(e)),5)),gl.get(e)&&gl.set(e,t),e.setSelectionRange(...t)}function Xe(e,t,o="After"){if(e.value=t[`value${o}`],Ol){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function Je(e){if(null==e)return"";const t=ml.test(e.charAt(0))&&ml.test(e.charAt(1))?2:1;return e.substring(0,t)}function Qe(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:ml.test(e.charAt(t))&&ml.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:Je(e.substring(t)).length}function et(e,t){const o=Je(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function tt(e){const t=Je(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ot(e,t){const o=Je(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function nt(e,t){for(;t.buffer;){const o=Je(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function rt(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(Qe(t.buffer,0))}return null}function st(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function at(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=Ye(e);o=[n[0],t.endPos,"none"];const[r,s]=vt(e,t.value),a=kt(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(He(i)&&st(p,i).length===p.length&&a<r.length-1)return Dl(),r[a+1];if(Ne(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=gt(o.values,r);if(s)return ht(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return $t(i.values,p)?[l[1],l[1],"forward"]:(Dl(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return Ke(s,n)||(cl.add(e),setTimeout((()=>cl.delete(e)),5)),s}return l}function lt(e,t,o,n){var r,s;const a=null!==(r=fl.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:hl.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:vl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:vt(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return it(a,l,void 0,n),l}function it(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":dt(o,t,e.at(-1)===o);break;case"char":ct(o,t,l);break;case"enum":pt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};it(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=We(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++,it(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),We(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function pt(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=gt(e.values.concat([e.placeholder]),n);if(r){const s=ht(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):rt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=rt(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function dt(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?Je(t.data):"",s=Je(n);if(e===s)n=et(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ot(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function ct(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=Je(t.data);if(e.pattern.test(n))return et(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void nt(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=Je(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,tt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return tt(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function ut(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=vt(e),a=kt(e,r,s),[l,i]=vt(e,t.value),p=void 0!==a&&ft(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>ft(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function ft(e,t,o){if(We(o))return!1;if(He(o)){let n=t[0];for(;n<t[1];){const t=Je(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Ne(o)||e.substring(t[0],t[1])===o.placeholder}function ht(e,t){let o="";do{const n=Je(e).toLowerCase(),r=Je(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function vt(e,t){const o=fl.get(e);if(!o)return[[],[]];if($l.has(e))return $l.get(e);const n=null!=t?t:ze(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(We(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(He(a)&&He(e)&&e.token===a.token)i++;else if(He(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Ne(e)){l&&r.push([l,i,"none"]),yt(e)||(p=!1);const t=mt(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&$l.set(e,d),d}function mt(e,t,o){if(yt(t))return t.values[0].length;const n=e.slice(o),r=gt(t.values.concat([t.placeholder]),n);return r?r.length:0}function gt(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=Je(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=gt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function $t(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function yt(e){if(!yl.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;yl.set(e,e.values.every((e=>e.length===t)))}return yl.get(e)}function bt(e,t=1){const[o]=vt(e),n=kt(e,qe(e,Ye(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...je(e,o[n+t])),!0)}function wt(e,t=1){const[o,n]=vt(e),r=kt(e,Ye(e));if(void 0!==r&&r in n){const s=n[r];if(Ne(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((()=>Ue(e,t)),0),!0}}}return!1}function xt(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 xt(e.slice(...r),t)}function kt(e,t,o){const[n]=null!=o?o:vt(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!Ke(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=xt([...s],t[1]);return l in a?a[l]:void 0}function _t(e){var t,o;const n=null!==(t=pl.get(e))&&void 0!==t?t:[];return n[null!==(o=dl.get(e))&&void 0!==o?o:n.length-1]}function St(e,t=!1){const o=_t(e);return o&&(o.complete||t)?xl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Lt(e){var t;const o=_t(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Mt(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 Dt(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 At(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(Kl);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(Kl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Et(e){const t=At(e);return t.setDate(1),t.setHours(0,0,0),t}function Ot(e){const t=At(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function Tt(e){return Ot(e).getDate()}function It(e,t=0){const o=At(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function Ct(e,t=1){const o=At(e);return o.setDate(o.getDate()+t),o}function Ft(e,t=1,o=!1){const n=At(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=Tt(n);n.setDate(e<r?e:r)}return n}function Bt(e,t=1,o=!1){const n=At(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=Tt(n);n.setDate(e<r?e:r)}return n}function Vt(e,t){const o=At(e),n=At(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function Pt(e,t,o){if(!Cl.has(e)){const t=new Date(Il),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(Xt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Xt).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})}))}}Cl.set(e,s)}const n=Cl.get(e);return n?n[t][o]:void 0}function Ht(e,t){const o=Rl.get(t);if(o&&o[e])return o[e];const n=new Date(Il);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Xt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Rl.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function Nt(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(Il)).map(Xt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Xt).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?Nl.get("YY"):Nl.get("YYYY");case"month":return s?1===r?Nl.get("M"):Nl.get("MM"):(a=Pt(o,e,t),"long"===a?Nl.get("MMMM"):Nl.get("MMM"));case"day":return 1===r?Nl.get("D"):Nl.get("DD");case"weekday":switch(a=Pt(o,e,t),a){case"narrow":return Nl.get("d");case"short":return Nl.get("ddd");default:return Nl.get("dddd")}case"hour":return 12===n?1===r?Nl.get("h"):Nl.get("hh"):1===r?Nl.get("H"):Nl.get("HH");case"minute":return 1===r?Nl.get("m"):Nl.get("mm");case"second":return 1===r?Nl.get("s"):Nl.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Nl.get("A"):Nl.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Nl.get("ZZ"):Nl.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 Rt(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(Wl.includes(e)||"object"==typeof e)return Nt(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}(Fl.filter(s).concat(Bl.filter(s)).map(o.bind(null,!1)).concat(Vl.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 Wt(e,t="en",o=!1,n=(()=>!0)){return Rt(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Fl.concat(Bl).concat(Vl).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 Kt(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=Ht(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Jt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&Hl.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Xt)),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(Xt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Xt)}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=At(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=At(e);return t.map((e=>({...e,value:r(e)})))}function Yt(e,t="long",o="en",n=!1,r=(()=>!0)){return"ISO8601"===t?At(e).toISOString():Kt(e,Rt(t,o).filter(r),o,n).map((e=>e.value)).join("")}function Ut(e){return["numeric","2-digit"].includes(e.partValue)}function zt(e,t){let o=0;const n=e=>[e[o++],e[o]];let r=0;const s=[];let a;do{const[o,l]=n(t);a=l;let i=1;if("literal"===o.partName)i=o.partValue.length;else if(o.token in Pl)i=Pl[o.token];else if(l)if("literal"===l.partName){if(i=e.indexOf(l.partValue,r)-r,i<0)throw new Error}else if("dayPeriod"===l.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(r+t)))){i=t;break}}else{const t=e.substring(r).search(/\d/);-1!==t&&(i=r+t)}else i=e.length;s.push({...o,value:e.substring(r,r+i)}),r+=i}while(a);return s}function jt(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 jt("MM").map((n=>Yt(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>Yt(`2022-10-${o}`,e,t)));if("a"===e)return[Ht("am",t).toLowerCase(),Ht("pm",t).toLowerCase()];if("A"===e)return[Ht("am",t).toUpperCase(),Ht("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(Yt(`${o+Number(r)}-06-06`,e,t)),n.unshift(Yt(o-Number(r)+"-06-06",e,t)),n)),[Yt(`${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 qt(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 (${Wt(t,o)})`)};if("ISO8601"===t)return At(n);const l=Wl.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in Pl||o.token in Pl||Ut(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(Rt(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=zt(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()===Ht("am",o).toLowerCase();else if("Z"===n)f=Gt(e.value);else{const t=jt(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=Tt(new Date(`${Ul(v)}-${Yl(m+1)}-10`));if(w<g&&"throw"===s)throw new Error(`Invalid date ${Ul(v)}-${Yl(m+1)}-${Yl(g)}`);g="backward"===s?Math.min(g,w):g;const x=`${Ul(v)}-${Yl(m+1)}-${Yl(g)}T${Yl($)}:${Yl(y)}:${Yl(b)}${f}`,k=new Date(x);return isFinite(+k)?k:a()}function Gt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function Zt(e,t="UTC",o="browser"){o="browser"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=At(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(Xt),o={};return t.forEach((e=>{o[e.type]=e.value})),new Date(`${o.year}-${o.month}-${o.day}T${o.hour}:${o.minute}:${o.second}Z`)},s=r(t);return Jt((r(o).getTime()-s.getTime())/1e3/60)}function Xt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Jt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Qt(e,t="+0000"){const o=At(e),n=function(e){Gt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function eo(e,t="+0000"){const o="+"===t.slice(0,1);return Qt(e,t.replace(o?"+":"-",o?"-":"+"))}function to(e,t,o=7){let n,r;const s=At(e);switch(o){case"month":r=s.getDate(),n=Tt(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=At(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=At(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=Ct(s,e);if(t(o))return o}if(e&&e<=r){const o=Ct(s,-e);if(t(o))return o}}return null}function oo(e){return"timeZoneName"!==e.partName}function no(e,t){const o=[],n=At(t);n.setDate(1);let r=It(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=It(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Ot(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Ct(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function ro(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>no(e,Ft(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(Yt(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Bt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=At(e.props.renderedDate);return t.setMonth(0),n(12,(e=>Ft(t,e)))}(e)}function so(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_panels`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ao(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:qt(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,oo),o}function lo(e){return Array.isArray(e.props.sequence)?Xo.clone(e.props.sequence):["day"]}function io(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?Zt(t,e.props.timezone):"+0000";const s=Qt(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(Yt(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function po(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function co(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Zl.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`)?Ql.add(e):Ql.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===wl.get(t)&&(n=t.value),Ie(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!pl.has(e))return;const r=null!==(o=kl.get(e))&&void 0!==o?o:"",s=null!==(n=_l.get(e))&&void 0!==n?n:"";Ue(e,{type:"insert",selectionBefore:Ye(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ce(t)),10))}));const[r,s]=fo(e);Te(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(uo(e),jl.has(e))return jl.delete(e);n&&n===o?n="":(Ie(t),e.props.inputText=o,setTimeout((()=>Ce(t)),10))}})}function uo(e){var t,o;if(e.props.overlay){const n=Zl.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||St(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=s(Lt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fo(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=Rt(e.props.format,t);return[Wt(e.props.format,t,!0,oo),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=jt(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")&&Xl.set(e,a),r}),[])]}function ho(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function vo(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!ti.get(e)&&ei){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){ti.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function go(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=Xo.undefine(e.props.overlay),e.props.pickerOnly=Xo.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&Xo.whenAvailable(`${e.props.id}`,mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function $o(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Yi.set(e,t),Te(t,{...Ki.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=s(o)}})}function yo(e){const t=Pp.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.addEventListener("dragstart",_o),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||e.addEventListener("dragenter",Eo))}function bo(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const o=[];for(const e of t.accepts)o.push(e);Hp.set(e,o)}}function wo(e){const t=[],o=Pp.get(e),n=Bp.get(e);for(let n=0;n<e.children.length;n++){const r=e.children[n];r instanceof HTMLElement&&(o&&o.childIsDraggable&&!o.childIsDraggable(r)||t.push(r))}for(let e=0;e<t.length;e++){const o=t[e];yo(o),Fp.set(o,{value:n()[e],index:e})}}function xo(e,t,o,n){if(Np.has(e))Pp.set(e,o),bo(e,o),Bp.set(e,t),Vp.set(e,n),wo(e);else{new MutationObserver(ko).observe(e,{childList:!0}),Pp.set(e,o),bo(e,o),Np.add(e),Bp.set(e,t),Vp.set(e,n),function(e){const t=Pp.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Oo),e.addEventListener("dragenter",Ao))}(e),wo(e)}}function ko(e){const t=[];for(const o of e){wo(o.target);for(const e of o.addedNodes)e instanceof HTMLElement&&Fp.has(e)&&t.push(e);for(const e of o.removedNodes)e instanceof HTMLElement&&Fp.has(e)}if(t.length&&Yp)for(const e of t)for(const t of Up)Fp.get(e).value!==Fp.get(t).value||e.classList.add("dnd-placeholder");setTimeout((()=>{zp=!1}),200)}function _o(e){if(So(e)&&Mo(e.currentTarget.parentNode)){const t=Pp.get(e.currentTarget.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();if(Yp=e.currentTarget,!Yp.parentNode)return;const o=Vp.get(e.currentTarget.parentNode)();o.includes(Yp)||o.push(Yp);const n=new DocumentFragment,r=document.createElement("div");r.id="dnd-selections",r.style.display="flex",r.style.flexDirection="column",o.map((e=>{Up.push(e);let t=null;if(Yp===e){t=Yp.cloneNode(!0);const e=Yp.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),Yp.appendChild(n),Yp.classList.add("dnd-dragging"),Yp.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Fp.get(Yp)}));const s=Bp.get(Yp.parentNode)();Rp.set(Yp,s),Wp.set(Yp,Yp.parentNode)}}function So(e){return!!e.currentTarget}function Lo(e){return!!e&&e instanceof HTMLElement}function Mo(e){return!!e&&e instanceof HTMLElement}function Do(e){return Array.isArray(e)&&e.length>0}function Ao(e){if(So(e)&&Lo(Yp)&&Mo(Yp.parentNode)&&Do(Up)&&!zp){const t=function(e,t){const o=Hp.get(e),n=Wp.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,Yp);if(t.accepted&&!t.draggedElementReturned){zp=!0;const t=[...Bp.get(e.currentTarget)()],o=[];for(const e of Up)o.push(Fp.get(e).value);const n=t.concat(o);Wp.set(Yp,e.currentTarget),Yp.style.display="none",e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}else if(t.accepted&&t.draggedElementReturned){zp=!0;const t=Rp.get(Yp);Wp.set(Yp,e.currentTarget),Yp.style.display="",Yp.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t}))}}}function Eo(e){if(So(e)&&Mo(e.currentTarget.parentNode)&&Lo(Yp)&&Mo(Yp.parentNode)&&Do(Up)&&function(e,t){const o=Hp.get(e);return o?o&&o.length?o.includes(t.parentNode):void 0:{accepted:!0,draggedElementReturned:!1}}(e.currentTarget.parentNode,Yp)&&function(e,t){return Fp.get(t).value!==Fp.get(e).value}(e.currentTarget,Yp)&&!zp){zp=!0;const t=[...Bp.get(e.currentTarget.parentNode)()],o=Up.map((e=>Fp.get(e).value)),n=[...t.filter((e=>!o.includes(e)))],r=Fp.get(e.currentTarget).index;n.splice(r,0,...o),"none"!==Yp.style.display&&Yp.parentNode!==e.currentTarget.parentNode?Yp.style.display="none":"none"===Yp.style.display&&Yp.parentNode===e.currentTarget.parentNode&&(Yp.style.display=""),Wp.set(Yp,e.currentTarget.parentNode),e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}}function Oo(e){if(e.stopPropagation(),e.preventDefault(),jp=!0,!e.currentTarget)return;const t=Bp.get(e.currentTarget)();e.currentTarget.dispatchEvent(new CustomEvent("dndDrop",{detail:t})),setTimeout((()=>{To()}),50)}function To(){Yp&&(Rp.delete(Yp),Wp.delete(Yp)),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=""))}})),Yp=null,Up=[]}function Io(e,t){e.props.page++,qp.set(e,t),e.store.set(Jo.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function Co(e){return"__original"in e?e.__original:e.value}function Fo(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),Vo(e)}function Bo(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=>Co(e)===Co(t)))))]),(!e.props.newSourceValue||e.props.isSourceOption||e.props.dropped||e.props.forceUpdate)&&(e.props.targetOptions=t),e.props.targetOptionValues=t.map((e=>Co(e))),e.props.showSourceEmptyMessage=e.props.sourceOptions&&0===e.props.sourceOptions.length,e.props.selections=[],e.props.dropped=!1,e.props.forceUpdate=!1)}function Vo(e,t=!0){e.store.set(td),e.props.loadingCounter++,e.store.set(Jo.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,qp.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function Po(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Ho(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[...Ro(t,o,n,r)]}function No(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,Po(255*t,2),Po(255*a,2),n]}function Ro(e,t,o,n=1){const r=Po(t/255,4),s=Po(o/255,4);if(1===s)return[e,0,100,n];const a=Po(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,Po(l,2),Po(100*a,2),n]}function Wo(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 Ko(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 Yo(e,t,o,n=1){const[r,s,a,l]=Wo(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 Uo(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function zo(e){if(e){if(Uo(e))return Ho(e);if(e.startsWith("rgb")){const t=e.match(Sc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Ko(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(Lc);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 Ro(o,Po(255*n,2),Po(255*r,2),s)}}}function jo(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function qo(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 Go(e){return!1!==e&&"false"!==e}function Zo(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}Object.defineProperty(exports,"__esModule",{value:!0});var Xo=require("@formkit/utils"),Jo=require("@formkit/core"),Qo=require("@formkit/inputs");require("@formkit/vue");const en=[988,24029,396,13078,980],tn=18806588,on=502357,nn=16217489;let rn=189024;const sn=()=>[30548127325,27022924,34729821653783].map(fn).join("y"),an=/^[0-9a-f]+$/,ln="undefined"!=typeof window,pn=n(32,(e=>e)).map((()=>{rn|=0,rn=rn+1831565813|0;let e=rn^rn>>>15|rn;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),dn=ln?setTimeout:()=>0,cn=e=>{clearTimeout(un[e])},un={},fn=e=>e.toString(32),hn=e=>`${fn(pn[e]).substring(2)}.${fn(en[e%(en.length-1)])}`,vn={},mn={},gn=new Set(["",null,void 0]),$n={},yn=()=>({$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"}}),bn=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),wn=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),xn=()=>({$el:"ul",if:"$fns.length($messages)"}),kn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),_n=()=>({$el:"div",if:"$help"}),Sn=()=>({$el:null}),Ln=(e,t)=>()=>Qo.icon(e,t),Mn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Dn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),An=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),En=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),On=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Tn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),In=()=>({$el:null,for:["part","$_overlayParts"]}),Cn=p("dd"),{outer:Fn,wrapper:Bn,inner:Vn,icon:Pn,label:Hn,prefix:Nn,suffix:Rn,help:Wn,messages:Kn,message:Yn}=d(Cn),Un=Cn("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=Cn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),jn=Cn("selection",(()=>({$el:"div"}))),qn=Cn("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),Gn=Cn("optionLoading","span"),Zn=Cn("option",(()=>({$el:"div"}))),Xn=Cn("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"}}))),Jn=Cn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),Qn=Cn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),er=Cn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),tr=Cn("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 || ""'}))),or=Cn("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"}}))),nr=Cn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"0"}}))),rr=Cn("tagLabel",(()=>({$el:"span"}))),sr=Cn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),ar=Cn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),lr=Cn("tagLoading","span"),ir=f(Cn),pr=new WeakMap,dr=Jo.createMessage({key:"loading",type:"state",value:!0,visible:!1}),cr=Jo.createMessage({key:"loading",type:"state",value:!1,visible:!1}),ur=Symbol(),fr="undefined"!=typeof window,hr=new WeakMap,vr=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=>Xo.eq(g(t),e)));o||(o={value:e,label:Array.isArray(e)?e.join(", "):e,isPlaceholder:!1,noOptionFound:!0}),n.push(o)}return n},mr=new WeakSet,gr=new WeakMap,$r=new WeakMap,yr=new WeakMap,br=new WeakSet,wr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},xr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},kr={overflow:"hidden",height:"100%"},_r={},Sr={};let Lr=0;const Mr={schema:Fn(Bn(Hn("$label"),Vn(Pn("prefix"),Nn(),Un(u("$inputStd.length === 0 && $state.loading !== true",qn('$placeholder || ""'),u("$multiple !== true",zn(u("$state.loading && $selections.length === 0",Gn("$ui.isLoading.value"),jn(Zn("$option.label")))),u('$multiple && $selectionAppearance === "truncate"',Jn(Qn(u("$state.loading && $selections.length === 0",Gn("$ui.isLoading.value"),tr()))),u('$multiple && $selectionAppearance === "tags"',sr(ar(u("$state.loading && $isLoadingOption !== true && $selections.length === 0",Gn("$ui.isLoading.value"),or(nr(u("$state.loading && $currentOptionsLoading.includes($option.value)",lr("$ui.isLoading.value"),rr("$option.label")),Xn(Pn("close"))))))))))),u("$truncationCount && $state.loading !== true",er("$truncationCount")),u("$state.loading",Pn("loader")),u("$inputStd.length !== 0 && $selectionRemovable",Xn(Pn("close")),Pn("select"))),ir(),Rn(),Pn("suffix"))),Wn("$help"),Kn(Yn("$message.value"))),type:"input",family:"dropdown",props:[],features:[Qo.defaultIcon("select","select"),Qo.defaultIcon("close","close"),Qo.defaultIcon("selected","check"),Qo.defaultIcon("loader","spinner"),Qo.localize("isLoading"),Qo.localize("loadMore"),Qo.options,W.bind(null,(function(e){e.props.applyLoadedOptions=x,void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=Xo.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=Xo.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&Xo.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)}))),!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)}))]},Dr=p("tg"),{outer:Ar,wrapper:Er,label:Or,prefix:Tr,suffix:Ir,help:Cr,messages:Fr,message:Br,icon:Vr}=d(Dr),Pr=Dr("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Hr=Dr("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Nr=Dr("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"}))),Rr=Dr("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"}}))),Wr=Dr("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"}}}))),Kr=Dr("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Yr=Dr("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Ur=Dr("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),zr={schema:Ar(Er(Nr(),Kr(Tr(),Pr(),Yr(Rr(),Ur(u("$slots.default","$slots.default",Vr("thumb")))),Ir()),Wr(),Hr()),Cr("$help"),Fr(Br("$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=Xo.undefine(e.props.disabled)),e.props.altLabelPosition=Xo.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=Xo.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=Xo.eq(t,e.props.onValue)}))}]},jr=p("rp"),{outer:qr,inner:Gr,prefix:Zr,suffix:Xr,help:Jr,messages:Qr,message:es,icon:ts}=d(jr),os=jr("empty",(()=>({$el:"div"}))),ns=jr("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),rs=jr("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ss=jr("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),as=jr("items",(()=>({$el:"ul",attrs:{role:"list"}}))),ls=jr("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),is=jr("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),ps=jr("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),ds=jr("content","div"),cs=jr("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),us=jr("legend",(()=>({$el:"legend",if:"$label"}))),fs=jr("group",(()=>({$formkit:"group",index:"$index"}))),hs=jr("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),vs=jr("remove",(()=>({$el:"li",if:"$removeControl"}))),ms=jr("insert",(()=>({$el:"li",if:"$insertControl"}))),gs=jr("up",(()=>({$el:"li",if:"$upControl"}))),$s=jr("down",(()=>({$el:"li",if:"$downControl"}))),ys=jr("controlLabel","span"),bs={schema:qr(cs(us("$label"),Jr("$help"),Gr(Zr(),u("$value.length === 0",u("$slots.empty",os()),u("$slots.default",as(ls(ds(fs("$slots.default")),hs(gs(ps(ys("$ui.moveUp.value"),ts("moveUp"))),vs(ss(ys("$ui.remove.value"),ts("remove"))),ms(ns(ys("$ui.add.value"),ts("add"))),$s(is(ys("$ui.moveDown.value"),ts("moveDown")))))),Xr()))),rs('$addLabel || ($ui.add.value + " " + ($label || ""))')),Qr(es("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){e._c.sync=!0,e.on("created",fe.bind(null,e))},Qo.localize("remove"),Qo.localize("add"),Qo.localize("moveUp"),Qo.localize("moveDown"),Qo.defaultIcon("remove","trash"),Qo.defaultIcon("add","add"),Qo.defaultIcon("moveUp","arrowUp"),Qo.defaultIcon("moveDown","arrowDown")]},ws="undefined"!=typeof window,xs=p("rt"),{outer:ks,wrapper:_s,inner:Ss,label:Ls,prefix:Ms,suffix:Ds,help:As,messages:Es,message:Os,icon:Ts}=d(xs),Is=xs("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"}}}))),Cs=xs("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Fs=xs("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"}}}))),Bs=xs("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"}}}))),Vs=xs("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Ps=xs("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Hs={schema:ks(_s(Ls("$label"),Ss(Ts("prefix"),Ms(),Cs(Fs(Vs(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),Ts("rating"))))),Bs(Ps(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),Ts("rating")))))),Is(),Ds(),Ts("suffix"))),As("$help"),Es(Os("$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=Xo.undefine(e.props.disabled)),e.on("created",(()=>{ws&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=ve.bind(null,e),e.context.handlers.ratingHoverOut=me.bind(null,e),e.context.handlers.handleClick=he.bind(null,e),ws&&Xo.whenAvailable(`${e.props.id}`,(()=>{$e(e),function(e){var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!o)return;const n=new ResizeObserver((()=>{$e(e)}));n.observe(o)}(e),setTimeout((()=>$e(e)),100)}),e.props.__root))})),e.on("input",(()=>ye(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)}))},Qo.defaultIcon("rating","star")]},Ns=p("ac"),{outer:Rs,wrapper:Ws,inner:Ks,icon:Ys,label:Us,prefix:zs,suffix:js,help:qs,messages:Gs,message:Zs}=d(Ns),Xs=Ns("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"}}))),Js=Ns("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"}}))),Qs=Ns("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"}}))),ea=Ns("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),ta=Ns("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),oa=Ns("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"}}))),na=Ns("optionLoading","span"),ra=Ns("option",(()=>({$el:"div",if:"$value !== undefined"}))),sa=f(Ns),aa=new WeakSet,la=new WeakMap,ia=new WeakMap,pa="undefined"!=typeof window,da=new WeakMap;let ca=!1;const ua={schema:Rs(Ws(Us("$label"),Ks(Ys("prefix"),zs(),Xs(),u("$multiple !== true && $selectionAppearance === option && $expanded === false",ta(Qs(ea(ra(u("$state.loading",na("$ui.isLoading.value"),"$option.label"))),u("$state.loading && $isSingleOption !== true && $currentOptionsLoading.includes($option.value)",Ys("loader")),u("$selectionRemovable && $isSingleOption",oa(Ys("close")))))),u("$state.loading && ($isSingleOption !== true || $selections.length === 0)",Ys("loader")),u('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',oa(Ys("close")),u('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',Js(Ys("select")))),u("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $currentOptionsLoading.length > 0)",Js(Ys("select"))),sa(),js(),Ys("suffix")),u("$multiple && $selectionAppearance === option",ta(Qs(ea(ra(u("$state.loading && $isLoadingOption",na("$ui.isLoading.value"),"$option.label"))),oa(Ys("close")))))),qs("$help"),Gs(Zs("$message.value"))),type:"input",family:"dropdown",props:[],features:[Qo.defaultIcon("select","select"),Qo.defaultIcon("close","close"),Qo.defaultIcon("selected","check"),Qo.defaultIcon("loader","spinner"),Qo.localize("isLoading"),Qo.localize("loadMore"),Qo.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=Xo.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=Xo.undefine(e.props.selectionRemovable),e.props.applyLoadedOptions=k,e.props.openOnClick=Xo.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=Xo.undefine(e.props.allowNewValues)}),be,(function(e){e.props.multiple?e.props.multiple&&"option"===e.props.selectionAppearance?(Ee(e),e.props.disabledDragAndDrop||pe(e)):e.props.multiple&&"text-input"===e.props.selectionAppearance&&Le(e):Oe(e)}))]},fa=p("dp"),{outer:ha,wrapper:va,inner:ma,icon:ga,label:$a,prefix:ya,suffix:ba,help:wa,messages:xa,message:ka}=d(fa),_a=fa("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"}}))),Sa=fa("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"}}))),La=fa("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ma=fa("nextLabel","span"),Da=fa("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Aa=fa("prevLabel","span"),Ea=fa("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Oa=fa("calendarWeeks",(()=>({$el:"tbody"}))),Ta=fa("calendarHeader",(()=>({$el:"thead"}))),Ia=fa("weekDays",(()=>({$el:"tr"}))),Ca=fa("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Fa=fa("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Ba=fa("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")'}}))),Va=fa("day","div"),Pa=fa("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'}}))),Ha=fa("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Na=fa("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)"}}))),Ra=fa("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Wa=fa("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)"}}))),Ka=fa("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Ya=fa("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Ua=fa("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),za=fa("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),ja=fa("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),qa=fa("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Ga=fa("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Za=fa("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Xa=fa("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Ja=fa("time",(()=>({$el:"div",if:'$panel === "time"'}))),Qa=fa("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),el=fa("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:tl,overlayLiteral:ol,overlayChar:nl,overlayEnum:rl,overlay:sl,overlayParts:al,overlayInner:ll}=c(fa),il=fa("panel","div"),pl=new WeakMap,dl=new WeakMap,cl=new WeakSet,ul=new WeakMap,fl=new WeakMap,hl=new WeakSet,vl=new WeakMap,ml=/[\uD800-\uDBFF]/,gl=new WeakMap,$l=new WeakMap,yl=new WeakMap,bl=new WeakMap,wl=new WeakMap,xl=new WeakSet,kl=new WeakMap,_l=new WeakMap,Sl=new WeakMap,Ll=new WeakMap;let Ml=!1;const Dl=()=>{Ml=!0,setTimeout((()=>{Ml=!1}),500)},Al={"#":{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"}},El=new WeakMap,Ol="undefined"!=typeof window;let Tl=!1;Ol&&document.addEventListener("selectionchange",(()=>{const e=a();if(!(e instanceof HTMLInputElement))return;if(Ll.has(e))return function(e){const t=Ll.get(e);if(t){const[o,n]=t,[r,s]=vt(e),a=s.indexOf(o);if(-1===a)return void Ll.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];Ke(Ye(e),i)||Ze(e,i)}}(e);if("select"!==vl.get(e))return;const t=Ye(e);if(!Ke(t,El.get(e))){if(El.set(e,t),cl.has(e))return cl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:Ye(e)}))}}));const Il="1999-03-04T02:05:01.000Z",Cl=new Map,Fl=[["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"}]],Bl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Vl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Pl={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Hl=["MMMM","MMM","dddd","ddd"],Nl=new Map([...Fl,...Bl,...Vl].map((e=>[e[0],e]))),Rl=new Map,Wl=["full","long","medium","short"],Kl=/^([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})?$/,Yl=e=>String(e).padStart(2,"0"),Ul=e=>String(e).padStart(2,"0"),zl="undefined"!=typeof window,jl=new WeakSet,ql=new WeakSet,Gl=new WeakSet,Zl=new WeakMap,Xl=new WeakMap,Jl=new WeakSet,Ql=new WeakSet,ei="undefined"!=typeof window,ti=new WeakMap,oi={schema:ha(va($a("$label"),ma(ga("prefix"),ya(),sl(ll(al(tl("$part.value"),ol("$part.value"),nl("$part.value"),rl("$part.value")))),_a(),Sa(Ka(Da(Aa("$ui.prev.value"),ga("prev")),Ya("$decade"),Ua(qa()),za(Ga(),qa()),ja(Ga(),Za(),qa()),La(Ma("$ui.next.value"),ga("next")),el(ga("close"))),il(Ha(Na("$fns.format($year, $yearFormat)")),Ra(Wa("$fns.format($month, $monthFormat)")),Ea(Ta(Ia(Ca("$fns.format($day, $weekdayFormat)"))),Oa(Fa(Ba(Va("$fns.format($day, $dateFormat)"))))),Ja(Qa()))),Xa(ga("clear")),Pa(ga("calendar")),ba(),ga("suffix"))),wa("$help"),xa(ka("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[go,function(e){var t,o,r,s,a,l,i,p,d,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=Zt(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=lo(e),e.props.pickerOnly=Xo.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=Xo.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=Xo.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):ho.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=At(t);else if("string"==typeof t)try{o=At(qt(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${Wt(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?Zt(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?qt(e.props.minDate):e.props.minDate;e.props.minDate=eo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?qt(e.props.maxDate):e.props.maxDate;e.props.maxDate=eo(t,e.props.offset)}o=o&&eo(o,e.props.offset),o&&io(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&Yt(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=Yt,e.on("created",(()=>{if(Xo.whenAvailable(`${e.props.id}`,co.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>Yt(t,o,e.props.locale||"en",!1,oo),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!to(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!to(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return Vt(t,eo(n instanceof Date?n:qt(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=Zl.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!ql.has(e)&&(Gl.add(e),e.props.expanded=!0,setTimeout((()=>Gl.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;io(e,void 0,!0),ao(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(Jl.has(e))return Jl.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=qt({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:oo});if(function(e){return Rt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Ll.get(t.target)&&Yt(n,e.props.format,e.props.locale,!1,oo)!==t.target.value){const r=jt("dddd",e.props.locale),s=Rt(e.props.format,e.props.locale),a=null===(o=zt(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=Yt(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=Ct(n,t),jl.add(e)}}io(e,n)}catch(t){io(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Bt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=Ft(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Bt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=Ft(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),ao(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=to(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&Vt(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=At(e);return t.setHours(0,0,0),t}(t).getTime();return o<Et(e).getTime()||o>Ot(e).getTime()||void 0}}}));const _=so.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),io(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void ao(e,void 0);const o=new Date,n=t?ao(e,eo("string"==typeof t?qt(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=Yt(n,"HH:mm"),function(e){const t=Xl.get(e);if(e._value&&t){const o=Tt(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",ro.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Ql.delete(e),e.props.panels=lo(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=to(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}ro(e),Xo.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){Jl.add(e);const t="string"==typeof e._value?qt(e._value,e.props.valueFormat,e.props.valueLocale):e._value;ao(e,eo(t,e.props.offset))}else ao(e,void 0);zl&&(ql.add(e),document.removeEventListener("click",_),setTimeout((()=>ql.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=Et(e.props.renderedDate),r=Ot(Ft(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=Ft(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=Ft(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=Bt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Bt(e.props.renderedDate,-10))}e.props.expanded&&ao(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||po(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Ct(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=Ct(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=Bt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=Ft(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=to(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Zl.get(e)&&uo(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=Jo.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:vo(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},Qo.localize("next"),Qo.localize("prev"),Qo.localize("changeDate"),Qo.localize("chooseDate"),Qo.defaultIcon("close","close"),Qo.defaultIcon("next","right"),Qo.defaultIcon("clear","close"),Qo.defaultIcon("prev","left"),Qo.defaultIcon("calendar","date")]},ni=p("tl"),{outer:ri,wrapper:si,inner:ai,icon:li,label:ii,prefix:pi,suffix:di,help:ci,messages:ui,message:fi}=d(ni),hi=ni("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"}}))),vi=ni("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'}}))),mi=ni("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"}}))),gi=ni("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),$i=ni("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"}}))),yi=ni("tagLabel",(()=>({$el:"span"}))),bi=ni("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),wi=ni("tagLoading","span"),xi=f(ni),ki={schema:ri(si(ii("$label"),ai(li("prefix"),pi(),bi(mi(gi(u("$state.loading && $currentOptionsLoading.includes($option.value)",wi("$ui.isLoading.value"),yi("$option.label")),$i(li("close")))),hi()),u("$state.loading",li("loader")),vi(li("select")),xi(),di(),li("suffix"))),ci("$help"),ui(fi("$message.value"))),type:"input",family:"dropdown",props:[],features:[Qo.options,W.bind(null,(function(e){e.props.multiple=!0,e.props.applyLoadedOptions=k,e.props.openOnClick=Xo.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=Xo.undefine(e.props.allowNewValues)}),be,(function(e){Ee(e),e.props.disableDragAndDrop||pe(e)})),Qo.defaultIcon("select","select"),Qo.defaultIcon("close","close"),Qo.defaultIcon("selected","check"),Qo.defaultIcon("loader","spinner"),Qo.localize("isLoading"),Qo.localize("loadMore")]},_i=p("mk"),{outer:Si,wrapper:Li,inner:Mi,label:Di,prefix:Ai,suffix:Ei,help:Oi,messages:Ti,message:Ii,icon:Ci}=d(_i),{overlayPlaceholder:Fi,overlayLiteral:Bi,overlayChar:Vi,overlayEnum:Pi,overlay:Hi,overlayParts:Ni,overlayInner:Ri}=c(_i),Wi=_i("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),Ki=new WeakMap,Yi=new WeakMap,Ui=new WeakMap,zi={schema:Si(Li(Di("$label"),Mi(Ci("prefix"),Ai(),Hi(Ri(Ni(Fi("$part.value"),Bi("$part.value"),Vi("$part.value"),Pi("$part.value")))),Wi(),Ei(),Ci("suffix"))),Oi("$help"),Ti(Ii("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[go,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,a;const l=Be("string"==typeof e._value?e._value:"");Yi.set(e,l),Ui.set(e,l),e.props.allowIncomplete=Xo.undefine(e.props.allowIncomplete),e.props.overlay=Xo.undefine(e.props.overlay);const i=!(void 0!==e.props.showMask&&!Xo.undefine(e.props.showMask));e.props.unmaskValue=Xo.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=Xo.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:Xo.undefine(e.props.reverse)};Ki.set(e,p),e.hook.input(((t,o)=>{const n=function(e,t){const o=Yi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Ui.get(e);r.value=ze(r,t);const a=Fe(r,Ki.get(e)),l=St(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=l?l:"":null===l?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||a===e.props._maskValue||(o.value=a,e.props._maskValue=a,e.props._overlayParts=s(Lt(r)||[]));return null===l?"":e.props.unmaskValue?l:a}(e,t);return o(n)})),e.props._maskValue=Fe(l,p),e.input(e.props._maskValue,!1),Xo.whenAvailable(`${e.props.id}`,$o.bind(null,e),e.props.__root)}))}]},ji=p("tf"),{outer:qi,wrapper:Gi,inner:Zi,icon:Xi,prefix:Ji,suffix:Qi,help:ep,messages:tp,message:op}=d(ji),np=ji("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),rp=ji("legend",(()=>({if:"$label",$el:"legend"}))),sp=ji("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),ap=ji("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),lp=ji("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),ip=ji("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()"}))),pp=ji("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),dp=ji("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)"}))),cp=ji("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),up=ji("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),fp=ji("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'}}))),hp=ji("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'}}))),vp=ji("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"}}))),mp=ji("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'}}))),gp=ji("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),$p=ji("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'}}))),yp=ji("loadMoreInner","span"),bp=ji("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),wp=ji("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),xp=ji("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"}}))),kp=ji("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'}}))),_p=ji("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Sp=ji("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Lp=ji("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Mp=ji("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'}}))),Dp=ji("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'}}))),Ap=ji("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'}}))),Ep=ji("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'}}))),Op=ji("controlLabel","span"),Tp=ji("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Ip=ji("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Cp=ji("emptyMessageInner","span"),Fp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Pp=new WeakMap,Hp=new WeakMap,Np=new WeakSet,Rp=new WeakMap,Wp=new WeakMap,Kp="undefined"!=typeof window;let Yp=null,Up=[],zp=!1,jp=!1;Kp&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("dragend",(()=>{jp?jp=!1:function(){if(Lo(Yp)&&Mo(Yp.parentNode)){const e=Rp.get(Yp);Yp.parentNode.dispatchEvent(new CustomEvent("dndDrop",{detail:e}))}To()}()})));const qp=new WeakMap,Gp=new WeakSet,Zp=new WeakSet,Xp=new WeakMap,Jp=new WeakMap,Qp="undefined"!=typeof window,ed=new WeakMap,td=Jo.createMessage({key:"loading",type:"state",value:!0,visible:!1}),od=Jo.createMessage({key:"loading",type:"state",value:!1,visible:!1}),nd=Symbol(),rd={schema:qi(np(rp("$label"),ep("$help"),Gi(sp(ap(lp(),ip()),cp(up(fp(),hp(Xi("close")))),vp(Tp(Cp("$sourceEmptyMessage")),mp(u("$transferOnSelect !== true && $fns.isSelected($option)",Xi("selected")),gp("$option.label")),$p(yp(u("$targetLoading !== true && $state.loading",Xi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Lp(Dp(Op("$ui.addAllValues.value"),Xi("fastForward")),Mp(Op("$ui.addSelectedValues.value"),Xi("moveRight")),Ap(Op("$ui.removeSelectedValues.value"),Xi("moveLeft")),Ep(Op("$ui.removeAllValues.value"),Xi("rewind"))),bp(wp(pp(),dp()),xp(Ip(u("$state.loading !== true",Cp("$targetEmptyMessage"))),kp(u("$transferOnSelect !== true && $fns.isSelected($option)",Xi("selected")),_p("$option.label")),Sp(yp(u("$targetLoading && $state.loading",Xi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),tp(op("$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=>Xo.eq(Co(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=>Xo.eq(t,Co(e))));if(o)e.push(o);else{const o=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:Xo.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=>Co(e)===Co(t))),n=p.findIndex((t=>Co(t)===Co(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=>Co(e)));if(i.includes(Co(t))){const o=e.props.selections.findIndex((e=>Co(e)===Co(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=>Co(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=>Co(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=>Co(e))),o=e.value.filter((e=>!t.includes(e)));if(e.props.forceUpdate=!0,e.input(o),e.props.optionsLoader){const t=[...e.props.options];e.props.options=[...t]}e.props.selections=[]}}function i(t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Gp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Zp.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Gp.add(e),e.props.mouseOnTarget&&Zp.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)?Co(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}else d(e);e.props.mouseOnSource||e.props.mouseOnTarget?(l&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&l.scrollTop+l.offsetHeight>l.scrollHeight-200&&e.props.mouseOnSource&&(e.props.allowAppendOptions=!0,null===(a=e.context)||void 0===a||a.handlers.loadMore(!1)),e.props.mouseOnSource&&Gp.has(e)||e.props.mouseOnTarget&&Zp.has(e)?requestAnimationFrame(p.bind(null,e,t,o,n)):i(n)):(Gp.delete(e),Zp.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=Io.bind(null,e),e.props.applyLoadedOptions=function(e,o,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t,o){const n=Qo.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=Co(r))}(e,o,n);const r=Qo.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(od),e.store.set(Jo.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),t(e),ed.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=Xo.undefine(e.props.disabled)),e.props.searchable=Xo.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=>Co(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?Vo(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=>Co(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function r(e){return Qp&&p(e)}function i(e){return Qp&&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=Fo.bind(null,e),e.context.fns.isActive=t=>Xo.eq(e.props.activeValue,Co(t))||void 0,e.context.fns.optionValue=Co,e.context.fns.isSelected=t=>e.props.selections.map((e=>Co(e))).includes(Co(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(Co(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=>Co(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(Xp.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Xp.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(Co(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(Co(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(Co(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(nd);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=>Co(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(Co(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(nd);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=>Co(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(Co(t))&&!(null===(o=t.attrs)||void 0===o?void 0:o.disabled)})),o=t[0];o&&(e.props.activeValue=Co(o))},e.context.handlers.targetFocused=()=>{const t=e.props.targetOptions[0];t&&(e.props.activeValue=Co(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},Qp){Xo.whenAvailable(e.props.id+"_source_list_items",(n=>{Xo.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=>{Xo.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})),xo(n,o.bind(null,e),{accepts:[s],dropBehavior:"append",childIsDraggable:u,isDisabled:f.bind(null,e)},r.bind(null,e)),xo(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===Jp.get(e)&&void 0!==Jp.get(e))return;if(Jp.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:Xo.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(td),Bo(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=>Xo.eq(Co(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const t=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,Bo(e,o(e)),e.off(t))}))}else Bo(e,o(e));return}const n=o(e);if(!Qp||n||void 0===t||e.props.options&&e.props.options.length||"function"!=typeof e.props.optionsLoader)Bo(e,n);else{const t=Vo(e);Bo(e),t.then((()=>{Bo(e,o(e))}))}})),e.on("prop:options",(({payload:t})=>{e.props.sourceOptions=[...t].filter((t=>!e.props.targetOptionValues.includes(Co(t)))),Bo(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,Vo(e)))})),e.on("prop:activeValue",(({payload:t})=>{if(t===nd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Xo.eq(Co(e),t)));if(o>=0)e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`;else{const o=e.props.targetOptions.findIndex((e=>Xo.eq(Co(e),t)));if(!o)return void(e.props.activeDescendant=void 0);e.props.activeDescendant=o}})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,Gp.delete(e),i(t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,Zp.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(od)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(od)}))},Qo.options,Qo.defaultIcon("moveRight","right"),Qo.defaultIcon("moveLeft","left"),Qo.defaultIcon("fastForward","fastForward"),Qo.defaultIcon("rewind","rewind"),Qo.defaultIcon("close","close"),Qo.defaultIcon("loader","spinner"),Qo.defaultIcon("selected","check"),Qo.localize("isLoading"),Qo.localize("loadMore"),Qo.localize("addAllValues"),Qo.localize("addSelectedValues"),Qo.localize("removeSelectedValues"),Qo.localize("removeAllValues")]},sd=p("sl"),{outer:ad,wrapper:ld,inner:id,icon:pd,label:dd,prefix:cd,suffix:ud,help:fd,messages:hd,message:vd}=d(sd),md=sd("chart",(()=>({$el:"div",if:"$chart"}))),gd=sd("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 + "%"'}}}}))),$d=sd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),yd=sd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),bd=sd("trackWrapper",(()=>({$el:"div"}))),wd=sd("trackInner",(()=>({$el:"div"}))),xd=sd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),kd=sd("linkedValues",(()=>({$el:"div"}))),_d=sd("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"}))),Sd=sd("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"}))),Ld=sd("marks",(()=>({$el:"div",if:"$marks"}))),Md=sd("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) + "%"'}}}))),Dd=sd("markLabel",(()=>({$el:"span",if:"$markLabels",children:'$step.label || " "',attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Ad=sd("handles",(()=>({$el:"ul"}))),Ed=sd("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"}}))),Od=sd("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"}}))),Td=sd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Id=sd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Cd=sd("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"}}))),Fd=sd("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"}}))),Bd={schema:ad(ld(dd("$label"),fd("$help"),$d(pd("prefix"),cd(),yd(md(gd()),bd(wd(xd(),Ld(Md(Dd())),Ad(Od(Fd(),Td()),Ed(Cd(),Id()))))),ud(),pd("suffix"),u("$showInput && $isMulti === false",_d())),u("$showInput && $isMulti",kd(Sd(),_d())),hd(vd("$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=Xo.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;Xo.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=Xo.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":v;const m=Xo.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=Xo.undefine(e.props.markLabels),e.props.snapToMarks=Xo.undefine(e.props.snapToMarks),e.props.showInput=Xo.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,Xo.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(Xo.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(Xo.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)}))}]},Vd=p("cp"),{outer:Pd,wrapper:Hd,inner:Nd,label:Rd,prefix:Wd,suffix:Kd,help:Yd,messages:Ud,message:zd,icon:jd}=d(Vd),qd=Vd("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'}}))),Gd=Vd("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:""}}}}))),Zd=Vd("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"}}}}))),Xd=Vd("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"}}))),Jd=Vd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Qd=Vd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),ec=Vd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),tc=Vd("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 + "%"'}}))),oc=Vd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),nc=Vd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),rc=Vd("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"}}))),sc=Vd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),ac=Vd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),lc=Vd("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"}}))),ic=Vd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),pc=Vd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),dc=Vd("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"}}]}))),cc=Vd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),uc=Vd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),fc=Vd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),hc=Vd("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"}}]}))),vc=Vd("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"}}]}))),mc=Vd("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"}}]}))),gc=Vd("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"}}]}))),$c=Vd("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"}}]}))),yc=Vd("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"}}]}))),bc=Vd("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"}}]}))),wc=Vd("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"}}]}))),xc=Vd("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"}}))),kc=Vd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),_c=Vd("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"}}}}))),Sc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Lc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Mc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},Dc={schema:Pd(Hd(Rd("$label"),u("$inline && $help",Yd("$help")),Nd(u("($inline === undefined || $inline === false) && $prefixIcon !== undefined",jd("prefix","label")),u("$inline === undefined || $inline === false",Wd()),u("$inline === undefined || $inline === false",qd(dc(),u("$showValue",Gd()))),u("$inline || $panelIsOpen)",Zd(u("$showPanelClose && ($inline === undefined || $inline === false)",Xd(jd("close"))),u("$panelControls",Jd(Qd(ec(),tc()),ic(pc()),oc(nc(),rc()),sc(ac(),lc()),u("$eyeDropper && $hasNativeEyeDropper",cc(jd("eyeDropper"))))),u("$panelFormat",uc(fc(u('$panelActiveFormat === "hex"',hc()),u('$panelActiveFormat === "rgba"',vc()),u('$panelActiveFormat === "rgba"',mc()),u('$panelActiveFormat === "rgba"',gc()),u('$panelActiveFormat === "hsla"',yc()),u('$panelActiveFormat === "hsla"',bc()),u('$panelActiveFormat === "hsla"',wc()),u('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',$c())),xc(jd("switch")))),u("$options",kc(_c())))),u("$inline === undefined || $inline === false",Kd()),u("($inline === undefined || $inline === false) && $suffixIcon !== undefined",jd("suffix"))),u("$: ($inline === undefined || $inline === false) && $help",Yd("$help"))),Ud(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&&!Uo(n)&&!Sc.test(n)&&!Lc.test(n))return;(Uo(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){if(!t)return;const o=zo(t);if(o){const[n,r,s,a]=o;"undefined"!==t&&("number"!=typeof n||isNaN(n)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Po(n,2)===e.props.h&&Po(r,2)===e.props.s&&Po(s,2)===e.props.v&&Po(a,2)===e.props.alpha)||(e.props.alpha=Po(a,2),w(n,r,s))}else{const o=null==E?void 0:E.find((e=>{var o;return(null===(o=e.dataset.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(o&&o.dataset.color){const[t,n,r,s]=jo(o.dataset.color);e.props.alpha=Po(s,2),w(t,n,r)}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),Xo.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]=Ho(t.sRGBHex);e.props.alpha=1,w(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),I,v),l("canvas-hue",(e=>{L=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=Mc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),k=Mc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){Xo.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(){Xo.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(!L)return;const e=L.getContext("2d");if(!e)return;const t=L.width,o=L.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]=jo(o),[l,i,p,d]=No(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,S,((t,o)=>{const n=t/S.width*100,r=100-o/S.height*100;V(e.props.hue,n,r)}))}function m(t){h(t,L,((t,o)=>{if(!L)return;const n=L.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`${Po(0===o||100===o&&0===t?0:e,0)}-${Po(r,0)}-${Po(o,0)}-${Po(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:Po(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:Po(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:Po(Math.max(Math.min(n,100),0),2);const{h:r,s:s,v:a,alpha:l}=e.props,[i,p,d]=No(r,s,a),[c,u,f]=Wo(r,s,a),h=e.props.hexInputFocused?e.props.hex:Yo(r,s,a,l),v=Po(l,2);e.props.hsla={h:r,s:p,l:d,a:v},e.props.hslaPercent={h:Po(r,0),s:100===a&&0===s?0:Po(0===a?p/255:Math.max(Math.min(p/255*100,100),0),0),l:Po(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}, ${Po(0===a?p/255:p/255*100,2)}%, ${Po(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,S=null,L=null,M=null,D=null,A=null,E=null,O=0;const T=["hex","rgba","hsla"],I=qo((function(){if(!S)return;const t=S.getContext("2d");if(!t)return;const{width:o,height:n}=S,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=qo((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:r,g:s,b:a}=e.props.rgba,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=qo(c,2),B=qo(u,2),V=qo(w,2),P=qo(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||0,e.props.s=e.props.s||0,e.props.v=e.props.v||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=Go(e.props.panelControls),e.props.eyeDropper=Go(e.props.eyeDropper),e.props.panelFormat=Go(e.props.panelFormat),e.props.showValue=Go(e.props.showValue),e.props.allowPaste=Go(e.props.allowPaste),e.props.inline=Xo.undefine(e.props.inline),e.props.disabled=Xo.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=Xo.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=zo(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),`${Po(n,t)}-${Po(r,t)}-${Po(s,t)}-${Po(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(Zo),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=Po(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=Po(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=Po(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=Po(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,Uo(r)){const[t,o,n,s]=Ho(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(!Uo(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;Uo(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]=Ro(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]=Ko(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]=jo(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"}})}))},Qo.options,Qo.defaultIcon("eyeDropper","color"),Qo.defaultIcon("close","close"),Qo.localize("close"),Qo.localize("next")]};var Ac=Object.freeze({__proto__:null,dropdown:Mr,toggle:zr,repeater:bs,rating:Hs,autocomplete:ua,datepicker:oi,taglist:ki,mask:zi,transferlist:rd,slider:Bd,colorpicker:Dc});const Ec="undefined"!=typeof window?setInterval:()=>0,Oc=new WeakSet;exports.$if=u,exports.autocomplete=ua,exports.colorpicker=Dc,exports.createBaseSections=d,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Oc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:fn(13919),children:`${fn(451228594)}${fn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){$n[e]?$n[e].add(t):$n[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(!an.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];Oc.add(o),o.define({...r,schema:n(e)})}Ec((()=>gn.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=oi,exports.dropdown=Mr,exports.inputs=Ac,exports.mask=zi,exports.rating=Hs,exports.repeater=bs,exports.slider=Bd,exports.taglist=ki,exports.toggle=zr,exports.transferlist=rd;
1
+ "use strict";function e(e,o){e in vn||(vn[e]={timer:0,inputs:new Set});const n=vn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=dn((()=>{un[e]||(un[e]=dn((()=>gn.add(e)),2e3)),function(e){if(ln){window.addEventListener(sn(),(o=>{const n=new URL(o.blockedURI).hostname;pn.some(((e,t)=>hn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=fn(tn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(vn[e].inputs),i=l.filter((t=>!(mn[e]&&mn[e].has(t)))).join("");if(cn(e),i){o++;try{const a=await window[fn(nn)](`${n}${r}${hn((s+o)%pn.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[fn(on)])return t(e,p.schema);if(a.ok)return mn[e]||(mn[e]=new Set),void l.forEach((t=>mn[e].add(t)))}catch(e){}o<2&&dn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){gn.add(e),function(e,t){$n[e]&&$n[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return gn.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e){return Xo.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?Qo.extendSchema(p,{children:d}):p;if(c=Qo.extendSchema(c,l),"object"==typeof c){let s=c;if(!Jo.isDOM(c)&&!Jo.isComponent(c)||c.meta||(c.meta={section:n,node:r}),Jo.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(Jo.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&&Xo.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",yn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",bn,!1),icon:Ln,label:e("label",wn,!1),prefix:e("prefix",Sn,!1),suffix:e("suffix",Sn,!1),help:e("help",_n,!1),messages:e("messages",xn,!1),message:e("message",kn,!1)}}function c(e){return{overlayPlaceholder:e("overlayPlaceholder",Mn),overlayLiteral:e("overlayLiteral",Dn),overlayChar:e("overlayChar",An),overlayEnum:e("overlayEnum",En),overlay:e("overlay",On),overlayParts:e("overlayParts",In),overlayInner:e("overlayInner",Tn)}}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)}:(Qo.isSlotCondition(s)?Object.assign(s.else,{if:e}):Qo.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)",Ln("selected")),i("$option.label")),r(u("$state.loading && $isLoadingOptions || $state.hasNextPage",s(u("$state.loading",Ln("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}function h(e,t=!0){e.props.isLoadingOptions=!0,e.store.set(dr),e.props.loadingCounter++,e.store.set(Jo.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,pr.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++,pr.set(e,t),e.store.set(Jo.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=>!Xo.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=vr(e);e.props.isLoadingOption=!0;const o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>Xo.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:Xo.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(dr),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=>Xo.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=vr(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:fr&&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=>Xo.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=Qo.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=Qo.normalizeOptions(o);e.props.options=n,e.props.options.length||(e.store.set(cr),e.store.set(Jo.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),w(e),hr.set(e,e.props.searchValue)}function _(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(g(t)!==ur?(e.props.option=t,e.props.maxReached&&!M(e,t)||e.input(S(e,g(t)))):null===(n=e.context)||void 0===n||n.handlers.loadMore())}function S(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];return o.includes(t)?(e.props.optionRemoved=!0,o.filter((e=>e!==t))):[...o,t]}return t===e.value?void(e.props.optionRemoved=!0):t}function L(e,t){return Xo.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)):Xo.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||(Jo.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=Xo.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:ur},e.props.listboxStyles={},e.props.loadingCounter=0,e.props.searchable=Xo.undefine(e.props.searchable),e.props.loadOnScroll=Xo.undefine(e.props.loadOnScroll),e.props.multiple=Xo.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=Xo.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&Xo.undefine(e.props.openOnRemove),e.props.hasNextPage=m.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.currentOptionsLoading=[],e.props.loadOnCreated=Xo.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||mr.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]),mr.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)),mr.has(e)?requestAnimationFrame(o.bind(null,e,n,r)):t(e,r)):mr.delete(e)}if(!fr)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=>Xo.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),Xo.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);mr.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;fr&&(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;fr&&(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===ur)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Xo.eq(g(e),t)));e.props.activeDescendant=o>=0?`${e.props.id}_listitem_${o}`:void 0}))}function E(e){var t,o;if(!fr)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||!fr)return;e.context.fns.isActive=L.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=gr.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else gr.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function C(e){gr.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=Xo.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(cr),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(fr)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(ur);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}`);o.currentTarget.style.display="none",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(S(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===ur)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Xo.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===ur)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.options.find((t=>Xo.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)})),fr&&Xo.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(!fr||!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=yr.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;$r.set(t,{value:o[e],index:e})}const l=$r.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=$r.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=$r.get(o);e.push(s.value)}yr.set(s,e),o&&o(e)}}}function i(e){e.preventDefault(),l()}let p=0,d=null;if(null!=r||(r=document),br.has(e))yr.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=$r.get(e);t&&(n?$r.set(e,{value:n.value,index:o}):$r.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),br.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),$r.set(r[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);yr.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){S(e,t)}const o=t=>{const o="taglist"===e.props.type||"dropdown"===e.props.type?"formkit-tag-wrapper":"formkit-selection";return t.classList.contains(o)&&!e.props.disabled};e.on("prop:loadingCounter",(({payload:n})=>{0===n&&fr&&!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&&fr&&!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",(()=>{Xo.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=>Xo.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&&Jo.error(300,[e]),e.props.dropdownWrapperStyles=Xo.clone(wr),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(){Lr=document.documentElement.scrollTop;for(const e in xr)Sr[e]=document.documentElement.style[e],document.documentElement.style[e]=xr[e];for(const e in kr)_r[e]=document.body.style[e],document.body.style[e]=kr[e];document.body.scrollTop=Lr}():function(){for(const e in xr)document.documentElement.style[e]=Sr[e];for(const e in kr)document.body.style[e]=_r[e];document.body.scrollTop=0,document.documentElement.scrollTop=Lr}())}))}function fe(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=Xo.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 he(e,t){var o,n;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let r;t instanceof MouseEvent?r=t.clientX:(r=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let s=ge(e,r,t.currentTarget)||0;s=s>e.props.min?s:e.props.min,s=s<e.props.max?s:e.props.max,e.input(s),null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()}}function ve(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){ye(e,ge(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function me(e){ye(e)}function ge(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function $e(e){setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);o&&(e.props.wrapperWidth=`0 0 ${o.offsetWidth/e.props.max}px`)}))}function ye(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function be(e){e.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===e.props.debounce?e.props.debounce=200:e.props.debounce=parseInt(e.props.debounce),e.props.nonceKey="searchValue",e.props.searchValue="",e.props.inputText="",e.props.filterOptions=xe.bind(null,e),e.props.reloadOnCommit=Xo.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=Xo.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&&fr&&(e.context.handlers.focus=_e.bind(null,e),e.context.handlers.input=we.bind(null,e),e.context.handlers.focus=_e.bind(null,e),e.context.handlers.click=ke.bind(null,e),e.context.handlers.toggleListbox=Se.bind(null,e),e.context.handlers.keydown=ee.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>J(e,t,o),e.context.handlers.searchInputTagKeydown=t=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":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||hr.delete(e)}))}function we(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&xe(e,!0)}function xe(e,t=!1){if("function"==typeof e.props.optionsLoader){e.store.set(dr),t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(la.get(e));const o=e.props.searchValue?e.props.debounce:0;la.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)&&(aa.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 ke(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 _e(e){e.props.disabled||e.props.disabledInternally||(e.props.attrs.onFocus&&e.props.attrs.onFocus(),e.props.activeSelectionValue=void 0,e.props.skipOpen?e.props.skipOpen=!1:e.props.openOnFocus&&(e.props.expanded=!0))}function Se(e){var t,o,n;e.props.disabled||e.props.disabledInternally||(null===(t=e.context)||void 0===t?void 0:t.state.loading)||(e.props.expanded=!e.props.expanded,e.props.openOnFocus||null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus())}function Le(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Me(e)})),e.on("created",(()=>{if(!e.context||!pa)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=Ae(e);if(e.props.highlightedRange){const[t,n]=De(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){Xo.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&da.set(t,e)}),e.props.__root),pa&&!ca&&(ca=!0,document.addEventListener("selectionchange",(()=>{const e=a();if(e instanceof HTMLInputElement&&da.has(e)){const t=da.get(e);t&&function(e){clearTimeout(ia.get(e)),ia.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=Ae(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]=De(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,Me(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=Ae(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=[],xe(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(pa&&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="",xe(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=Ae(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 Me(e){var t;if(!pa)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 De(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 Ae(e){const t=vr(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 Ee(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],xe(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&&xe(e,!0))}))}(e)}function Oe(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=[],xe(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&&xe(e,!0)}))}(e)}function Te(e,t){var o;if(pl.has(e))return;pl.set(e,[]),t.reverse&&xl.add(e),t.prefix&&kl.set(e,t.prefix),t.suffix&&_l.set(e,t.suffix),Ve(e,t.pattern,t.partOverrides,t.explicitParts);const n=fl.get(e),r=null==n?void 0:n.some((e=>Ne(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)&&hl.add(e),vl.set(e,l),t.onChange&&bl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Tl)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=pl.get(e);if(null==r?void 0:r.length){const o=(null!==(n=dl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;Xe(e,s),e.setSelectionRange(...s.selectionAfter),dl.set(e,o),bl.has(e)&&bl.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=Ye(e),a=e.value;n&&Ue(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===l&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),bt(e);case"ArrowLeft":return t.preventDefault(),bt(e,-1);case"ArrowUp":return void(wt(e,1)&&t.preventDefault());case"ArrowDown":return void(wt(e,-1)&&t.preventDefault());case"Tab":return Ml?void t.preventDefault():void(bt(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=hl.has(e),n=vl.get(e);if(o){let o=null,r=null,s=!1;const l="shift"===n?0:1,i=e.value;lt(e,{type:"insert",data:i,selectionBefore:[0,0,"none"],valueBefore:i},"shift"===n?"":i,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-l),(He(t)||Ne(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"===vl.get(e)){const[o]=vt(e),n=kt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){gl.set(e,je(e,t));const n=async()=>{if(!Ol||a()!==e)return;"select"===vl.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=Ye(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=qe(e,t);const[o]=vt(e),n=kt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&gl.set(e,je(e,o[n]))}(e));const t=gl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),gl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(gl.get(e))return;Dt(e),t=qe(e,t);const[o]=vt(e),n=kt(e,t),r=void 0!==n&&je(e,o[n]);r&&!Ke(t,r)&&Ze(e,r,!0)}(e,t.detail))),Ue(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ie(e){var t,o;if(Ll.has(e))return;const n=null!==(t=pl.get(e))&&void 0!==t?t:[],r=n[null!==(o=dl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=vt(e,r.valueAfter),s=kt(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"];Ll.set(e,[r,l])}}}function Ce(e){Ll.delete(e)}function Fe(e,t){const o="string"==typeof e||!pl.has(e),n="string"==typeof e?Be(e):e;if(o)t.prefix&&kl.set(n,t.prefix),t.suffix&&_l.set(n,t.suffix),n.value=ze(n,n.value),Te(n,t);else{const e=_t(n),o=n.value;n.value="",Ue(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 Be(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ve(e,t,o,n,r){r=e&&xl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Al);if(!e)return t;const o={...e},n=[];for(const r of t)if(!We(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Pe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Pe(e)?n.push(e):console.warn(`Invalid ${e.type} token`,e);return n}(o)).sort(((e,t)=>{const o="token"in e?e.token.length:-1,n="token"in t?t.token.length:-1;return o===n?0:o>n?-1:1}));let a=[];[t,a]=function(e,t,o,n){let r,s=0,a="",l="",i="";const p=[];for(;a=Je(e);)a===t&&r!==n?(s++,s>1&&(i+=a)):a===o&&s&&r!==n?(s--,0===s?(l+=`{$${p.length}}`,p.push(i),i=""):i+=a):s?i+=a:r!==n||a!==t&&a!==o?l+=a:l=`${l.substring(0,l.length-1)}${a}`,r=a,e=e.substring(a.length);return[l,p]}(t,"{","}","\\");const l=a.length;t=s.reduce(((e,t,o)=>"token"in t?e.replaceAll(`\\${t.token}`,"{“!”}").replaceAll(t.token,`{$${l+o}}`).replaceAll("{“!”}",t.token):e),t);const i=function(e,t,o){return e.reduce(((e,n)=>{const[r,s]=function(e){const[t,...o]=e.split("|"),n=o.reduce(((e,t)=>{const[o,n=!0]=t.split(":");return Object.assign(e,{[o]:n})}),{});return[t,n]}(n);let a=Ve(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&&fl.set(e,c),c}function Pe(e){return!!e&&(We(e)||He(e)||Ne(e))}function He(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Re(e))}function Ne(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Re(e))}function Re(e){return!!e&&("placeholder"in e&&"token"in e)}function We(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function Ke(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Ye(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 Ue(e,t){var o;xl.has(e)&&Mt(t);let n=!1;switch(wl.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=Ge(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===vl.get(e)){const[s,a]=vt(e),l=s.findIndex((e=>Ke(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(He(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=st(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=Je(e);e=e.substring(o.length),t.pattern.test(o)&&(n+=o)}return Math.min(Math.max(n.length,1),o)}(t.data,i,o);if(l.length>=o)return a||(t.insertPos=e[1]-p),(null!==(n=i.selectFill)&&void 0!==n?n:i.placeholder).repeat(o);const d=(null!==(r=i.selectFill)&&void 0!==r?r:i.placeholder).repeat(o-l.length-(a?0:p));return t.insertPos=a?e[0]+l.length:e[1]-p,"left"===i.selectDirection?`${l}${d}`:`${d}${l}${i.placeholder}`}if(Ne(i)){const e=t.selectionBefore;return t.valueBefore.substring(e[0],e[1])}}return""}(e,t);o=`${o.substring(0,n[0])}${r}${o.substring(n[1])}`;const s=lt(e,t,o);return ul.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:at(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=Ge(t),n=t.selectionBefore,r=xl.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=Qe(o,s):s-=Qe(o,s,"backward"));const l=vl.get(e);let i="";if("select"===l){const[o,n]=vt(e),r=kt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];He(l)?i=l.placeholder.repeat(a-s):Ne(l)&&([i,s]=Ke(p,Ye(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=Qe(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=gt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&$t(t.values,i)&&(p=i);return[null!=p?p:t.placeholder,p?a:o[0]]}(0,l,p,t))}}const p=`${o.substring(0,s)}${i}${o.substring(a)}`,d=lt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:ut(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(xl.has(e)&&n&&Mt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=je(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)){bl.has(e)&&Sl.set(e,(()=>{Sl.delete(e),n&&bl.get(e)(n,e)})),wl.set(e,"beforeCallback");let t=null!==(o=pl.get(e))&&void 0!==o?o:[];const r=dl.get(e);r&&(t=t.slice(0,r),dl.delete(e)),t.push(n),pl.set(e,t),Ol&&a()===e&&"function"==typeof document.execCommand&&!Tl?(Ze(e,[0,e.value.length,"forward"],!0),Tl=!0,document.execCommand("insertText",void 0,n.valueAfter),Tl=!1):Xe(e,n),Ol&&a()===e&&Ze(e,n.selectionAfter);const s=Sl.get(e);s&&s(),Dt(e)}wl.set(e,"complete")}function ze(e,t){var o,n;const r=null!==(o=kl.get(e))&&void 0!==o?o:"",s=null!==(n=_l.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 je(e,t){const o=kl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function qe(e,t){const o=kl.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function Ge(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 Ze(e,t,o=!1){o&&(cl.add(e),setTimeout((()=>cl.delete(e)),5)),gl.get(e)&&gl.set(e,t),e.setSelectionRange(...t)}function Xe(e,t,o="After"){if(e.value=t[`value${o}`],Ol){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function Je(e){if(null==e)return"";const t=ml.test(e.charAt(0))&&ml.test(e.charAt(1))?2:1;return e.substring(0,t)}function Qe(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:ml.test(e.charAt(t))&&ml.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:Je(e.substring(t)).length}function et(e,t){const o=Je(e.data),n=o.length;if(e.value+=o,e.pos+=n,"string"==typeof e.data&&(e.data=e.data.substring(n),e.data.length||(e.endPos=e.pos)),t)return t.substring(n)}function tt(e){const t=Je(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function ot(e,t){const o=Je(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function nt(e,t){for(;t.buffer;){const o=Je(t.buffer);if(e.pattern.test(o)||t.placeholder&&e.placeholder===o)return void("replace"!==t.mode&&"select"!==t.mode||(t.buffer=t.buffer.substring(o.length)));t.buffer=t.buffer.substring(o.length)}}function rt(e,t){const o=e.values.concat([e.placeholder]).map((e=>e.toLowerCase())).sort(((e,t)=>e.length>t.length?-1:1));for(;t.buffer;){const e=t.buffer.toLowerCase(),n=o.find((t=>e.startsWith(t)));if(n){const e=t.buffer.substring(0,n.length);return t.buffer=t.buffer.substring(n.length),e}t.buffer=t.buffer.substring(Qe(t.buffer,0))}return null}function st(e,t){let o=e.replaceAll(t.placeholder,"");const n="left"===t.selectDirection;if(t.selectFill){const e=new RegExp(`${n?"":"^"}${r=t.selectFill,r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}+${n?"$":""}`);o=o.replace(e,"")}var r;return o}function at(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=Ye(e);o=[n[0],t.endPos,"none"];const[r,s]=vt(e,t.value),a=kt(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(He(i)&&st(p,i).length===p.length&&a<r.length-1)return Dl(),r[a+1];if(Ne(i)&&t.insertPos>=l[0]&&t.insertPos<=l[1]){if(t.cycle)return l;const o=function(e,t,o){if(null===e.originalData)return 0;const n=e.insertPos>=t?e.value.substring(t,e.insertPos):"",r=`${n}${e.originalData}`,s=gt(o.values,r);if(s)return ht(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return $t(i.values,p)?[l[1],l[1],"forward"]:(Dl(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return Ke(s,n)||(cl.add(e),setTimeout((()=>cl.delete(e)),5)),s}return l}function lt(e,t,o,n){var r,s;const a=null!==(r=fl.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:hl.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:vl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:vt(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return it(a,l,void 0,n),l}function it(e,t,o,n){var r,s;const a={...t};(null==o?void 0:o.placeholder)&&(t.placeholder=!0);const l=(null==o?void 0:o.repeat)&&"literal"===(null===(r=o.nextPart)||void 0===r?void 0:r.type)?o.nextPart.value:null;let i=0;const p=e.reduce(((e,t)=>e+("char"===t.type?1:0)),0),d=t.chars;for(const o of e){const r=e[i+1];switch(o.type){case"literal":dt(o,t,e.at(-1)===o);break;case"char":ct(o,t,l);break;case"enum":pt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};it(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=We(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++,it(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),We(o)&&t.value.endsWith(o.value)&&(t.value=t.value.substring(0,t.value.length-o.value.length),t.pos=t.value.length)}p>1&&r<p&&0!==r&&t.insertPos<=t.pos?t.data="":o.repeat&&!s&&o.repeats&&Object.assign(t,a)}t.placeholder=a.placeholder}function pt(e,t){const[o,n]=t.rangeParts,r=o[n.indexOf(e)];if(r&&(t.insertPos<=t.pos||t.insertPos>=r[0]&&t.insertPos<=r[1])&&t.data){const o=t.buffer.substring(0,t.insertPos-t.pos),n=`${o}${t.data}`,r=gt(e.values.concat([e.placeholder]),n);if(r){const s=ht(n,r);return t.data=t.data.substring(s.length),t.value+=r,r!==e.placeholder?t.unmasked+=r:t.complete=!1,t.meta.push({type:r!==e.placeholder?"enum":"placeholder",value:r}),o?t.buffer=t.buffer.substring(o.length):rt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=rt(e,t);if(o)return t.value+=o,o!==e.placeholder?t.unmasked+=o:t.complete=!1,t.meta.push({type:o!==e.placeholder?"enum":"placeholder",value:o}),void(t.pos=t.value.length)}t.complete=!1,t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder}),t.pos=t.value.length}function dt(e,t,o){let n=e.value;if(""===t.data&&!t.buffer&&!t.placeholder&&!o)return;let r=!1;for(;n;){const e=t.insertPos<=t.pos?Je(t.data):"",s=Je(n);if(e===s)n=et(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=ot(t,n),t.meta.push({type:"literal",value:s});else if(r&&!t.data)break;t.buffer.startsWith(s)&&(t.buffer=t.buffer.substring(s.length))}null===t.data&&!t.buffer&&t.insertPos<=t.pos&&!t.placeholder&&(t.value=t.value.substring(0,t.value.length-e.value.length),t.pos=t.endPos=t.value.length)}function ct(e,t,o){var n;let r=!0;if(t.insertPos<=t.pos)for(;null===(n=t.data)||void 0===n?void 0:n.length;){const n=Je(t.data);if(e.pattern.test(n))return et(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void nt(e,t);if("string"==typeof t.data){if(o&&t.data.startsWith(o)){r=!1;break}t.data=t.data.substring(n.length)}}for(;r&&t.buffer;){const n=Je(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,tt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return tt(t),void t.meta.push({type:"placeholder",value:n});if("string"==typeof t.buffer){if(o&&t.buffer.startsWith(o)){t.buffer=t.buffer.substring(o.length);break}t.buffer=t.buffer.substring(n.length)}}t.placeholder?(t.value+=e.placeholder,t.meta.push({type:"placeholder",value:e.placeholder})):t.endPos=t.pos}function ut(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=vt(e),a=kt(e,r,s),[l,i]=vt(e,t.value),p=void 0!==a&&ft(o.valueBefore,s[0][a],s[1][a]);if(void 0!==a&&a in l){if(p){const e=l.slice(a).every(((e,o)=>ft(t.value,e,i[a+o])));return e&&l[a-1]?l[a-1]:l[a]}return[n,l[a][1],"none"]}}return r}function ft(e,t,o){if(We(o))return!1;if(He(o)){let n=t[0];for(;n<t[1];){const t=Je(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!Ne(o)||e.substring(t[0],t[1])===o.placeholder}function ht(e,t){let o="";do{const n=Je(e).toLowerCase(),r=Je(t).toLowerCase();if(n!==r)break;o+=n,e=e.substring(n.length),t=t.substring(r.length)}while(e.length&&t.length);return o}function vt(e,t){const o=fl.get(e);if(!o)return[[],[]];if($l.has(e))return $l.get(e);const n=null!=t?t:ze(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(We(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(He(a)&&He(e)&&e.token===a.token)i++;else if(He(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(Ne(e)){l&&r.push([l,i,"none"]),yt(e)||(p=!1);const t=mt(n,e,i);l=null,r.push([i,i+t,"none"]),s.push(e),i+=t}a=e}null!==l&&r.push([l,i,"none"]);const d=[[...r],[...s]];return p&&!t&&$l.set(e,d),d}function mt(e,t,o){if(yt(t))return t.values[0].length;const n=e.slice(o),r=gt(t.values.concat([t.placeholder]),n);return r?r.length:0}function gt(e,t,o=null,n){var r;if(0===t.length)return o;if(!n){const o=e.find((e=>e.toLowerCase()===t.toLowerCase()));if(o)return o}const s=Je(t.toLowerCase()),a=`${null!=n?n:""}${s}`,l=e.filter((e=>e.toLowerCase().startsWith(a))),i=l.find((e=>e.toLowerCase()===a));return i&&(o=i),0===l.length?o:1===l.length?l[0]:(l.length>1&&(o=l[0]),null!==(r=gt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function $t(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function yt(e){if(!yl.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;yl.set(e,e.values.every((e=>e.length===t)))}return yl.get(e)}function bt(e,t=1){const[o]=vt(e),n=kt(e,qe(e,Ye(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...je(e,o[n+t])),!0)}function wt(e,t=1){const[o,n]=vt(e),r=kt(e,Ye(e));if(void 0!==r&&r in n){const s=n[r];if(Ne(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((()=>Ue(e,t)),0),!0}}}return!1}function xt(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 xt(e.slice(...r),t)}function kt(e,t,o){const[n]=null!=o?o:vt(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!Ke(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=xt([...s],t[1]);return l in a?a[l]:void 0}function _t(e){var t,o;const n=null!==(t=pl.get(e))&&void 0!==t?t:[];return n[null!==(o=dl.get(e))&&void 0!==o?o:n.length-1]}function St(e,t=!1){const o=_t(e);return o&&(o.complete||t)?xl.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Lt(e){var t;const o=_t(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Mt(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 Dt(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 At(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(Kl);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(Kl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Et(e){const t=At(e);return t.setDate(1),t.setHours(0,0,0),t}function Ot(e){const t=At(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function Tt(e){return Ot(e).getDate()}function It(e,t=0){const o=At(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function Ct(e,t=1){const o=At(e);return o.setDate(o.getDate()+t),o}function Ft(e,t=1,o=!1){const n=At(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=Tt(n);n.setDate(e<r?e:r)}return n}function Bt(e,t=1,o=!1){const n=At(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=Tt(n);n.setDate(e<r?e:r)}return n}function Vt(e,t){const o=At(e),n=At(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function Pt(e,t,o){if(!Cl.has(e)){const t=new Date(Il),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(Xt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Xt).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})}))}}Cl.set(e,s)}const n=Cl.get(e);return n?n[t][o]:void 0}function Ht(e,t){const o=Rl.get(t);if(o&&o[e])return o[e];const n=new Date(Il);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Xt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Rl.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function Nt(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(Il)).map(Xt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Xt).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?Nl.get("YY"):Nl.get("YYYY");case"month":return s?1===r?Nl.get("M"):Nl.get("MM"):(a=Pt(o,e,t),"long"===a?Nl.get("MMMM"):Nl.get("MMM"));case"day":return 1===r?Nl.get("D"):Nl.get("DD");case"weekday":switch(a=Pt(o,e,t),a){case"narrow":return Nl.get("d");case"short":return Nl.get("ddd");default:return Nl.get("dddd")}case"hour":return 12===n?1===r?Nl.get("h"):Nl.get("hh"):1===r?Nl.get("H"):Nl.get("HH");case"minute":return 1===r?Nl.get("m"):Nl.get("mm");case"second":return 1===r?Nl.get("s"):Nl.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Nl.get("A"):Nl.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Nl.get("ZZ"):Nl.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 Rt(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(Wl.includes(e)||"object"==typeof e)return Nt(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}(Fl.filter(s).concat(Bl.filter(s)).map(o.bind(null,!1)).concat(Vl.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 Wt(e,t="en",o=!1,n=(()=>!0)){return Rt(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return Fl.concat(Bl).concat(Vl).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 Kt(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=Ht(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Jt(-1*a.getTimezoneOffset()):r}const s=function(e,t,o,n=!1){function r(e,t=!1){const r=`${o}-u-hc-${t?"h12":"h23"}`;if(i.push(...new Intl.DateTimeFormat(r,e.reduce(((e,t)=>"literal"===t.partName?e:(n&&Hl.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Xt)),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(Xt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Xt)}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=At(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=At(e);return t.map((e=>({...e,value:r(e)})))}function Yt(e,t="long",o="en",n=!1,r=(()=>!0)){return"ISO8601"===t?At(e).toISOString():Kt(e,Rt(t,o).filter(r),o,n).map((e=>e.value)).join("")}function Ut(e){return["numeric","2-digit"].includes(e.partValue)}function zt(e,t){let o=0;const n=e=>[e[o++],e[o]];let r=0;const s=[];let a;do{const[o,l]=n(t);a=l;let i=1;if("literal"===o.partName)i=o.partValue.length;else if(o.token in Pl)i=Pl[o.token];else if(l)if("literal"===l.partName){if(i=e.indexOf(l.partValue,r)-r,i<0)throw new Error}else if("dayPeriod"===l.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(r+t)))){i=t;break}}else{const t=e.substring(r).search(/\d/);-1!==t&&(i=r+t)}else i=e.length;s.push({...o,value:e.substring(r,r+i)}),r+=i}while(a);return s}function jt(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 jt("MM").map((n=>Yt(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>Yt(`2022-10-${o}`,e,t)));if("a"===e)return[Ht("am",t).toLowerCase(),Ht("pm",t).toLowerCase()];if("A"===e)return[Ht("am",t).toUpperCase(),Ht("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(Yt(`${o+Number(r)}-06-06`,e,t)),n.unshift(Yt(o-Number(r)+"-06-06",e,t)),n)),[Yt(`${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 qt(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 (${Wt(t,o)})`)};if("ISO8601"===t)return At(n);const l=Wl.includes(t)||"object"==typeof t,i=function(e){let t;for(const o of e){if("literal"===o.partName&&!isNaN(parseFloat(o.partValue)))throw new Error(`Numbers in format (${o.partValue}).`);if(t&&"literal"!==t.partName&&"literal"!==o.partName&&!(t.token in Pl||o.token in Pl||Ut(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(Rt(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=zt(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()===Ht("am",o).toLowerCase();else if("Z"===n)f=Gt(e.value);else{const t=jt(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=Tt(new Date(`${Ul(v)}-${Yl(m+1)}-10`));if(w<g&&"throw"===s)throw new Error(`Invalid date ${Ul(v)}-${Yl(m+1)}-${Yl(g)}`);g="backward"===s?Math.min(g,w):g;const x=`${Ul(v)}-${Yl(m+1)}-${Yl(g)}T${Yl($)}:${Yl(y)}:${Yl(b)}${f}`,k=new Date(x);return isFinite(+k)?k:a()}function Gt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function Zt(e,t="UTC",o="browser"){o="browser"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=At(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(Xt),o={};return t.forEach((e=>{o[e.type]=e.value})),new Date(`${o.year}-${o.month}-${o.day}T${o.hour}:${o.minute}:${o.second}Z`)},s=r(t);return Jt((r(o).getTime()-s.getTime())/1e3/60)}function Xt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Jt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Qt(e,t="+0000"){const o=At(e),n=function(e){Gt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function eo(e,t="+0000"){const o="+"===t.slice(0,1);return Qt(e,t.replace(o?"+":"-",o?"-":"+"))}function to(e,t,o=7){let n,r;const s=At(e);switch(o){case"month":r=s.getDate(),n=Tt(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=At(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=At(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=Ct(s,e);if(t(o))return o}if(e&&e<=r){const o=Ct(s,-e);if(t(o))return o}}return null}function oo(e){return"timeZoneName"!==e.partName}function no(e,t){const o=[],n=At(t);n.setDate(1);let r=It(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=It(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Ot(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Ct(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function ro(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>no(e,Ft(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(Yt(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>Bt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=At(e.props.renderedDate);return t.setMonth(0),n(12,(e=>Ft(t,e)))}(e)}function so(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_panels`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function ao(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:qt(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,oo),o}function lo(e){return Array.isArray(e.props.sequence)?Xo.clone(e.props.sequence):["day"]}function io(e,t,o=!0){var n,r;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?Zt(t,e.props.timezone):"+0000";const s=Qt(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(Yt(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function po(e,t){var o;const n=["prev_button","month_button","day_button","year_button","next_button"].find((t=>{var o;return null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${t}`)})),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_${n}`);r instanceof HTMLElement&&(t.preventDefault(),r.focus())}function co(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Zl.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`)?Ql.add(e):Ql.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===wl.get(t)&&(n=t.value),Ie(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!pl.has(e))return;const r=null!==(o=kl.get(e))&&void 0!==o?o:"",s=null!==(n=_l.get(e))&&void 0!==n?n:"";Ue(e,{type:"insert",selectionBefore:Ye(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>Ce(t)),10))}));const[r,s]=fo(e);Te(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(uo(e),jl.has(e))return jl.delete(e);n&&n===o?n="":(Ie(t),e.props.inputText=o,setTimeout((()=>Ce(t)),10))}})}function uo(e){var t,o;if(e.props.overlay){const n=Zl.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||St(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=s(Lt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function fo(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=Rt(e.props.format,t);return[Wt(e.props.format,t,!0,oo),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=jt(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")&&Xl.set(e,a),r}),[])]}function ho(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function vo(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!ti.get(e)&&ei){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){ti.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function go(e){e.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),e.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:e.props._isPlaceholder?"auto":"none"},e.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},e.on("created",(()=>{e.props.overlay=Xo.undefine(e.props.overlay),e.props.pickerOnly=Xo.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&Xo.whenAvailable(`${e.props.id}`,mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function $o(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Yi.set(e,t),Te(t,{...Ki.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=s(o)}})}function yo(e){const t=Pp.get(e.parentElement);t&&t.childIsDraggable&&!t.childIsDraggable(e)||(e.setAttribute("draggable","true"),e.addEventListener("dragstart",_o),t&&(!1===t.accepts||"append"==t.dropBehavior||Array.isArray(t.accepts)&&!t.accepts.length)||e.addEventListener("dragenter",Eo))}function bo(e,t){if(t&&t.accepts&&Array.isArray(t.accepts)){const o=[];for(const e of t.accepts)o.push(e);Hp.set(e,o)}}function wo(e){const t=[],o=Pp.get(e),n=Bp.get(e);for(let n=0;n<e.children.length;n++){const r=e.children[n];r instanceof HTMLElement&&(o&&o.childIsDraggable&&!o.childIsDraggable(r)||t.push(r))}for(let e=0;e<t.length;e++){const o=t[e];yo(o),Fp.set(o,{value:n()[e],index:e})}}function xo(e,t,o,n){if(Np.has(e))Pp.set(e,o),bo(e,o),Bp.set(e,t),Vp.set(e,n),wo(e);else{new MutationObserver(ko).observe(e,{childList:!0}),Pp.set(e,o),bo(e,o),Np.add(e),Bp.set(e,t),Vp.set(e,n),function(e){const t=Pp.get(e.parentElement);t&&(!1===t.accepts||Array.isArray(t.accepts)&&!t.accepts.length)||(e.addEventListener("drop",Oo),e.addEventListener("dragenter",Ao))}(e),wo(e)}}function ko(e){const t=[];for(const o of e){wo(o.target);for(const e of o.addedNodes)e instanceof HTMLElement&&Fp.has(e)&&t.push(e);for(const e of o.removedNodes)e instanceof HTMLElement&&Fp.has(e)}if(t.length&&Yp)for(const e of t)for(const t of Up)Fp.get(e).value!==Fp.get(t).value||e.classList.add("dnd-placeholder");setTimeout((()=>{zp=!1}),200)}function _o(e){if(So(e)&&Mo(e.currentTarget.parentNode)){const t=Pp.get(e.currentTarget.parentNode);if(t&&t.isDisabled&&t.isDisabled())return void e.preventDefault();if(Yp=e.currentTarget,!Yp.parentNode)return;const o=Vp.get(e.currentTarget.parentNode)();o.includes(Yp)||o.push(Yp);const n=new DocumentFragment,r=document.createElement("div");r.id="dnd-selections",r.style.display="flex",r.style.flexDirection="column",o.map((e=>{Up.push(e);let t=null;if(Yp===e){t=Yp.cloneNode(!0);const e=Yp.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),Yp.appendChild(n),Yp.classList.add("dnd-dragging"),Yp.parentNode.dispatchEvent(new CustomEvent("dndDragStart",{detail:Fp.get(Yp)}));const s=Bp.get(Yp.parentNode)();Rp.set(Yp,s),Wp.set(Yp,Yp.parentNode)}}function So(e){return!!e.currentTarget}function Lo(e){return!!e&&e instanceof HTMLElement}function Mo(e){return!!e&&e instanceof HTMLElement}function Do(e){return Array.isArray(e)&&e.length>0}function Ao(e){if(So(e)&&Lo(Yp)&&Mo(Yp.parentNode)&&Do(Up)&&!zp){const t=function(e,t){const o=Hp.get(e),n=Wp.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,Yp);if(t.accepted&&!t.draggedElementReturned){zp=!0;const t=[...Bp.get(e.currentTarget)()],o=[];for(const e of Up)o.push(Fp.get(e).value);const n=t.concat(o);Wp.set(Yp,e.currentTarget),Yp.style.display="none",e.currentTarget.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}else if(t.accepted&&t.draggedElementReturned){zp=!0;const t=Rp.get(Yp);Wp.set(Yp,e.currentTarget),Yp.style.display="",Yp.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:t}))}}}function Eo(e){if(So(e)&&Mo(e.currentTarget.parentNode)&&Lo(Yp)&&Mo(Yp.parentNode)&&Do(Up)&&function(e,t){const o=Hp.get(e);return o?o&&o.length?o.includes(t.parentNode):void 0:{accepted:!0,draggedElementReturned:!1}}(e.currentTarget.parentNode,Yp)&&function(e,t){return Fp.get(t).value!==Fp.get(e).value}(e.currentTarget,Yp)&&!zp){zp=!0;const t=[...Bp.get(e.currentTarget.parentNode)()],o=Up.map((e=>Fp.get(e).value)),n=[...t.filter((e=>!o.includes(e)))],r=Fp.get(e.currentTarget).index;n.splice(r,0,...o),"none"!==Yp.style.display&&Yp.parentNode!==e.currentTarget.parentNode?Yp.style.display="none":"none"===Yp.style.display&&Yp.parentNode===e.currentTarget.parentNode&&(Yp.style.display=""),Wp.set(Yp,e.currentTarget.parentNode),e.currentTarget.parentNode.dispatchEvent(new CustomEvent("dndNewValue",{detail:n}))}}function Oo(e){if(e.stopPropagation(),e.preventDefault(),jp=!0,!e.currentTarget)return;const t=Bp.get(e.currentTarget)();e.currentTarget.dispatchEvent(new CustomEvent("dndDrop",{detail:t})),setTimeout((()=>{To()}),50)}function To(){Yp&&(Rp.delete(Yp),Wp.delete(Yp)),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=""))}})),Yp=null,Up=[]}function Io(e,t){e.props.page++,qp.set(e,t),e.store.set(Jo.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function Co(e){return"__original"in e?e.__original:e.value}function Fo(e){e.props.didLoadMore=!0,setTimeout((()=>{e.props.didLoadMore=!1}),300),Vo(e)}function Bo(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=>Co(e)===Co(t)))))]),(!e.props.newSourceValue||e.props.isSourceOption||e.props.dropped||e.props.forceUpdate)&&(e.props.targetOptions=t),e.props.targetOptionValues=t.map((e=>Co(e))),e.props.showSourceEmptyMessage=e.props.sourceOptions&&0===e.props.sourceOptions.length,e.props.selections=[],e.props.dropped=!1,e.props.forceUpdate=!1)}function Vo(e,t=!0){e.store.set(td),e.props.loadingCounter++,e.store.set(Jo.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,qp.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function Po(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Ho(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[...Ro(t,o,n,r)]}function No(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,Po(255*t,2),Po(255*a,2),n]}function Ro(e,t,o,n=1){const r=Po(t/255,4),s=Po(o/255,4);if(1===s)return[e,0,100,n];const a=Po(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,Po(l,2),Po(100*a,2),n]}function Wo(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 Ko(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 Yo(e,t,o,n=1){const[r,s,a,l]=Wo(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 Uo(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function zo(e){if(e){if(Uo(e))return Ho(e);if(e.startsWith("rgb")){const t=e.match(Sc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Ko(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(Lc);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 Ro(o,Po(255*n,2),Po(255*r,2),s)}}}function jo(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function qo(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 Go(e){return!1!==e&&"false"!==e}function Zo(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}Object.defineProperty(exports,"__esModule",{value:!0});var Xo=require("@formkit/utils"),Jo=require("@formkit/core"),Qo=require("@formkit/inputs");require("@formkit/vue");const en=[988,24029,396,13078,980],tn=18806588,on=502357,nn=16217489;let rn=189024;const sn=()=>[30548127325,27022924,34729821653783].map(fn).join("y"),an=/^[0-9a-f]+$/,ln="undefined"!=typeof window,pn=n(32,(e=>e)).map((()=>{rn|=0,rn=rn+1831565813|0;let e=rn^rn>>>15|rn;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),dn=ln?setTimeout:()=>0,cn=e=>{clearTimeout(un[e])},un={},fn=e=>e.toString(32),hn=e=>`${fn(pn[e]).substring(2)}.${fn(en[e%(en.length-1)])}`,vn={},mn={},gn=new Set(["",null,void 0]),$n={},yn=()=>({$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"}}),bn=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),wn=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),xn=()=>({$el:"ul",if:"$fns.length($messages)"}),kn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),_n=()=>({$el:"div",if:"$help"}),Sn=()=>({$el:null}),Ln=(e,t)=>()=>Qo.icon(e,t),Mn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Dn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),An=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),En=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),On=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),Tn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),In=()=>({$el:null,for:["part","$_overlayParts"]}),Cn=p("dd"),{outer:Fn,wrapper:Bn,inner:Vn,icon:Pn,label:Hn,prefix:Nn,suffix:Rn,help:Wn,messages:Kn,message:Yn}=d(Cn),Un=Cn("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=Cn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),jn=Cn("selection",(()=>({$el:"div"}))),qn=Cn("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),Gn=Cn("optionLoading","span"),Zn=Cn("option",(()=>({$el:"div"}))),Xn=Cn("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"}}))),Jn=Cn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),Qn=Cn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),er=Cn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),tr=Cn("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 || ""'}))),or=Cn("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"}}))),nr=Cn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"0"}}))),rr=Cn("tagLabel",(()=>({$el:"span"}))),sr=Cn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),ar=Cn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),lr=Cn("tagLoading","span"),ir=f(Cn),pr=new WeakMap,dr=Jo.createMessage({key:"loading",type:"state",value:!0,visible:!1}),cr=Jo.createMessage({key:"loading",type:"state",value:!1,visible:!1}),ur=Symbol(),fr="undefined"!=typeof window,hr=new WeakMap,vr=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=>Xo.eq(g(t),e)));o||(o={value:e,label:Array.isArray(e)?e.join(", "):e,isPlaceholder:!1,noOptionFound:!0}),n.push(o)}return n},mr=new WeakSet,gr=new WeakMap,$r=new WeakMap,yr=new WeakMap,br=new WeakSet,wr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},xr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},kr={overflow:"hidden",height:"100%"},_r={},Sr={};let Lr=0;const Mr={schema:Fn(Bn(Hn("$label"),Vn(Pn("prefix"),Nn(),Un(u("$inputStd.length === 0 && $state.loading !== true",qn('$placeholder || ""'),u("$multiple !== true",zn(u("$state.loading && $selections.length === 0",Gn("$ui.isLoading.value"),jn(Zn("$option.label")))),u('$multiple && $selectionAppearance === "truncate"',Jn(Qn(u("$state.loading && $selections.length === 0",Gn("$ui.isLoading.value"),tr()))),u('$multiple && $selectionAppearance === "tags"',sr(ar(u("$state.loading && $isLoadingOption !== true && $selections.length === 0",Gn("$ui.isLoading.value"),or(nr(u("$state.loading && $currentOptionsLoading.includes($option.value)",lr("$ui.isLoading.value"),rr("$option.label")),Xn(Pn("close"))))))))))),u("$truncationCount && $state.loading !== true",er("$truncationCount")),u("$state.loading",Pn("loader")),u("$inputStd.length !== 0 && $selectionRemovable",Xn(Pn("close")),Pn("select"))),ir(),Rn(),Pn("suffix"))),Wn("$help"),Kn(Yn("$message.value"))),type:"input",family:"dropdown",props:[],features:[Qo.defaultIcon("select","select"),Qo.defaultIcon("close","close"),Qo.defaultIcon("selected","check"),Qo.defaultIcon("loader","spinner"),Qo.localize("isLoading"),Qo.localize("loadMore"),Qo.options,W.bind(null,(function(e){e.props.applyLoadedOptions=x,void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=Xo.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=Xo.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&Xo.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)}))),!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)}))]},Dr=p("tg"),{outer:Ar,wrapper:Er,label:Or,prefix:Tr,suffix:Ir,help:Cr,messages:Fr,message:Br,icon:Vr}=d(Dr),Pr=Dr("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Hr=Dr("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Nr=Dr("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"}))),Rr=Dr("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"}}))),Wr=Dr("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"}}}))),Kr=Dr("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Yr=Dr("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Ur=Dr("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),zr={schema:Ar(Er(Nr(),Kr(Tr(),Pr(),Yr(Rr(),Ur(u("$slots.default","$slots.default",Vr("thumb")))),Ir()),Wr(),Hr()),Cr("$help"),Fr(Br("$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=Xo.undefine(e.props.disabled)),e.props.altLabelPosition=Xo.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=Xo.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=Xo.eq(t,e.props.onValue)}))}]},jr=p("rp"),{outer:qr,inner:Gr,prefix:Zr,suffix:Xr,help:Jr,messages:Qr,message:es,icon:ts}=d(jr),os=jr("empty",(()=>({$el:"div"}))),ns=jr("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),rs=jr("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ss=jr("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),as=jr("items",(()=>({$el:"ul",attrs:{role:"list"}}))),ls=jr("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),is=jr("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),ps=jr("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),ds=jr("content","div"),cs=jr("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),us=jr("legend",(()=>({$el:"legend",if:"$label"}))),fs=jr("group",(()=>({$formkit:"group",index:"$index"}))),hs=jr("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),vs=jr("remove",(()=>({$el:"li",if:"$removeControl"}))),ms=jr("insert",(()=>({$el:"li",if:"$insertControl"}))),gs=jr("up",(()=>({$el:"li",if:"$upControl"}))),$s=jr("down",(()=>({$el:"li",if:"$downControl"}))),ys=jr("controlLabel","span"),bs={schema:qr(cs(us("$label"),Jr("$help"),Gr(Zr(),u("$value.length === 0",u("$slots.empty",os()),u("$slots.default",as(ls(ds(fs("$slots.default")),hs(gs(ps(ys("$ui.moveUp.value"),ts("moveUp"))),vs(ss(ys("$ui.remove.value"),ts("remove"))),ms(ns(ys("$ui.add.value"),ts("add"))),$s(is(ys("$ui.moveDown.value"),ts("moveDown")))))),Xr()))),rs('$addLabel || ($ui.add.value + " " + ($label || ""))')),Qr(es("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){e._c.sync=!0,e.on("created",fe.bind(null,e))},Qo.localize("remove"),Qo.localize("add"),Qo.localize("moveUp"),Qo.localize("moveDown"),Qo.defaultIcon("remove","trash"),Qo.defaultIcon("add","add"),Qo.defaultIcon("moveUp","arrowUp"),Qo.defaultIcon("moveDown","arrowDown")]},ws="undefined"!=typeof window,xs=p("rt"),{outer:ks,wrapper:_s,inner:Ss,label:Ls,prefix:Ms,suffix:Ds,help:As,messages:Es,message:Os,icon:Ts}=d(xs),Is=xs("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"}}}))),Cs=xs("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Fs=xs("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"}}}))),Bs=xs("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"}}}))),Vs=xs("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Ps=xs("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Hs={schema:ks(_s(Ls("$label"),Ss(Ts("prefix"),Ms(),Cs(Fs(Vs(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),Ts("rating"))))),Bs(Ps(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),Ts("rating")))))),Is(),Ds(),Ts("suffix"))),As("$help"),Es(Os("$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=Xo.undefine(e.props.disabled)),e.on("created",(()=>{ws&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=ve.bind(null,e),e.context.handlers.ratingHoverOut=me.bind(null,e),e.context.handlers.handleClick=he.bind(null,e),ws&&Xo.whenAvailable(`${e.props.id}`,(()=>{$e(e),function(e){var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!o)return;const n=new ResizeObserver((()=>{$e(e)}));n.observe(o)}(e),setTimeout((()=>$e(e)),100)}),e.props.__root))})),e.on("input",(()=>ye(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),s=Number(e.props.max);return n>s?o(s):e.props.min&&n<=r?o(r):o(n)}))},Qo.defaultIcon("rating","star")]},Ns=p("ac"),{outer:Rs,wrapper:Ws,inner:Ks,icon:Ys,label:Us,prefix:zs,suffix:js,help:qs,messages:Gs,message:Zs}=d(Ns),Xs=Ns("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"}}))),Js=Ns("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"}}))),Qs=Ns("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"}}))),ea=Ns("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),ta=Ns("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),oa=Ns("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"}}))),na=Ns("optionLoading","span"),ra=Ns("option",(()=>({$el:"div",if:"$value !== undefined"}))),sa=f(Ns),aa=new WeakSet,la=new WeakMap,ia=new WeakMap,pa="undefined"!=typeof window,da=new WeakMap;let ca=!1;const ua={schema:Rs(Ws(Us("$label"),Ks(Ys("prefix"),zs(),Xs(),u("$multiple !== true && $selectionAppearance === option && $expanded === false",ta(Qs(ea(ra(u("$state.loading",na("$ui.isLoading.value"),"$option.label"))),u("$state.loading && $isSingleOption !== true && $currentOptionsLoading.includes($option.value)",Ys("loader")),u("$selectionRemovable && $isSingleOption",oa(Ys("close")))))),u("$state.loading && ($isSingleOption !== true || $selections.length === 0)",Ys("loader")),u('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',oa(Ys("close")),u('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',Js(Ys("select")))),u("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $currentOptionsLoading.length > 0)",Js(Ys("select"))),sa(),js(),Ys("suffix")),u("$multiple && $selectionAppearance === option",ta(Qs(ea(ra(u("$state.loading && $isLoadingOption",na("$ui.isLoading.value"),"$option.label"))),oa(Ys("close")))))),qs("$help"),Gs(Zs("$message.value"))),type:"input",family:"dropdown",props:[],features:[Qo.defaultIcon("select","select"),Qo.defaultIcon("close","close"),Qo.defaultIcon("selected","check"),Qo.defaultIcon("loader","spinner"),Qo.localize("isLoading"),Qo.localize("loadMore"),Qo.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=Xo.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=Xo.undefine(e.props.selectionRemovable),e.props.applyLoadedOptions=k,e.props.openOnClick=Xo.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=Xo.undefine(e.props.allowNewValues)}),be,(function(e){e.props.multiple?e.props.multiple&&"option"===e.props.selectionAppearance?(Ee(e),e.props.disabledDragAndDrop||pe(e)):e.props.multiple&&"text-input"===e.props.selectionAppearance&&Le(e):Oe(e)}))]},fa=p("dp"),{outer:ha,wrapper:va,inner:ma,icon:ga,label:$a,prefix:ya,suffix:ba,help:wa,messages:xa,message:ka}=d(fa),_a=fa("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"}}))),Sa=fa("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"}}))),La=fa("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ma=fa("nextLabel","span"),Da=fa("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Aa=fa("prevLabel","span"),Ea=fa("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Oa=fa("calendarWeeks",(()=>({$el:"tbody"}))),Ta=fa("calendarHeader",(()=>({$el:"thead"}))),Ia=fa("weekDays",(()=>({$el:"tr"}))),Ca=fa("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Fa=fa("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Ba=fa("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")'}}))),Va=fa("day","div"),Pa=fa("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'}}))),Ha=fa("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Na=fa("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)"}}))),Ra=fa("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Wa=fa("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)"}}))),Ka=fa("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Ya=fa("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Ua=fa("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),za=fa("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),ja=fa("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),qa=fa("yearButton",(()=>({$el:"button",attrs:{id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Ga=fa("monthButton",(()=>({$el:"button",attrs:{id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Za=fa("dayButton",(()=>({$el:"button",attrs:{id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Xa=fa("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Ja=fa("time",(()=>({$el:"div",if:'$panel === "time"'}))),Qa=fa("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),el=fa("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:tl,overlayLiteral:ol,overlayChar:nl,overlayEnum:rl,overlay:sl,overlayParts:al,overlayInner:ll}=c(fa),il=fa("panel","div"),pl=new WeakMap,dl=new WeakMap,cl=new WeakSet,ul=new WeakMap,fl=new WeakMap,hl=new WeakSet,vl=new WeakMap,ml=/[\uD800-\uDBFF]/,gl=new WeakMap,$l=new WeakMap,yl=new WeakMap,bl=new WeakMap,wl=new WeakMap,xl=new WeakSet,kl=new WeakMap,_l=new WeakMap,Sl=new WeakMap,Ll=new WeakMap;let Ml=!1;const Dl=()=>{Ml=!0,setTimeout((()=>{Ml=!1}),500)},Al={"#":{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"}},El=new WeakMap,Ol="undefined"!=typeof window;let Tl=!1;Ol&&document.addEventListener("selectionchange",(()=>{const e=a();if(!(e instanceof HTMLInputElement))return;if(Ll.has(e))return function(e){const t=Ll.get(e);if(t){const[o,n]=t,[r,s]=vt(e),a=s.indexOf(o);if(-1===a)return void Ll.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];Ke(Ye(e),i)||Ze(e,i)}}(e);if("select"!==vl.get(e))return;const t=Ye(e);if(!Ke(t,El.get(e))){if(El.set(e,t),cl.has(e))return cl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:Ye(e)}))}}));const Il="1999-03-04T02:05:01.000Z",Cl=new Map,Fl=[["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"}]],Bl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Vl=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Pl={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Hl=["MMMM","MMM","dddd","ddd"],Nl=new Map([...Fl,...Bl,...Vl].map((e=>[e[0],e]))),Rl=new Map,Wl=["full","long","medium","short"],Kl=/^([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})?$/,Yl=e=>String(e).padStart(2,"0"),Ul=e=>String(e).padStart(2,"0"),zl="undefined"!=typeof window,jl=new WeakSet,ql=new WeakSet,Gl=new WeakSet,Zl=new WeakMap,Xl=new WeakMap,Jl=new WeakSet,Ql=new WeakSet,ei="undefined"!=typeof window,ti=new WeakMap,oi={schema:ha(va($a("$label"),ma(ga("prefix"),ya(),sl(ll(al(tl("$part.value"),ol("$part.value"),nl("$part.value"),rl("$part.value")))),_a(),Sa(Ka(Da(Aa("$ui.prev.value"),ga("prev")),Ya("$decade"),Ua(qa()),za(Ga(),qa()),ja(Ga(),Za(),qa()),La(Ma("$ui.next.value"),ga("next")),el(ga("close"))),il(Ha(Na("$fns.format($year, $yearFormat)")),Ra(Wa("$fns.format($month, $monthFormat)")),Ea(Ta(Ia(Ca("$fns.format($day, $weekdayFormat)"))),Oa(Fa(Ba(Va("$fns.format($day, $dateFormat)"))))),Ja(Qa()))),Xa(ga("clear")),Pa(ga("calendar")),ba(),ga("suffix"))),wa("$help"),xa(ka("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[go,function(e){var t,o,r,s,a,l,i,p,d,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=Zt(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=lo(e),e.props.pickerOnly=Xo.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=Xo.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=Xo.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):ho.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=At(t);else if("string"==typeof t)try{o=At(qt(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${Wt(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?Zt(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?qt(e.props.minDate):e.props.minDate;e.props.minDate=eo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?qt(e.props.maxDate):e.props.maxDate;e.props.maxDate=eo(t,e.props.offset)}o=o&&eo(o,e.props.offset),o&&io(e,o,!1);let n=o||new Date;n=e.props.minDate>n?e.props.minDate:n,e.props.renderedDate=n,e.props.activeDate=n,e.props.localTime=o&&Yt(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=Yt,e.on("created",(()=>{if(Xo.whenAvailable(`${e.props.id}`,co.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>Yt(t,o,e.props.locale||"en",!1,oo),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!to(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!to(t,(t=>!e.props._isDisabled(t)),"year"),e.context.fns.isSelected=t=>{var o;const n=null===(o=e.context)||void 0===o?void 0:o.value;if(null==n)return;return Vt(t,eo(n instanceof Date?n:qt(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=Zl.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!ql.has(e)&&(Gl.add(e),e.props.expanded=!0,setTimeout((()=>Gl.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;io(e,void 0,!0),ao(e,void 0);const n=null===(o=null===(t=e.props)||void 0===t?void 0:t.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},e.context.handlers.dateInput=t=>{var o;if(Jl.has(e))return Jl.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=qt({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:oo});if(function(e){return Rt(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!Ll.get(t.target)&&Yt(n,e.props.format,e.props.locale,!1,oo)!==t.target.value){const r=jt("dddd",e.props.locale),s=Rt(e.props.format,e.props.locale),a=null===(o=zt(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=Yt(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=Ct(n,t),jl.add(e)}}io(e,n)}catch(t){io(e,void 0)}},e.context.handlers.open=()=>{e.props.expanded=!0},e.context.handlers.next=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Bt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=Ft(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=Bt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=Ft(e.props.renderedDate,-1))}},e.context.handlers.setDate=t=>()=>{var o;"month"!==e.props.panel&&"year"!==e.props.panel||!e.props.activeDate||(t=e.props.activeDate),(null===(o=e.context)||void 0===o?void 0:o.fns.isDisabled(t))||e.emit("dateSelected",t)},e.context.handlers.localTime=t=>{const o=t.target;if(!o.value)return;const[n,r]=o.value.split(":");e.props.localTime=o.value,e.props.activeDate.setHours(n,r),ao(e,e.props.activeDate)},e.context.handlers.keyDown=t=>{switch(e.props.panel){case"day":return e.emit("calendarKeydown",t);case"year":return e.emit("yearKeydown",t);case"month":return e.emit("monthKeydown",t);case"time":return e.emit("timeKeydown",t);default:return}},e.context.handlers.inputKeydown=t=>{e.emit("keydown",t)},e.context.handlers.openKeydown=t=>{"Enter"!==t.key&&"Space"!==t.key||(e.props.expanded=!0)},e.context.handlers.mouseEnter=o=>n=>{clearTimeout(t),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===e.props.panel||"year"===e.props.panel?e.props.activeDate=to(o,(t=>!e.props._isDisabled(t)),e.props.panel):e.props.activeDate=o)},e.context.handlers.mouseLeave=()=>{clearTimeout(t),t=setTimeout((()=>{}),100)},e.context.handlers.jumpTo=t=>()=>{e.props.panels.unshift(e.props.panel),e.props.panel=t},e.context.fns.sameDay=t=>{var o;return(null===(o=e.context)||void 0===o?void 0:o.activeDate)instanceof Date&&Vt(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=At(e);return t.setHours(0,0,0),t}(t).getTime();return o<Et(e).getTime()||o>Ot(e).getTime()||void 0}}}));const _=so.bind(null,e);e.on("prop:panel",(({payload:t})=>{e.props.showPagination=e.props.paginatedPanels.includes(t)})),e.on("dateSelected",(({payload:t})=>{var o,n;t&&e.props._isDisabled(t)||(Array.isArray(e.props.panels)&&e.props.panels.length?e.props.panel=e.props.panels.shift():(e.props.expanded=!1,null===(n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`))||void 0===n||n.focus()),io(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void ao(e,void 0);const o=new Date,n=t?ao(e,eo("string"==typeof t?qt(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=Yt(n,"HH:mm"),function(e){const t=Xl.get(e);if(e._value&&t){const o=Tt(e.props.activeDate);if(t.length>o)t.splice(o,t.length-o);else if(t.length<o)for(let e=t.length+1;e<=o;e++)t.push(String(e))}}(e)})),e.on("prop:renderedDate",ro.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Ql.delete(e),e.props.panels=lo(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=to(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}ro(e),Xo.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){Jl.add(e);const t="string"==typeof e._value?qt(e._value,e.props.valueFormat,e.props.valueLocale):e._value;ao(e,eo(t,e.props.offset))}else ao(e,void 0);zl&&(ql.add(e),document.removeEventListener("click",_),setTimeout((()=>ql.delete(e)),50))}})),e.on("prop:activeDate",(({payload:t})=>{if(Array.isArray(e.props.calendar)&&e.props.calendar.length)if("day"===e.props.panel){const o=e.props.calendar,n=Et(e.props.renderedDate),r=Ot(Ft(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=Ft(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=Ft(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=Bt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=Bt(e.props.renderedDate,-10))}e.props.expanded&&ao(e,e.props.activeDate)})),e.on("keydown",(({payload:t})=>{switch(t.key){case"ArrowDown":case"ArrowUp":case" ":t.preventDefault(),e.props.pickerOnly&&(e.props.expanded=!0);break;case"Enter":case"Return":e.props.expanded||(e.props.expanded=!0);break;case"Escape":e.props.expanded=!1}})),e.on("calendarKeydown",(({payload:t})=>{t.preventDefault();let o=null,r=0;switch(t.key){case"ArrowRight":r=1;break;case"ArrowLeft":r=-1;break;case"ArrowDown":r=7;break;case"ArrowUp":r=-7;break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Tab":t.shiftKey||po(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Ct(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=Ct(o,t);return!e.props._isDisabled(n)&&(e.props.activeDate=n,!0)}))}})),e.on("yearKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=5;break;case"ArrowRight":o=1;break;case"ArrowUp":o=-5;break;case"ArrowLeft":o=-1;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}const n=e.props.activeDate.getFullYear()+o-e.props.renderedDate.getFullYear();e.props.activeDate=Bt(e.props.renderedDate,n)})),e.on("monthKeydown",(({payload:t})=>{let o=0;switch(t.key){case"ArrowDown":o=3;break;case"ArrowRight":o=1;break;case"ArrowLeft":o=-1;break;case"ArrowUp":o=-3;break;case"Tab":t.shiftKey||po(e,t);break;case"Return":case"Enter":e.emit("dateSelected",e.props.activeDate);break;case"Escape":e.props.expanded=!1}o&&t.preventDefault();let n=(e.props.activeDate.getMonth()+o)%12;n=n<0?12+n:n;const r=n-e.props.renderedDate.getMonth();let s=Ft(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=to(s,(t=>!e.props._isDisabled(t)),"month");t&&(s=t)}e.props.activeDate=s})),e.on("timeKeydown",(({payload:t})=>{switch(t.key){case"Return":case"Enter":t.preventDefault(),e.emit("dateSelected",e.props.activeDate)}})),e.on("prop:_isFocused",(()=>{Zl.get(e)&&uo(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=Jo.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:vo(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},Qo.localize("next"),Qo.localize("prev"),Qo.localize("changeDate"),Qo.localize("chooseDate"),Qo.defaultIcon("close","close"),Qo.defaultIcon("next","right"),Qo.defaultIcon("clear","close"),Qo.defaultIcon("prev","left"),Qo.defaultIcon("calendar","date")]},ni=p("tl"),{outer:ri,wrapper:si,inner:ai,icon:li,label:ii,prefix:pi,suffix:di,help:ci,messages:ui,message:fi}=d(ni),hi=ni("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"}}))),vi=ni("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'}}))),mi=ni("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"}}))),gi=ni("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),$i=ni("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"}}))),yi=ni("tagLabel",(()=>({$el:"span"}))),bi=ni("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),wi=ni("tagLoading","span"),xi=f(ni),ki={schema:ri(si(ii("$label"),ai(li("prefix"),pi(),bi(mi(gi(u("$state.loading && $currentOptionsLoading.includes($option.value)",wi("$ui.isLoading.value"),yi("$option.label")),$i(li("close")))),hi()),u("$state.loading",li("loader")),vi(li("select")),xi(),di(),li("suffix"))),ci("$help"),ui(fi("$message.value"))),type:"input",family:"dropdown",props:[],features:[Qo.options,W.bind(null,(function(e){e.props.multiple=!0,e.props.applyLoadedOptions=k,e.props.openOnClick=Xo.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=Xo.undefine(e.props.allowNewValues)}),be,(function(e){Ee(e),e.props.disableDragAndDrop||pe(e)})),Qo.defaultIcon("select","select"),Qo.defaultIcon("close","close"),Qo.defaultIcon("selected","check"),Qo.defaultIcon("loader","spinner"),Qo.localize("isLoading"),Qo.localize("loadMore")]},_i=p("mk"),{outer:Si,wrapper:Li,inner:Mi,label:Di,prefix:Ai,suffix:Ei,help:Oi,messages:Ti,message:Ii,icon:Ci}=d(_i),{overlayPlaceholder:Fi,overlayLiteral:Bi,overlayChar:Vi,overlayEnum:Pi,overlay:Hi,overlayParts:Ni,overlayInner:Ri}=c(_i),Wi=_i("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",value:"$_maskValue",id:"$id","aria-describedby":"$describedBy"}}))),Ki=new WeakMap,Yi=new WeakMap,Ui=new WeakMap,zi={schema:Si(Li(Di("$label"),Mi(Ci("prefix"),Ai(),Hi(Ri(Ni(Fi("$part.value"),Bi("$part.value"),Vi("$part.value"),Pi("$part.value")))),Wi(),Ei(),Ci("suffix"))),Oi("$help"),Ti(Ii("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[go,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,a;const l=Be("string"==typeof e._value?e._value:"");Yi.set(e,l),Ui.set(e,l),e.props.allowIncomplete=Xo.undefine(e.props.allowIncomplete),e.props.overlay=Xo.undefine(e.props.overlay);const i=!(void 0!==e.props.showMask&&!Xo.undefine(e.props.showMask));e.props.unmaskValue=Xo.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=Xo.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:Xo.undefine(e.props.reverse)};Ki.set(e,p),e.hook.input(((t,o)=>{const n=function(e,t){const o=Yi.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Ui.get(e);r.value=ze(r,t);const a=Fe(r,Ki.get(e)),l=St(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=l?l:"":null===l?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||a===e.props._maskValue||(o.value=a,e.props._maskValue=a,e.props._overlayParts=s(Lt(r)||[]));return null===l?"":e.props.unmaskValue?l:a}(e,t);return o(n)})),e.props._maskValue=Fe(l,p),e.input(e.props._maskValue,!1),Xo.whenAvailable(`${e.props.id}`,$o.bind(null,e),e.props.__root)}))}]},ji=p("tf"),{outer:qi,wrapper:Gi,inner:Zi,icon:Xi,prefix:Ji,suffix:Qi,help:ep,messages:tp,message:op}=d(ji),np=ji("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),rp=ji("legend",(()=>({if:"$label",$el:"legend"}))),sp=ji("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),ap=ji("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),lp=ji("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),ip=ji("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()"}))),pp=ji("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),dp=ji("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)"}))),cp=ji("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),up=ji("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),fp=ji("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'}}))),hp=ji("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'}}))),vp=ji("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"}}))),mp=ji("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'}}))),gp=ji("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$selections && $selections.length > 0 && $fns.isSelected($option)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),$p=ji("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'}}))),yp=ji("loadMoreInner","span"),bp=ji("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),wp=ji("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),xp=ji("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"}}))),kp=ji("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'}}))),_p=ji("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index',class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Sp=ji("targetLoadMore",(()=>({$el:"li",if:"$targetLoading && $state.loading",attrs:{id:'$id + "_target_load_more"',key:"loadMore","aria-selected":"false",class:'$classes.transferlistLoadMore + " " + $classes.targetLoadMore'}}))),Lp=ji("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Mp=ji("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'}}))),Dp=ji("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'}}))),Ap=ji("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'}}))),Ep=ji("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'}}))),Op=ji("controlLabel","span"),Tp=ji("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Ip=ji("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Cp=ji("emptyMessageInner","span"),Fp=new WeakMap,Bp=new WeakMap,Vp=new WeakMap,Pp=new WeakMap,Hp=new WeakMap,Np=new WeakSet,Rp=new WeakMap,Wp=new WeakMap,Kp="undefined"!=typeof window;let Yp=null,Up=[],zp=!1,jp=!1;Kp&&(document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("dragend",(()=>{jp?jp=!1:function(){if(Lo(Yp)&&Mo(Yp.parentNode)){const e=Rp.get(Yp);Yp.parentNode.dispatchEvent(new CustomEvent("dndDrop",{detail:e}))}To()}()})));const qp=new WeakMap,Gp=new WeakSet,Zp=new WeakSet,Xp=new WeakMap,Jp=new WeakMap,Qp="undefined"!=typeof window,ed=new WeakMap,td=Jo.createMessage({key:"loading",type:"state",value:!0,visible:!1}),od=Jo.createMessage({key:"loading",type:"state",value:!1,visible:!1}),nd=Symbol(),rd={schema:qi(np(rp("$label"),ep("$help"),Gi(sp(ap(lp(),ip()),cp(up(fp(),hp(Xi("close")))),vp(Tp(Cp("$sourceEmptyMessage")),mp(u("$transferOnSelect !== true && $fns.isSelected($option)",Xi("selected")),gp("$option.label")),$p(yp(u("$targetLoading !== true && $state.loading",Xi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))),Lp(Dp(Op("$ui.addAllValues.value"),Xi("fastForward")),Mp(Op("$ui.addSelectedValues.value"),Xi("moveRight")),Ap(Op("$ui.removeSelectedValues.value"),Xi("moveLeft")),Ep(Op("$ui.removeAllValues.value"),Xi("rewind"))),bp(wp(pp(),dp()),xp(Ip(u("$state.loading !== true",Cp("$targetEmptyMessage"))),kp(u("$transferOnSelect !== true && $fns.isSelected($option)",Xi("selected")),_p("$option.label")),Sp(yp(u("$targetLoading && $state.loading",Xi("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),tp(op("$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=>Xo.eq(Co(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=>Xo.eq(t,Co(e))));if(o)e.push(o);else{const o=e=>"string"==typeof e?{label:e,value:t}:r(e)?e:Xo.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=>Co(e)===Co(t))),n=p.findIndex((t=>Co(t)===Co(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=>Co(e)));if(i.includes(Co(t))){const o=e.props.selections.findIndex((e=>Co(e)===Co(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=>Co(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=>Co(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=>Co(e))),o=e.value.filter((e=>!t.includes(e)));if(e.props.forceUpdate=!0,e.input(o),e.props.optionsLoader){const t=[...e.props.options];e.props.options=[...t]}e.props.selections=[]}}function i(t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Gp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Zp.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Gp.add(e),e.props.mouseOnTarget&&Zp.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)?Co(s):void 0,!0}return!1};do{if(null!==n&&s(n,t[n]))break;if(null!==r&&s(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}else d(e);e.props.mouseOnSource||e.props.mouseOnTarget?(l&&!(null===(r=e.store.loading)||void 0===r?void 0:r.value)&&(null===(s=e.store.hasNextPage)||void 0===s?void 0:s.value)&&l.scrollTop+l.offsetHeight>l.scrollHeight-200&&e.props.mouseOnSource&&(e.props.allowAppendOptions=!0,null===(a=e.context)||void 0===a||a.handlers.loadMore(!1)),e.props.mouseOnSource&&Gp.has(e)||e.props.mouseOnTarget&&Zp.has(e)?requestAnimationFrame(p.bind(null,e,t,o,n)):i(n)):(Gp.delete(e),Zp.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=Io.bind(null,e),e.props.applyLoadedOptions=function(e,o,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t,o){const n=Qo.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=Co(r))}(e,o,n);const r=Qo.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(od),e.store.set(Jo.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),t(e),ed.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=Xo.undefine(e.props.disabled)),e.props.searchable=Xo.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=>Co(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?Vo(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=>Co(e))).filter((t=>!e.props.targetOptionValues.includes(t)))}function r(e){return Qp&&p(e)}function i(e){return Qp&&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=Fo.bind(null,e),e.context.fns.isActive=t=>Xo.eq(e.props.activeValue,Co(t))||void 0,e.context.fns.optionValue=Co,e.context.fns.isSelected=t=>e.props.selections.map((e=>Co(e))).includes(Co(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(Co(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=>Co(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(Xp.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Xp.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(Co(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(Co(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(Co(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(nd);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=>Co(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(Co(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&n.push(nd);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=>Co(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(Co(t))&&!(null===(o=t.attrs)||void 0===o?void 0:o.disabled)})),o=t[0];o&&(e.props.activeValue=Co(o))},e.context.handlers.targetFocused=()=>{const t=e.props.targetOptions[0];t&&(e.props.activeValue=Co(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},Qp){Xo.whenAvailable(e.props.id+"_source_list_items",(n=>{Xo.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=>{Xo.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})),xo(n,o.bind(null,e),{accepts:[s],dropBehavior:"append",childIsDraggable:u,isDisabled:f.bind(null,e)},r.bind(null,e)),xo(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===Jp.get(e)&&void 0!==Jp.get(e))return;if(Jp.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:Xo.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(td),Bo(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=>Xo.eq(Co(e),t))))})),e.props.loadingCounter){e.props.isLoadingOption=!0;const t=e.on("prop:loadingCounter",(()=>{e.props.loadingCounter||(e.props.isLoadingOption=!1,Bo(e,o(e)),e.off(t))}))}else Bo(e,o(e));return}const n=o(e);if(!Qp||n||void 0===t||e.props.options&&e.props.options.length||"function"!=typeof e.props.optionsLoader)Bo(e,n);else{const t=Vo(e);Bo(e),t.then((()=>{Bo(e,o(e))}))}})),e.on("prop:options",(({payload:t})=>{e.props.sourceOptions=[...t].filter((t=>!e.props.targetOptionValues.includes(Co(t)))),Bo(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,Vo(e)))})),e.on("prop:activeValue",(({payload:t})=>{if(t===nd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=e.props.options.findIndex((e=>Xo.eq(Co(e),t)));if(o>=0)e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`;else{const o=e.props.targetOptions.findIndex((e=>Xo.eq(Co(e),t)));if(!o)return void(e.props.activeDescendant=void 0);e.props.activeDescendant=o}})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,Gp.delete(e),i(t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,Zp.delete(e),i(t)}})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(od)})),e.on("prop:loadingCounter",(({payload:t})=>{0===t&&e.store.set(od)}))},Qo.options,Qo.defaultIcon("moveRight","right"),Qo.defaultIcon("moveLeft","left"),Qo.defaultIcon("fastForward","fastForward"),Qo.defaultIcon("rewind","rewind"),Qo.defaultIcon("close","close"),Qo.defaultIcon("loader","spinner"),Qo.defaultIcon("selected","check"),Qo.localize("isLoading"),Qo.localize("loadMore"),Qo.localize("addAllValues"),Qo.localize("addSelectedValues"),Qo.localize("removeSelectedValues"),Qo.localize("removeAllValues")]},sd=p("sl"),{outer:ad,wrapper:ld,inner:id,icon:pd,label:dd,prefix:cd,suffix:ud,help:fd,messages:hd,message:vd}=d(sd),md=sd("chart",(()=>({$el:"div",if:"$chart"}))),gd=sd("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 + "%"'}}}}))),$d=sd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),yd=sd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),bd=sd("trackWrapper",(()=>({$el:"div"}))),wd=sd("trackInner",(()=>({$el:"div"}))),xd=sd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),kd=sd("linkedValues",(()=>({$el:"div"}))),_d=sd("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"}))),Sd=sd("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"}))),Ld=sd("marks",(()=>({$el:"div",if:"$marks"}))),Md=sd("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) + "%"'}}}))),Dd=sd("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Ad=sd("handles",(()=>({$el:"ul"}))),Ed=sd("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"}}))),Od=sd("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"}}))),Td=sd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Id=sd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Cd=sd("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"}}))),Fd=sd("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"}}))),Bd={schema:ad(ld(dd("$label"),fd("$help"),$d(pd("prefix"),cd(),yd(md(gd()),bd(wd(xd(),Ld(Md(Dd())),Ad(Od(Fd(),Td()),Ed(Cd(),Id()))))),ud(),pd("suffix"),u("$showInput && $isMulti === false",_d())),u("$showInput && $isMulti",kd(Sd(),_d())),hd(vd("$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=Xo.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;Xo.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=Xo.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":v;const m=Xo.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=Xo.undefine(e.props.markLabels),e.props.snapToMarks=Xo.undefine(e.props.snapToMarks),e.props.showInput=Xo.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,Xo.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(Xo.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(Xo.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)}))}]},Vd=p("cp"),{outer:Pd,wrapper:Hd,inner:Nd,label:Rd,prefix:Wd,suffix:Kd,help:Yd,messages:Ud,message:zd,icon:jd}=d(Vd),qd=Vd("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'}}))),Gd=Vd("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:""}}}}))),Zd=Vd("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"}}}}))),Xd=Vd("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"}}))),Jd=Vd("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Qd=Vd("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),ec=Vd("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),tc=Vd("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 + "%"'}}))),oc=Vd("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),nc=Vd("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),rc=Vd("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"}}))),sc=Vd("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),ac=Vd("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),lc=Vd("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"}}))),ic=Vd("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),pc=Vd("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),dc=Vd("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"}}]}))),cc=Vd("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),uc=Vd("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),fc=Vd("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),hc=Vd("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"}}]}))),vc=Vd("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"}}]}))),mc=Vd("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"}}]}))),gc=Vd("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"}}]}))),$c=Vd("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"}}]}))),yc=Vd("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"}}]}))),bc=Vd("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"}}]}))),wc=Vd("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"}}]}))),xc=Vd("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"}}))),kc=Vd("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),_c=Vd("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"}}}}))),Sc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Lc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Mc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},Dc={schema:Pd(Hd(Rd("$label"),u("$inline && $help",Yd("$help")),Nd(u("($inline === undefined || $inline === false) && $prefixIcon !== undefined",jd("prefix","label")),u("$inline === undefined || $inline === false",Wd()),u("$inline === undefined || $inline === false",qd(dc(),u("$showValue",Gd()))),u("$inline || $panelIsOpen)",Zd(u("$showPanelClose && ($inline === undefined || $inline === false)",Xd(jd("close"))),u("$panelControls",Jd(Qd(ec(),tc()),ic(pc()),oc(nc(),rc()),sc(ac(),lc()),u("$eyeDropper && $hasNativeEyeDropper",cc(jd("eyeDropper"))))),u("$panelFormat",uc(fc(u('$panelActiveFormat === "hex"',hc()),u('$panelActiveFormat === "rgba"',vc()),u('$panelActiveFormat === "rgba"',mc()),u('$panelActiveFormat === "rgba"',gc()),u('$panelActiveFormat === "hsla"',yc()),u('$panelActiveFormat === "hsla"',bc()),u('$panelActiveFormat === "hsla"',wc()),u('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',$c())),xc(jd("switch")))),u("$options",kc(_c())))),u("$inline === undefined || $inline === false",Kd()),u("($inline === undefined || $inline === false) && $suffixIcon !== undefined",jd("suffix"))),u("$: ($inline === undefined || $inline === false) && $help",Yd("$help"))),Ud(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&&!Uo(n)&&!Sc.test(n)&&!Lc.test(n))return;(Uo(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){if(!t)return;const o=zo(t);if(o){const[n,r,s,a]=o;"undefined"!==t&&("number"!=typeof n||isNaN(n)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Po(n,2)===e.props.h&&Po(r,2)===e.props.s&&Po(s,2)===e.props.v&&Po(a,2)===e.props.alpha)||(e.props.alpha=Po(a,2),w(n,r,s))}else{const o=null==E?void 0:E.find((e=>{var o;return(null===(o=e.dataset.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(o&&o.dataset.color){const[t,n,r,s]=jo(o.dataset.color);e.props.alpha=Po(s,2),w(t,n,r)}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),Xo.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]=Ho(t.sRGBHex);e.props.alpha=1,w(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),I,v),l("canvas-hue",(e=>{L=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=Mc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),k=Mc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){Xo.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(){Xo.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(!L)return;const e=L.getContext("2d");if(!e)return;const t=L.width,o=L.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]=jo(o),[l,i,p,d]=No(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,S,((t,o)=>{const n=t/S.width*100,r=100-o/S.height*100;V(e.props.hue,n,r)}))}function m(t){h(t,L,((t,o)=>{if(!L)return;const n=L.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`${Po(0===o||100===o&&0===t?0:e,0)}-${Po(r,0)}-${Po(o,0)}-${Po(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:Po(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:Po(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:Po(Math.max(Math.min(n,100),0),2);const{h:r,s:s,v:a,alpha:l}=e.props,[i,p,d]=No(r,s,a),[c,u,f]=Wo(r,s,a),h=e.props.hexInputFocused?e.props.hex:Yo(r,s,a,l),v=Po(l,2);e.props.hsla={h:r,s:p,l:d,a:v},e.props.hslaPercent={h:Po(r,0),s:100===a&&0===s?0:Po(0===a?p/255:Math.max(Math.min(p/255*100,100),0),0),l:Po(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}, ${Po(0===a?p/255:p/255*100,2)}%, ${Po(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,S=null,L=null,M=null,D=null,A=null,E=null,O=0;const T=["hex","rgba","hsla"],I=qo((function(){if(!S)return;const t=S.getContext("2d");if(!t)return;const{width:o,height:n}=S,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=qo((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:r,g:s,b:a}=e.props.rgba,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=qo(c,2),B=qo(u,2),V=qo(w,2),P=qo(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||0,e.props.s=e.props.s||0,e.props.v=e.props.v||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=Go(e.props.panelControls),e.props.eyeDropper=Go(e.props.eyeDropper),e.props.panelFormat=Go(e.props.panelFormat),e.props.showValue=Go(e.props.showValue),e.props.allowPaste=Go(e.props.allowPaste),e.props.inline=Xo.undefine(e.props.inline),e.props.disabled=Xo.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=Xo.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=zo(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),`${Po(n,t)}-${Po(r,t)}-${Po(s,t)}-${Po(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(Zo),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=Po(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=Po(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=Po(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=Po(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,Uo(r)){const[t,o,n,s]=Ho(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(!Uo(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;Uo(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]=Ro(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]=Ko(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]=jo(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"}})}))},Qo.options,Qo.defaultIcon("eyeDropper","color"),Qo.defaultIcon("close","close"),Qo.localize("close"),Qo.localize("next")]};var Ac=Object.freeze({__proto__:null,dropdown:Mr,toggle:zr,repeater:bs,rating:Hs,autocomplete:ua,datepicker:oi,taglist:ki,mask:zi,transferlist:rd,slider:Bd,colorpicker:Dc});const Ec="undefined"!=typeof window?setInterval:()=>0,Oc=new WeakSet;exports.$if=u,exports.autocomplete=ua,exports.colorpicker=Dc,exports.createBaseSections=d,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Oc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:fn(13919),children:`${fn(451228594)}${fn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){$n[e]?$n[e].add(t):$n[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(!an.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];Oc.add(o),o.define({...r,schema:n(e)})}Ec((()=>gn.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=oi,exports.dropdown=Mr,exports.inputs=Ac,exports.mask=zi,exports.rating=Hs,exports.repeater=bs,exports.slider=Bd,exports.taglist=ki,exports.toggle=zr,exports.transferlist=rd;