@formkit/pro 0.123.6 → 0.124.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/autocomplete/index.mjs +1 -1
- package/currency/currency.ts +49 -0
- package/currency/index.mjs +1 -0
- package/dropdown/index.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/rating/index.mjs +1 -1
- package/taglist/index.mjs +1 -1
- package/taglist/taglist.ts +1 -1
- package/unit/index.mjs +1 -1
package/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,o){e in Jn||(Jn[e]={timer:0,inputs:new Set});const n=Jn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=jn((()=>{qn[e]||(qn[e]=jn((()=>er.add(e)),2e3)),function(e){if(Un){window.addEventListener(Wn(),(o=>{const n=new URL(o.blockedURI).hostname;Zn.some(((e,t)=>Xn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=Gn(Hn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(Jn[e].inputs),i=l.filter((t=>!(Qn[e]&&Qn[e].has(t)))).join("");if(zn(e),i){o++;try{const a=await window[Gn(Rn)](`${n}${r}${Xn((s+o)%Zn.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[Gn(Nn)])return t(e,p.schema);if(a.ok)return Qn[e]||(Qn[e]=new Set),void l.forEach((t=>Qn[e].add(t)))}catch(e){}o<2&&jn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){er.add(e),function(e,t){tr[e]&&tr[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return er.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e,t,n,r){return(...a)=>l=>i=>{const p=function(e,t,n,r,a,l){const i=l[n],p="function"==typeof r?r():{$el:r},d=a.map((e=>"string"==typeof e?e:e(t)(l)));let c=d.length&&p?Sn(p,{children:d}):p;if(c=Sn(c,i),"object"==typeof c){let a=c;if(!gn(c)&&!$n(c)||c.meta||(c.meta={section:n,node:r}),gn(c)){const{$el:r,...l}=c;l.attrs?"class"in l.attrs||"if"in l.attrs||(l.attrs={class:`$classes.${n}`,...l.attrs}):l.attrs={class:`$classes.${n}`},a=s(t,n,Object.defineProperty(l,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if($n(c)){const{$cmp:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return a}return s(t,n,c)}(e,l,t,n,a,i);return r&&dn(p)&&(p.memo=e+JSON.stringify(i)),r?[p]:p}}function s(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 a(e){return(t,o,n=!1)=>r(e,t,o,n)}function l(e){return{outer:e("outer",or,!0),wrapper:e("wrapper","div",!1),inner:e("inner",nr,!1),icon:pr,label:e("label",rr,!1),prefix:e("prefix",ir,!1),suffix:e("suffix",ir,!1),help:e("help",lr,!1),messages:e("messages",sr,!1),message:e("message",ar,!1)}}function i(e){return{overlayPlaceholder:e("overlayPlaceholder",dr),overlayLiteral:e("overlayLiteral",cr),overlayChar:e("overlayChar",ur),overlayEnum:e("overlayEnum",fr),overlay:e("overlay",hr),overlayParts:e("overlayParts",mr),overlayInner:e("overlayInner",vr)}}function p(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)}:(_n(s)?Object.assign(s.else,{if:e}):kn(s)&&Object.assign(s,{if:e}),s)}}function d(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"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",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",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)"}}))),d=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),u=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),f=e("groupLabel","span"),h=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return t(o(a(l("$emptyMessage")),d(p("$option.group",u(f("$option.group"),h(c((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),v=n(p("$fns.isSelected($option)",pr("selected")),i("$option.label")),t=>{const o=o=>{const n=v(t)(o),r="function"==typeof e?e(t):e;return cn(r)?(_n(n)&&gn(n.else)?n.else.attrs={...n.else.attrs,...r}:gn(n)&&(n.attrs={...n.attrs,...r}),n):n};return o._s=v._s,o})))),n(p("$fns.isSelected($option)",pr("selected")),i("$option.label")))),r(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(p("$state.loading",pr("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,v}}function c(e){return dn(e)&&"value"in e&&"label"in e}function u(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 f(){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 h(e){return"__original"in e?e.__original:e.value}async function v(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(jr.get(e));const o=t?e.props.debounce:0;0===o?m(e,n):jr.set(e,setTimeout((()=>{e.props.page=1,m(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function m(e,t){e.props.allowAppendOptions=t,b(e)}function g(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=Ln(t);e.props.appendingOptions=!0,e.props.activeValue=h(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=Ln(t);e.props.options=o,e.props.options.length||(e.store.set(qr),e.store.set(bn({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Zr.set(e,e.props.searchValue)}function $(e,t,o){if(e.store.set(zr),e.props.optionLoadingCounter++,e.props.multiple&&"truncate"!==e.props.selectionAppearance){let o;o=un(t)?{label:"Loading...",value:String(t)}:{label:String(t),value:t},e.props.optionLoaderValues.includes(o.value)||e.props.optionLoaderValues.push(o.value),"transferlist"===e.props.type||e.props.selections.includes(o)||(e.props.selections=[...e.props.selections,o])}const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:c(e)?e:dn(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>{const o=e.props.memoOptions.findIndex((e=>fn(h(e),h(t))));return-1===o?e.props.memoOptions=[...e.props.memoOptions,t]:e.props.memoOptions[o]=t,t};return n instanceof Promise?n.then((e=>{if("string"==typeof e||c(e))return s(r(e))})).finally((()=>{e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--})):(e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--,s(r(n)))}function b(e){e.store.set(zr),e.props.optionsLoadingCounter++,e.store.set(bn({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Gr.get(e)),n=g.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function y(e,t){e.props.page++,Gr.set(e,t),e.store.set(bn({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function x(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!fn(h(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 w(e){const t=Jr(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:Un&&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 _(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=h(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>fn(h(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=h(e.props.allOptions[0]);else if(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=h(e.props.selections[e.props.selections.length-1]):e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=h(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function k(e){return e.reduce(((e,t)=>(t.options?e.push(...k(t.options)):e.push(t),e)),[])}function S(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(h(t)!==Xr?(e.props.option=t,e.props.maxReached&&!A(e,t)||(e.input(L(e,h(t))),A(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function L(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const n of o)if(fn(n,t))return e.props.optionRemoved=!0,o.filter((e=>!fn(e,t)));return[...o,t]}return fn(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function D(e,t){return fn(e.props.activeValue,h(t))||void 0}function A(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(fn(o,h(t)))return!0;return!1}return fn(e.value,h(t))}function C(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function I(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&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=b(e);t instanceof Promise&&t.then((()=>{w(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(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&w(e):(t=e.props.inputStd,async function(e){const t=Jr(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>fn(h(e),t))))):e.props.inputStd;if(o.forEach((o=>{$(e,o,Array.isArray(t)&&t.find((e=>fn(h(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{w(e),e.props.optionLoadingCounter||e.off(t)}))}else w(e)}(e))}))}function M(e){function t(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const n=new MutationObserver((n=>{const r=n[0].target;if("overscroll"===e.props.behavior&&r.id!==`${e.props.id}_popover`)return;const s=e.props.positionListBox(t);Qr.delete(e),o(e,s);let a,l=null;const i=new ResizeObserver((()=>{clearTimeout(a),a=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{i.disconnect(),e.off(l)})))}))}));i.observe(t)}));n.observe(t,{childList:!0,subtree:!0})}function o(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||Qr.has(e))return;const r=e.props.options.reduce(((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach(((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])})),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t}),[]),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),Qr.add(e),r.length&&n(e,r,t)}function n(e,t,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const o=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=r||0,n=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 s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?e.props.activeValue=h(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==n&&s(n,t[n]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==n&&(n--,n<0&&(n=null))}while(null!==o||null!==n)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||T(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&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),Qr.has(e)?requestAnimationFrame(n.bind(null,e,t,r)):o(e,r)):Qr.delete(e)}if(!Un)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=>fn(e.value,h(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&T(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.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):(e.props.invertPopover=!1,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}))}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),e.on("mounted",(()=>{vn(`${e.props.id}_popover`,t.bind(null,e),e.props.__root)}));const r=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}_popover`);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)}},s=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,r;Un&&(t?null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",s):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_popover`))})),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",r),e.props.styleWrapper(),_(e)):document.removeEventListener("mousemove",r)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;Un&&(t?null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.removeEventListener("scroll",s):null===(o=document.getElementById(`${e.props.id}_popover`))||void 0===o||o.addEventListener("scroll",s))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Xr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,n=-1;for(let r=0;r<e.props.options.length;r++){if("group"in e.props.options[r])for(let s=0;s<e.props.options[r].options.length;s++)if(fn(h(e.props.options[r].options[s]),t)){n=s,o=r;break}if(fn(h(e.props.options[r]),t)){n=r;break}}e.props.activeDescendant=n<0?void 0:void 0===o?`${e.props.id}_listitem_${n}`:`${e.props.id}_listitem_${o}_${n}`}))}function T(e){var t,o;if(!Un)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function E(){}function O(e){e.on("created",(()=>{if(!e.context||!Un)return;e.context.fns.isActive=D.bind(null,e),e.context.fns.isSelected=t=>A(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(fn(h(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Y,e.context.handlers.selectOption=t=>o=>U.call(null,e,t,o),e.context.handlers.loadMore=m.bind(null,e),e.context.handlers.removeSelection=t=>o=>W(e,t,o),e.context.handlers.tagTouchstart=t=>o=>W(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?P.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>fn(e,h(t)),e.context.handlers.tagClick=t=>N.bind(null,e,t),e.context.handlers.tagFocus=t=>R.bind(null,e,t),e.context.handlers.tagBlur=()=>K.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=F.bind(null,e),e.context.handlers.touchend=V.bind(null,e)}))}function F(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=es.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else es.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function V(e){es.delete(e)}function B(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function P(e,t,o){o.currentTarget instanceof HTMLElement&&(fn(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus()))}function H(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function N(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(fn(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus())))}function R(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=h(t),e.props.justFocused=!0)}function K(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function W(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},x(e,t))}function Y(e){e.stopPropagation()}function U(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},S(e,t))}function Z(e,t,o,n){!function(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===e.props.deselect?e.props.deselect=!0:e.props.deselect=hn(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(yn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=hn(e.props.disabled)),e.props.allOptions=k(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,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:Xr},e.props.loadOptions=b,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=hn(e.props.searchable),e.props.loadOnScroll=hn(e.props.loadOnScroll),e.props.multiple=hn(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=hn(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&hn(e.props.openOnRemove),e.props.hasNextPage=y.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=hn(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),e.on("mounted",(()=>C(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{C(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,h(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),I(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),M(e),e.props.loadOnCreated&&!e.props.optionsLoaded?b(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=hn(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),O(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.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(qr))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(qr)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=k(e.props.options),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)})),e.on("prop:expanded",(({payload:o})=>{var n;if(Un)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),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(),e.props.searchExpand||(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 j(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 z(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(h(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(Xr);let a=-1;e.props.activeValue&&(a=o.findIndex((t=>fn(t,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 q(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){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.selections[e.props.selections.length-1]?e.props.activeSelectionValue=h(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=h(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function G(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 X(e,t,o,n=!0){var r,s,a,l,i,p,d;const c=o.key;if(o.altKey){const n=f(),r=e.props.selections.findIndex((e=>fn(h(e),h(t)))),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=h(t),e.input([...s.map(h)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.findIndex((e=>fn(h(e),h(t))));if(-1===o)return;const u="ArrowRight"===c?o+1:o-1;if(u>=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===(l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}`))||void 0===l||l.focus()}else if(u<0&&0===o)null===(p=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===p||p.focus();else if(u<0)return;const f=null===(d=e.props.__root)||void 0===d?void 0:d.getElementById(`${e.props.id}_tag-wrapper_${u}`);f&&f.focus(),e.props.selections[u]?e.props.activeSelectionValue=h(e.props.selections[u]):e.props.activeSelectionValue=void 0}}function J(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.findIndex((e=>fn(h(e),h(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},x(e,t)}function Q(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Xr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>fn(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}function ee(e){e.props.expanded&&(e.props.expanded=!1)}function te(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o,!1);break;case"Delete":case"Backspace":J(e,t,o)}}function oe(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.findIndex((e=>fn(h(e),h(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.findIndex((e=>fn(h(e),h(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;if(t){const n=e.props.selections.findIndex((e=>fn(h(e),h(t))));if(-1===n)return;const r=e.props.selections[n+1]?n+1:n-1,s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${r}`);s&&s.focus(),e.props.selections[r]?e.props.activeSelectionValue=h(e.props.selections[r]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),x(e,t)}(e,t)}}function ne(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":z(e,o,t);break;case"ArrowLeft":case"ArrowRight":q(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":j(e);break;default:e.emit("unusedKeydown",t)}}function re(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&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(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":z(e,o,t);break;case"ArrowRight":case"ArrowLeft":q(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":j(e)}}function se(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 ae(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 le(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===Xr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>fn(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=h(r)),t=setTimeout((()=>{o=""}),400)}}))}function ie(e){pe(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,pe(e)})),Un&&vn(`${e.props.id}_selections`,ce.bind(null,e),e.props.__root)}function pe(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 de(e){var t,o;if(!Un||!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((()=>{pe(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,pe(e)}function ce(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:de(e))})),n=new ResizeObserver((()=>{de(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ue(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}_popover`),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 fe(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),v=i.height-u-f;t.scrollTop=c;const m=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},g=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||v>g?t.scrollTop=c:m();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=>fn(e.value,h(t))))),-1===r&&(r=null)}return r}function he(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&xn(300,[e]),e.props.dropdownWrapperStyles=mn(ts),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=ue.bind(null,e),e.props.positionListBox=fe.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){as=document.documentElement.scrollTop;for(const e in os)ss[e]=document.documentElement.style[e],document.documentElement.style[e]=os[e];for(const e in ns)rs[e]=document.body.style[e],document.body.style[e]=ns[e];document.body.scrollTop=as}():function(){for(const e in os)document.documentElement.style[e]=ss[e];for(const e in ns)document.body.style[e]=rs[e];document.body.scrollTop=0,document.documentElement.scrollTop=as}())}))}function ve(e){e.addProps(["multiLine"]),e.on("created",(()=>{Un&&(e.props.multiLineHeight=void 0,vn(`${e.props.id}_selections`,me.bind(null,e),e.props.__root))}))}function me(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),ge(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function ge(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function $e(e){function t(){const{x:t,y:o,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(n,r);e.props.popoverAncestorCoordinates={x:t,y:o,width:s,height:a},e.props.popoverCoordinates={x:t,y:o,width:s,height:0}}function o(t){t?(null==n||n.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==n?void 0:n.offsetHeight)||0}),5)):(null==n?void 0:n.matches(":popover-open"))&&(null==n||n.hidePopover(),e.props.popoverCoordinates.height=0)}if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=hn(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let n=null,r=null,s=[],a=null;if(e.props.popoverOffset=hn(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.');const l=()=>{document.removeEventListener("resize",a),document.removeEventListener("scroll",a),s.forEach((e=>{e.removeEventListener("scroll",a)}))};e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:expanded",(({payload:i})=>{var p;e.context&&(!1===i?l():vn(`${null===(p=e.context)||void 0===p?void 0:p.id}_popover`,(()=>{if(!e.context)return;n=document.querySelector(`#${e.context.id}_popover[popover]`)||document.querySelector(`#${e.context.id}_popover [popover]`),r||(r=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(n)),t(),o(i),a=ls((()=>{e.context&&(t(),o(i))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),s=[];let l=null==n?void 0:n.parentElement;for(;l;)l.scrollHeight>l.clientHeight&&s.push(l),l=l.parentElement;s.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}function be(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.draggable=hn(e.props.draggable),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(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 ye(e,t){function o(){return Array.isArray(t.value)?t.value:[]}function n(e){t.input(e)}if(!t.context)return;const r={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[Mn({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};Tn({parent:e,getValues:o,setValues:n,config:r}),t.on("prop:disabled",(({payload:t})=>{r.disabled=t,Tn({parent:e,getValues:o,setValues:n,config:r})})),t.on("prop:draggable",(({payload:t})=>{r.disabled=!t,Tn({parent:e,getValues:o,setValues:n,config:r})}))}function xe(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function we(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function _e(e,t){const{x:o,y:n}=Te(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function ke(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?Ee(e,t,o):e.input(t+1,!1))}function Se(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,xe(e);const o=ra.get(e);o&&(o.abort(),ra.delete(e))}function Le(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>Se(e,t)),{signal:n.signal}),ra.set(e,n),1===e.props.step?e.input(t+1,!1):Ee(e,t,o)}function De(e,t){if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=document.getElementById(e.props.id+"_0_0");null==t||t.focus(),e.input(Number(null==t?void 0:t.getAttribute("value")))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=document.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`);null==t||t.focus(),e.input(Number(null==t?void 0:t.getAttribute("value")))}}function Ae(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function Ce(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(xe(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):Ee(e,t,o,!!e.props.dragStarted)))}function Ie(e){xe(e)}function Me(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void Ee(e,t,o)}function Te(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function Ee(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=Te(o),a=o.currentTarget.getBoundingClientRect();let l=function(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):xe(e,l):e.input(0)}function Oe(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=v.bind(null,e),e.props.reloadOnCommit=hn(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=hn(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&Un&&(e.context.handlers.focus=Be.bind(null,e),e.context.handlers.input=Fe.bind(null,e),e.context.handlers.focus=Be.bind(null,e),e.context.handlers.click=Ve.bind(null,e),e.context.handlers.toggleListbox=Pe.bind(null,e),e.context.handlers.toggleListboxKeydown=He.bind(null,e),e.context.handlers.keydown=re.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>oe(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":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o);break;case"Delete":case"Backspace":J(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>h(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||Zr.delete(e)}))}function Fe(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&v(e,e.props.searchValue,!0)}function Ve(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 Be(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 Pe(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 He(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),Pe(e))}function Ne(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Re(e)})),e.on("created",(()=>{if(!e.context||!za)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=We(e);if(e.props.highlightedRange){const[t,n]=Ke(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){vn(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&qa.set(t,e)}),e.props.__root),za&&!Ga&&(Ga=!0,document.addEventListener("selectionchange",(()=>{const e=f();if(e instanceof HTMLInputElement&&qa.has(e)){const t=qa.get(e);t&&function(e){clearTimeout(ja.get(e)),ja.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=We(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]=Ke(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,Re(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=We(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?(x(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=[],v(e,e.props.searchValue))):(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(za&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),f()===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="",v(e,e.props.searchValue))}));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=We(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,_(e))}))}function Re(e){var t;if(!za)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 Ke(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 We(e){const t=Jr(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 Ye(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(e,e.props.searchValue,!0))):(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&&v(e,e.props.searchValue,!0))}))}(e)}function Ue(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.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||e.props.searchExpand||(e.props.options=[],v(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}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&&v(e,e.props.searchValue,!0)}))}(e)}function Ze(e,t){var o;if(zl.has(e))return;zl.set(e,[]),t.reverse&&li.add(e),t.prefix&&ii.set(e,t.prefix),t.suffix&&pi.set(e,t.suffix),Xe(e,t.pattern,t.partOverrides,t.explicitParts);const n=Jl.get(e),r=null==n?void 0:n.some((e=>et(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 a=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&Ql.add(e),ei.set(e,a),t.onChange&&si.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(gi)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=zl.get(e);if(null==r?void 0:r.length){const o=(null!==(n=ql.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;ct(e,s),e.setSelectionRange(...s.selectionAfter),ql.set(e,o),si.has(e)&&si.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=rt(e),a=e.value;n&&st(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Ot(e);case"ArrowLeft":return t.preventDefault(),Ot(e,-1);case"ArrowUp":return void(Ft(e,1)&&t.preventDefault());case"ArrowDown":return void(Ft(e,-1)&&t.preventDefault());case"Tab":return ui?void t.preventDefault():void(Ot(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=Ql.has(e),n=ei.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;xt(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(Qe(t)||et(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const i=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===ei.get(e)){const[o]=Ct(e),n=Bt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){oi.set(e,lt(e,t));const n=async()=>{if(!mi||f()!==e)return;"select"===ei.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=rt(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=it(e,t);const[o]=Ct(e),n=Bt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&oi.set(e,lt(e,o[n]))}(e));const t=oi.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),oi.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(oi.get(e))return;Kt(e),t=it(e,t);const[o]=Ct(e),n=Bt(e,t),r=void 0!==n&<(e,o[n]);r&&!nt(t,r)&&dt(e,r,!0)}(e,t.detail))),st(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function je(e){var t,o;if(ci.has(e))return;const n=null!==(t=zl.get(e))&&void 0!==t?t:[],r=n[null!==(o=ql.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Ct(e,r.valueAfter),s=Bt(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"];ci.set(e,[r,l])}}}function ze(e){ci.delete(e)}function qe(e,t){const o="string"==typeof e||!zl.has(e),n="string"==typeof e?Ge(e):e;if(o)t.prefix&&ii.set(n,t.prefix),t.suffix&&pi.set(n,t.suffix),n.value=at(n,n.value),Ze(n,t);else{const e=Pt(n),o=n.value;n.value="",st(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 Ge(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Xe(e,t,o,n,r){r=e&&li.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(hi);if(!e)return t;const o={...e},n=[];for(const r of t)if(!ot(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Je(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Je(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=ut(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=Xe(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&&Jl.set(e,c),c}function Je(e){return!!e&&(ot(e)||Qe(e)||et(e))}function Qe(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&tt(e))}function et(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&tt(e))}function tt(e){return!!e&&("placeholder"in e&&"token"in e)}function ot(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function nt(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function rt(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 st(e,t){var o;li.has(e)&&Rt(t);let n=!1;switch(ai.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=pt(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===ei.get(e)){const[s,a]=Ct(e),l=s.findIndex((e=>nt(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(Qe(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=bt(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ut(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(et(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=xt(e,t,o);return Xl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:yt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=pt(t),n=t.selectionBefore,r=li.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ft(o,s):s-=ft(o,s,"backward"));const l=ei.get(e);let i="";if("select"===l){const[o,n]=Ct(e),r=Bt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];Qe(l)?i=l.placeholder.repeat(a-s):et(l)&&([i,s]=nt(p,rt(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ft(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Mt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Tt(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=xt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Lt(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(li.has(e)&&n&&Rt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=lt(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)){si.has(e)&&di.set(e,(()=>{di.delete(e),n&&si.get(e)(n,e)})),ai.set(e,"beforeCallback");let t=null!==(o=zl.get(e))&&void 0!==o?o:[];const r=ql.get(e);r&&(t=t.slice(0,r),ql.delete(e)),t.push(n),zl.set(e,t),mi&&f()===e&&"function"==typeof document.execCommand&&!gi?(dt(e,[0,e.value.length,"forward"],!0),gi=!0,document.execCommand("insertText",void 0,n.valueAfter),gi=!1):ct(e,n),mi&&f()===e&&dt(e,n.selectionAfter);const s=di.get(e);s&&s(),Kt(e)}ai.set(e,"complete")}function at(e,t){var o,n;const r=null!==(o=ii.get(e))&&void 0!==o?o:"",s=null!==(n=pi.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 lt(e,t){const o=ii.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function it(e,t){const o=ii.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function pt(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 dt(e,t,o=!1){o&&(Gl.add(e),setTimeout((()=>Gl.delete(e)),5)),oi.get(e)&&oi.set(e,t),e.setSelectionRange(...t)}function ct(e,t,o="After"){if(e.value=t[`value${o}`],mi){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ut(e){if(null==e)return"";const t=ti.test(e.charAt(0))&&ti.test(e.charAt(1))?2:1;return e.substring(0,t)}function ft(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:ti.test(e.charAt(t))&&ti.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ut(e.substring(t)).length}function ht(e,t){const o=ut(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 vt(e){const t=ut(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function mt(e,t){const o=ut(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function gt(e,t){for(;t.buffer;){const o=ut(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 $t(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(ft(t.buffer,0))}return null}function bt(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 yt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=rt(e);o=[n[0],t.endPos,"none"];const[r,s]=Ct(e,t.value),a=Bt(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(Qe(i)&&bt(p,i).length===p.length&&a<r.length-1)return fi(),r[a+1];if(et(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=Mt(o.values,r);if(s)return At(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Tt(i.values,p)?[l[1],l[1],"forward"]:(fi(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return nt(s,n)||(Gl.add(e),setTimeout((()=>Gl.delete(e)),5)),s}return l}function xt(e,t,o,n){var r,s;const a=null!==(r=Jl.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:Ql.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:ei.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Ct(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return wt(a,l,void 0,n),l}function wt(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":kt(o,t,e.at(-1)===o);break;case"char":St(o,t,l);break;case"enum":_t(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};wt(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=ot(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++,wt(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),ot(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 _t(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=Mt(e.values.concat([e.placeholder]),n);if(r){const s=At(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):$t(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=$t(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 kt(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?ut(t.data):"",s=ut(n);if(e===s)n=ht(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=mt(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 St(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=ut(t.data);if(e.pattern.test(n))return ht(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void gt(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=ut(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,vt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return vt(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 Lt(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=Ct(e),a=Bt(e,r,s),[l,i]=Ct(e,t.value),p=void 0!==a&&Dt(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)=>Dt(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 Dt(e,t,o){if(ot(o))return!1;if(Qe(o)){let n=t[0];for(;n<t[1];){const t=ut(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!et(o)||e.substring(t[0],t[1])===o.placeholder}function At(e,t){let o="";do{const n=ut(e).toLowerCase(),r=ut(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 Ct(e,t){const o=Jl.get(e);if(!o)return[[],[]];if(ni.has(e))return ni.get(e);const n=null!=t?t:at(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(ot(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(Qe(a)&&Qe(e)&&e.token===a.token)i++;else if(Qe(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(et(e)){l&&r.push([l,i,"none"]),Et(e)||(p=!1);const t=It(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&&ni.set(e,d),d}function It(e,t,o){if(Et(t))return t.values[0].length;const n=e.slice(o),r=Mt(t.values.concat([t.placeholder]),n);return r?r.length:0}function Mt(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=ut(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=Mt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Tt(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function Et(e){if(!ri.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;ri.set(e,e.values.every((e=>e.length===t)))}return ri.get(e)}function Ot(e,t=1){const[o]=Ct(e),n=Bt(e,it(e,rt(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...lt(e,o[n+t])),!0)}function Ft(e,t=1){const[o,n]=Ct(e),r=Bt(e,rt(e));if(void 0!==r&&r in n){const s=n[r];if(et(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((()=>st(e,t)),0),!0}}}return!1}function Vt(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 Vt(e.slice(...r),t)}function Bt(e,t,o){const[n]=null!=o?o:Ct(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!nt(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=Vt([...s],t[1]);return l in a?a[l]:void 0}function Pt(e){var t,o;const n=null!==(t=zl.get(e))&&void 0!==t?t:[];return n[null!==(o=ql.get(e))&&void 0!==o?o:n.length-1]}function Ht(e,t=!1){const o=Pt(e);return o&&(o.complete||t)?li.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Nt(e){var t;const o=Pt(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Rt(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 Kt(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 Wt(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($i);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($i);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Yt(e,t=1){const o=Wt(e);return o.setDate(o.getDate()+t),o}function Ut(e){const t=Wt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function Zt(e){return Ut(e).getDate()}function jt(e,t=1,o=!1){const n=Wt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=Zt(n);n.setDate(e<r?e:r)}return n}function zt(e,t=1,o=!1){const n=Wt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=Zt(n);n.setDate(e<r?e:r)}return n}function qt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Gt(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=eo(a.getHours()<12?"am":"pm",o);return"A"===n?e.toUpperCase():e.toLowerCase()}return"timeZoneName"===e?Xt(-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&&Si.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(qt)),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(qt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(qt)}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=Wt(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];a.length&&r(a,!0);l.length&&r(l);return i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Wt(e);return t.map((e=>({...e,value:r(e)})))}function Xt(e){return`${e<0?"-":"+"}${String(Math.floor(Math.abs(e/60))).padStart(2,"0")}${String(Math.abs(e%60)).padStart(2,"0")}`}function Jt(e){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function Qt(e){return["numeric","2-digit"].includes(e.partValue)}function eo(e,t){const o=Di.get(t);if(o&&o[e])return o[e];const n=new Date(bi);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(qt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Di.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function to(e,t="+0000"){const o=Wt(e),n=function(e){Jt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function oo(e,t){const o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:t,hourCycle:"h23"}).formatToParts(e).map(qt),n={};return o.forEach((e=>{n[e.type]=e.value})),new Date(`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}:${n.second}Z`)}function no(e,t="UTC",o="device"){o="device"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Wt(e),r=oo(n,t);return Xt((oo(n,o).getTime()-r.getTime())/1e3/60)}function ro(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(Ai.includes(e)||"object"==typeof e)return function(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(bi)).map(qt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(qt).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?Li.get("YY"):Li.get("YYYY");case"month":return s?1===r?Li.get("M"):Li.get("MM"):(a=so(o,e,t),"long"===a?Li.get("MMMM"):Li.get("MMM"));case"day":return 1===r?Li.get("D"):Li.get("DD");case"weekday":switch(a=so(o,e,t),a){case"narrow":return Li.get("d");case"short":return Li.get("ddd");default:return Li.get("dddd")}case"hour":return 12===n?1===r?Li.get("h"):Li.get("hh"):1===r?Li.get("H"):Li.get("HH");case"minute":return 1===r?Li.get("m"):Li.get("mm");case"second":return 1===r?Li.get("s"):Li.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Li.get("A"):Li.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Li.get("ZZ"):Li.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))}(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}(xi.filter(s).concat(wi.filter(s)).map(o.bind(null,!1)).concat(_i.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 so(e,t,o){if(!yi.has(e)){const t=new Date(bi),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(qt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(qt).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})}))}}yi.set(e,s)}const n=yi.get(e);return n?n[t][o]:void 0}function ao(e,t="+0000"){const o="+"===t.slice(0,1);return to(e,t.replace(o?"+":"-",o?"-":"+"))}function lo(e,t="long",o="device",n=!1,r){let s;return"object"!=typeof e||e instanceof Date||({date:e,format:t,locale:o,genitive:n,partFilter:r,tz:s}=e),"ISO8601"===t?Wt(e).toISOString():(s&&(e=ao(e,no(e,s))),o&&"device"!==o||(o=Intl.DateTimeFormat().resolvedOptions().locale),Gt(e,ro(t,o).filter(null!=r?r:()=>!0),o,n).map((e=>e.value)).join(""))}function io(e,t="en",o=!1,n=(()=>!0)){return ro(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return xi.concat(wi).concat(_i).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],`\\${t[0]}`)),e)}(t.token):t.token)),"").normalize("NFKC")}function po(e){const t=Wt(e);return t.setDate(1),t.setHours(0,0,0),t}function co(e,t,o=7){let n,r;const s=Wt(e);switch(o){case"month":r=s.getDate(),n=Zt(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Wt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Wt(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=Yt(s,e);if(t(o))return o}if(e&&e<=r){const o=Yt(s,-e);if(t(o))return o}}return null}function uo(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 uo("MM").map((n=>lo(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>lo(`2022-10-${o}`,e,t)));if("a"===e)return[eo("am",t).toLowerCase(),eo("pm",t).toLowerCase()];if("A"===e)return[eo("am",t).toUpperCase(),eo("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(lo(`${o+Number(r)}-06-06`,e,t)),n.unshift(lo(o-Number(r)+"-06-06",e,t)),n)),[lo(`${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 fo(e,t="ISO8601",o="device"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="device",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 (${io(t,o)})`)};if("ISO8601"===t)return Wt(n);const l=Ai.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 ki||o.token in ki||Qt(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(ro(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=ho(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()===eo("am",o).toLowerCase();else if("Z"===n)f=Jt(e.value);else{const t=uo(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,$,b,y]=Array.from(c.values());const x=Zt(new Date(`${Ii(v)}-${Ci(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${Ii(v)}-${Ci(m+1)}-${Ci(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${Ii(v)}-${Ci(m+1)}-${Ci(g)}T${Ci($)}:${Ci(b)}:${Ci(y)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function ho(e,t){let o=0;let n=0;const r=[];let s;do{const[l,i]=[(a=t)[o++],a[o]];s=i;let p=1;if("literal"===l.partName)p=l.partValue.length;else if(l.token in ki)p=ki[l.token];else if(i)if("literal"===i.partName){if(p=e.indexOf(i.partValue,n)-n,p<0)throw new Error}else if("dayPeriod"===i.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(n+t)))){p=t;break}}else{const t=e.substring(n).search(/\d/);-1!==t&&(p=n+t)}else p=e.length;r.push({...l,value:e.substring(n,n+p)}),n+=p}while(s);var a;return r}function vo(e,t){const o=Wt(e),n=Wt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function mo(e,t=0){const o=Wt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function go(e){return"timeZoneName"!==e.partName}function $o(e,t){const o=[],n=Wt(t);n.setDate(1);let r=mo(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=mo(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Ut(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Yt(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function bo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>$o(e,jt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(lo(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>zt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Wt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>jt(t,e)))}(e)}function yo(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function xo(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:fo(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,go),o}function wo(e){return Array.isArray(e.props.sequence)?mn(e.props.sequence):["day"]}function _o(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?no(t,e.props.timezone):"+0000";const s=to(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(lo(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function ko(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 So(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Fi.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}_popover`)?Pi.add(e):Pi.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===ai.get(t)&&(n=t.value),je(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!zl.has(e))return;const r=null!==(o=ii.get(e))&&void 0!==o?o:"",s=null!==(n=pi.get(e))&&void 0!==n?n:"";st(e,{type:"insert",selectionBefore:rt(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>ze(t)),10))}));const[r,s]=Do(e);Ze(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Lo(e),Ti.has(e))return Ti.delete(e);n&&n===o?n="":(je(t),e.props.inputText=o,setTimeout((()=>ze(t)),10))}})}function Lo(e){var t,o;if(e.props.overlay){const n=Fi.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Ht(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=u(Nt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Do(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=ro(e.props.format,t);return[io(e.props.format,t,!0,go),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=uo(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")&&Vi.set(e,a),r}),[])]}function Ao(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Co(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}function Io(e,t){var o,n;if(t instanceof HTMLInputElement&&!Ni.get(e)&&Hi){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){Ni.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function Mo(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=hn(e.props.overlay),e.props.pickerOnly=hn(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&vn(`${e.props.id}`,Io.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function To(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Cp.set(e,t),Ze(t,{...Ap.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=u(o)}})}function Eo(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function Oo(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>h(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Fo(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>h(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Vo(e){var t,o;if(e.props.activeValue===bd){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function Bo(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((n=>{const r=e.props.memoOptions.find((e=>fn(h(e),n)));if(r&&!r.noOptionFound){t.push(r);const s=e.props.options.findIndex((e=>fn(h(e),n)));-1!==s&&(o=o.filter((e=>!fn(h(e),n))))}else{const e=o.find((e=>fn(h(e),n)));e?(t.push(e),o=o.filter((e=>!fn(h(e),n)))):t.push({label:String(n),value:n,noOptionFound:!0})}})),e.props.targetOptions=t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&function(e){var t,o,n,r,s,a,l;if(e.props.isDragging)return;if(e.props.sourceSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=h(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const i=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let p=!1;for(let t=e.props.activeIndex;t<=i.length;t++)if(!(null===(n=i.attrs)||void 0===n?void 0:n.disabled)&&i[t]){p=!0,e.props.activeValue=h(i[t]);break}if(!p&&i.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)&&i[t])return p=!0,void(e.props.activeValue=h(i[t]));if(!p){let t;t=e.props.sourceListOrigin?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`):e.props.searchable?null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_source_search_input`):null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}(e)}function Po(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function Ho(e){Array.isArray(e.value)&&e.value.forEach((async t=>{$(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>fn(h(e),t)))}(e,t))}))}function No(e){e.context&&(e.context.handlers.loadMore=m.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return fn(o,h(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(h(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",v(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Ro(e,t,o)},e.context.handlers.transferForward=Oo.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>h(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Fo.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,v(e,o.value,!0)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Ro(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===r)),e.props.transferOnSelect?o?Oo(e,r):Fo(e,r):Eo(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Ko(e,!0)},e.context.handlers.sourceListFocused=t=>{Ko(e,!0)},e.context.handlers.targetListFocused=()=>{Ko(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{Wo(e,t,!0)},e.context.handlers.targetListKeydown=t=>{Wo(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{Wo(e,t,!0)})}function Ro(e,t,o,n){var r;if(h(t)===bd)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===s)),e.props.transferOnSelect?o?Oo(e,s):Fo(e,s):Eo(e,t,o)}function Ko(e,t){const o=Po(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=h(o))}function Wo(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(h(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(bd);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}Vo(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(Po(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===bd)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex((e=>h(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Oo(t,h(a)):Fo(t,h(a)):Eo(t,a,o)}(t,e,o)}function Yo(e){e.on("created",(()=>{if(e.props.skipSetActiveValue=!0,"function"==typeof e.props.optionsLoader&&b(e),No(e),e.props.disabled&&(e.props.draggable=!1),Un){vn(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){function o(){return e.props.sourceOptions.map((e=>h(e)))}function n(){return[]}if(!e.context)return;const r={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],Vn(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[Bn({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,On(t)},handleEnd(t){En(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,Fn(t)},selections:()=>e.props.selectedSourceItems.map((e=>h(e)))})],Tn({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,Tn({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,Tn({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,Tn({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),vn(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){function o(){return Array.isArray(e.value)?[...e.value]:[]}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}if(!e.context)return;const r={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};r.plugins=[Bn({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,On(t)},handleEnd(t){En(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,Fn(t)},selections:()=>e.props.selectedTargetItems.map((e=>h(e)))})],Tn({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,Tn({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,Tn({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;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",t)}}))}function Uo(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=yd.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=xd.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&&yd.add(e),e.props.mouseOnTarget&&xd.add(e),a.length&&Zo(e,a,null,t)}function Zo(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.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)?h(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)}}else Vo(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&yd.has(e)||e.props.mouseOnTarget&&xd.has(e)?requestAnimationFrame(Zo.bind(null,e,t,o,n)):Uo(e,n):(yd.delete(e),xd.delete(e))}function jo(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function zo(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[...Go(t,o,n,r)]}function qo(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,jo(255*t,2),jo(255*a,2),n]}function Go(e,t,o,n=1){const r=jo(t/255,4),s=jo(o/255,4);if(1===s)return[e,0,100,n];const a=jo(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,jo(l,2),jo(100*a,2),n]}function Xo(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 Jo(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Qo(e,t,o,n=1){const[r,s,a,l]=Xo(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 en(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function tn(e){if(e){if(en(e))return zo(e);if(e.startsWith("rgb")){const t=e.match(Wc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Jo(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(Yc);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 Go(o,jo(255*n,2),jo(255*r,2),s)}}}function on(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function nn(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 rn(e){return!1!==e&&"false"!==e}function sn(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}function an(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>fn(e,t))).length>0:void 0!==t?fn(e.value,t):(e.props._isChecked=fn(e.value,e.props.onValue),e.props._isChecked)}function ln(e){function t(t){var o,n,a;const l=(`${t}`.match(/\-/g)||[]).length%2==1;t=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(p.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:(o[1]=o[1].padEnd(i(),"0").slice(0,i()),t=o.join("."))}return t}(t);const u={};"unit"===r()&&(u.minimumFractionDigits=t.includes(".")?1:0),u.maximumFractionDigits=i(),e.props.minDecimals&&(u.minimumFractionDigits=e.props.minDecimals,t.includes(".")||(t+=".".padEnd(e.props.minDecimals,"0"))),0===u.maximumFractionDigits&&t.includes(".")&&(t=t.split(".")[0]);let f="";isNaN(t)||""===t.trim()||(t=l?`-${t}`:t,e.props.max&&!isNaN(e.props.max)&&(t=`${Math.min(t,e.props.max)}`),e.props.min&&!isNaN(e.props.min)&&(t=`${Math.max(t,e.props.min)}`),t.includes(".")?t=t.split(".")[0].padStart(1,"0")+"."+(null!==(o=t.split(".")[1])&&void 0!==o?o:"0"):u.maximumFractionDigits=null!==(n=u.minimumFractionDigits)&&void 0!==n?n:0,f=s(e.props.displayLocale,u).format(t));let h,v=t.split(".");return v=v[0]+(null!==(a=v[1])&&void 0!==a?a:"").padEnd(i(),"0"),v.length>1&&(v=v.replace(/^0+/,""),v=""!==t&&""===v?"0":v),c={number:t,integer:v,string:f},d=!0,c&&(h=c.hasOwnProperty(e.props.valueFormat)?c[e.props.valueFormat]:c.number),e.input(""===h?void 0:h).then((()=>(d=!1,Promise.resolve())))}function o(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return n&&(n.value=null!==(o=null==c?void 0:c.string)&&void 0!==o?o:""),Promise.resolve()}function n(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function r(){return e.props.currency?"currency":"unit"}function s(t,o={}){const n=r(),s=Object.assign({},{style:n,roundingMode:"trunc"},o);return s[n]=e.props[n],new Intl.NumberFormat(t,s)}function a(){var t,o,n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);if(r){r.dataset.placeholder||(r.dataset.placeholder=null!==(o=r.getAttribute("placeholder"))&&void 0!==o?o:"");const e=((p.unitLeft?`${p.unit} `:"")+(null!==(n=r.dataset.placeholder)&&void 0!==n?n:"")+(p.unitLeft?"":` ${p.unit}`)).trim();r.setAttribute("placeholder",e)}}function l(t){var o;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=p.unit.length+p.literal.length;t=p.unitLeft?Math.max(t,s):Math.min(t,n().length-s),r.setSelectionRange(t,t)}function i(){return!1===e.props.decimals||"false"===e.props.decimals?0:isNaN(`${e.props.decimals}`)?p.fractionLength:e.props.decimals}let p=null,d=!1,c=null;e.on("input",(({payload:e})=>{d||(t(e),o())})),e.on("mounted",(()=>{a()})),e.context&&(e.context.handlers.setPlaceholder=a,e.context.handlers.init=(n=null)=>{var r;!function(){var t,o,n,r,a,l,i;const d=s(e.props.displayLocale).formatToParts(12345678.12345678);p={decimal:null===(t=d.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=d.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=d.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(r=d.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(r=null!=n?n:e._value)&&void 0!==r?r:"";c?a=c.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=i())&&void 0!==t?t:0)).toString().replace(".",i())}(`${null!=a?a:""}`)),t(a),o()},e.context.handlers.handleBeforeInput=o=>{var n,r,s,a,i,d,u;if(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement){const f=o.target,h=null!==(n=o.data)&&void 0!==n?n:"",v=null!==(r=o.target.value)&&void 0!==r?r:"",m=null!==(s=o.target.selectionStart)&&void 0!==s?s:0,g=null!==(a=o.target.selectionEnd)&&void 0!==a?a:0,$=v.indexOf(p.decimal);let b=(null!==(i=o.target.selectionStart)&&void 0!==i?i:0)+(o.data?0:-1),y=v,x=1;if(v.includes(p.decimal)&&h===p.decimal)return h===p.decimal&&(b=y.indexOf(p.decimal)+1),void l(b);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===h)return;if(h.match(/[a-zA-Z]/))return;"deleteContentBackward"===o.inputType&&v[m-1]===p.group?(x+=1,b-=1):"deleteContentForward"===o.inputType&&v[m]===p.group&&(x+=1,b+=1),-1!==$&&b>$&&"insertText"===o.inputType?y=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(y,b,null!==(d=o.data)&&void 0!==d?d:"0"):"insertText"===o.inputType?y=y.slice(0,m)+o.data+y.slice(g):"deleteContentForward"===o.inputType?(b+=2,y=y.slice(0,m)+y.slice(g+x)):"deleteContentBackward"===o.inputType&&(b+=1,y=y.slice(0,Math.max(m-x,0))+y.slice(g)),o.inputType.includes("delete")&&v[m-1]===p.decimal&&(y=y.slice(0,m-1)),t(y),y=null!==(u=null==c?void 0:c.string)&&void 0!==u?u:"",b=y.length-v.length+b,y.length===v.length&&(b+=o.inputType.includes("delete")?-1:1),f.setSelectionRange(0,v.length),document.execCommand("insertText",!1,y),h===p.decimal?b=y.indexOf(p.decimal)+1:v.includes(p.decimal)&&!y.includes(p.decimal)&&(b=y.length),l(Math.max(0,b))}},e.context.handlers.handleInput=e=>{e.target instanceof HTMLInputElement&&t(e.target.value)},e.context.handlers.handleKeyDown=r=>{var s;if(r.target instanceof HTMLInputElement&&("ArrowUp"===r.key||"ArrowDown"===r.key)){const a="ArrowUp"===r.key?1*e.props.step:-1*e.props.step;t(function(e,t){var o,n,r,s;let a=`${e}`.split("."),l=`${t}`.split("."),i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0",d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"";const u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(s=null==c?void 0:c.number)&&void 0!==s?s:0,a)),o(),setTimeout((()=>{l(n().length)}),1)}})}function pn(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Lu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Gn(13919),children:`${Gn(451228594)}${Gn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){tr[e]?tr[e].add(t):tr[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(!Yn.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];Lu.add(o),o.define({...r,schema:n(e)})}Su((()=>er.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}import{isRecord as dn,isObject as cn,isPojo as un,eq as fn,undefine as hn,whenAvailable as vn,clone as mn}from"@formkit/utils";import{isDOM as gn,isComponent as $n,createMessage as bn,warn as yn,error as xn}from"@formkit/core";import{icon as wn,isSlotCondition as _n,isSchemaObject as kn,extendSchema as Sn,normalizeOptions as Ln,defaultIcon as Dn,localize as An,options as Cn,disablesChildren as In}from"@formkit/inputs";import"@formkit/vue";import{animations as Mn,dragAndDrop as Tn,handleEnd as En,handleDragstart as On,handleTouchstart as Fn,handleTouchmove as Vn,multiDrag as Bn}from"@formkit/drag-and-drop";const Pn=[988,24029,396,13078,980],Hn=18806588,Nn=502357,Rn=16217489;let Kn=189024;const Wn=()=>[30548127325,27022924,34729821653783].map(Gn).join("y"),Yn=/^[0-9a-f]+$/,Un="undefined"!=typeof window,Zn=n(32,(e=>e)).map((()=>{Kn|=0,Kn=Kn+1831565813|0;let e=Kn^Kn>>>15|Kn;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),jn=Un?setTimeout:()=>0,zn=e=>{clearTimeout(qn[e])},qn={},Gn=e=>e.toString(32),Xn=e=>`${Gn(Zn[e]).substring(2)}.${Gn(Pn[e%(Pn.length-1)])}`,Jn={},Qn={},er=new Set(["",null,void 0]),tr={},or=()=>({$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-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined"}}),nr=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),rr=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),sr=()=>({$el:"ul",if:"$fns.length($messages)"}),ar=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),lr=()=>({$el:"div",if:"$help"}),ir=()=>({$el:null}),pr=(e,t)=>()=>wn(e,t),dr=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),cr=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),ur=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),fr=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),hr=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),vr=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),mr=()=>({$el:null,for:["part","$_overlayParts"]}),gr=a("dd"),{outer:$r,wrapper:br,inner:yr,icon:xr,label:wr,prefix:_r,suffix:kr,help:Sr,messages:Lr,message:Dr}=l(gr),Ar=gr("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Cr=gr("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Ir=gr("selection",(()=>({$el:"div"}))),Mr=gr("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),Tr=gr("optionLoading","span"),Er=gr("option",(()=>({$el:"div"}))),Or=gr("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),Fr=gr("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),Vr=gr("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),Br=gr("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),Pr=gr("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 || ""'}))),Hr=gr("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)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection($activeSelectionValue, $option)"}}))),Nr=gr("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),Rr=gr("tagLabel",(()=>({$el:"span"}))),Kr=gr("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),Wr=gr("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),Yr=gr("tagLoading","span"),Ur=d(gr),Zr=new WeakMap,jr=new WeakMap,zr=bn({key:"loading",type:"state",value:!0,visible:!1}),qr=bn({key:"loading",type:"state",value:!1,visible:!1}),Gr=new WeakMap,Xr=Symbol(),Jr=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o,r=t.find((t=>fn(h(t),e)));o=un(e)?void 0:Array.isArray(e)?e.join(", "):e,r||(r={value:e,label:o,isPlaceholder:!1,noOptionFound:!0}),n.push(r)}return n},Qr=new WeakSet,es=new WeakMap,ts={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},os={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},ns={overflow:"hidden",height:"100%"},rs={},ss={};let as=0;const ls=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout((()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)}),t))}},is={schema:$r(br(wr("$label"),yr(xr("prefix"),_r(),Ar(p("$inputStd.length === 0 && $state.loading !== true",Mr('$placeholder || "placeholder"'),p("$multiple !== true",Cr(p("$state.loading && $selections.length === 0",Tr("$ui.isLoading.value"),Ir(Er("$option.label")))),p('$multiple && $selectionAppearance === "truncate"',Fr(Vr(p("$state.loading && $selections.length === 0",Tr("$ui.isLoading.value"),Pr()))),p('$multiple && $selectionAppearance === "tags"',Kr(Wr(p("$state.loading && $isLoadingOption !== true && $selections.length === 0",Tr("$ui.isLoading.value"),Hr(Nr(p("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",Yr("$ui.isLoading.value"),Rr("$option.label")),Or(xr("close"))))))))))),p("$truncationCount && $state.loading !== true",Br("$truncationCount")),p("$state.loading",xr("loader")),p("$inputStd.length !== 0 && $selectionRemovable",Or(xr("close")),xr("select"))),Ur(),kr(),xr("suffix"))),Sr("$help"),Lr(Dr("$message.value"))),type:"input",family:"dropdown",props:[],features:[Dn("select","select"),Dn("close","close"),Dn("selected","check"),Dn("loader","spinner"),An("isLoading"),An("loadMore"),An("remove"),Cn,Z.bind(null,(function(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=hn(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=hn(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&hn(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=se.bind(null,e),e.context.handlers.focus=ae.bind(null,e),e.context.handlers.keydown=ne.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>te.bind(null,e,t))}))}),(function(e){if(e.on("created",(()=>{e.context&&le(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,ie(e),e.on("prop:selections",(()=>{ie(e)}))),"tags"===e.props.selectionAppearance&&ve(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),vn(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[Mn()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};Tn({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,Tn({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,Tn({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}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=[],b(e))})),"overscroll"===e.props.behavior&&he(e)})),$e]},ps=a("tg"),{outer:ds,wrapper:cs,label:us,prefix:fs,suffix:hs,help:vs,messages:ms,message:gs,icon:$s}=l(ps),bs=ps("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),ys=ps("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),xs=ps("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"}))),ws=ps("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"}}))),_s=ps("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"}}}))),ks=ps("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Ss=ps("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Ls=ps("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Ds={schema:ds(cs(xs(),ks(fs(),bs(),Ss(ws(),Ls(p("$slots.default","$slots.default",$s("thumb")))),hs()),_s(),ys()),vs("$help"),ms(gs("$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=hn(e.props.disabled)),e.props.altLabelPosition=hn(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=fn(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=fn(t,e.props.onValue)}))}]},As=a("rp"),{outer:Cs,inner:Is,prefix:Ms,suffix:Ts,help:Es,messages:Os,message:Fs,icon:Vs}=l(As),Bs=As("empty",(()=>({$el:"div"}))),Ps=As("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),Hs=As("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Ns=As("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Rs=As("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),Ks=As("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Ws=As("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Ys=As("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Us=As("content","div"),Zs=As("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),js=As("legend",(()=>({$el:"legend",if:"$label"}))),zs=As("group",(()=>({$formkit:"group",index:"$index"}))),qs=As("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Gs=As("remove",(()=>({$el:"li",if:"$removeControl"}))),Xs=As("insert",(()=>({$el:"li",if:"$insertControl"}))),Js=As("up",(()=>({$el:"li",if:"$upControl"}))),Qs=As("down",(()=>({$el:"li",if:"$downControl"}))),ea=As("controlLabel","span"),ta=As("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),oa=As("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}))),na={schema:Cs(Zs(js("$label"),Es("$help"),Is(Ms(),p("$value.length === 0",p("$slots.empty",Bs()),p("$slots.default",Rs(Ks(ta(oa(Vs("dragHandle"))),Us(zs("$slots.default")),qs(Js(Ys(ea("$ui.moveUp.value"),Vs("moveUp"))),Gs(Ns(ea("$ui.remove.value"),Vs("remove"))),Xs(Ps(ea("$ui.add.value"),Vs("add"))),Qs(Ws(ea("$ui.moveDown.value"),Vs("moveDown")))))),Ts()))),Hs('$addLabel || ($ui.add.value + " " + ($label || ""))')),Os(Fs("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",be.bind(null,e)),e.on("mounted",(()=>{vn(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){ye(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void ye(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},In,An("remove"),An("add"),An("moveUp"),An("moveDown"),Dn("dragHandle","dragHandle"),Dn("remove","trash"),Dn("add","add"),Dn("moveUp","arrowUp"),Dn("moveDown","arrowDown")]},ra=new WeakMap,sa=a("rt"),{outer:aa,wrapper:la,inner:ia,label:pa,prefix:da,suffix:ca,help:ua,messages:fa,message:ha,icon:va}=l(sa),ma=sa("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),ga=sa("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),$a=sa("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),ba=sa("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),ya=sa("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),xa=sa("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),wa=sa("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),_a=sa("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),ka=sa("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Sa=sa("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),La={schema:aa(la(pa("$label"),ia(va("prefix"),da(),ma(ga($a(ba(wa(ka(p("$slots.onItem",(()=>()=>"$slots.onItem"),p("$slots.default",(()=>()=>"$slots.default"),va("rating"))))),_a(Sa(p("$slots.offItem",(()=>()=>"$slots.offItem"),p("$slots.default",(()=>()=>"$slots.default"),va("rating"))))),ya()),xa()))),ca(),va("suffix"))),ua("$help"),fa(ha("$message.value"))),type:"input",props:[],features:[function(e){function t(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=hn(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=hn(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,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)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);xe(e,o)})),e.on("created",(()=>{e.context&&(vn(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Ae.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>De.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>we.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>Me.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Ce.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Ie.call(null,e),e.context.handlers.handleDragstart=t=>o=>Le.call(null,e,t,o),e.context.handlers.handleMouseup=t=>Se.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>ke.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>_e.call(null,e,t),e.context.handlers.handleKeydown=t=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(e,t,o))}))},Dn("rating","star")]},Da=a("ac"),{outer:Aa,wrapper:Ca,inner:Ia,icon:Ma,label:Ta,prefix:Ea,suffix:Oa,help:Fa,messages:Va,message:Ba}=l(Da),Pa=Da("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",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $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"}}))),Ha=Da("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",tabindex:'$disabled && "-1" || 0',"aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-disabled":"$disabled || $state.loading || undefined","data-disabled":"$disabled || $disabledInternally || undefined"}}))),Na=Da("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-is-selection":"true","data-active-selection":"$fns.isActiveSelection($activeSelectionValue, $option)"}}))),Ra=Da("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Ka=Da("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Wa=Da("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Ya=Da("optionLoading","span"),Ua=Da("option",(()=>({$el:"div",if:"$value !== undefined"}))),Za=d(Da),ja=new WeakMap,za="undefined"!=typeof window,qa=new WeakMap;let Ga=!1;const Xa={schema:Aa(Ca(Ta("$label"),Ia(Ma("prefix"),Ea(),Pa(),p("$multiple !== true && $selectionAppearance === option && $expanded === false",Ka(Na(Ra(Ua(p("$state.loading",Ya("$ui.isLoading.value"),"$option.label"))),p("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",Ma("loader")),p("$selectionRemovable && $isSingleOption",Wa(Ma("close")))))),p("$state.loading && ($isSingleOption !== true || $selections.length === 0)",Ma("loader")),p('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',Wa(Ma("close")),p('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',Ha(Ma("select")))),p("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",Ha(Ma("select"))),Za(),Oa(),Ma("suffix")),p("$multiple && $selectionAppearance === option",Ka(Na(Ra(Ua(p("$state.loading && $isLoadingOption",Ya("$ui.isLoading.value"),"$option.label"))),Wa(Ma("close")))))),Fa("$help"),Va(Ba("$message.value"))),type:"input",family:"dropdown",props:[],features:[Dn("select","select"),Dn("close","close"),Dn("selected","check"),Dn("loader","spinner"),An("isLoading"),An("loadMore"),An("remove"),An("open"),An("close"),Cn,Z.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=hn(e.props.clearSearchOnOpen)),e.props.selectionRemovable=hn(e.props.selectionRemovable),e.props.openOnClick=hn(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=hn(e.props.allowNewValues)}),Oe,(function(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}Ye(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),vn(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[Mn()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};Tn({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,Tn({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,Tn({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Ne(e);else Ue(e)})),$e]},Ja=a("dp"),{outer:Qa,wrapper:el,inner:tl,icon:ol,label:nl,prefix:rl,suffix:sl,help:al,messages:ll,message:il}=l(Ja),pl=Ja("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"}}))),dl=Ja("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),cl=Ja("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),ul=Ja("nextLabel","span"),fl=Ja("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),hl=Ja("prevLabel","span"),vl=Ja("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),ml=Ja("calendarWeeks",(()=>({$el:"tbody"}))),gl=Ja("calendarHeader",(()=>({$el:"thead"}))),$l=Ja("weekDays",(()=>({$el:"tr"}))),bl=Ja("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),yl=Ja("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),xl=Ja("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")'}}))),wl=Ja("day","div"),_l=Ja("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'}}))),kl=Ja("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Sl=Ja("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)"}}))),Ll=Ja("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Dl=Ja("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)"}}))),Al=Ja("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Cl=Ja("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Il=Ja("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Ml=Ja("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Tl=Ja("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),El=Ja("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Ol=Ja("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Fl=Ja("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Vl=Ja("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Bl=Ja("time",(()=>({$el:"div",if:'$panel === "time"'}))),Pl=Ja("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),Hl=Ja("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:Nl,overlayLiteral:Rl,overlayChar:Kl,overlayEnum:Wl,overlay:Yl,overlayParts:Ul,overlayInner:Zl}=i(Ja),jl=Ja("panel","div"),zl=new WeakMap,ql=new WeakMap,Gl=new WeakSet,Xl=new WeakMap,Jl=new WeakMap,Ql=new WeakSet,ei=new WeakMap,ti=/[\uD800-\uDBFF]/,oi=new WeakMap,ni=new WeakMap,ri=new WeakMap,si=new WeakMap,ai=new WeakMap,li=new WeakSet,ii=new WeakMap,pi=new WeakMap,di=new WeakMap,ci=new WeakMap;let ui=!1;const fi=()=>{ui=!0,setTimeout((()=>{ui=!1}),500)},hi={"#":{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"}},vi=new WeakMap,mi="undefined"!=typeof window;let gi=!1;mi&&document.addEventListener("selectionchange",(()=>{const e=f();if(!(e instanceof HTMLInputElement))return;if(ci.has(e))return function(e){const t=ci.get(e);if(t){const[o,n]=t,[r,s]=Ct(e),a=s.indexOf(o);if(-1===a)return void ci.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];nt(rt(e),i)||dt(e,i)}}(e);if("select"!==ei.get(e))return;const t=rt(e);if(!nt(t,vi.get(e))){if(vi.set(e,t),Gl.has(e))return Gl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:rt(e)}))}}));var $i=/^([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})?$/,bi="1999-03-04T02:05:01.000Z",yi=new Map,xi=[["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"}]],wi=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],_i=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],ki={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Si=["MMMM","MMM","dddd","ddd"],Li=new Map([...xi,...wi,..._i].map((e=>[e[0],e]))),Di=new Map,Ai=["full","long","medium","short"],Ci=e=>String(e).padStart(2,"0"),Ii=e=>String(e).padStart(2,"0");const Mi="undefined"!=typeof window,Ti=new WeakSet,Ei=new WeakSet,Oi=new WeakSet,Fi=new WeakMap,Vi=new WeakMap,Bi=new WeakSet,Pi=new WeakSet,Hi="undefined"!=typeof window,Ni=new WeakMap,Ri={schema:Qa(el(nl("$label"),tl(ol("prefix"),rl(),Yl(Zl(Ul(Nl("$part.value"),Rl("$part.value"),Kl("$part.value"),Wl("$part.value")))),pl(),dl(Al(fl(hl("$ui.prev.value"),ol("prev")),Cl("$decade"),Il(El()),Ml(Ol(),El()),Tl(Ol(),Fl(),El()),cl(ul("$ui.next.value"),ol("next")),Hl(ol("close"))),jl(kl(Sl("$fns.format($year, $yearFormat)")),Ll(Dl("$fns.format($month, $monthFormat)")),vl(gl($l(bl("$fns.format($day, $weekdayFormat)"))),ml(yl(xl(wl("$fns.format($day, $dateFormat)"))))),Bl(Pl()))),Vl(ol("clear")),_l(ol("calendar")),sl(),ol("suffix"))),al("$help"),ll(il("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[Mo,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v,m,g,$,b,y,x,w,_;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","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=no(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=(b=e.props).yearFormat)&&void 0!==i||(b.yearFormat="YYYY"),null!==(p=(y=e.props).paginatedPanels)&&void 0!==p||(y.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(c=(w=e.props).format)&&void 0!==c||(w.format="long"),e.props.panels=wo(e),e.props.pickerOnly=hn(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=hn(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=hn(e.props.clearable)),null!==(u=(_=e.props).maxScan)&&void 0!==u||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):Ao.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Wt(t);else if("string"==typeof t)try{o=Wt(fo(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${io(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?no(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?fo(e.props.minDate):e.props.minDate;e.props.minDate=ao(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?fo(e.props.maxDate):e.props.maxDate;e.props.maxDate=ao(t,e.props.offset)}o=o&&ao(o,e.props.offset),o&&_o(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&&lo(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=lo,e.on("created",(()=>{if(vn(`${e.props.id}`,So.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>lo(t,o,e.props.locale||"en",!1,go),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!co(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!co(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 vo(t,ao(n instanceof Date?n:fo(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}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Fi.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Ei.has(e)&&(Oi.add(e),e.props.expanded=!0,setTimeout((()=>Oi.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;_o(e,void 0,!0),xo(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(Bi.has(e))return Bi.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=fo({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:go});if(function(e){return ro(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!ci.get(t.target)&&lo(n,e.props.format,e.props.locale,!1,go)!==t.target.value){const r=uo("dddd",e.props.locale),s=ro(e.props.format,e.props.locale),a=null===(o=ho(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=lo(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=Yt(n,t),Ti.add(e)}}_o(e,n)}catch(t){_o(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=zt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=jt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=zt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=jt(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),xo(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=co(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&&vo(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=Wt(e);return t.setHours(0,0,0),t}(t).getTime();return o<po(e).getTime()||o>Ut(e).getTime()||void 0}}}));const k=yo.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()),_o(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void xo(e,void 0);const o=new Date,n=t?xo(e,ao("string"==typeof t?fo(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=lo(n,"HH:mm"),function(e){const t=Vi.get(e);if(e._value&&t){const o=Zt(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",bo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Pi.delete(e),e.props.panels=wo(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=co(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}bo(e),vn(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{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)}),0)}),e.props.__root),Mi&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){Bi.add(e);const t="string"==typeof e._value?fo(e._value,e.props.valueFormat,e.props.valueLocale):e._value;xo(e,ao(t,e.props.offset))}else xo(e,void 0);Mi&&(Ei.add(e),document.removeEventListener("click",k),setTimeout((()=>Ei.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=po(e.props.renderedDate),r=Ut(jt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=jt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=jt(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=zt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=zt(e.props.renderedDate,-10))}e.props.expanded&&xo(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||ko(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Yt(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=Yt(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||ko(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=zt(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||ko(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=jt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=co(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",(()=>{Fi.get(e)&&Lo(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=bn({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Co(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},$e,An("next"),An("prev"),An("changeDate"),An("chooseDate"),Dn("close","close"),Dn("next","right"),Dn("clear","close"),Dn("prev","left"),Dn("calendar","date")]},Ki=a("tl"),{outer:Wi,wrapper:Yi,inner:Ui,icon:Zi,label:ji,prefix:zi,suffix:qi,help:Gi,messages:Xi,message:Ji}=l(Ki),Qi=Ki("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",name:"$node.name",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","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),ep=Ki("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),tp=Ki("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-is-tag":"true","data-active-selection":"$fns.isActiveSelection($activeSelectionValue, $option)"}}))),op=Ki("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),np=Ki("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),rp=Ki("tagLabel",(()=>({$el:"span"}))),sp=Ki("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),ap=Ki("tagLoading","span"),lp=d(Ki),ip={schema:Wi(Yi(ji("$label"),Ui(Zi("prefix"),zi(),sp(tp(op(p("$state.loading && $fns.hasOptionLoaderValue($option) || $option.label === undefined",ap("$ui.isLoading.value"),rp("$option.label")),np(Zi("close")))),Qi()),p("$state.loading",Zi("loader")),ep(Zi("select")),lp(),qi(),Zi("suffix"))),Gi("$help"),Xi(Ji("$message.value"))),type:"input",family:"dropdown",props:[],features:[Cn,Z.bind(null,(function(e){e.props.multiple=!0,e.props.openOnClick=hn(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=hn(e.props.allowNewValues)}),Oe,(function(e){Ye(e),ve(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),vn(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[Mn()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,En(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,On(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,Fn(t)}};Tn({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,Tn({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,Tn({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))})),Dn("select","select"),Dn("close","close"),Dn("selected","check"),Dn("loader","spinner"),An("isLoading"),An("loadMore"),An("remove"),An("open"),An("close"),$e]},pp=a("mk"),{outer:dp,wrapper:cp,inner:up,label:fp,prefix:hp,suffix:vp,help:mp,messages:gp,message:$p,icon:bp}=l(pp),{overlayPlaceholder:yp,overlayLiteral:xp,overlayChar:wp,overlayEnum:_p,overlay:kp,overlayParts:Sp,overlayInner:Lp}=i(pp),Dp=pp("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),Ap=new WeakMap,Cp=new WeakMap,Ip=new WeakMap,Mp={schema:dp(cp(fp("$label"),up(bp("prefix"),hp(),kp(Lp(Sp(yp("$part.value"),xp("$part.value"),wp("$part.value"),_p("$part.value")))),Dp(),vp(),bp("suffix"))),mp("$help"),gp($p("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[Mo,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,s;const a=Ge("string"==typeof e._value?e._value:"");Cp.set(e,a),Ip.set(e,a),e.props.allowIncomplete=hn(e.props.allowIncomplete),e.props.overlay=hn(e.props.overlay);const l=!(void 0!==e.props.showMask&&!hn(e.props.showMask));e.props.unmaskValue=hn(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=hn(e)),t(e))));const i={placeholder:l,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!==(s=e.props.suffix)&&void 0!==s?s:void 0,reverse:hn(e.props.reverse)};Ap.set(e,i),e.hook.input(((t,o)=>{const n=function(e,t){const o=Cp.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Ip.get(e);r.value=at(r,t);const s=qe(r,Ap.get(e)),a=Ht(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=u(Nt(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=qe(a,i),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),vn(`${e.props.id}`,To.bind(null,e),e.props.__root)}))}]},Tp=a("tf"),{outer:Ep,wrapper:Op,inner:Fp,icon:Vp,prefix:Bp,suffix:Pp,help:Hp,messages:Np,message:Rp}=l(Tp),Kp=Tp("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),Wp=Tp("legend",(()=>({if:"$label",$el:"legend"}))),Yp=Tp("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),Up=Tp("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),Zp=Tp("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),jp=Tp("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),zp=Tp("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),qp=Tp("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),Gp=Tp("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Xp=Tp("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Jp=Tp("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),Qp=Tp("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),ed=Tp("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$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.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred"}}))),td=Tp("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),od=Tp("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),nd=Tp("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),rd=Tp("loadMoreInner","span"),sd=Tp("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),ad=Tp("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),ld=Tp("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred"}}))),id=Tp("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":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),pd=Tp("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),dd=Tp("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),cd=Tp("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),ud=Tp("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),fd=Tp("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),hd=Tp("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'}}))),vd=Tp("controlLabel","span"),md=Tp("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),gd=Tp("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),$d=Tp("emptyMessageInner","span"),bd=Symbol(),yd=new WeakSet,xd=new WeakSet,wd={schema:Ep(Kp(Wp("$label"),Hp("$help"),Op(Yp(Up(Zp(),jp(p("$optionsLoadingCounter > 0",Vp("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),Gp(Xp(Jp(),Qp(Vp("close")))),ed(md($d("$sourceEmptyMessage")),td(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",Vp("selected")),od("$option.label")),nd(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",rd(p("$state.loading",Vp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),dd(ud(vd("$ui.addAllValues.value"),Vp("fastForward")),cd(vd("$ui.addSelectedValues.value"),Vp("moveRight")),fd(vd("$ui.removeSelectedValues.value"),Vp("moveLeft")),hd(vd("$ui.removeAllValues.value"),Vp("rewind"))),sd(ad(zp(),qp("$fns.getTargetItemCount($selectedTargetItems)")),ld(gd(p("$state.loading !== true",$d("$targetEmptyMessage"))),id(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",Vp("selected")),pd(p("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),Np(Rp("$message.value")))),type:"input",props:[],features:[Dn("moveRight","right"),Dn("moveLeft","left"),Dn("fastForward","fastForward"),Dn("rewind","rewind"),Dn("close","close"),Dn("loader","spinner"),Dn("selected","check"),An("isLoading"),An("loadMore"),An("addAllValues"),An("addSelectedValues"),An("removeSelectedValues"),An("removeAllValues"),Cn,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),e.props.loadMoreOption={label:"Load more",value:bd},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=y.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=hn(e.props.disabled)),e.props.searchable=hn(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=hn(e.props.clearOnSelect),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=>h(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(v(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Bo(e)),"function"==typeof e.props.optionLoader?Ho(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Yo(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Bo(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Bo(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,yd.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===bd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>fn(h(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){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,e.props.sourceListOrigin=!0,yd.delete(e),Uo(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,xd.delete(e),Uo(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(qr)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(qr),e.props.skipSetActiveValue=!0,Bo(e))}))}(e)}]},_d=a("sl"),{outer:kd,wrapper:Sd,inner:Ld,icon:Dd,label:Ad,prefix:Cd,suffix:Id,help:Md,messages:Td,message:Ed}=l(_d),Od=_d("chart",(()=>({$el:"div",if:"$chart"}))),Fd=_d("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 + "%"'}}}}))),Vd=_d("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),Bd=_d("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),Pd=_d("trackWrapper",(()=>({$el:"div"}))),Hd=_d("trackInner",(()=>({$el:"div"}))),Nd=_d("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Rd=_d("linkedValues",(()=>({$el:"div"}))),Kd=_d("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"}))),Wd=_d("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Yd=_d("marks",(()=>({$el:"div",if:"$marks"}))),Ud=_d("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) + "%"'}}}))),Zd=_d("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),jd=_d("handles",(()=>({$el:"ul"}))),zd=_d("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"}}))),qd=_d("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"}}))),Gd=_d("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Xd=_d("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Jd=_d("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"}}))),Qd=_d("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"}}))),ec={schema:kd(Sd(Ad("$label"),Md("$help"),Vd(Dd("prefix"),Cd(),Bd(Od(Fd()),Pd(Hd(Nd(),Yd(Ud(Zd())),jd(qd(Qd(),Gd()),zd(Jd(),Xd()))))),Id(),Dd("suffix"),p("$showInput && $isMulti === false",Kd())),p("$showInput && $isMulti",Rd(Wd(),Kd())),Td(Ed("$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){u();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 p(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){u();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(void 0===t){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return r(),void l()}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==f?void 0:f.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=d([...e._value].sort(s))}else Array.isArray(t)?n=d(t):(n=d(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=c(n));const a=i(n);o&&e.input(a),r(),l()}function l(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];h&&h.input(t),v&&v.input(o)}else v&&v.input(e._value)}function i(t){return e.props.isMulti&&Array.isArray(t)?[i(t[0]),i(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function p(t){return parseFloat(t.toFixed(e.props.decimals))}function d(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>p(Math.round(t/e.props.step)*e.props.step))):p(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 p(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 p(n.value+Math.round((t-n.value)/n.step)*n.step)}}function c(t){if(Array.isArray(t))return t[0]=c(t[0]),t[1]=c(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}}function u(){if(g)return;hn(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=m[e.props.scalingFunction]||m.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...m.linear,...e.props.scalingFunction}):e.props.scalingFunction=m.linear,g=!0}let f,h,v;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const m={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)}};let g=!1;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=hn(e.props.disabled)),e.on("created",(()=>{function l(o){var n;if(!f||!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}=f.getBoundingClientRect();a(t((r-s)/l*100))}var p;u(),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 d=hn(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":d;const m=hn(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=hn(e.props.markLabels),e.props.snapToMarks=hn(e.props.snapToMarks),e.props.showInput=hn(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,vn(`track-${e.props.id}`,(()=>{var t;f=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value,!1),r()}),e.props.__root),e.context){let r=0,p="";const d=e.context.handlers.blur;e.context.handlers.blur=t=>{d(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!f)return;e.props.dragging=!1;const{left:n,width:r}=f.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(!f)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,a(e._value)},e.context.handlers.startDrag=t=>{if(!f)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,l,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,l),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=c(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=>{v=t,t.hook.commit(((o,n)=>{if(fn(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(i(r))}))},e.context.handlers.minNode=t=>{h=t,t.hook.commit(((o,n)=>{if(fn(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(i(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),h&&h.input(e.value[0]),v&&v.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value,!1)})),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)}))}]},tc=a("cp"),{outer:oc,wrapper:nc,inner:rc,label:sc,prefix:ac,suffix:lc,help:ic,messages:pc,message:dc,icon:cc}=l(tc),uc=tc("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",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'}}))),fc=tc("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:""}}}}))),hc=tc("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),vc=tc("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"}}))),mc=tc("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),gc=tc("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),$c=tc("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),bc=tc("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 + "%"'}}))),yc=tc("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),xc=tc("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),wc=tc("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"}}))),_c=tc("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),kc=tc("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),Sc=tc("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"}}))),Lc=tc("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),Dc=tc("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),Ac=tc("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=tc("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),Ic=tc("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),Mc=tc("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),Tc=tc("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"}}]}))),Ec=tc("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"}}]}))),Oc=tc("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"}}]}))),Fc=tc("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"}}]}))),Vc=tc("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"}}]}))),Bc=tc("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"}}]}))),Pc=tc("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"}}]}))),Hc=tc("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"}}]}))),Nc=tc("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"}}))),Rc=tc("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Kc=tc("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"}}}}))),Wc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Yc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Uc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},Zc={schema:oc(nc(sc("$label"),p("$inline && $help",ic("$help")),rc(p("($inline === undefined || $inline === false) && $prefixIcon !== undefined",cc("prefix","label")),p("$inline === undefined || $inline === false",ac()),p("$inline === undefined || $inline === false",uc(Ac(),p("$showValue",fc()))),p("$inline || $expanded)",hc(p("$showPanelClose && ($inline === undefined || $inline === false)",vc(cc("close"))),p("$panelControls",mc(gc($c(),bc()),Lc(Dc()),yc(xc(),wc()),_c(kc(),Sc()),p("$eyeDropper && $hasNativeEyeDropper",Cc(cc("eyeDropper"))))),p("$panelFormat",Ic(Mc(p('$panelActiveFormat === "hex"',Tc()),p('$panelActiveFormat === "rgba"',Ec()),p('$panelActiveFormat === "rgba"',Oc()),p('$panelActiveFormat === "rgba"',Fc()),p('$panelActiveFormat === "hsla"',Bc()),p('$panelActiveFormat === "hsla"',Pc()),p('$panelActiveFormat === "hsla"',Hc()),p('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',Vc())),Nc(cc("switch")))),p("$options",Rc(Kc())))),p("$inline === undefined || $inline === false",lc()),p("($inline === undefined || $inline === false) && $suffixIcon !== undefined",cc("suffix"))),p("$: ($inline === undefined || $inline === false) && $help",ic("$help"))),pc(dc("$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(k&&k.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!en(n)&&!Wc.test(n)&&!Yc.test(n))return;(en(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=tn(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||jo(o,2)===e.props.h&&jo(r,2)===e.props.s&&jo(s,2)===e.props.v&&jo(a,2)===e.props.alpha)||(e.props.alpha=jo(a,2),x(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=tn(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=jo(s,2),x(o,n,r)}else x(e.props.h,e.props.s,e.props.v)}else x(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!I)return;const o=I[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),vn(`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]=zo(t.sRGBHex);e.props.alpha=1,x(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),E,v),l("canvas-hue",(e=>{L=e}),d,m),l("canvas-alpha",(e=>{D=e}),O,g),i(`canvas-preview-${e.props.id}`,(e=>{A=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{C=e,u()}),V),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&&_&&r(e)},p=e=>{_&&r(e)},d=()=>{_=void 0,a()},c=()=>{_=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"),_=Uc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),_=Uc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){vn(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(){vn(`swatches-${e.props.id}`,(()=>{var t,o,n;I=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),I.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=I[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,b()}),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(!A)return;const t=A.getContext("2d");if(!t)return;$(A,A.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,A.width,A.height)}function u(){if(!C)return;const t=C.getContext("2d");if(!t)return;$(C,C.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,C.width,C.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]=on(o),[l,i,p,d]=qo(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=()=>{_=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{_=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;B(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,B(e.props.h,e.props.s,e.props.v)}))}function g(t){h(t,D,((t,o)=>{const n=t/D.width*100/100;e.props.alpha=n,B(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 b(){var t,o;if(!e.context||!e.props.options||!I)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`${jo(0===o||100===o&&0===t?0:e,0)}-${jo(r,0)}-${jo(o,0)}-${jo(n,2)}`}(r,s,a,l);let p=!1,d=!1;I.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&&I&&(n(I.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=I[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function y(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 x(t,o,n,r=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:jo(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:jo(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:jo(Math.max(Math.min(n,100),0),2);const{h:s,s:a,v:l,alpha:i}=e.props,[p,d,c]=qo(s,a,l),[u,f,h]=Xo(s,a,l),v=e.props.hexInputFocused?e.props.hex:Qo(s,a,l,i),m=jo(i,2);e.props.hsla={h:s,s:d,l:c,a:m},e.props.hslaPercent={h:jo(s,0),s:100===l&&0===a?0:jo(0===l?d/255:Math.max(Math.min(d/255*100,100),0),0),l:jo(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:m},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${m})`,e.props.hslaStringPrecise=`hsla(${s}, ${jo(0===l?d/255:d/255*100,2)}%, ${jo(c/255*100,2)}%, ${m})`,e.props.rgba={r:u,g:f,b:h,a:m},e.props.rgbaString=`rgba(${u}, ${f}, ${h}, ${m})`,y(v),setTimeout((()=>{var t;w(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),k||"undefined"==typeof window||(k=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const g=e.props.valueFormat?e.props.valueFormat:e.props.format;r||("hex"===g?e.input(e.props.hex):"rgba"===g?e.input(e.props.rgbaString):"hsla"===g&&e.input(e.props.hslaStringPrecise))}function w(){E(),O(),F(),V()}let _,k=null,S=null,L=null,D=null,A=null,C=null,I=null,M=0;const T=["hex","rgba","hsla"],E=nn((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),O=nn((function(){if(!D)return;const t=D.getContext("2d");if(!t)return;const o=Math.round(D.width),n=Math.round(D.height);t.clearRect(0,0,o,n),$(D,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=nn(c,2),V=nn(u,2),B=nn(x,2),P=nn(b,10,!1);e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=rn(e.props.panelControls),e.props.eyeDropper=rn(e.props.eyeDropper),e.props.panelFormat=rn(e.props.panelFormat),e.props.showValue=rn(e.props.showValue),e.props.allowPaste=rn(e.props.allowPaste),e.props.inline=hn(e.props.inline),e.props.disabled=hn(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=hn(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},x(0,0,0,!0)):o(`${e.value}`),e.on("input",(({payload:t})=>{k&&void 0!==e.props.__root&&!k.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:expanded",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}var o;if(e.props.expanded)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=tn(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),`${jo(n,t)}-${jo(r,t)}-${jo(s,t)}-${jo(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},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.expanded=!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.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!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.expanded){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(sn),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":x(o,n-s,r);break;case"ArrowRight":x(o,n+s,r);break;case"ArrowUp":x(o,n,r+s);break;case"ArrowDown":x(o,n,r-s);break;case"PageUp":x(o,n,r+10);break;case"PageDown":x(o,n,r-10);break;case"Home":x(o,n-10,r);break;case"End":x(o,n+10,r)}w()}},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":x(o-s,n,r);break;case"ArrowRight":case"ArrowUp":x(o+s,n,r);break;case"PageUp":x(o+10,n,r);break;case"PageDown":x(o-10,n,r);break;case"Home":x(0,n,r);break;case"End":x(360,n,r)}w()}},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=jo(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=jo(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=jo(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=jo(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}x(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,en(r)){const[t,o,n,s]=zo(r);e.props.alpha=s,y(r),x(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!en(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;en(o)&&y(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]=Go(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);x(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]=Jo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);x(t,o,n)}else"alpha"==t&&(e.props.alpha=i,x())},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]=on(o.dataset.colorPrecise);e.props.alpha=s,x(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!I||!I.length)return;const l=I.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)}(I),d=I.length;let c=0,u=d,f=!1;const h=I[l].dataset.group;if(void 0!==h){const e=I.filter((e=>e.dataset.group===h));c=I.indexOf(e[0]),u=I.indexOf(e[e.length-1])}const v=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,M=v,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void I.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),M=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-(M-v))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(M-v))),f=!0;break;case"ArrowLeft":i=l-1,M=(i-c)%p;break;case"ArrowRight":i=l+1,M=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=I[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=I[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=I.filter((e=>e.dataset.group===h)),n=I.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,M),e-1)}else i>u&&(i=v?Math.min(u+Math.max(d,M)+1,I.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),I.forEach((e=>{delete e.parentElement.dataset.focused}));const e=I[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},$e,Cn,Dn("eyeDropper","color"),Dn("close","close"),An("close"),An("next")]},jc=a("tb"),{outer:zc,inner:qc,wrapper:Gc,label:Xc,prefix:Jc,suffix:Qc,help:eu,messages:tu,message:ou,icon:nu}=l(jc),ru=jc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),su=jc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),au=jc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),lu=jc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),iu=jc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}))),pu={schema:zc(p("$options",Gc(Xc("$label"),lu(iu(su(p("$fns.isChecked($option) === true",au("$slots.default || $slots.on || $option.onLabel || $option.label"),au("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Gc(p("$label && ($slots.default || $slots.on || $onLabel)",Xc("$label")),ru(nu("prefix"),Jc(),p("$_isChecked === true",au("$slots.default || $slots.on || $onLabel || $label"),au("$slots.default || $slots.off || $offLabel || $label")),Qc(),nu("suffix")))),eu("$help"),tu(ou("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,n,r;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=hn(e.props.enforced),e.props.multiple=hn(e.props.multiple),e.props.vertical=hn(e.props.vertical),e.props.disabled=hn(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=an(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>an(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?h(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],n=o.findIndex((e=>fn(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else fn(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(fn(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},Cn]},du=a("tb"),{outer:cu,inner:uu,wrapper:fu,label:hu,prefix:vu,suffix:mu,help:gu,messages:$u,message:bu,icon:yu}=l(du),xu=du("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),wu={schema:cu(fu(hu("$label"),uu(yu("prefix"),vu(),xu(),mu(),yu("suffix"))),gu("$help"),$u(bu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(h=e.props).step)&&void 0!==a||(h.step=1),null!==(l=(v=e.props).unit)&&void 0!==l||(v.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ln(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},Cn]},_u={schema:cu(fu(hu("$label"),uu(yu("prefix"),vu(),xu(),mu(),yu("suffix"))),gu("$help"),$u(bu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).currency)&&void 0!==o||(d.currency=e.props.currency||"USD"),null!==(n=(c=e.props).decimals)&&void 0!==n||(c.decimals=null),null!==(r=(u=e.props).minDecimals)&&void 0!==r||(u.minDecimals=null),null!==(s=(f=e.props).min)&&void 0!==s||(f.min=null),null!==(a=(h=e.props).max)&&void 0!==a||(h.max=null),null!==(l=(v=e.props).step)&&void 0!==l||(v.step=1),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(ln(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},Cn]};var ku=Object.freeze({__proto__:null,autocomplete:Xa,colorpicker:Zc,currency:_u,datepicker:Ri,dropdown:is,mask:Mp,rating:La,repeater:na,slider:ec,taglist:ip,toggle:Ds,togglebuttons:pu,transferlist:wd,unit:wu});const Su="undefined"!=typeof window?setInterval:()=>0,Lu=new WeakSet;export{p as $if,Xa as autocomplete,Zc as colorpicker,l as createBaseSections,pn as createProPlugin,a as createSectionFactory,_u as currency,Ri as datepicker,is as dropdown,ku as inputs,Mp as mask,La as rating,na as repeater,ec as slider,ip as taglist,Ds as toggle,pu as togglebuttons,wd as transferlist,wu as unit};
|
|
1
|
+
function e(e,o){e in Qn||(Qn[e]={timer:0,inputs:new Set});const n=Qn[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=zn((()=>{Gn[e]||(Gn[e]=zn((()=>tr.add(e)),2e3)),function(e){if(Zn){window.addEventListener(Yn(),(o=>{const n=new URL(o.blockedURI).hostname;jn.some(((e,t)=>Jn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=Xn(Nn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(Qn[e].inputs),i=l.filter((t=>!(er[e]&&er[e].has(t)))).join("");if(qn(e),i){o++;try{const a=await window[Xn(Kn)](`${n}${r}${Jn((s+o)%jn.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[Xn(Rn)])return t(e,p.schema);if(a.ok)return er[e]||(er[e]=new Set),void l.forEach((t=>er[e].add(t)))}catch(e){}o<2&&zn(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){tr.add(e),function(e,t){or[e]&&or[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return tr.has(o)?null:t}function n(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function r(e,t,n,r){return(...a)=>l=>i=>{const p=function(e,t,n,r,a,l){const i=l[n],p="function"==typeof r?r():{$el:r},d=a.map((e=>"string"==typeof e?e:e(t)(l)));let c=d.length&&p?Ln(p,{children:d}):p;if(c=Ln(c,i),"object"==typeof c){let a=c;if(!$n(c)&&!bn(c)||c.meta||(c.meta={section:n,node:r}),$n(c)){const{$el:r,...l}=c;l.attrs?"class"in l.attrs||"if"in l.attrs||(l.attrs={class:`$classes.${n}`,...l.attrs}):l.attrs={class:`$classes.${n}`},a=s(t,n,Object.defineProperty(l,"$el",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if(bn(c)){const{$cmp:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$cmp",{enumerable:!1,get:o.bind(null,r,t,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${n}`;const{$formkit:r,...l}=c;a=s(t,n,Object.defineProperty(l,"$formkit",{enumerable:!1,get:o.bind(null,r,t,e)}))}return a}return s(t,n,c)}(e,l,t,n,a,i);return r&&cn(p)&&(p.memo=e+JSON.stringify(i)),r?[p]:p}}function s(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 a(e){return(t,o,n=!1)=>r(e,t,o,n)}function l(e){return{outer:e("outer",nr,!0),wrapper:e("wrapper","div",!1),inner:e("inner",rr,!1),icon:dr,label:e("label",sr,!1),prefix:e("prefix",pr,!1),suffix:e("suffix",pr,!1),help:e("help",ir,!1),messages:e("messages",ar,!1),message:e("message",lr,!1)}}function i(e){return{overlayPlaceholder:e("overlayPlaceholder",cr),overlayLiteral:e("overlayLiteral",ur),overlayChar:e("overlayChar",fr),overlayEnum:e("overlayEnum",hr),overlay:e("overlay",vr),overlayParts:e("overlayParts",gr),overlayInner:e("overlayInner",mr)}}function p(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)}:(kn(s)?Object.assign(s.else,{if:e}):Sn(s)&&Object.assign(s,{if:e}),s)}}function d(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_popover"',popover:{if:"$usePopover",then:"$popover",else:void 0},"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",bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",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)"}}))),d=e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),c=e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),u=e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),f=e("groupLabel","span"),h=e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>{return t(o(a(l("$emptyMessage")),d(p("$option.group",u(f("$option.group"),h(c((e=()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'}),v=n(p("$fns.isSelected($option)",dr("selected")),i("$option.label")),t=>{const o=o=>{const n=v(t)(o),r="function"==typeof e?e(t):e;return un(r)?(kn(n)&&$n(n.else)?n.else.attrs={...n.else.attrs,...r}:$n(n)&&(n.attrs={...n.attrs,...r}),n):n};return o._s=v._s,o})))),n(p("$fns.isSelected($option)",dr("selected")),i("$option.label")))),r(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(p("$state.loading",dr("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,v}}function c(e){return cn(e)&&"value"in e&&"label"in e}function u(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 f(){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 h(e){return"__original"in e?e.__original:e.value}async function v(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(zr.get(e));const o=t?e.props.debounce:0;0===o?m(e,n):zr.set(e,setTimeout((()=>{e.props.page=1,m(e,n)}),o))}else if(Array.isArray(e.props.options)){const o=JSON.parse(JSON.stringify(e.props.initialOptions));e.props.options=[...o.filter((o=>{if("options"in o){const n=o.options=[...o.options].filter((o=>e.props.filter(o,null!=t?t:"",e)));return n.length>0&&{...o,options:n}}return e.props.filter(o,null!=t?t:"",e)}))]}}function m(e,t){e.props.allowAppendOptions=t,b(e)}function g(e,t){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const o=Dn(t);e.props.appendingOptions=!0,e.props.activeValue=h(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=Dn(t);e.props.options=o,e.props.options.length||(e.store.set(Gr),e.store.set(yn({key:"hasNextPage",type:"state",value:!1,visible:!1}))),jr.set(e,e.props.searchValue)}function $(e,t,o){if(e.store.set(qr),e.props.optionLoadingCounter++,e.props.multiple&&"truncate"!==e.props.selectionAppearance){let o;o=fn(t)?{label:"Loading...",value:String(t)}:{label:String(t),value:t},e.props.optionLoaderValues.includes(o.value)||e.props.optionLoaderValues.push(o.value),"transferlist"===e.props.type||e.props.selections.includes(o)||(e.props.selections=[...e.props.selections,o])}const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:c(e)?e:cn(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>{const o=e.props.memoOptions.findIndex((e=>hn(h(e),h(t))));return-1===o?e.props.memoOptions=[...e.props.memoOptions,t]:e.props.memoOptions[o]=t,t};return n instanceof Promise?n.then((e=>{if("string"==typeof e||c(e))return s(r(e))})).finally((()=>{e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--})):(e.props.optionLoaderValues=e.props.optionLoaderValues.filter((e=>e!==t)),e.props.optionLoadingCounter--,s(r(n)))}function b(e){e.store.set(qr),e.props.optionsLoadingCounter++,e.store.set(yn({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Xr.get(e)),n=g.bind(null,e),r=o instanceof Promise?o.then(((...o)=>{void 0!==e.props.nonceKey&&t!==e.props[e.props.nonceKey]||n(...o)})):(n(o),e.props.optionsLoadingCounter--);if(r instanceof Promise)return r.finally((()=>{e.props.optionsLoadingCounter--}))}function y(e,t){e.props.page++,Xr.set(e,t),e.store.set(yn({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function x(e,t){if(e.props.optionRemoved=!0,t){const o=(e.props.inputStd||[]).filter((e=>!hn(h(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 w(e){const t=Qr(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:Zn&&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 _(e){var t,o;if(e.props.allOptions&&e.props.allOptions.length)if(null===(t=e.props.highlightedRange)||void 0===t?void 0:t.option.value)e.props.activeValue=h(e.props.highlightedRange.option);else{if(e.props.activeSelectionValue){const t=e.props.allOptions.find((t=>hn(h(t),e.props.activeSelectionValue)));if(t)return void(e.props.activeValue=t.value)}if(e.props.reloadOnCommit)e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.searchValue&&!e.props.appendingOptions)e.props.activeValue=h(e.props.allOptions[0]);else if(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=h(e.props.selections[e.props.selections.length-1]):e.props.activeValue=h(e.props.allOptions[0]);else{if(e.props.appendingOptions)return void(e.props.appendingOptions=!1);e.props.activeValue=h(e.props.allOptions[0])}e.props.appendingOptions&&(e.props.appendingOptions=!1)}}}function k(e){return e.reduce(((e,t)=>(t.options?e.push(...k(t.options)):e.push(t),e)),[])}function S(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(h(t)!==Jr?(e.props.option=t,e.props.maxReached&&!A(e,t)||(e.input(L(e,h(t))),A(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function L(e,t){if(e.props.multiple){const o=Array.isArray(e.value)?e.value:[];for(const n of o)if(hn(n,t))return e.props.optionRemoved=!0,o.filter((e=>!hn(e,t)));return[...o,t]}return hn(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function D(e,t){return hn(e.props.activeValue,h(t))||void 0}function A(e,t){if(e.props.multiple){if(!Array.isArray(e.value))return!1;for(const o of e.value)if(hn(o,h(t)))return!0;return!1}return hn(e.value,h(t))}function C(e){var t,o;if(!e.props.usePopover||"overscroll"===e.props.behavior)return;const n=e.props.invertPopover?e.props.popoverCoordinates.y-e.props.popoverCoordinates.height-e.props.popoverOffset-e.props.popoverAncestorCoordinates.height:e.props.popoverCoordinates.y+e.props.popoverOffset;e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,minWidth:0,width:"100%",maxWidth:(null===(o=null===(t=e.props)||void 0===t?void 0:t.popoverAncestorCoordinates)||void 0===o?void 0:o.width)+"px",top:n+"px",bottom:"unset",left:e.props.popoverCoordinates.x+"px",margin:0,padding:0}}function I(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&&0===e.props.optionsLoadingCounter){e.props.optionsLoaded=!0;const t=b(e);t instanceof Promise&&t.then((()=>{w(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(let o=0;o<e.length;++o)if(e[o]!==t[o])return!1;return!0}(t,e.props.inputStd)?0===e.props.optionsLoadingCounter&&w(e):(t=e.props.inputStd,async function(e){const t=Qr(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>hn(h(e),t))))):e.props.inputStd;if(o.forEach((o=>{$(e,o,Array.isArray(t)&&t.find((e=>hn(h(e),o)&&!e.noOptionFound)))})),e.props.optionLoadingCounter){const t=e.on("prop:optionLoadingCounter",(()=>{w(e),e.props.optionLoadingCounter||e.off(t)}))}else w(e)}(e))}))}function M(e){function t(e,t){"overscroll"!==e.props.behavior&&"none"===getComputedStyle(t).maxHeight&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,maxHeight:"400px"});const n=new MutationObserver((n=>{const r=n[0].target;if("overscroll"===e.props.behavior&&r.id!==`${e.props.id}_popover`)return;const s=e.props.positionListBox(t);es.delete(e),o(e,s);let a,l=null;const i=new ResizeObserver((()=>{clearTimeout(a),a=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),l||(l=e.on("prop:expanded",(()=>{i.disconnect(),e.off(l)})))}))}));i.observe(t)}));n.observe(t,{childList:!0,subtree:!0})}function o(e,t){var o;if(!e.props.expanded||!e.props.options||!e.props.options.length||es.has(e))return;const r=e.props.options.reduce(((t,o,n)=>{var r,s,a;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;if("group"in o&&(null===(s=o.options)||void 0===s?void 0:s.length))return o.options.forEach(((o,r)=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_listitem_${n}_${r}`);a&&t.push([a,o])})),t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_listitem_${n}`);return l&&t.push([l,o]),t}),[]),s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);s&&r.push([s,e.props.loadMoreOption]),es.add(e),r.length&&n(e,r,t)}function n(e,t,r){var s,a,l,i;const p=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_popover`);if(e.props.trackHover){const o=p?p.getBoundingClientRect():{top:0,bottom:0};if(r=null,e.props.mouseY>o.top&&e.props.mouseY<o.bottom){let o=r||0,n=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 s&&!(null===(n=s.attrs)||void 0===n?void 0:n.disabled)?e.props.activeValue=h(s):e.props.activeValue=void 0,!0}return!1};do{if(null!==o&&s(o,t[o]))break;if(null!==n&&s(n,t[n]))break;null!==o&&(o++,o>t.length-1&&(o=null)),null!==n&&(n--,n<0&&(n=null))}while(null!==o||null!==n)}null===r&&(e.props.activeValue=void 0)}e.props.trackHover||T(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&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!0)),es.has(e)?requestAnimationFrame(n.bind(null,e,t,r)):o(e,r)):es.delete(e)}if(!Zn)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=>hn(e.value,h(t)))),-1===r&&(r=null);(null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant))&&T(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.invertPopover=!0,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"})):(e.props.invertPopover=!1,e.props.usePopover||(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}))}return r}.bind(null,e),e.props.styleWrapper=E.bind(null),e.on("mounted",(()=>{mn(`${e.props.id}_popover`,t.bind(null,e),e.props.__root)}));const r=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}_popover`);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)}},s=()=>{e.props.ignoreScroll?e.props.ignoreScroll=!1:e.props.trackHover=!0};e.on("prop:trackHover",(({payload:t})=>{var o,n,r;Zn&&(t?null===(r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_popover`))||void 0===r||r.removeEventListener("scroll",s):null===(o=e.props.__root)||void 0===o||o.getElementById(`${e.props.id}_popover`))})),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",r),e.props.styleWrapper(),_(e)):document.removeEventListener("mousemove",r)})),e.on("prop:trackHover",(({payload:t})=>{var o,n;Zn&&(t?null===(n=document.getElementById(`${e.props.id}_popover`))||void 0===n||n.removeEventListener("scroll",s):null===(o=document.getElementById(`${e.props.id}_popover`))||void 0===o||o.addEventListener("scroll",s))})),e.on("prop:activeValue",(({payload:t})=>{if(t===Jr)return void(e.props.activeDescendant=`${e.props.id}_load_more`);let o,n=-1;for(let r=0;r<e.props.options.length;r++){if("group"in e.props.options[r])for(let s=0;s<e.props.options[r].options.length;s++)if(hn(h(e.props.options[r].options[s]),t)){n=s,o=r;break}if(hn(h(e.props.options[r]),t)){n=r;break}}e.props.activeDescendant=n<0?void 0:void 0===o?`${e.props.id}_listitem_${n}`:`${e.props.id}_listitem_${o}_${n}`}))}function T(e){var t,o;if(!Zn)return;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_popover`),r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!n||!r)return;const{y:s,height:a}=r.getBoundingClientRect(),{y:l,height:i}=n.getBoundingClientRect();s<l?(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop):s+a>l+i&&(e.props.ignoreScroll=!0,n.scrollTop=r.offsetTop+a-i)}function E(){}function O(e){e.on("created",(()=>{if(!e.context||!Zn)return;e.context.fns.isActive=D.bind(null,e),e.context.fns.isSelected=t=>A(e,t),e.context.fns.hasOptionLoaderValue=t=>{for(const o of e.props.optionLoaderValues)if(hn(h(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Y,e.context.handlers.selectOption=t=>o=>U.call(null,e,t,o),e.context.handlers.loadMore=m.bind(null,e),e.context.handlers.removeSelection=t=>o=>W(e,t,o),e.context.handlers.tagTouchstart=t=>o=>W(e,t,o),e.context.handlers.selectionClick=t=>e.props.multiple?P.bind(null,e,t):B.bind(null,e),e.context.handlers.selectionBlur=()=>H.bind(null,e),e.context.fns.isActiveSelection=(e,t)=>hn(e,h(t)),e.context.handlers.tagClick=t=>N.bind(null,e,t),e.context.handlers.tagFocus=t=>R.bind(null,e,t),e.context.handlers.tagBlur=()=>K.bind(null,e);const t=e.context.handlers.blur;e.context.handlers.blur=function(e,o){var n;if(o&&o.relatedTarget instanceof HTMLElement){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(t instanceof HTMLElement&&t.contains(o.relatedTarget))return}t(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,e),e.context.handlers.touchmove=F.bind(null,e),e.context.handlers.touchend=V.bind(null,e)}))}function F(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=ts.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else ts.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function V(e){ts.delete(e)}function B(e,t){e.props.disabled||((!e.props.expanded&&e.props.openOnClick||e.props.openOnFocus)&&(e.props.expanded=!0),t.currentTarget instanceof HTMLElement&&t.currentTarget.focus())}function P(e,t,o){o.currentTarget instanceof HTMLElement&&(hn(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus()))}function H(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function N(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.justFocused?e.props.justFocused=!1:o.currentTarget instanceof HTMLElement&&(hn(e.props.activeSelectionValue,h(t))?e.props.activeSelectionValue=void 0:(e.props.activeSelectionValue=h(t),o.currentTarget.focus())))}function R(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=h(t),e.props.justFocused=!0)}function K(e,t){var o;if(t.relatedTarget instanceof HTMLElement){const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_inner");if(n instanceof HTMLElement&&n.contains(t.relatedTarget))return}e.props.activeSelectionValue=void 0}function W(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"},x(e,t))}function Y(e){e.stopPropagation()}function U(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},S(e,t))}function Z(e,t,o,n){!function(e){e.addProps(["options","expanded","placeholder","multiple","selections","activeValue","activeDescendant","forceExpanded","optionLoader","showEmptyMessage","emptyMessage","option","listboxStyles","invertPopover","dropdownWrapperStyles","optionsLoader","loadMoreOption","hasNextPage","page","behavior","selectionRemovable","openOnRemove","clearOnClick","openOnClick","hideOnOpen","closeOnSelect","openOnFocus","selectionAppearance","optionsAppearance","filter","inputText","formattedSelections","lastVisibleIndex","optionLoaderValues","disabledInternally","isLoadingOption","isLoadingOptions","thereIsAnOptionSelected","formattedSelections","activeSelections","allowNewValues","inputStd","isSingleOption","max","disableDragAndDrop","clearSearchOnOpen","firstSelectionLabel","memoOptions","loadOnCreated","alwaysLoadOnOpen","showFormattedSelections","truncationCount","reloadOnCommit","activeSelectionValue","setForceExpanded","option","loadOnScroll","optionsLoadingCounter","optionLoadingCounter","draggable","deselect"]),void 0===e.props.deselect?e.props.deselect=!0:e.props.deselect=vn(e.props.deselect),e.props.option={},e.props.expanded=!1,e.props.inputStd=[],void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.options||(xn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.allOptions=k(e.props.options),e.props.selections=[],e.props.memoOptions=[],e.props.invertPopover=!1,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:Jr},e.props.loadOptions=b,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=vn(e.props.searchable),e.props.loadOnScroll=vn(e.props.loadOnScroll),e.props.multiple=vn(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=vn(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&vn(e.props.openOnRemove),e.props.hasNextPage=y.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=vn(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),e.on("mounted",(()=>C(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{C(e)}),10)))}(n),n.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,h(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),I(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),M(e),e.props.loadOnCreated&&!e.props.optionsLoaded?b(e):e.props.optionsLoaded&&(e.props.optionsLoaded=!1),e.props.forceExpanded=vn(e.props.forceExpanded),e.props.forceExpanded&&(e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{e.props.setForceExpanded=!0}),100)))}))}(n),O(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.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&(e.props.emptyMessage&&(e.props.showEmptyMessage=!e.props.options.length),0===e.props.optionLoadingCounter&&e.store.set(Gr))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Gr)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=k(e.props.options),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)})),e.on("prop:expanded",(({payload:o})=>{var n;if(Zn)if(e.props.alwaysLoadOnOpen&&(e.props.page=1),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(),e.props.searchExpand||(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 j(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 z(e,t,o){var n,r,s;if(o.preventDefault(),e.props.trackHover=!1,e.props.expanded){const o=e.props.allOptions.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(h(t)),e}),[]);(null===(n=e.store.hasNextPage)||void 0===n?void 0:n.value)&&o.push(Jr);let a=-1;e.props.activeValue&&(a=o.findIndex((t=>hn(t,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 q(e,t){var o,n,r;if(("taglist"===e.props.type||"tags"===e.props.selectionAppearance)&&e.props.inputStd.length&&!e.props.inputText){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.selections[e.props.selections.length-1]?e.props.activeSelectionValue=h(e.props.selections[e.props.selections.length-1]):e.props.activeSelectionValue=void 0),void(e.props.expanded=!1);"ArrowRight"===t&&(null===(r=document.getElementById(`${e.props.id}_tag-wrapper_0`))||void 0===r||r.focus(),e.props.selections[0]?e.props.activeSelectionValue=h(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function G(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 X(e,t,o,n=!0){var r,s,a,l,i,p,d;const c=o.key;if(o.altKey){const n=f(),r=e.props.selections.findIndex((e=>hn(h(e),h(t)))),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=h(t),e.input([...s.map(h)]),setTimeout((()=>{n instanceof HTMLElement&&n.focus()}),100)}else{const o=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===o)return;const u="ArrowRight"===c?o+1:o-1;if(u>=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===(l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}`))||void 0===l||l.focus()}else if(u<0&&0===o)null===(p=null===(i=e.props.__root)||void 0===i?void 0:i.getElementById(`${e.props.id}`))||void 0===p||p.focus();else if(u<0)return;const f=null===(d=e.props.__root)||void 0===d?void 0:d.getElementById(`${e.props.id}_tag-wrapper_${u}`);f&&f.focus(),e.props.selections[u]?e.props.activeSelectionValue=h(e.props.selections[u]):e.props.activeSelectionValue=void 0}}function J(e,t,o){var n;if(!(o.currentTarget instanceof HTMLElement))return;if(e.props.searchValue)return;const r=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===r)return;const s=e.props.selections[r+1]?r+1:r-1,a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_tag-wrapper_${s}`);a&&a.focus(),e.props.userAction={type:"tagDelete"},x(e,t)}function Q(e,t){var o;if(t.preventDefault(),e.props.allowNewValues&&e.props.searchValue&&e.input(L(e,e.props.searchValue)),e.props.expanded){if(e.props.activeValue===Jr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>hn(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}function ee(e){e.props.expanded&&(e.props.expanded=!1)}function te(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o,!1);break;case"Delete":case"Backspace":J(e,t,o)}}function oe(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.findIndex((e=>hn(h(e),h(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.findIndex((e=>hn(h(e),h(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;if(t){const n=e.props.selections.findIndex((e=>hn(h(e),h(t))));if(-1===n)return;const r=e.props.selections[n+1]?n+1:n-1,s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_selection_wrapper_${r}`);s&&s.focus(),e.props.selections[r]?e.props.activeSelectionValue=h(e.props.selections[r]):e.props.activeSelectionValue=void 0}t&&1!==e.props.selections.length||(e.props.userAction={type:"selectionDelete"}),x(e,t)}(e,t)}}function ne(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":z(e,o,t);break;case"ArrowLeft":case"ArrowRight":q(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":j(e);break;default:e.emit("unusedKeydown",t)}}function re(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&&"autocomplete"===e.props.type&&"option"===e.props.selectionAppearance&&(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":z(e,o,t);break;case"ArrowRight":case"ArrowLeft":q(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":j(e)}}function se(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 ae(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 le(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===Jr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>hn(h(t),e.props.activeValue)));if(!t)return;S(e,t)}else e.props.expanded=!0}(e,n);e.props.expanded=!0,clearTimeout(t),o+=n.key;const r=e.props.allOptions.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=h(r)),t=setTimeout((()=>{o=""}),400)}}))}function ie(e){pe(e),e.on("prop:selections",(()=>{e.props.skipFormatSelections=!1,pe(e)})),Zn&&mn(`${e.props.id}_selections`,ce.bind(null,e),e.props.__root)}function pe(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 de(e){var t,o;if(!Zn||!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((()=>{pe(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,pe(e)}function ce(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:de(e))})),n=new ResizeObserver((()=>{de(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}function ue(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}_popover`),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 fe(e,t){var o,n;let r=null;if(e.props.activeDescendant){const s=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);if(!s)return r;e.props.ignoreScroll=!0;const a=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_listbox`);if(!a)return r;const l=t.getBoundingClientRect(),i=a.getBoundingClientRect(),p=parseInt(getComputedStyle(t).paddingTop),d=parseInt(getComputedStyle(t).paddingBottom),c=s.offsetTop-p,u=Math.max(c-p,0),f=Math.max(t.scrollHeight-d-c-l.height,0),v=i.height-u-f;t.scrollTop=c;const m=()=>{t.scrollTop=f>0?f<p?t.scrollHeight:p:u<d?0:c-d},g=Math.min(150,i.height);u>0&&f>0||0===u&&0===f||v>g?t.scrollTop=c:m();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=>hn(e.value,h(t))))),-1===r&&(r=null)}return r}function he(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&wn(300,[e]),e.props.dropdownWrapperStyles=gn(os),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=ue.bind(null,e),e.props.positionListBox=fe.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){ls=document.documentElement.scrollTop;for(const e in ns)as[e]=document.documentElement.style[e],document.documentElement.style[e]=ns[e];for(const e in rs)ss[e]=document.body.style[e],document.body.style[e]=rs[e];document.body.scrollTop=ls}():function(){for(const e in ns)document.documentElement.style[e]=as[e];for(const e in rs)document.body.style[e]=ss[e];document.body.scrollTop=0,document.documentElement.scrollTop=ls}())}))}function ve(e){e.addProps(["multiLine"]),e.on("created",(()=>{Zn&&(e.props.multiLineHeight=void 0,mn(`${e.props.id}_selections`,me.bind(null,e),e.props.__root))}))}function me(e){var t;const o=new ResizeObserver((t=>{for(const o of t){const{height:t}=o.contentRect;e.props.selectionsHeight!==t&&(e.props.selectionsHeight=t),ge(e,o.target)}})),n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_selections`);n&&o.observe(n)}function ge(e,t){var o;const n=t.querySelectorAll(`[id^="${e.props.id}_tag-wrapper"`);let r,s=[];if("taglist"===e.props.type){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;s=[t,...Array.from(n)]}else s=Array.from(n);if(!n)return;let a=!1;for(const t of s)if(void 0===r)r=t.getBoundingClientRect();else{const o=t.getBoundingClientRect();if(r.top>=o.top+o.height/5||r.top<=o.top-o.height/5){a=!0,e.props.multiLine=!0;break}}a||(e.props.multiLine=!1)}function $e(e){function t(){const{x:t,y:o,width:s,height:a}=function(e,t){if(!e||!t)return{x:0,y:0};const{left:o,top:n,width:r,height:s}=t.getBoundingClientRect();return{x:o+window.scrollX,y:n+s+window.scrollY,width:r,height:s}}(n,r);e.props.popoverAncestorCoordinates={x:t,y:o,width:s,height:a},e.props.popoverCoordinates={x:t,y:o,width:s,height:0}}function o(t){t?(null==n||n.showPopover(),setTimeout((()=>{e.props.popoverCoordinates.height=(null==n?void 0:n.offsetHeight)||0}),5)):(null==n?void 0:n.matches(":popover-open"))&&(null==n||n.hidePopover(),e.props.popoverCoordinates.height=0)}if(e.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),e.props.popover=vn(e.props.popover)?"manual":void 0,"input"!==e.type||"overscroll"===e.props.behavior)return;let n=null,r=null,s=[],a=null;if(e.props.popoverOffset=vn(e.props.popoverOffset)?parseInt(e.props.popoverOffset):0,!e.props.popover)return;if("undefined"==typeof document||!("popover"in HTMLElement.prototype))return void console.warn('FormKit: Popover API is not supported in this browser — input panels will be rendered with fallback CSS positioning. This could result in inaccessible inputs due to parent containers using "overflow: hidden" or z-index conflicts.');const l=()=>{document.removeEventListener("resize",a),document.removeEventListener("scroll",a),s.forEach((e=>{e.removeEventListener("scroll",a)}))};e.on("mounted",(()=>{e.context&&(e.props.usePopover=!0,e.props.popoverCoordinates={x:0,y:0,width:0,height:0},e.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),e.on("destroyed",(()=>{l()})),e.on("prop:expanded",(({payload:i})=>{var p;e.context&&(!1===i?l():mn(`${null===(p=e.context)||void 0===p?void 0:p.id}_popover`,(()=>{if(!e.context)return;n=document.querySelector(`#${e.context.id}_popover[popover]`)||document.querySelector(`#${e.context.id}_popover [popover]`),r||(r=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(n)),t(),o(i),a=is((()=>{e.context&&(t(),o(i))}),10),document.addEventListener("resize",a),document.addEventListener("scroll",a),s=[];let l=null==n?void 0:n.parentElement;for(;l;)l.scrollHeight>l.clientHeight&&s.push(l),l=l.parentElement;s.forEach((e=>{e.addEventListener("scroll",a)}))})))}))}function be(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.draggable=vn(e.props.draggable),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(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 ye(e,t){function o(){return Array.isArray(t.value)?t.value:[]}function n(e){t.input(e)}if(!t.context)return;const r={group:t.props.id,dragHandle:`#${t.props.id}_drag_handle`,draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[Tn({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};En({parent:e,getValues:o,setValues:n,config:r}),t.on("prop:disabled",(({payload:t})=>{r.disabled=t,En({parent:e,getValues:o,setValues:n,config:r})})),t.on("prop:draggable",(({payload:t})=>{r.disabled=!t,En({parent:e,getValues:o,setValues:n,config:r})}))}function xe(e,t){const o={onItems:[],offItems:[]},n=t||Number(e.value||0);for(let t=0;t<e.props.max;t++)if(t<n&&t+1>=n){const r=e.props.rightToLeft?100-100*(n-t):100*(n-t);o.onItems.push(r+"%"),o.offItems.push(100-r+"%")}else t<n?(o.offItems.push("0%"),o.onItems.push("100%")):t>=n&&(o.offItems.push("100%"),o.onItems.push("0%"));e.props.itemsToPercentages=o}function we(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function _e(e,t){const{x:o,y:n}=Te(t);let r=document.elementFromPoint(o,n);const s=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));let a=!0;for(;r&&a;){if(s.includes(r)){a=!1;break}r=r.parentNode}if(!a){const t=s.indexOf(r);if(1===e.props.step)return void e.input(t+1,!1)}}function ke(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?Ee(e,t,o):e.input(t+1,!1))}function Se(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,xe(e);const o=sa.get(e);o&&(o.abort(),sa.delete(e))}function Le(e,t,o){if(e.props.hoverHighlight||e.props.disabled)return;o.preventDefault(),e.props.hoverHighlight=!0,e.props.dragStarted=!0;const n=new AbortController;document.addEventListener("mouseup",(t=>Se(e,t)),{signal:n.signal}),sa.set(e,n),1===e.props.step?e.input(t+1,!1):Ee(e,t,o)}function De(e,t){var o,n;if(document.activeElement===t.currentTarget)if("ArrowRight"===t.key||"ArrowDown"===t.key){e.props.arrow=1;const t=e.value?Oe(e.value+1*e.props.step,e.props.step):e.props.min+1*e.props.step,n=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(e.value?`#${e.props.id}_inner input[value="${t}"]`:"#"+(e.props.id+"_0_0"));e.props.preventFocus=!0,n&&n instanceof HTMLInputElement&&n.focus(),e.props.preventFocus=!1,e.input(Number(t))}else if("ArrowLeft"===t.key||"ArrowUp"===t.key){e.props.arrow=-1;const t=e.value?Oe(e.value-1*e.props.step,e.props.step):e.props.max,o=null===(n=e.props.__root)||void 0===n?void 0:n.querySelector(`#${e.props.id}_inner input[value="${t}"]`);e.props.preventFocus=!0,o&&o instanceof HTMLInputElement&&o.focus(),e.props.preventFocus=!0,e.input(Number(t)),e.props.preventFocus=!1}}function Ae(e,t){if(!e.props.preventFocus)if(e.props.preventFocus=!0,setTimeout((()=>{e.props.preventFocus=!1}),50),t.relatedTarget instanceof HTMLElement&&t.relatedTarget.id===e.props.id+"_items_wrapper")e.props.arrow>0?setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_0_0"))||void 0===o||o.focus()})):e.props.arrow<0&&setTimeout((()=>{var t,o;null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+`_${e.props.max-1}_${e.props.stepsPerValue-1}`))||void 0===o||o.focus()}));else if(t.target instanceof HTMLInputElement){if(Number(t.target.value)===e.props.step&&e.value===e.props.max||Number(t.target.value)===e.props.max&&e.value===e.props.step){const t=document.getElementById(e.props.id+"_items_wrapper");return null==t||t.focus(),void e.input(0)}e.input(Number(t.target.value))}}function Ce(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(xe(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):Ee(e,t,o,!!e.props.dragStarted)))}function Ie(e){xe(e)}function Me(e,t,o){if(!e.props.disabled&&"touchstart"!==o.type&&(o.preventDefault(),(0!==o.clientX||0!==o.clientY)&&o.currentTarget instanceof HTMLElement))return 1===e.props.step?e.props.deselect&&Number(e.value)===t+1?void e.input(0):void e.input(t+1):void Ee(e,t,o)}function Te(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function Ee(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=Te(o),a=o.currentTarget.getBoundingClientRect();let l=Oe((r-a.x)/a.width+t,e.props.step);l=l>e.props.min?l:e.props.min,l=l<e.props.max?l:e.props.max,!e.props.deselect||l!==Number(e.value)||e.props.dragStarted?n?e.input(l,!1):xe(e,l):e.input(0)}function Oe(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}function Fe(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=v.bind(null,e),e.props.reloadOnCommit=vn(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=vn(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&Zn&&(e.context.handlers.focus=Pe.bind(null,e),e.context.handlers.input=Ve.bind(null,e),e.context.handlers.focus=Pe.bind(null,e),e.context.handlers.click=Be.bind(null,e),e.context.handlers.toggleListbox=He.bind(null,e),e.context.handlers.toggleListboxKeydown=Ne.bind(null,e),e.context.handlers.keydown=re.bind(null,e),e.context.handlers.selectionKeydown=t=>o=>oe(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":G(e);break;case"ArrowRight":case"ArrowLeft":X(e,t,o);break;case"Delete":case"Backspace":J(e,t,o)}}(e,t,o),e.on("prop:options",(({payload:t})=>{if((0===e.props.initialOptions.length&&"function"!=typeof e.props.optionsLoader||!e.props.searchValue&&t.length)&&(e.props.initialOptions=[...t]),e.props.selections&&e.props.selections.length&&t.length)for(let o=0;o<e.props.selections.length;o++){const n=e.props.selections[o],r=t.find((e=>h(e)===n.value));r&&(e.props.selections[o]=r)}})))})),e.on("prop:expanded",(({payload:t})=>{t||jr.delete(e)}))}function Ve(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&v(e,e.props.searchValue,!0)}function Be(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 Pe(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 He(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 Ne(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),He(e))}function Re(e){e.props.searchValue=null,e.on("commit",(()=>{e.props.searchValue=null,e.props.highlightedRange||Ke(e)})),e.on("created",(()=>{if(!e.context||!qa)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=Ye(e);if(e.props.highlightedRange){const[t,n]=We(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){mn(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Ga.set(t,e)}),e.props.__root),qa&&!Xa&&(Xa=!0,document.addEventListener("selectionchange",(()=>{const e=f();if(e instanceof HTMLInputElement&&Ga.has(e)){const t=Ga.get(e);t&&function(e){clearTimeout(za.get(e)),za.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=Ye(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]=We(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,Ke(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=Ye(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?(x(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=[],v(e,e.props.searchValue))):(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(qa&&e.isCreated){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}`);if(null==o||o.focus(),f()===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="",v(e,e.props.searchValue))}));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=Ye(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,_(e))}))}function Ke(e){var t;if(!qa)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 We(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 Ye(e){const t=Qr(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 Ue(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],v(e,e.props.searchValue,!0))):(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&&v(e,e.props.searchValue,!0))}))}(e)}function Ze(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.searchValue=e.props.inputText,e.props.options.length&&!e.props.alwaysLoadOnOpen||e.props.searchExpand||(e.props.options=[],v(e,e.props.searchValue,!0)),e.props.searchExpand&&(e.props.searchExpand=!1)}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&&v(e,e.props.searchValue,!0)}))}(e)}function je(e,t){var o;if(ql.has(e))return;ql.set(e,[]),t.reverse&&ii.add(e),t.prefix&&pi.set(e,t.prefix),t.suffix&&di.set(e,t.suffix),Je(e,t.pattern,t.partOverrides,t.explicitParts);const n=Ql.get(e),r=null==n?void 0:n.some((e=>tt(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 a=r?"select":null!==(o=t.mode)&&void 0!==o?o:"shift";if(s&&"select"===a)throw new Error("Cannot use groups in select mode.");(t.placeholder||"select"===a)&&ei.add(e),ti.set(e,a),t.onChange&&ai.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if($i)return;if("insertLineBreak"===o.inputType)return;if(o.inputType.startsWith("history"))return function(e,t){e.addEventListener("input",(o=>{var n;o.preventDefault(),o.stopImmediatePropagation();const r=ql.get(e);if(null==r?void 0:r.length){const o=(null!==(n=Gl.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;ut(e,s),e.setSelectionRange(...s.selectionAfter),Gl.set(e,o),ai.has(e)&&ai.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=st(e),a=e.value;n&&at(e,{type:n,selectionBefore:s,data:o.data,valueBefore:a,suffix:t.suffix,prefix:t.prefix})})),"select"===a&&e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowRight":return t.preventDefault(),Ft(e);case"ArrowLeft":return t.preventDefault(),Ft(e,-1);case"ArrowUp":return void(Vt(e,1)&&t.preventDefault());case"ArrowDown":return void(Vt(e,-1)&&t.preventDefault());case"Tab":return fi?void t.preventDefault():void(Ft(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=ei.has(e),n=ti.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;wt(e,{type:"insert",data:l,selectionBefore:[0,0,"none"],valueBefore:l},"shift"===n?"":l,((e,t)=>(null===o&&"char"===t.type&&(o=e.pos-a),(et(t)||tt(t))&&e.value.endsWith(t.placeholder)?(r=e.pos-a,!1):("char"===t.type&&(s=!0),!0))));const i=null!==(t=null!=r?r:s?l.length:o)&&void 0!==t?t:null;if(null!==i){let t=[i,i,"none"];if("select"===ti.get(e)){const[o]=It(e),n=Pt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){ni.set(e,it(e,t));const n=async()=>{if(!gi||f()!==e)return;"select"===ti.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=st(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=pt(e,t);const[o]=It(e),n=Pt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&ni.set(e,it(e,o[n]))}(e));const t=ni.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),ni.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(ni.get(e))return;Wt(e),t=pt(e,t);const[o]=It(e),n=Pt(e,t),r=void 0!==n&&it(e,o[n]);r&&!rt(t,r)&&ct(e,r,!0)}(e,t.detail))),at(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function ze(e){var t,o;if(ui.has(e))return;const n=null!==(t=ql.get(e))&&void 0!==t?t:[],r=n[null!==(o=Gl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=It(e,r.valueAfter),s=Pt(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"];ui.set(e,[r,l])}}}function qe(e){ui.delete(e)}function Ge(e,t){const o="string"==typeof e||!ql.has(e),n="string"==typeof e?Xe(e):e;if(o)t.prefix&&pi.set(n,t.prefix),t.suffix&&di.set(n,t.suffix),n.value=lt(n,n.value),je(n,t);else{const e=Ht(n),o=n.value;n.value="",at(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 Xe(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Je(e,t,o,n,r){r=e&&ii.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(vi);if(!e)return t;const o={...e},n=[];for(const r of t)if(!nt(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Qe(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Qe(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=ft(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=Je(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&&Ql.set(e,c),c}function Qe(e){return!!e&&(nt(e)||et(e)||tt(e))}function et(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&ot(e))}function tt(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&ot(e))}function ot(e){return!!e&&("placeholder"in e&&"token"in e)}function nt(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function rt(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function st(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 at(e,t){var o;ii.has(e)&&Kt(t);let n=!1;switch(li.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=dt(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===ti.get(e)){const[s,a]=It(e),l=s.findIndex((e=>rt(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(et(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=yt(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=ft(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(tt(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=wt(e,t,o);return Jl.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:xt(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=dt(t),n=t.selectionBefore,r=ii.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=ht(o,s):s-=ht(o,s,"backward"));const l=ti.get(e);let i="";if("select"===l){const[o,n]=It(e),r=Pt(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];et(l)?i=l.placeholder.repeat(a-s):tt(l)&&([i,s]=rt(p,st(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=ht(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=Tt(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&Et(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=wt(e,t,p);return{...t,valueAfter:d.value,selectionAfter:Dt(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(ii.has(e)&&n&&Kt(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=it(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)){ai.has(e)&&ci.set(e,(()=>{ci.delete(e),n&&ai.get(e)(n,e)})),li.set(e,"beforeCallback");let t=null!==(o=ql.get(e))&&void 0!==o?o:[];const r=Gl.get(e);r&&(t=t.slice(0,r),Gl.delete(e)),t.push(n),ql.set(e,t),gi&&f()===e&&"function"==typeof document.execCommand&&!$i?(ct(e,[0,e.value.length,"forward"],!0),$i=!0,document.execCommand("insertText",void 0,n.valueAfter),$i=!1):ut(e,n),gi&&f()===e&&ct(e,n.selectionAfter);const s=ci.get(e);s&&s(),Wt(e)}li.set(e,"complete")}function lt(e,t){var o,n;const r=null!==(o=pi.get(e))&&void 0!==o?o:"",s=null!==(n=di.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 it(e,t){const o=pi.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function pt(e,t){const o=pi.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function dt(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 ct(e,t,o=!1){o&&(Xl.add(e),setTimeout((()=>Xl.delete(e)),5)),ni.get(e)&&ni.set(e,t),e.setSelectionRange(...t)}function ut(e,t,o="After"){if(e.value=t[`value${o}`],gi){const o=new InputEvent("input",{inputType:"insert"===t.type?"insertText":t.type,data:t.data});e.dispatchEvent(o)}}function ft(e){if(null==e)return"";const t=oi.test(e.charAt(0))&&oi.test(e.charAt(1))?2:1;return e.substring(0,t)}function ht(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:oi.test(e.charAt(t))&&oi.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:ft(e.substring(t)).length}function vt(e,t){const o=ft(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 mt(e){const t=ft(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function gt(e,t){const o=ft(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function $t(e,t){for(;t.buffer;){const o=ft(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 bt(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(ht(t.buffer,0))}return null}function yt(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 xt(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=st(e);o=[n[0],t.endPos,"none"];const[r,s]=It(e,t.value),a=Pt(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(et(i)&&yt(p,i).length===p.length&&a<r.length-1)return hi(),r[a+1];if(tt(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=Tt(o.values,r);if(s)return Ct(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return Et(i.values,p)?[l[1],l[1],"forward"]:(hi(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return rt(s,n)||(Xl.add(e),setTimeout((()=>Xl.delete(e)),5)),s}return l}function wt(e,t,o,n){var r,s;const a=null!==(r=Ql.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:ei.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:ti.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:It(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return _t(a,l,void 0,n),l}function _t(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":St(o,t,e.at(-1)===o);break;case"char":Lt(o,t,l);break;case"enum":kt(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};_t(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=nt(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++,_t(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),nt(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 kt(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=Tt(e.values.concat([e.placeholder]),n);if(r){const s=Ct(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):bt(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=bt(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 St(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?ft(t.data):"",s=ft(n);if(e===s)n=vt(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=gt(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 Lt(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=ft(t.data);if(e.pattern.test(n))return vt(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void $t(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=ft(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,mt(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return mt(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 Dt(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=It(e),a=Pt(e,r,s),[l,i]=It(e,t.value),p=void 0!==a&&At(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)=>At(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 At(e,t,o){if(nt(o))return!1;if(et(o)){let n=t[0];for(;n<t[1];){const t=ft(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!tt(o)||e.substring(t[0],t[1])===o.placeholder}function Ct(e,t){let o="";do{const n=ft(e).toLowerCase(),r=ft(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 It(e,t){const o=Ql.get(e);if(!o)return[[],[]];if(ri.has(e))return ri.get(e);const n=null!=t?t:lt(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(nt(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(et(a)&&et(e)&&e.token===a.token)i++;else if(et(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(tt(e)){l&&r.push([l,i,"none"]),Ot(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&&ri.set(e,d),d}function Mt(e,t,o){if(Ot(t))return t.values[0].length;const n=e.slice(o),r=Tt(t.values.concat([t.placeholder]),n);return r?r.length:0}function Tt(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=ft(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=Tt(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function Et(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function Ot(e){if(!si.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;si.set(e,e.values.every((e=>e.length===t)))}return si.get(e)}function Ft(e,t=1){const[o]=It(e),n=Pt(e,pt(e,st(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...it(e,o[n+t])),!0)}function Vt(e,t=1){const[o,n]=It(e),r=Pt(e,st(e));if(void 0!==r&&r in n){const s=n[r];if(tt(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((()=>at(e,t)),0),!0}}}return!1}function Bt(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 Bt(e.slice(...r),t)}function Pt(e,t,o){const[n]=null!=o?o:It(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!rt(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=Bt([...s],t[1]);return l in a?a[l]:void 0}function Ht(e){var t,o;const n=null!==(t=ql.get(e))&&void 0!==t?t:[];return n[null!==(o=Gl.get(e))&&void 0!==o?o:n.length-1]}function Nt(e,t=!1){const o=Ht(e);return o&&(o.complete||t)?ii.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Rt(e){var t;const o=Ht(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Kt(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 Wt(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 Yt(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(bi);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(bi);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function Ut(e,t=1){const o=Yt(e);return o.setDate(o.getDate()+t),o}function Zt(e){const t=Yt(e);return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),t}function jt(e){return Zt(e).getDate()}function zt(e,t=1,o=!1){const n=Yt(e),r=n.getDate();if(o||n.setDate(1),n.setMonth(n.getMonth()+t),!o){const e=jt(n);n.setDate(e<r?e:r)}return n}function qt(e,t=1,o=!1){const n=Yt(e),r=n.getDate();if(o||n.setDate(1),n.setFullYear(n.getFullYear()+t),!o){const e=jt(n);n.setDate(e<r?e:r)}return n}function Gt(e){return"literal"===e.type&&(e.value=e.value.normalize("NFKC")),e}function Xt(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=to(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&&Li.includes(t.token)&&p.push(t),Object.assign(e,t.option))),{})).formatToParts(s).map(Gt)),n&&p.length)for(const e of p){let t=[];switch(e.token){case"MMMM":t=new Intl.DateTimeFormat(r,{dateStyle:"long"}).formatToParts(s).map(Gt);break;case"MMM":t=new Intl.DateTimeFormat(r,{dateStyle:"medium"}).formatToParts(s).map(Gt)}const o=t.find((t=>t.type===e.partName)),n=i.findIndex((t=>t.type===e.partName));o&&n>-1&&(i[n]=o)}}const s=Yt(e),a=t.filter((e=>e.hour12)),l=t.filter((e=>!e.hour12)),i=[],p=[];a.length&&r(a,!0);l.length&&r(l);return i.reduce(((e,t)=>(e[t.type]=t.value,e)),{})}(e,t,o,n),a=Yt(e);return t.map((e=>({...e,value:r(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){if(!/^([+-])[0-3][0-9][0-6][0-9]$/.test(e))throw new Error(`Invalid offset: ${e}`);return e}function eo(e){return["numeric","2-digit"].includes(e.partValue)}function to(e,t){const o=Ai.get(t);if(o&&o[e])return o[e];const n=new Date(yi);n.setUTCHours("am"===e?5:20);const r=new Intl.DateTimeFormat(t,{timeStyle:"full",timeZone:"UTC",hour12:!0}).formatToParts(n).map(Gt).find((e=>"dayPeriod"===e.type));if(r){const n=o||{};return Ai.set(t,Object.assign(n,{[e]:r.value})),r.value}return e}function oo(e,t="+0000"){const o=Yt(e),n=function(e){Qt(e);const[t,o,n,r]=e.match(/([+-])([0-3][0-9])([0-6][0-9])/),s=60*Number(n)+Number(r);return"+"===o?s:-s}(t);return new Date(o.getTime()+1e3*n*60)}function no(e,t){const o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZone:t,hourCycle:"h23"}).formatToParts(e).map(Gt),n={};return o.forEach((e=>{n[e.type]=e.value})),new Date(`${n.year}-${n.month}-${n.day}T${n.hour}:${n.minute}:${n.second}Z`)}function ro(e,t="UTC",o="device"){o="device"===o?Intl.DateTimeFormat().resolvedOptions().timeZone:o;const n=Yt(e),r=no(n,t);return Jt((no(n,o).getTime()-r.getTime())/1e3/60)}function so(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(Ci.includes(e)||"object"==typeof e)return function(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(yi)).map(Gt),s=n.formatToParts(new Date("1999-04-05T23:05:01.000Z")).map(Gt).find((e=>"hour"===e.type)),a=s&&"23"===s.value?24:12;return r.map((e=>{const o=e.type,n=function(e,t,o,n){const r=t.length,s=!isNaN(Number(t));let a;switch(e){case"year":return 2===r?Di.get("YY"):Di.get("YYYY");case"month":return s?1===r?Di.get("M"):Di.get("MM"):(a=ao(o,e,t),"long"===a?Di.get("MMMM"):Di.get("MMM"));case"day":return 1===r?Di.get("D"):Di.get("DD");case"weekday":switch(a=ao(o,e,t),a){case"narrow":return Di.get("d");case"short":return Di.get("ddd");default:return Di.get("dddd")}case"hour":return 12===n?1===r?Di.get("h"):Di.get("hh"):1===r?Di.get("H"):Di.get("HH");case"minute":return 1===r?Di.get("m"):Di.get("mm");case"second":return 1===r?Di.get("s"):Di.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?Di.get("A"):Di.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?Di.get("ZZ"):Di.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))}(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}(wi.filter(s).concat(_i.filter(s)).map(o.bind(null,!1)).concat(ki.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 ao(e,t,o){if(!xi.has(e)){const t=new Date(yi),o=[3,8,9,7,6,4,3],n=["weekday","month","dayPeriod"],r=["long","short","narrow"],s={};for(let a=0;a<12;a++){t.setMonth(0+a),a in o&&t.setDate(o[a]),t.setUTCHours(8+a);for(const o of r){const r=new Intl.DateTimeFormat(e,n.reduce(((e,t)=>Object.assign(e,{[t]:o})),{hour12:!0,timeZone:"UTC"})).formatToParts(t).map(Gt);if("long"===o||"short"===o){const n=new Intl.DateTimeFormat(e,{dateStyle:"short"===o?"medium":"long"}).formatToParts(t).map(Gt).find((e=>"month"===e.type)),s=r.findIndex((e=>"month"===e.type));s>-1&&n&&(r[s]=n)}r.forEach((e=>{if("literal"===e.type)return;const t=e.type;s[t]=Object.assign(s[t]||{},{[e.value]:o})}))}}xi.set(e,s)}const n=xi.get(e);return n?n[t][o]:void 0}function lo(e,t="+0000"){const o="+"===t.slice(0,1);return oo(e,t.replace(o?"+":"-",o?"-":"+"))}function io(e,t="long",o="device",n=!1,r){let s;return"object"!=typeof e||e instanceof Date||({date:e,format:t,locale:o,genitive:n,partFilter:r,tz:s}=e),"ISO8601"===t?Yt(e).toISOString():(s&&(e=lo(e,ro(e,s))),o&&"device"!==o||(o=Intl.DateTimeFormat().resolvedOptions().locale),Xt(e,so(t,o).filter(null!=r?r:()=>!0),o,n).map((e=>e.value)).join(""))}function po(e,t="en",o=!1,n=(()=>!0)){return so(e,t).filter(n).reduce(((e,t)=>e+(o&&"literal"===t.partName?function(e){return wi.concat(_i).concat(ki).sort(((e,t)=>e[0].length>t[0].length?1:-1)).reduce(((e,t)=>e.replace(t[0],`\\${t[0]}`)),e)}(t.token):t.token)),"").normalize("NFKC")}function co(e){const t=Yt(e);return t.setDate(1),t.setHours(0,0,0),t}function uo(e,t,o=7){let n,r;const s=Yt(e);switch(o){case"month":r=s.getDate(),n=jt(s)-s.getDate();break;case"week":r=s.getDay()+1,n=6-s.getDay();break;case"year":const e=function(e){const t=Yt(e);return(new Date(t.getFullYear()+1,0,0).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5}(s),t=function(e){const t=Yt(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=Ut(s,e);if(t(o))return o}if(e&&e<=r){const o=Ut(s,-e);if(t(o))return o}}return null}function fo(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 fo("MM").map((n=>io(`2000-${n}-05`,e,t,o)));if(e.startsWith("d"))return n(7,(e=>`0${e+2}`)).map((o=>io(`2022-10-${o}`,e,t)));if("a"===e)return[to("am",t).toLowerCase(),to("pm",t).toLowerCase()];if("A"===e)return[to("am",t).toUpperCase(),to("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(io(`${o+Number(r)}-06-06`,e,t)),n.unshift(io(o-Number(r)+"-06-06",e,t)),n)),[io(`${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 ho(e,t="ISO8601",o="device"){let n,r=()=>!0,s="backward";if("object"==typeof e?({date:n,format:t="ISO8601",locale:o="device",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 (${po(t,o)})`)};if("ISO8601"===t)return Yt(n);const l=Ci.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 Si||o.token in Si||eo(t)&&"a"===o.token.toLowerCase()))throw new Error(`Illegal adjacent tokens (${t.token}, ${o.token})`);t=o}return e}(so(t,o).filter(r));if(!i.length)throw new Error("parse() requires a pattern.");let p;try{p=vo(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()===to("am",o).toLowerCase();else if("Z"===n)f=Qt(e.value);else{const t=fo(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,$,b,y]=Array.from(c.values());const x=jt(new Date(`${Mi(v)}-${Ii(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${Mi(v)}-${Ii(m+1)}-${Ii(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${Mi(v)}-${Ii(m+1)}-${Ii(g)}T${Ii($)}:${Ii(b)}:${Ii(y)}${f}`,_=new Date(w);return isFinite(+_)?_:a()}function vo(e,t){let o=0;let n=0;const r=[];let s;do{const[l,i]=[(a=t)[o++],a[o]];s=i;let p=1;if("literal"===l.partName)p=l.partValue.length;else if(l.token in Si)p=Si[l.token];else if(i)if("literal"===i.partName){if(p=e.indexOf(i.partValue,n)-n,p<0)throw new Error}else if("dayPeriod"===i.partName){for(let t=1;t<=4;t++)if(isNaN(Number(e.charAt(n+t)))){p=t;break}}else{const t=e.substring(n).search(/\d/);-1!==t&&(p=n+t)}else p=e.length;r.push({...l,value:e.substring(n,n+p)}),n+=p}while(s);var a;return r}function mo(e,t){const o=Yt(e),n=Yt(t);return o.getDate()===n.getDate()&&o.getMonth()===n.getMonth()&&o.getFullYear()===n.getFullYear()}function go(e,t=0){const o=Yt(e);let n=t-o.getDay();return n>0&&(n-=7),o.setDate(o.getDate()+n),o.setHours(0,0,0),o}function $o(e){return"timeZoneName"!==e.partName}function bo(e,t){const o=[],n=Yt(t);n.setDate(1);let r=go(n,e.props.weekStart);r.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const s=function(e,t=0){const o=go(e,t);return o.setDate(o.getDate()+6),o.setHours(23,59,59),o}(Zt(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=Ut(r)}while(r.getTime()<=s.getTime());return{monthDay:n,weeks:o}}function yo(e){e.props.calendar=n(e.props.showMonths,(e=>e)).map((t=>bo(e,zt(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(io(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,n(10,(n=>qt(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=Yt(e.props.renderedDate);return t.setMonth(0),n(12,(e=>zt(t,e)))}(e)}function xo(e,t){var o;t.target&&t.target instanceof Element&&(t.target.closest(`#${e.props.id}_popover`)||!(null===(o=e.props.__root)||void 0===o?void 0:o.contains(t.target)))||(e.props.expanded=!1)}function wo(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:ho(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,$o),o}function _o(e){return Array.isArray(e.props.sequence)?gn(e.props.sequence):["day"]}function ko(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?ro(t,e.props.timezone):"+0000";const s=oo(t,null!==(n=(r=e.props).offset)&&void 0!==n?n:r.offset="+0000");e.input(io(s,e.props.valueFormat,e.props.valueLocale,!1),o)}function So(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 Lo(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Vi.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}_popover`)?Hi.add(e):Hi.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===li.get(t)&&(n=t.value),ze(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!ql.has(e))return;const r=null!==(o=pi.get(e))&&void 0!==o?o:"",s=null!==(n=di.get(e))&&void 0!==n?n:"";at(e,{type:"insert",selectionBefore:st(e),data:t,valueBefore:e.value,suffix:s,prefix:r})}(t,e),t.value=e,setTimeout((()=>qe(t)),10))}));const[r,s]=Ao(e);je(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Do(e),Ei.has(e))return Ei.delete(e);n&&n===o?n="":(ze(t),e.props.inputText=o,setTimeout((()=>qe(t)),10))}})}function Do(e){var t,o;if(e.props.overlay){const n=Vi.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Nt(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=u(Rt(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Ao(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,r=so(e.props.format,t);return[po(e.props.format,t,!0,$o),r.reduce(((r,s)=>{if("literal"===s.partName)return r;let a=fo(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")&&Bi.set(e,a),r}),[])]}function Co(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Io(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&&!Ri.get(e)&&Ni){const r=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_overlay`),s=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_overlay_inner`);if(r&&t&&s){Ri.set(e,r);const o=getComputedStyle(t).color;t.style.color="transparent",t.style.caretColor=o;const n=new ResizeObserver((()=>{var o;const n=getComputedStyle(t),r=t.getBoundingClientRect(),s=null===(o=t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();e.props._overlayStyles={...e.props._overlayStyles,width:n.width,height:n.height,boxSizing:n.boxSizing,padding:n.padding,margin:n.margin,fontSize:n.fontSize,lineHeight:n.lineHeight,top:r.top-((null==s?void 0:s.top)||r.top)+"px",left:r.left-((null==s?void 0:s.left)||r.left)+"px"}}));n.observe(t);const a=e=>{s.scrollLeft=e.detail};t.addEventListener("input-scroll",a),e.on("destroyed",(()=>{t.removeEventListener("input-scroll",a),n.disconnect()}))}}}function To(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=vn(e.props.overlay),e.props.pickerOnly=vn(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&mn(`${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 Eo(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Ip.set(e,t),je(t,{...Cp.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=u(o)}})}function Oo(e,t,o,n){if(!(e.props.disabled||(e.props.isSourceOption=o,e.props.isSourceOption&&Array.isArray(e.value)&&e.value.length>=e.props.max)))if(o){if(e.props.selectedSourceItems.includes(t))return e.props.selectedSourceItems=e.props.selectedSourceItems.filter((e=>e!==t)),e.props.activeValue=void 0,void(e.props.activeDescendant=void 0);e.props.selectedTargetItems=[],e.props.selectedSourceItems=[...e.props.selectedSourceItems,t]}else{if(e.props.selectedTargetItems.includes(t))return void(e.props.selectedTargetItems=e.props.selectedTargetItems.filter((e=>e!==t)));e.props.selectedSourceItems=[],e.props.selectedTargetItems=[...e.props.selectedTargetItems,t]}}function Fo(e,t){if(e.props.sourceListOrigin=!0,e.props.maxReached)return;if(t){const o=Array.isArray(e.value)?[...e.value,t]:[t];return void e.input(o)}const o=e.props.selectedSourceItems.map((e=>h(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Vo(e,t){if(e.props.sourceListOrigin=!1,t){const o=Array.isArray(e.value)?e.value.filter((e=>e!==t)):[];return void e.input(o)}const o=e.props.selectedTargetItems.map((e=>h(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Bo(e){var t,o;if(e.props.activeValue===yd){const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_load_more`);return void(o&&o.scrollIntoView({block:"nearest",inline:"start"}))}const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.activeDescendant);n&&n.scrollIntoView({block:"nearest",inline:"start"})}function Po(e){var t;if(Array.isArray(e.value)){const t=[];let o=[...e.props.options];e.value.forEach((n=>{const r=e.props.memoOptions.find((e=>hn(h(e),n)));if(r&&!r.noOptionFound){t.push(r);const s=e.props.options.findIndex((e=>hn(h(e),n)));-1!==s&&(o=o.filter((e=>!hn(h(e),n))))}else{const e=o.find((e=>hn(h(e),n)));e?(t.push(e),o=o.filter((e=>!hn(h(e),n)))):t.push({label:String(n),value:n,noOptionFound:!0})}})),e.props.targetOptions=t,e.props.sourceOptions=o}else e.props.sourceOptions=[...e.props.options],e.props.targetOptions=[];if(e.props.skipSetActiveValue)return void(e.props.skipSetActiveValue=!1);(null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(e.props.id+"_source_list_items"))&&function(e){var t,o,n,r,s,a,l;if(e.props.isDragging)return;if(e.props.sourceSearchActive){if((null===(o=null===(t=e.props.__root)||void 0===t?void 0:t.activeElement)||void 0===o?void 0:o.id)===`${e.props.id}_source_search_input`){const t=e.props.sourceOptions.find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));return t?void(e.props.activeValue=h(t)):void(e.props.activeValue=void 0)}e.props.sourceSearchActive=!1}if(!1===e.props.transferOnSelect)return void(e.props.activeValue=void 0);const i=e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions;let p=!1;for(let t=e.props.activeIndex;t<=i.length;t++)if(!(null===(n=i.attrs)||void 0===n?void 0:n.disabled)&&i[t]){p=!0,e.props.activeValue=h(i[t]);break}if(!p&&i.length)for(let t=e.props.activeIndex;t>=0;t--)if(!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)&&i[t])return p=!0,void(e.props.activeValue=h(i[t]));if(!p){let t;t=e.props.sourceListOrigin?null===(l=e.props.__root)||void 0===l?void 0:l.getElementById(`${e.props.id}`):e.props.searchable?null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(`${e.props.id}_source_search_input`):null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(`${e.props.id}_source_list_items`),t&&t.focus()}}(e)}function Ho(e,t){return(t?e.props.sourceOptions:e.props.targetOptions).find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}))}function No(e){Array.isArray(e.value)&&e.value.forEach((async t=>{$(e,t,function(e,t){const o=[...e.props.options,...e.props.memoOptions];return o.find((e=>hn(h(e),t)))}(e,t))}))}function Ro(e){e.context&&(e.context.handlers.loadMore=m.bind(null,e),e.context.fns.getSourceItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.sourceOptions.length:e.props.sourceOptions.length,e.context.fns.getTargetItemCount=t=>!1===e.props.transferOnSelect&&t.length?t.length+"/"+e.props.targetOptions.length:e.props.targetOptions.length,e.context.fns.isActive=(t,o)=>{if(!e.props.isDragging&&!e.props.touchStarted)return hn(o,h(t))||void 0},e.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),e.context.fns.optionLoading=t=>e.props.optionLoaderValues.includes(h(t)),e.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",v(e,"",!0);const o=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_source_search_input`);if(!o)return;o.focus()}(e)},e.context.handlers.sourceSearchBlur=t=>{setTimeout((()=>{var o;if(t.relatedTarget&&t.relatedTarget instanceof HTMLElement&&(t.relatedTarget.id===`${e.props.id}_source_list_items`||t.relatedTarget.id===`${e.props.id}`)){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_source_search_input`);if(!t)return;t.focus()}else e.props.activeValue=void 0}))},e.context.handlers.listitemClick=(t,o)=>n=>{Ko(e,t,o)},e.context.handlers.transferForward=Fo.bind(null,e,void 0),e.context.handlers.transferForwardAll=()=>{let t;if(e.props.maxReached)return;const o=e.props.sourceOptions.map((e=>h(e)));t=Array.isArray(e.value)?[...e.value,...o]:[...o],e.input(t),e.props.selectedSourceItems=[]},e.context.handlers.transferBackward=Vo.bind(null,e,void 0),e.context.handlers.transferBackwardAll=()=>{Array.isArray(e.value)&&(e.input([]),e.props.selectedTargetItems=[])},e.context.handlers.onSearch=t=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,v(e,o.value,!0)}(e,t)},e.context.handlers.onMouseenter=t=>o=>{"touchstart"!==o.type&&(t?e.props.mouseOnSource=!0:e.props.mouseOnTarget=!0)},e.context.handlers.onMouseleave=t=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(t?`${e.props.id}_source_list_items`:`${e.props.id}`);r&&(r.contains(o.relatedTarget)||(e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeIndex=void 0,t?e.props.mouseOnSource=!1:e.props.mouseOnTarget=!1))},e.context.handlers.listitemClick=(t,o)=>n=>{n instanceof MouseEvent&&e.props.touchStarted||Ko(e,t,o)},e.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(e)},e.context.handlers.listitemTouchend=(t,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===r)),e.props.transferOnSelect?o?Fo(e,r):Vo(e,r):Oo(e,t,o)}(e,t,o)},e.context.handlers.listitemTouchmove=()=>t=>{!function(e){e.props.touchMoved=!0}(e)},e.context.handlers.sourceSearchFocus=t=>{Wo(e,!0)},e.context.handlers.sourceListFocused=t=>{Wo(e,!0)},e.context.handlers.targetListFocused=()=>{Wo(e,!1)},e.context.handlers.sourceListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.targetListBlurred=t=>{e.props.activeValue=void 0},e.context.handlers.sourceListKeydown=t=>{Yo(e,t,!0)},e.context.handlers.targetListKeydown=t=>{Yo(e,t,!1)},e.context.handlers.sourceSearchKeydown=t=>{Yo(e,t,!0)})}function Ko(e,t,o,n){var r;if(h(t)===yd)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=h(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>h(e)===s)),e.props.transferOnSelect?o?Fo(e,s):Vo(e,s):Oo(e,t,o)}function Wo(e,t){const o=Ho(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=h(o))}function Yo(e,t,o){if("ArrowDown"===t.key||"ArrowUp"===t.key)!function(e,t,o){var n,r,s;e.preventDefault();const a=o?t.props.sourceOptions:t.props.targetOptions,l=a.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(h(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(yd);const i=l.indexOf(t.props.activeValue);if("ArrowUp"===e.key&&0!==i)for(let e=i-1;e>=0;e--){t.props.sourceListOrigin=o,t.props.activeValue=l[i-1];break}else if("ArrowDown"===e.key&&i!==l.length-1)for(let e=i+1;e<l.length;e++)if(!(null===(s=null===(r=a[e])||void 0===r?void 0:r.attrs)||void 0===s?void 0:s.disabled)){t.props.sourceListOrigin=o,t.props.activeValue=l[e];break}Bo(t)}(t,e,o);else if("ArrowRight"===t.key||"ArrowLeft"===t.key){if("ArrowLeft"===t.key&&o)return;if("ArrowRight"===t.key&&!o)return;!function(e,t,o){if(t.props.searchable)return;e.preventDefault(),function(e,t){var o,n,r;if(Ho(e,!t))if(t){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);t&&t.focus()}else if(e.props.searchable){const t=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(`${e.props.id}_source_search_input`);t&&t.focus()}else{const t=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(`${e.props.id}_source_list_items`);t&&t.focus()}}(t,o)}(t,e,o)}else"Enter"===t.key&&function(e,t,o){var n;if(e.preventDefault(),!t.props.activeValue)return;if(t.props.activeValue===yd)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const r=o?t.props.sourceOptions:t.props.targetOptions,s=r.findIndex((e=>h(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Fo(t,h(a)):Vo(t,h(a)):Oo(t,a,o)}(t,e,o)}function Uo(e){e.on("created",(()=>{if(e.props.skipSetActiveValue=!0,"function"==typeof e.props.optionsLoader&&b(e),Ro(e),e.props.disabled&&(e.props.draggable=!1),Zn){mn(e.props.id+"_source_list_items",(t=>{t instanceof HTMLElement&&function(e,t){function o(){return e.props.sourceOptions.map((e=>h(e)))}function n(){return[]}if(!e.context)return;const r={longTouch:!0,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,group:e.props.id,root:e.props.__root||document,disabled:!e.props.draggable||e.props.maxReached,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,handleTouchmove(t){e.props.selectedSourceItems=[],Bn(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[Pn({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,Fn(t)},handleEnd(t){On(t),e.props.isDragging=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.activeDescendant=void 0,e.props.isDragging=!1,e.props.selectedTargetItems=[],e.props.selectedSourceItems=[]},handleTouchstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,e.props.mouseOnSource=!1,e.props.mouseOnTarget=!1,Vn(t)},selections:()=>e.props.selectedSourceItems.map((e=>h(e)))})],En({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,En({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),mn(`${e.props.id}`,(t=>{t instanceof HTMLElement&&function(e,t){function o(){return Array.isArray(e.value)?[...e.value]:[]}function n(t,o){e.props.sourceListOrigin=!0,e.input(t)}if(!e.context)return;const r={longTouch:!0,root:e.props.__root,group:e.props.id,disabled:!e.props.draggable,draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,selectionDraggingClass:e.context.classes.selectionDragging,selectionDropZoneClass:e.context.classes.selectionDropZone,touchSelectionDraggingClass:e.context.classes.touchSelectionDragging,touchSelectionDropZoneClass:e.context.classes.touchSelectionDropZone,longTouchClass:e.context.classes.longTouch,draggable:e=>"option"===e.getAttribute("role"),plugins:[]};r.plugins=[Pn({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,Fn(t)},handleEnd(t){On(t),e.props.selectedTargetItems=[],e.props.selectedSourceItems=[],e.props.activeValue=void 0,e.props.trackHover=!0,e.props.isDragging=!1},handleTouchstart(t){e.props.trackHover=!1,e.props.activeValue=void 0,e.props.isDragging=!0,e.props.activeDescendant=void 0,Vn(t)},selections:()=>e.props.selectedTargetItems.map((e=>h(e)))})],En({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root);const t=t=>{var o;if(e.props.isDragging)return;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",t)}}))}function Zo(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=xd.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=wd.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&&xd.add(e),e.props.mouseOnTarget&&wd.add(e),a.length&&jo(e,a,null,t)}function jo(e,t,o,n){const r=n?n.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.trackHover){if(e.props.mouseY>r.top&&e.props.mouseY<r.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)?h(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)}}else Bo(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&xd.has(e)||e.props.mouseOnTarget&&wd.has(e)?requestAnimationFrame(jo.bind(null,e,t,o,n)):Zo(e,n):(xd.delete(e),wd.delete(e))}function zo(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function qo(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[...Xo(t,o,n,r)]}function Go(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,zo(255*t,2),zo(255*a,2),n]}function Xo(e,t,o,n=1){const r=zo(t/255,4),s=zo(o/255,4);if(1===s)return[e,0,100,n];const a=zo(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,zo(l,2),zo(100*a,2),n]}function Jo(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 Qo(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 en(e,t,o,n=1){const[r,s,a,l]=Jo(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 tn(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function on(e){if(e){if(tn(e))return qo(e);if(e.startsWith("rgb")){const t=e.match(Yc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Qo(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(Uc);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 Xo(o,zo(255*n,2),zo(255*r,2),s)}}}function nn(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function rn(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 sn(e){return!1!==e&&"false"!==e}function an(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}function ln(e,t){return t=(null==t?void 0:t.hasOwnProperty("__original"))?null==t?void 0:t.__original:null==t?void 0:t.value,e.props.multiple?!!Array.isArray(e.value)&&e.value.filter((e=>hn(e,t))).length>0:void 0!==t?hn(e.value,t):(e.props._isChecked=hn(e.value,e.props.onValue),e.props._isChecked)}function pn(e){function t(t){var o,n,a;const l=(`${t}`.match(/\-/g)||[]).length%2==1;t=function(t){t=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${t}`),isNaN(t)&&(t=t.split(p.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(t=t.replace(/[^0-9\.]/g,""),t.includes(".")){const o=t.split(".");0===e.props.decimals?t=o[0]:(o[1]=o[1].padEnd(i(),"0").slice(0,i()),t=o.join("."))}return t}(t);const c={};"unit"===r()&&(c.minimumFractionDigits=t.includes(".")?1:0),c.maximumFractionDigits=i(),e.props.minDecimals&&(c.minimumFractionDigits=e.props.minDecimals,t.includes(".")||(t+=".".padEnd(e.props.minDecimals,"0"))),0===c.maximumFractionDigits&&t.includes(".")&&(t=t.split(".")[0]);let u="";isNaN(t)||""===t.trim()||(t=l?`-${t}`:t,e.props.max&&!isNaN(e.props.max)&&(t=`${Math.min(t,e.props.max)}`),e.props.min&&!isNaN(e.props.min)&&(t=`${Math.max(t,e.props.min)}`),t.includes(".")?t=t.split(".")[0].padStart(1,"0")+"."+(null!==(o=t.split(".")[1])&&void 0!==o?o:"0"):c.maximumFractionDigits=null!==(n=c.minimumFractionDigits)&&void 0!==n?n:0,u=s(e.props.displayLocale,c).format(t));let f,h=t.split(".");return h=h[0]+(null!==(a=h[1])&&void 0!==a?a:"").padEnd(i(),"0"),h.length>1&&(h=h.replace(/^0+/,""),h=""!==t&&""===h?"0":h),e.props.valueStore={number:t,integer:h,string:u},d=!0,e.props.valueStore&&(f=e.props.valueStore.hasOwnProperty(e.props.valueFormat)?e.props.valueStore[e.props.valueFormat]:e.props.valueStore.number),e.input(""===f?void 0:f).then((()=>(d=!1,Promise.resolve())))}function o(){mn(`${e.props.id}`,(t=>{var o,n;t instanceof HTMLInputElement&&(t.value=null!==(n=null===(o=e.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),e.props.__root)}function n(){var t,o;const n=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function r(){return e.props.currency?"currency":"unit"}function s(t,o={}){const n=r(),s=Object.assign({},{style:n,roundingMode:"trunc"},o);return s[n]=e.props[n],new Intl.NumberFormat(t,s)}function a(){var t,o,n;const r=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`#${e.props.id}_inner input`);if(r){r.dataset.placeholder||(r.dataset.placeholder=null!==(o=r.getAttribute("placeholder"))&&void 0!==o?o:"");const e=((p.unitLeft?`${p.unit} `:"")+(null!==(n=r.dataset.placeholder)&&void 0!==n?n:"")+(p.unitLeft?"":` ${p.unit}`)).trim();r.setAttribute("placeholder",e)}}function l(t){var o;const r=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`#${e.props.id}_inner input`);if(!r)return;const s=p.unit.length+p.literal.length;t=p.unitLeft?Math.max(t,s):Math.min(t,n().length-s),r.setSelectionRange(t,t)}function i(){return!1===e.props.decimals||"false"===e.props.decimals?0:isNaN(`${e.props.decimals}`)?p.fractionLength:e.props.decimals}let p=null,d=!1;e.props.valueStore=null,e.on("input",(({payload:e})=>{d||(t(e),o())})),e.on("mounted",(()=>{a()})),e.context&&(e.context.handlers.setPlaceholder=a,e.context.handlers.init=(n=null)=>{var r;!function(){var t,o,n,r,a,l,i;const d=s(e.props.displayLocale).formatToParts(12345678.12345678);p={decimal:null===(t=d.find((e=>"decimal"==e.type)))||void 0===t?void 0:t.value,group:null===(o=d.find((e=>"group"==e.type)))||void 0===o?void 0:o.value,unit:null===(n=d.find((e=>["unit","currency"].includes(e.type))))||void 0===n?void 0:n.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(r=d.find((e=>"literal"==e.type)))||void 0===r?void 0:r.value)&&void 0!==a?a:"",fractionLength:null!==(i=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==i?i:0}}();let a=null!==(r=null!=n?n:e._value)&&void 0!==r?r:"";e.props.valueStore?a=e.props.valueStore.number:"integer"===e.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=i())&&void 0!==t?t:0)).toString().replace(".",i())}(`${null!=a?a:""}`)),t(a),o()},e.context.handlers.handleBeforeInput=o=>{var n,r,s,a,i,d,c,u,f;if(o.preventDefault(),o.stopPropagation(),o.target instanceof HTMLInputElement){const h=o.target,v=null!==(n=o.data)&&void 0!==n?n:"",m=null!==(r=o.target.value)&&void 0!==r?r:"",g=null!==(s=o.target.selectionStart)&&void 0!==s?s:0,$=null!==(a=o.target.selectionEnd)&&void 0!==a?a:0,b=$-g,y=m.indexOf(p.decimal);let x=(null!==(i=o.target.selectionStart)&&void 0!==i?i:0)+(o.data?0:-1),w=m,_=1;if(m.includes(p.decimal)&&v===p.decimal)return v===p.decimal&&(x=w.indexOf(p.decimal)+1),void l(x);if(!(null===e.props.min||e.props.min<0||e.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===p.decimal&&(!1===e.props.decimals||"false"===e.props.decimals))return;if("deleteByCut"===o.inputType&&b>0&&(w=w.slice(0,g)+w.slice($),x=$),"insertFromPaste"===o.inputType){const e=null!==(d=o.data)&&void 0!==d?d:"";w=w.slice(0,g)+e+w.slice($)}if("deleteContentBackward"===o.inputType&&m[g-1]===p.group?(_+=1,x-=1):"deleteContentForward"===o.inputType&&m[g]===p.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===o.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=o.data)&&void 0!==c?c:"0"):"insertText"===o.inputType?(x=$,w=w.slice(0,g)+o.data+w.slice($)):"deleteContentForward"===o.inputType?(x+=2,w=0===b?w.slice(0,g)+w.slice($+_):w.slice(0,g)+w.slice($)):"deleteContentBackward"===o.inputType&&(x+=1,0===b?w=w.slice(0,Math.max(g-_,0))+w.slice($):b>0&&(w=w.slice(0,g)+w.slice($))),"deleteContentForward"===o.inputType&&m[g]===p.decimal){const e=w.slice(g-1);w=w.slice(0,g),e.includes(p.unit)&&(w+=" "+p.unit)}else if("deleteContentBackward"===o.inputType&&m[g-1]===p.decimal){const e=w.slice(g-1);w=w.slice(0,g-1),e.includes(p.unit)&&(w+=" "+p.unit)}t(w),w=null!==(f=null===(u=e.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-m.length+x,w.length===m.length&&(x+=o.inputType.includes("delete")?-1:1),h.setSelectionRange(0,m.length),document.execCommand("insertText",!1,w),v===p.decimal?x=w.indexOf(p.decimal)+1:m.includes(p.decimal)&&!w.includes(p.decimal)&&(x=w.length),l(Math.max(0,x))}},e.context.handlers.handleInput=o=>{o.target instanceof HTMLInputElement&&(e.props.inputText=o.target.value,t(o.target.value))},e.context.handlers.handleKeyDown=r=>{var s,a;if(r.target instanceof HTMLInputElement&&("ArrowUp"===r.key||"ArrowDown"===r.key)){const i="ArrowUp"===r.key?1*e.props.step:-1*e.props.step;t(function(e,t){var o,n,r,s;const a=`${e}`.split("."),l=`${t}`.split(".");let i=null!==(o=a[0])&&void 0!==o?o:"0",p=null!==(n=l[0])&&void 0!==n?n:"0";const d=null!==(r=a[1])&&void 0!==r?r:"",c=null!==(s=l[1])&&void 0!==s?s:"",u=Math.max(d.length,c.length);u>0&&(i+=d.padEnd(u,"0"),p+=c.padEnd(u,"0"));const f=BigInt(BigInt(i)+BigInt(p)).toString();return u>0?f.slice(0,-1*u)+"."+f.slice(-1*u):f}(null!==(a=null===(s=e.props.valueStore)||void 0===s?void 0:s.number)&&void 0!==a?a:0,i)),o(),setTimeout((()=>{l(n().length)}),1)}})}function dn(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Hu.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:Xn(13919),children:`${Xn(451228594)}${Xn(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){or[e]?or[e].add(t):or[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(!Un.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];Hu.add(o),o.define({...r,schema:n(e)})}Pu((()=>tr.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}import{isRecord as cn,isObject as un,isPojo as fn,eq as hn,undefine as vn,whenAvailable as mn,clone as gn}from"@formkit/utils";import{isDOM as $n,isComponent as bn,createMessage as yn,warn as xn,error as wn}from"@formkit/core";import{icon as _n,isSlotCondition as kn,isSchemaObject as Sn,extendSchema as Ln,normalizeOptions as Dn,defaultIcon as An,localize as Cn,options as In,disablesChildren as Mn}from"@formkit/inputs";import"@formkit/vue";import{animations as Tn,dragAndDrop as En,handleEnd as On,handleDragstart as Fn,handleTouchstart as Vn,handleTouchmove as Bn,multiDrag as Pn}from"@formkit/drag-and-drop";const Hn=[988,24029,396,13078,980],Nn=18806588,Rn=502357,Kn=16217489;let Wn=189024;const Yn=()=>[30548127325,27022924,34729821653783].map(Xn).join("y"),Un=/^[0-9a-f]+$/,Zn="undefined"!=typeof window,jn=n(32,(e=>e)).map((()=>{Wn|=0,Wn=Wn+1831565813|0;let e=Wn^Wn>>>15|Wn;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),zn=Zn?setTimeout:()=>0,qn=e=>{clearTimeout(Gn[e])},Gn={},Xn=e=>e.toString(32),Jn=e=>`${Xn(jn[e]).substring(2)}.${Xn(Hn[e%(Hn.length-1)])}`,Qn={},er={},tr=new Set(["",null,void 0]),or={},nr=()=>({$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-draggable":"$draggable || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id","data-inline":"$inline || undefined","data-is-max":"$max && $value && $value.length >= $max || undefined","data-multi-select":"$transferOnSelect === false || undefined","data-has-overlay":"$overlay || undefined","data-expanded":"$expanded || undefined","data-focused":"$_isFocused || undefined","data-appearance":"$selectionAppearance || undefined","data-is-multiline":"$multiLine || undefined"}}),rr=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),sr=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),ar=()=>({$el:"ul",if:"$fns.length($messages)"}),lr=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),ir=()=>({$el:"div",if:"$help"}),pr=()=>({$el:null}),dr=(e,t)=>()=>_n(e,t),cr=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),ur=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),fr=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),hr=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),vr=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),mr=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),gr=()=>({$el:null,for:["part","$_overlayParts"]}),$r=a("dd"),{outer:br,wrapper:yr,inner:xr,icon:wr,label:_r,prefix:kr,suffix:Sr,help:Lr,messages:Dr,message:Ar}=l($r),Cr=$r("selector",(()=>({$el:"button",bind:"$attrs",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onFocus:"$handlers.focus",onKeydown:"$handlers.keydown",tabindex:"0",name:"$node.name",disabled:"$disabled || $disabledInternally || undefined","aria-haspopup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),Ir=$r("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),Mr=$r("selection",(()=>({$el:"div"}))),Tr=$r("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true","aria-hidden":'$placeholder === undefined && "true" || undefined',style:{opacity:'$placeholder === undefined && "0" || undefined',"pointer-events":'$placeholder === undefined && "none" || undefined'}}}))),Er=$r("optionLoading","span"),Or=$r("option",(()=>({$el:"div"}))),Fr=$r("removeSelection",(()=>({$el:"div",attrs:{id:'$selectionAppearance === "tags" && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"-1",type:"button",key:"$value","aria-label":"$ui.remove.value",onClick:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',onTouchstart:'$handlers.removeSelection && $handlers.removeSelection($selectionAppearance === "tags" && $option || undefined)',"aria-controls":"$id"}}))),Vr=$r("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),Br=$r("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),Pr=$r("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),Hr=$r("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 || ""'}))),Nr=$r("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)",onKeydown:"$handlers.selectorTagKeydownHandler($option)",onFocus:"$handlers.tagFocus && $handlers.tagFocus($option)",onBlur:"$handlers.tagBlur && $handlers.tagBlur($option)","data-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Rr=$r("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),Kr=$r("tagLabel",(()=>({$el:"span"}))),Wr=$r("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),Yr=$r("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),Ur=$r("tagLoading","span"),Zr=d($r),jr=new WeakMap,zr=new WeakMap,qr=yn({key:"loading",type:"state",value:!0,visible:!1}),Gr=yn({key:"loading",type:"state",value:!1,visible:!1}),Xr=new WeakMap,Jr=Symbol(),Qr=e=>{const t=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(e),o=e.props.inputStd||[],n=[];for(const e of o){let o,r=t.find((t=>hn(h(t),e)));o=fn(e)?void 0:Array.isArray(e)?e.join(", "):e,r||(r={value:e,label:o,isPlaceholder:!1,noOptionFound:!0}),n.push(r)}return n},es=new WeakSet,ts=new WeakMap,os={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},ns={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},rs={overflow:"hidden",height:"100%"},ss={},as={};let ls=0;const is=(e,t)=>{let o=null,n=null,r=null;return function(...s){const a=this;o?(n=s,r=a):(e.apply(a,s),o=window.setTimeout((()=>{o=null,null!==n&&null!==r&&(e.apply(r,n),n=null,r=null)}),t))}},ps={schema:br(yr(_r("$label"),xr(wr("prefix"),kr(),Cr(p("$inputStd.length === 0 && $state.loading !== true",Tr('$placeholder || "placeholder"'),p("$multiple !== true",Ir(p("$state.loading && $selections.length === 0",Er("$ui.isLoading.value"),Mr(Or("$option.label")))),p('$multiple && $selectionAppearance === "truncate"',Vr(Br(p("$state.loading && $selections.length === 0",Er("$ui.isLoading.value"),Hr()))),p('$multiple && $selectionAppearance === "tags"',Wr(Yr(p("$state.loading && $isLoadingOption !== true && $selections.length === 0",Er("$ui.isLoading.value"),Nr(Rr(p("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",Ur("$ui.isLoading.value"),Kr("$option.label")),Fr(wr("close"))))))))))),p("$truncationCount && $state.loading !== true",Pr("$truncationCount")),p("$state.loading",wr("loader")),p("$inputStd.length !== 0 && $selectionRemovable",Fr(wr("close")),wr("select"))),Zr(),Sr(),wr("suffix"))),Lr("$help"),Dr(Ar("$message.value"))),type:"input",family:"dropdown",props:[],features:[An("select","select"),An("close","close"),An("selected","check"),An("loader","spinner"),Cn("isLoading"),Cn("loadMore"),Cn("remove"),In,Z.bind(null,(function(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=vn(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=vn(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&vn(e.props.alwaysLoadOnOpen),e.on("created",(()=>{e.context&&(e.context.handlers.click=se.bind(null,e),e.context.handlers.focus=ae.bind(null,e),e.context.handlers.keydown=ne.bind(null,e),e.context.handlers.selectorTagKeydownHandler=t=>te.bind(null,e,t))}))}),(function(e){if(e.on("created",(()=>{e.context&&le(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,ie(e),e.on("prop:selections",(()=>{ie(e)}))),"tags"===e.props.selectionAppearance&&ve(e),e.props.multiple&&"tags"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t,o){e.input(t)}e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),mn(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[Tn()],draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};En({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}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=[],b(e))})),"overscroll"===e.props.behavior&&he(e)})),$e]},ds=a("tg"),{outer:cs,wrapper:us,label:fs,prefix:hs,suffix:vs,help:ms,messages:gs,message:$s,icon:bs}=l(ds),ys=ds("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"checkbox",id:"$id",value:"$value",name:"$node.name",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),xs=ds("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),ws=ds("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"}))),_s=ds("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"}}))),ks=ds("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"}}}))),Ss=ds("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Ls=ds("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),Ds=ds("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),As={schema:cs(us(ws(),Ss(hs(),ys(),Ls(_s(),Ds(p("$slots.default","$slots.default",bs("thumb")))),vs()),ks(),xs()),ms("$help"),gs($s("$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=vn(e.props.disabled)),e.props.altLabelPosition=vn(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=hn(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=hn(t,e.props.onValue)}))}]},Cs=a("rp"),{outer:Is,inner:Ms,prefix:Ts,suffix:Es,help:Os,messages:Fs,message:Vs,icon:Bs}=l(Cs),Ps=Cs("empty",(()=>({$el:"div"}))),Hs=Cs("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),Ns=Cs("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Rs=Cs("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Ks=Cs("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),Ws=Cs("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Ys=Cs("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Us=Cs("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Zs=Cs("content","div"),js=Cs("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),zs=Cs("legend",(()=>({$el:"legend",if:"$label"}))),qs=Cs("group",(()=>({$formkit:"group",index:"$index"}))),Gs=Cs("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Xs=Cs("remove",(()=>({$el:"li",if:"$removeControl"}))),Js=Cs("insert",(()=>({$el:"li",if:"$insertControl"}))),Qs=Cs("up",(()=>({$el:"li",if:"$upControl"}))),ea=Cs("down",(()=>({$el:"li",if:"$downControl"}))),ta=Cs("controlLabel","span"),oa=Cs("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),na=Cs("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}))),ra={schema:Is(js(zs("$label"),Os("$help"),Ms(Ts(),p("$value.length === 0",p("$slots.empty",Ps()),p("$slots.default",Ks(Ws(oa(na(Bs("dragHandle"))),Zs(qs("$slots.default")),Gs(Qs(Us(ta("$ui.moveUp.value"),Bs("moveUp"))),Xs(Rs(ta("$ui.remove.value"),Bs("remove"))),Js(Hs(ta("$ui.add.value"),Bs("add"))),ea(Ys(ta("$ui.moveDown.value"),Bs("moveDown")))))),Es()))),Ns('$addLabel || ($ui.add.value + " " + ($label || ""))')),Fs(Vs("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(e){e._c.sync=!0,e.on("created",be.bind(null,e)),e.on("mounted",(()=>{mn(`${e.props.id}_items`,(t=>{if(t instanceof HTMLElement){ye(t,e);function o(t){for(const o of t)for(const t of Array.from(o.addedNodes))if(t instanceof HTMLElement&&t.id===`${e.props.id}_items`)return void ye(t,e)}new MutationObserver(o).observe(t.parentNode,{childList:!0})}}),e.props.__root)}))},Mn,Cn("remove"),Cn("add"),Cn("moveUp"),Cn("moveDown"),An("dragHandle","dragHandle"),An("remove","trash"),An("add","add"),An("moveUp","arrowUp"),An("moveDown","arrowDown")]},sa=new WeakMap,aa=a("rt"),{outer:la,wrapper:ia,inner:pa,label:da,prefix:ca,suffix:ua,help:fa,messages:ha,message:va,icon:ma}=l(aa),ga=aa("itemsWrapper",(()=>({$el:"span",attrs:{style:{"flex-direction":'$rightToLeft && "row-reverse" || undefined'},tabindex:"$value !== undefined && $value !== 0 && '-1' || '0'",id:"$id + _items_wrapper",onKeydown:"$handlers.handleWrapperKeydown","data-disabled":"$disabled",onBlur:"$handlers.handleWrapperBlur",onMouseleave:"$hoverHighlight && $handlers.handleMouseleave"}}))),$a=aa("ratingItem",(()=>({for:["item","index","$max"],$el:"span",attrs:{id:'$id + "_item_" + $index',onClick:"$handlers.handleItemClick($item)",draggable:"$hoverHighlight !== true && && $disabled !== true && true",onMousemove:"$handlers.handleMousemove($item)",onDragstart:"$handlers.handleDragstart($item)",onDragend:"$handlers.handleDragend",onTouchstart:"$handlers.handleTouchstart($item)",onTouchmove:"$handlers.handleTouchmove"}}))),ba=aa("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),ya=aa("itemLabel",(()=>({$el:"label",attrs:{id:'$id + "_label_" + $index + "_" + $stepIndex',for:'$id + "_" + $index + "_" + $stepIndex',"data-checked":'$value === $fns.getValue($item, $increment) && "true" || "false"',style:{width:'$fns.showLabel($fns.getValue($item, $increment), $stepIndex, $item) && "100%" || "0%"'}}}))),xa=aa("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),wa=aa("input",(()=>({$el:"input",attrs:{type:"radio",value:"$fns.getValue($item, $increment)",id:'$id + "_" + $index + "_" + $stepIndex',onFocus:"$handlers.handleFocus",tabindex:'$value === $fns.getValue($item, $increment) && "0" || "-1"',disabled:"$disabled",name:"$id","data-value":"$fns.getValue($item, $increment)",checked:"$value === $fns.getValue($item, $increment) && true",onKeydown:"$handlers.handleKeydown($fns.getValue($item, $increment))"}}))),_a=aa("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),ka=aa("offItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item, false)",display:"flex","flex-direction":"row-reverse",position:"absolute",zIndex:"$offItemStyles && 100",overflow:"hidden",top:"0",right:"0"}}}))),Sa=aa("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),La=aa("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),Da={schema:la(ia(da("$label"),pa(ma("prefix"),ca(),ga($a(ba(ya(_a(Sa(p("$slots.onItem",(()=>()=>"$slots.onItem"),p("$slots.default",(()=>()=>"$slots.default"),ma("rating"))))),ka(La(p("$slots.offItem",(()=>()=>"$slots.offItem"),p("$slots.default",(()=>()=>"$slots.default"),ma("rating"))))),xa()),wa()))),ua(),ma("suffix"))),fa("$help"),ha(va("$message.value"))),type:"input",props:[],features:[function(e){function t(e){setTimeout((()=>{const t=Array.from(document.querySelectorAll(`#${e.props.id}_items_wrapper > .formkit-ratingItem`));for(let e=0;e<t.length;e++){const o=t[e].querySelectorAll(".formkit-onItemWrapper"),n=t[e].querySelectorAll(".formkit-offItemWrapper");for(let n=0;n<o.length;n++)o[n].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`;for(let o=0;o<n.length;o++)n[o].style.flex=`0 0 ${t[e].getBoundingClientRect().width}px`}}))}e.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==e.props.hoverHighlight&&"false"!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.deselect=vn(e.props.deselect),e.props.max=Number(e.props.max)||5,e.props.min=Number(e.props.min)||0,e.props.step=Number(e.props.step)||1,e.props.numberOfSteps=e.props.max/e.props.step,e.props.lastIndex=1/e.props.step-1,e.props.itemsToPercentages={},"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.rightToLeft?(e.props.onItemStyles=void 0,e.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):e.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},e.props.stepsPerValue=1/e.props.step,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)})),e.on("commit",(({payload:t})=>{const o=Number(t||0);xe(e,o)})),e.on("created",(()=>{e.context&&(mn(`${e.props.id}_items_wrapper`,(()=>{t(e),function(e){var o;const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{t(e)})).observe(n)}(e),setTimeout((()=>t(e)),100)}),e.props.__root),e.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],e.context.fns.getValue=(t,o)=>t+Number((o*e.props.step+e.props.step).toFixed(1)),e.context.fns.showLabel=(t,o)=>{const n=Number(e.value||0);return 0===n&&0===o||n&&t===n||t>n&&0===o||n>t&&o===e.props.lastIndex},e.context.handlers.handleFocus=t=>Ae.call(null,e,t),e.context.handlers.handleWrapperKeydown=t=>De.call(null,e,t),e.context.handlers.handleWrapperBlur=t=>we.call(null,e,t),e.context.handlers.handleItemClick=t=>o=>Me.call(null,e,t,o),e.context.handlers.handleMousemove=t=>o=>Ce.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Ie.call(null,e),e.context.handlers.handleDragstart=t=>o=>Le.call(null,e,t,o),e.context.handlers.handleMouseup=t=>Se.call(null,e,t),e.context.handlers.handleTouchstart=t=>o=>ke.call(null,e,t,o),e.context.handlers.handleTouchmove=t=>_e.call(null,e,t),e.context.handlers.handleKeydown=t=>o=>function(e,t,o){const n=Number(e.value);e.props.deselect&&" "===o.key&&n===t?e.input(0):" "===o.key&&e.input(t)}(e,t,o))}))},An("rating","star")]},Aa=a("ac"),{outer:Ca,wrapper:Ia,inner:Ma,icon:Ta,label:Ea,prefix:Oa,suffix:Fa,help:Va,messages:Ba,message:Pa}=l(Aa),Ha=Aa("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",name:"$node.name",placeholder:"$state.loading && $ui.isLoading.value || $placeholder || undefined",tabindex:'$disabled && "-1" || 0',role:"combobox",autocomplete:'$attrs.autocomplete || "off"',autocapitalize:"none",readonly:"$attrs.readonly || $state.loading || $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"}}))),Na=Aa("listboxButton",(()=>({$el:"div",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',role:"button","aria-label":"$expanded && $ui.close.value || $ui.open.value",onClick:"$handlers.toggleListbox",onKeydown:"$handlers.toggleListboxKeydown",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"}}))),Ra=Aa("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-is-selection":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),Ka=Aa("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),Wa=Aa("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Ya=Aa("removeSelection",(()=>({$el:"button",attrs:{id:'$selectionAppearance === "option" && $multiple && $id + "_remove_selection_" + $index || $id + "_remove_selection"',tabindex:"0",title:"$ui.remove.value",type:"button","aria-label":"$ui.remove.value",onClick:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)",onTouchend:"$handlers.removeSelection && $handlers.removeSelection($multiple && $option || undefined)","aria-controls":"$id"}}))),Ua=Aa("optionLoading","span"),Za=Aa("option",(()=>({$el:"div",if:"$value !== undefined"}))),ja=d(Aa),za=new WeakMap,qa="undefined"!=typeof window,Ga=new WeakMap;let Xa=!1;const Ja={schema:Ca(Ia(Ea("$label"),Ma(Ta("prefix"),Oa(),Ha(),p("$multiple !== true && $selectionAppearance === option && $expanded === false",Wa(Ra(Ka(Za(p("$state.loading",Ua("$ui.isLoading.value"),"$option.label"))),p("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",Ta("loader")),p("$selectionRemovable && $isSingleOption",Ya(Ta("close")))))),p("$state.loading && ($isSingleOption !== true || $selections.length === 0)",Ta("loader")),p('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',Ya(Ta("close")),p('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',Na(Ta("select")))),p("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",Na(Ta("select"))),ja(),Fa(),Ta("suffix")),p("$multiple && $selectionAppearance === option",Wa(Ra(Ka(Za(p("$state.loading && $isLoadingOption",Ua("$ui.isLoading.value"),"$option.label"))),Ya(Ta("close")))))),Va("$help"),Ba(Pa("$message.value"))),type:"input",family:"dropdown",props:[],features:[An("select","select"),An("close","close"),An("selected","check"),An("loader","spinner"),Cn("isLoading"),Cn("loadMore"),Cn("remove"),Cn("open"),Cn("close"),In,Z.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=vn(e.props.clearSearchOnOpen)),e.props.selectionRemovable=vn(e.props.selectionRemovable),e.props.openOnClick=vn(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=vn(e.props.allowNewValues)}),Fe,(function(e){if(e.props.multiple)if(e.props.multiple&&"option"===e.props.selectionAppearance){function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}Ue(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),mn(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement&&e.context){const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,root:e.props.__root,disabled:!e.props.draggable,plugins:[Tn()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};En({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Re(e);else Ze(e)})),$e]},Qa=a("dp"),{outer:el,wrapper:tl,inner:ol,icon:nl,label:rl,prefix:sl,suffix:al,help:ll,messages:il,message:pl}=l(Qa),dl=Qa("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"}}))),cl=Qa("panelWrapper",(()=>({$el:"div",if:"$expanded",attrs:{id:'$id + "_popover"',role:"dialog",onBlur:"$handlers._blurOut()",tabindex:"-1",popover:"$popover","aria-modal":"true","aria-label":"Choose date","data-panel":"$panel",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"',width:'$popoverCoordinates.width + "px"'}}}}))),ul=Qa("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),fl=Qa("nextLabel","span"),hl=Qa("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),vl=Qa("prevLabel","span"),ml=Qa("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),gl=Qa("calendarWeeks",(()=>({$el:"tbody"}))),$l=Qa("calendarHeader",(()=>({$el:"thead"}))),bl=Qa("weekDays",(()=>({$el:"tr"}))),yl=Qa("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),xl=Qa("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),wl=Qa("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")'}}))),_l=Qa("day","div"),kl=Qa("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'}}))),Sl=Qa("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Ll=Qa("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)"}}))),Dl=Qa("months",(()=>({if:'$panel === "month"',$el:"ul"}))),Al=Qa("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)"}}))),Cl=Qa("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Il=Qa("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Ml=Qa("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),Tl=Qa("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),El=Qa("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Ol=Qa("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Fl=Qa("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Vl=Qa("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Bl=Qa("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),Pl=Qa("time",(()=>({$el:"div",if:'$panel === "time"'}))),Hl=Qa("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),Nl=Qa("panelClose",(()=>({$el:"button",if:"$showPanelClose && ($inline === undefined || $inline === false)",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:-1,"aria-label":"$ui.close.value"}}))),{overlayPlaceholder:Rl,overlayLiteral:Kl,overlayChar:Wl,overlayEnum:Yl,overlay:Ul,overlayParts:Zl,overlayInner:jl}=i(Qa),zl=Qa("panel","div"),ql=new WeakMap,Gl=new WeakMap,Xl=new WeakSet,Jl=new WeakMap,Ql=new WeakMap,ei=new WeakSet,ti=new WeakMap,oi=/[\uD800-\uDBFF]/,ni=new WeakMap,ri=new WeakMap,si=new WeakMap,ai=new WeakMap,li=new WeakMap,ii=new WeakSet,pi=new WeakMap,di=new WeakMap,ci=new WeakMap,ui=new WeakMap;let fi=!1;const hi=()=>{fi=!0,setTimeout((()=>{fi=!1}),500)},vi={"#":{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"}},mi=new WeakMap,gi="undefined"!=typeof window;let $i=!1;gi&&document.addEventListener("selectionchange",(()=>{const e=f();if(!(e instanceof HTMLInputElement))return;if(ui.has(e))return function(e){const t=ui.get(e);if(t){const[o,n]=t,[r,s]=It(e),a=s.indexOf(o);if(-1===a)return void ui.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];rt(st(e),i)||ct(e,i)}}(e);if("select"!==ti.get(e))return;const t=st(e);if(!rt(t,mi.get(e))){if(mi.set(e,t),Xl.has(e))return Xl.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:st(e)}))}}));var bi=/^([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})?$/,yi="1999-03-04T02:05:01.000Z",xi=new Map,wi=[["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"}]],_i=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],ki=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],Si={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},Li=["MMMM","MMM","dddd","ddd"],Di=new Map([...wi,..._i,...ki].map((e=>[e[0],e]))),Ai=new Map,Ci=["full","long","medium","short"],Ii=e=>String(e).padStart(2,"0"),Mi=e=>String(e).padStart(2,"0");const Ti="undefined"!=typeof window,Ei=new WeakSet,Oi=new WeakSet,Fi=new WeakSet,Vi=new WeakMap,Bi=new WeakMap,Pi=new WeakSet,Hi=new WeakSet,Ni="undefined"!=typeof window,Ri=new WeakMap,Ki={schema:el(tl(rl("$label"),ol(nl("prefix"),sl(),Ul(jl(Zl(Rl("$part.value"),Kl("$part.value"),Wl("$part.value"),Yl("$part.value")))),dl(),cl(Cl(hl(vl("$ui.prev.value"),nl("prev")),Il("$decade"),Ml(Ol()),Tl(Fl(),Ol()),El(Fl(),Vl(),Ol()),ul(fl("$ui.next.value"),nl("next")),Nl(nl("close"))),zl(Sl(Ll("$fns.format($year, $yearFormat)")),Dl(Al("$fns.format($month, $monthFormat)")),ml($l(bl(yl("$fns.format($day, $weekdayFormat)"))),gl(xl(wl(_l("$fns.format($day, $dateFormat)"))))),Pl(Hl()))),Bl(nl("clear")),kl(nl("calendar")),al(),nl("suffix"))),ll("$help"),il(pl("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[To,function(e){var t,o,r,s,a,l,i,p,d,c,u,f,h,v,m,g,$,b,y,x,w,_;e.addProps(["_isDisabled","_isFocused","activeDate","calendar","clearable","disabled","decade","disabledDays","expanded","inputText","localTime","maxDate","maxScan","minDate","months","offset","paginatedPanels","panel","pickerOnly","renderedDate","sequence","timezone","valueFormat","valueLocale","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=ro(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=(b=e.props).yearFormat)&&void 0!==i||(b.yearFormat="YYYY"),null!==(p=(y=e.props).paginatedPanels)&&void 0!==p||(y.paginatedPanels=["day","year"]),null!==(d=(x=e.props).valueLocale)&&void 0!==d||(x.valueLocale=e.props.locale),null!==(c=(w=e.props).format)&&void 0!==c||(w.format="long"),e.props.panels=_o(e),e.props.pickerOnly=vn(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=vn(e.props.clearable)),null!==(u=(_=e.props).maxScan)&&void 0!==u||(_.maxScan=7),e.props._isDisabled="function"==typeof e.props.disabledDays?e.props.disabledDays.bind(null,e):Co.bind(null,e),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=Yt(t);else if("string"==typeof t)try{o=Yt(ho(t,e.props.valueFormat,e.props.valueLocale))}catch{console.warn(`Date (${t}) does not match format (${po(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?ro(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?ho(e.props.minDate):e.props.minDate;e.props.minDate=lo(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?ho(e.props.maxDate):e.props.maxDate;e.props.maxDate=lo(t,e.props.offset)}o=o&&lo(o,e.props.offset),o&&ko(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&&io(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=io,e.on("created",(()=>{if(mn(`${e.props.id}`,Lo.bind(null,e),e.props.__root),e.context){let t;e.context.fns.format=(t,o)=>io(t,o,e.props.locale||"en",!1,$o),e.context.fns.isDisabled=e.props._isDisabled,e.context.fns.isDisabledMonth=t=>!uo(t,(t=>!e.props._isDisabled(t)),"month"),e.context.fns.isDisabledYear=t=>!uo(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 mo(t,lo(n instanceof Date?n:ho(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}_popover`)||!(null===(n=e.props.__root)||void 0===n?void 0:n.contains(o.relatedTarget))||o.relatedTarget.id===`${e.props.id}_popover`)||(e.props.expanded=!1)},e.context.handlers.overlayClick=()=>{const t=Vi.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!Oi.has(e)&&(Fi.add(e),e.props.expanded=!0,setTimeout((()=>Fi.delete(e)),200)))},e.context.handlers.clear=()=>{var t,o;ko(e,void 0,!0),wo(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(Pi.has(e))return Pi.delete(e);if(t.target instanceof HTMLInputElement&&!e.props.expanded)try{let n=ho({date:t.target.value,format:e.props.format,locale:e.props.locale,partFilter:$o});if(function(e){return so(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(e)&&e.props.activeDate instanceof Date&&e.props.activeDate.getTime()===n.getTime()&&!ui.get(t.target)&&io(n,e.props.format,e.props.locale,!1,$o)!==t.target.value){const r=fo("dddd",e.props.locale),s=so(e.props.format,e.props.locale),a=null===(o=vo(t.target.value,s).find((e=>"dddd"===e.token)))||void 0===o?void 0:o.value,l=io(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=Ut(n,t),Ei.add(e)}}ko(e,n)}catch(t){ko(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=qt(e.props.renderedDate,10));case"day":return void(e.props.renderedDate=zt(e.props.renderedDate,1))}},e.context.handlers.prev=()=>{switch(e.props.panel){case"year":return void(e.props.renderedDate=qt(e.props.renderedDate,-10));case"day":return void(e.props.renderedDate=zt(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),wo(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=uo(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&&mo(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=Yt(e);return t.setHours(0,0,0),t}(t).getTime();return o<co(e).getTime()||o>Zt(e).getTime()||void 0}}}));const k=xo.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()),ko(e,t))})),e.on("input",(({payload:t})=>{if(void 0===t&&!e.props._isFocused)return void wo(e,void 0);const o=new Date,n=t?wo(e,lo("string"==typeof t?ho(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=io(n,"HH:mm"),function(e){const t=Bi.get(e);if(e._value&&t){const o=jt(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",yo.bind(null,e)),e.on("prop:expanded",(({payload:t})=>{if(t){if(Hi.delete(e),e.props.panels=_o(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=uo(e.props.activeDate,(t=>!e.props._isDisabled(t)),"month")||t}yo(e),mn(`${e.props.id}_popover`,(t=>{const o=t.querySelector('[tabindex="0"]');o&&setTimeout((()=>{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)}),0)}),e.props.__root),Ti&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){Pi.add(e);const t="string"==typeof e._value?ho(e._value,e.props.valueFormat,e.props.valueLocale):e._value;wo(e,lo(t,e.props.offset))}else wo(e,void 0);Ti&&(Oi.add(e),document.removeEventListener("click",k),setTimeout((()=>Oi.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=co(e.props.renderedDate),r=Zt(zt(e.props.renderedDate,o.length-1));t.getTime()<n.getTime()?e.props.renderedDate=zt(e.props.renderedDate,-1):t.getTime()>r.getTime()&&(e.props.renderedDate=zt(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=qt(e.props.renderedDate,10):r<o&&(e.props.renderedDate=qt(e.props.renderedDate,-10))}e.props.expanded&&wo(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||So(e,t);break;case"Escape":e.props.expanded=!1}if(r&&(t.preventDefault(),o=Ut(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=Ut(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||So(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=qt(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||So(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=zt(e.props.renderedDate,r);if(e.props._isDisabled(s)){const t=uo(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",(()=>{Vi.get(e)&&Do(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=yn({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:e,name:Io(e),args:[]}]},type:"validation",value:"The selected date is invalid."});e.store.set(t)}else e.store.remove("rule_invalidDate")}))},$e,Cn("next"),Cn("prev"),Cn("changeDate"),Cn("chooseDate"),An("close","close"),An("next","right"),An("clear","close"),An("prev","left"),An("calendar","date")]},Wi=a("tl"),{outer:Yi,wrapper:Ui,inner:Zi,icon:ji,label:zi,prefix:qi,suffix:Gi,help:Xi,messages:Ji,message:Qi}=l(Wi),ep=Wi("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",name:"$node.name",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","aria-autocomplete":"list","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy","aria-activedescendant":"$expanded && $activeDescendant || undefined"}}))),tp=Wi("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-label":"$expanded && $ui.close.value || $ui.open.value",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),op=Wi("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-is-tag":"true","data-active-selection":"$fns.isActiveSelection && $fns.isActiveSelection($activeSelectionValue, $option)"}}))),np=Wi("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),rp=Wi("removeSelection",(()=>({$el:"button",if:"$selections.length > 0",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1","aria-label":"$ui.remove.value",type:"button",onClick:"$handlers.removeSelection && $handlers.removeSelection($option)",onTouchstart:"$handlers.removeSelection && $handlers.removeSelection($option)","aria-controls":"$id"}}))),sp=Wi("tagLabel",(()=>({$el:"span"}))),ap=Wi("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),lp=Wi("tagLoading","span"),ip=d(Wi),pp={schema:Yi(Ui(zi("$label"),Zi(ji("prefix"),qi(),ap(op(np(p("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",lp("$ui.isLoading.value"),sp("$option.label")),rp(ji("close")))),ep()),p("$state.loading",ji("loader")),tp(ji("select")),ip(),Gi(),ji("suffix"))),Xi("$help"),Ji(Qi("$message.value"))),type:"input",family:"dropdown",props:[],features:[In,Z.bind(null,(function(e){e.props.multiple=!0,e.props.openOnClick=vn(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=vn(e.props.allowNewValues)}),Fe,(function(e){Ue(e),ve(e),e.on("created",(()=>{function t(){return Array.isArray(e.value)?e.value:[]}function o(t){e.input(t)}e.props.disabled&&(e.props.draggable=!1),mn(`${e.props.id}_selections`,(n=>{if(n instanceof HTMLElement){if(!e.context)return;const r={draggingClass:e.context.classes.dragging,dropZoneClass:e.context.classes.dropZone,disabled:!e.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[Tn()],root:e.props.__root,touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(t){e.props.activeSelectionValue=void 0,On(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,Fn(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,Vn(t)}};En({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,En({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,En({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))})),An("select","select"),An("close","close"),An("selected","check"),An("loader","spinner"),Cn("isLoading"),Cn("loadMore"),Cn("remove"),Cn("open"),Cn("close"),$e]},dp=a("mk"),{outer:cp,wrapper:up,inner:fp,label:hp,prefix:vp,suffix:mp,help:gp,messages:$p,message:bp,icon:yp}=l(dp),{overlayPlaceholder:xp,overlayLiteral:wp,overlayChar:_p,overlayEnum:kp,overlay:Sp,overlayParts:Lp,overlayInner:Dp}=i(dp),Ap=dp("input",(()=>({$el:"input",bind:"$attrs",attrs:{type:"$type",disabled:"$disabled",name:"$node.name",onBlur:"$handlers.blur",onInput:"$handlers.DOMInput",value:"$_maskValue",placeholder:"$placeholder",id:"$id","aria-describedby":"$describedBy"}}))),Cp=new WeakMap,Ip=new WeakMap,Mp=new WeakMap,Tp={schema:cp(up(hp("$label"),fp(yp("prefix"),vp(),Sp(Dp(Lp(xp("$part.value"),wp("$part.value"),_p("$part.value"),kp("$part.value")))),Ap(),mp(),yp("suffix"))),gp("$help"),$p(bp("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[To,function(e){e.addProps(["_maskValue","_overlayParts"]),e.on("created",(()=>{var t,o,n,r,s;const a=Xe("string"==typeof e._value?e._value:"");Ip.set(e,a),Mp.set(e,a),e.props.allowIncomplete=vn(e.props.allowIncomplete),e.props.overlay=vn(e.props.overlay);const l=!(void 0!==e.props.showMask&&!vn(e.props.showMask));e.props.unmaskValue=vn(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=vn(e)),t(e))));const i={placeholder:l,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!==(s=e.props.suffix)&&void 0!==s?s:void 0,reverse:vn(e.props.reverse)};Cp.set(e,i),e.hook.input(((t,o)=>{const n=function(e,t){const o=Ip.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Mp.get(e);r.value=lt(r,t);const s=Ge(r,Cp.get(e)),a=Nt(r,e.props.allowIncomplete);if(t===o.value)return e.props.unmaskValue?null!=a?a:"":null===a?"":"string"==typeof t?t:"";if(""===t&&""!==o.value&&!e.props.allowIncomplete)return t;n||s===e.props._maskValue||(o.value=s,e.props._maskValue=s,e.props._overlayParts=u(Rt(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(e,t);return o(n)})),e.props._maskValue=Ge(a,i),e.input(e.props._maskValue,!1),e.context&&(e.context.handlers.DOMInput=t=>{e.emit("dom-input-event",t)}),mn(`${e.props.id}`,Eo.bind(null,e),e.props.__root)}))}]},Ep=a("tf"),{outer:Op,wrapper:Fp,inner:Vp,icon:Bp,prefix:Pp,suffix:Hp,help:Np,messages:Rp,message:Kp}=l(Ep),Wp=Ep("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),Yp=Ep("legend",(()=>({if:"$label",$el:"legend"}))),Up=Ep("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),Zp=Ep("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),jp=Ep("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),zp=Ep("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),qp=Ep("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),Gp=Ep("targetHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_target_header_item_count"',role:"presentation","aria-label":'$targetOptions.length + " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.targetHeaderItemCount'},children:"$targetOptions.length"}))),Xp=Ep("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Jp=Ep("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Qp=Ep("sourceSearchInput",(()=>({$el:"input",attrs:{id:'$id + "_source_search_input"',type:"text",placeholder:"$placeholder",onInput:"$handlers.onSearch",value:"$inputText",onKeydown:"$handlers.sourceSearchKeydown",disabled:"$disabled","aria-label":"Search",role:"searchbox",autocomplete:"off",class:'$classes.transferlistSearchInput + " " + $classes.sourceSearchInput',onFocus:"$handlers.sourceSearchFocus",onBlur:"$handlers.sourceSearchBlur"}}))),ed=Ep("sourceSearchClear",(()=>({$el:"button",if:'$inputText !== ""',attrs:{id:'$id + "_source_search_clear"',type:"button",onClick:"$handlers.clearSearch","aria-label":"Clear search",class:'$classes.transferlistSearchClear + " " + $classes.sourceSearchClear'}}))),td=Ep("sourceListItems",(()=>({$el:"ul",attrs:{id:'$id + "_source_list_items"',"aria-activedescendant":"$activeDescendant",onMouseenter:"$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.sourceListKeydown",tabindex:"$searchable || $sourceOptions.length === 0 && -1 || 0",onFocus:"$handlers.sourceListFocused",onBlur:"$handlers.sourceListBlurred"}}))),od=Ep("sourceListItem",(()=>({for:["option","index","$sourceOptions"],$el:"li",attrs:{id:'$id + "_source_list_item_" + $index',"data-value":"$option.value","aria-selected":"$transferOnSelect === false && $fns.isSelected($option, $selectedSourceItems)","data-is-active":"$fns.isActive($option, $activeValue)","data-disabled":"$option.attrs.disabled",role:"option",onClick:"$handlers.listitemClick($option, true)",onTouchstart:"$handlers.listitemTouchstart($option, true)",onTouchmove:"$handlers.listitemTouchmove($option, true)",onTouchend:"$handlers.listitemTouchend($option, true)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.sourceListItem'}}))),nd=Ep("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),rd=Ep("sourceLoadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_source_load_more"',key:"loadMore",onClick:"$handlers.listitemClick($loadMoreOption)","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)",tabindex:"-1"}}))),sd=Ep("loadMoreInner","span"),ad=Ep("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),ld=Ep("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),id=Ep("targetListItems",(()=>({$el:"ul",attrs:{id:"$id","aria-activedescendant":"$activeDescendant",onMouseenter:"$handlers.onMouseenter(false)",onMouseout:"$handlers.onMouseleave(false)",class:'$classes.transferlistListItems + " " + $classes.targetListItems',tabindex:"$targetOptions.length === 0 && -1 || 0",onKeydown:"$handlers.targetListKeydown",onFocus:"$handlers.targetListFocused",onBlur:"$handlers.targetListBlurred"}}))),pd=Ep("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":"$transferOnSelect === false && $fns.isSelected($option, $selectedTargetItems)","data-is-active":"$fns.isActive($option, $activeValue)",role:"option",onClick:"$handlers.listitemClick($option, false)",onTouchstart:"$handlers.listitemTouchstart($option, false)",onTouchmove:"$handlers.listitemTouchmove($option, false)",onTouchend:"$handlers.listitemTouchend($option, false)",key:"$option.value",class:'$classes.transferlistListItem + " " + $classes.targetListItem'}}))),dd=Ep("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),cd=Ep("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),ud=Ep("transferButtonForward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_forward"',type:"button",disabled:"$selectedSourceItems.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForward","aria-label":"$ui.addSelectedValues.value",title:"$ui.addSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonForward'}}))),fd=Ep("transferButtonForwardAll",(()=>({$el:"button",attrs:{id:'$id + "_transfer_button_forward_all"',type:"button",disabled:"$sourceOptions.length === 0 || $disabled || ($max && $value && $value.length >= $max)",onClick:"$handlers.transferForwardAll","aria-label":"$ui.addAllValues.value",title:"$ui.addAllValues.value",onFocus:"$handlers.transferForwardAllFocused",class:'$classes.transferlistButton + " " + $classes.transferButtonForwardAll'}}))),hd=Ep("transferButtonBackward",(()=>({if:"$transferOnSelect !== true",$el:"button",attrs:{id:'$id + "_transfer_button_backward"',onClick:"$handlers.transferBackward",type:"button",disabled:"$selectedTargetItems.length === 0 || $targetOptions.length === 0 || $disabled","aria-label":"$ui.removeSelectedValues.value",title:"$ui.removeSelectedValues.value",class:'$classes.transferlistButton + " " + $classes.transferButtonBackward'}}))),vd=Ep("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'}}))),md=Ep("controlLabel","span"),gd=Ep("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),$d=Ep("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),bd=Ep("emptyMessageInner","span"),yd=Symbol(),xd=new WeakSet,wd=new WeakSet,_d={schema:Op(Wp(Yp("$label"),Np("$help"),Fp(Up(Zp(jp(),zp(p("$optionsLoadingCounter > 0",Bp("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),Xp(Jp(Qp(),ed(Bp("close")))),td(gd(bd("$sourceEmptyMessage")),od(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",Bp("selected")),nd("$option.label")),rd(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",sd(p("$state.loading",Bp("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),cd(fd(md("$ui.addAllValues.value"),Bp("fastForward")),ud(md("$ui.addSelectedValues.value"),Bp("moveRight")),hd(md("$ui.removeSelectedValues.value"),Bp("moveLeft")),vd(md("$ui.removeAllValues.value"),Bp("rewind"))),ad(ld(qp(),Gp("$fns.getTargetItemCount($selectedTargetItems)")),id($d(p("$state.loading !== true",bd("$targetEmptyMessage"))),pd(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",Bp("selected")),dd(p("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),Rp(Kp("$message.value")))),type:"input",props:[],features:[An("moveRight","right"),An("moveLeft","left"),An("fastForward","fastForward"),An("rewind","rewind"),An("close","close"),An("loader","spinner"),An("selected","check"),Cn("isLoading"),Cn("loadMore"),Cn("addAllValues"),Cn("addSelectedValues"),Cn("removeSelectedValues"),Cn("removeAllValues"),In,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),e.props.loadMoreOption={label:"Load more",value:yd},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=y.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=vn(e.props.disabled)),e.props.searchable=vn(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=vn(e.props.clearOnSelect),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=>h(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(v(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Po(e)),"function"==typeof e.props.optionLoader?No(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Uo(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Po(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Po(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,xd.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===yd)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>hn(h(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){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,e.props.sourceListOrigin=!0,xd.delete(e),Zo(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,wd.delete(e),Zo(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(Gr)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(Gr),e.props.skipSetActiveValue=!0,Po(e))}))}(e)}]},kd=a("sl"),{outer:Sd,wrapper:Ld,inner:Dd,icon:Ad,label:Cd,prefix:Id,suffix:Md,help:Td,messages:Ed,message:Od}=l(kd),Fd=kd("chart",(()=>({$el:"div",if:"$chart"}))),Vd=kd("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),Bd=kd("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),Pd=kd("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),Hd=kd("trackWrapper",(()=>({$el:"div"}))),Nd=kd("trackInner",(()=>({$el:"div"}))),Rd=kd("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Kd=kd("linkedValues",(()=>({$el:"div"}))),Wd=kd("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"}))),Yd=kd("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Ud=kd("marks",(()=>({$el:"div",if:"$marks"}))),Zd=kd("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) + "%"'}}}))),jd=kd("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),zd=kd("handles",(()=>({$el:"ul"}))),qd=kd("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"}}))),Gd=kd("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"}}))),Xd=kd("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Jd=kd("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Qd=kd("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"}}))),ec=kd("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"}}))),tc={schema:Sd(Ld(Cd("$label"),Td("$help"),Bd(Ad("prefix"),Id(),Pd(Fd(Vd()),Hd(Nd(Rd(),Ud(Zd(jd())),zd(Gd(ec(),Xd()),qd(Qd(),Jd()))))),Md(),Ad("suffix"),p("$showInput && $isMulti === false",Wd())),p("$showInput && $isMulti",Kd(Yd(),Wd())),Ed(Od("$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){u();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 p(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){u();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(void 0===t){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return r(),void l()}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==f?void 0:f.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==t||t.focus()}n=d([...e._value].sort(s))}else Array.isArray(t)?n=d(t):(n=d(t),n=isNaN(n)?e.props.min:n);e.props.snapToMarks&&(n=c(n));const a=i(n);o&&e.input(a),r(),l()}function l(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,o]=[...e._value];h&&h.input(t),v&&v.input(o)}else v&&v.input(e._value)}function i(t){return e.props.isMulti&&Array.isArray(t)?[i(t[0]),i(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function p(t){return parseFloat(t.toFixed(e.props.decimals))}function d(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>p(Math.round(t/e.props.step)*e.props.step))):p(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 p(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 p(n.value+Math.round((t-n.value)/n.step)*n.step)}}function c(t){if(Array.isArray(t))return t[0]=c(t[0]),t[1]=c(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}}function u(){if(g)return;vn(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=m[e.props.scalingFunction]||m.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...m.linear,...e.props.scalingFunction}):e.props.scalingFunction=m.linear,g=!0}let f,h,v;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const m={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)}};let g=!1;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=vn(e.props.disabled)),e.on("created",(()=>{function l(o){var n;if(!f||!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}=f.getBoundingClientRect();a(t((r-s)/l*100))}var p;u(),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 d=vn(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":d;const m=vn(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=vn(e.props.markLabels),e.props.snapToMarks=vn(e.props.snapToMarks),e.props.showInput=vn(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,mn(`track-${e.props.id}`,(()=>{var t;f=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`track-${e.props.id}`),a(e.value,!1),r()}),e.props.__root),e.context){let r=0,p="";const d=e.context.handlers.blur;e.context.handlers.blur=t=>{d(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!f)return;e.props.dragging=!1;const{left:n,width:r}=f.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(!f)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,a(e._value)},e.context.handlers.startDrag=t=>{if(!f)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,l,{passive:!1}),document.addEventListener(r,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(n,l),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=c(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=>{v=t,t.hook.commit(((o,n)=>{if(hn(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(i(r))}))},e.context.handlers.minNode=t=>{h=t,t.hook.commit(((o,n)=>{if(hn(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(i(r))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(s),h&&h.input(e.value[0]),v&&v.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>o(t,e.props.min,e.props.max)}a(e.value,!1)})),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)}))}]},oc=a("cp"),{outer:nc,wrapper:rc,inner:sc,label:ac,prefix:lc,suffix:ic,help:pc,messages:dc,message:cc,icon:uc}=l(oc),fc=oc("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",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'}}))),hc=oc("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:""}}}}))),vc=oc("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),mc=oc("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"}}))),gc=oc("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),$c=oc("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),bc=oc("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),yc=oc("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 + "%"'}}))),xc=oc("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),wc=oc("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),_c=oc("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"}}))),kc=oc("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),Sc=oc("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),Lc=oc("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"}}))),Dc=oc("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),Ac=oc("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),Cc=oc("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"}}]}))),Ic=oc("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),Mc=oc("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),Tc=oc("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),Ec=oc("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"}}]}))),Oc=oc("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"}}]}))),Fc=oc("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"}}]}))),Vc=oc("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"}}]}))),Bc=oc("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"}}]}))),Pc=oc("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"}}]}))),Hc=oc("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"}}]}))),Nc=oc("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"}}]}))),Rc=oc("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=oc("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Wc=oc("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"}}}}))),Yc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Uc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i,Zc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},jc={schema:nc(rc(ac("$label"),p("$inline && $help",pc("$help")),sc(p("($inline === undefined || $inline === false) && $prefixIcon !== undefined",uc("prefix","label")),p("$inline === undefined || $inline === false",lc()),p("$inline === undefined || $inline === false",fc(Cc(),p("$showValue",hc()))),p("$inline || $expanded)",vc(p("$showPanelClose && ($inline === undefined || $inline === false)",mc(uc("close"))),p("$panelControls",gc($c(bc(),yc()),Dc(Ac()),xc(wc(),_c()),kc(Sc(),Lc()),p("$eyeDropper && $hasNativeEyeDropper",Ic(uc("eyeDropper"))))),p("$panelFormat",Mc(Tc(p('$panelActiveFormat === "hex"',Ec()),p('$panelActiveFormat === "rgba"',Oc()),p('$panelActiveFormat === "rgba"',Fc()),p('$panelActiveFormat === "rgba"',Vc()),p('$panelActiveFormat === "hsla"',Pc()),p('$panelActiveFormat === "hsla"',Hc()),p('$panelActiveFormat === "hsla"',Nc()),p('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',Bc())),Rc(uc("switch")))),p("$options",Kc(Wc())))),p("$inline === undefined || $inline === false",ic()),p("($inline === undefined || $inline === false) && $suffixIcon !== undefined",uc("suffix"))),p("$: ($inline === undefined || $inline === false) && $help",pc("$help"))),dc(cc("$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(k&&k.contains(s)){const n=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!n)return;if("INPUT"===s.tagName&&!tn(n)&&!Yc.test(n)&&!Uc.test(n))return;(tn(n)||n.startsWith("hsl")||n.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),o(n))}}function o(t){var o;if(!t)return;const n=on(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||zo(o,2)===e.props.h&&zo(r,2)===e.props.s&&zo(s,2)===e.props.v&&zo(a,2)===e.props.alpha)||(e.props.alpha=zo(a,2),x(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=on(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=zo(s,2),x(o,n,r)}else x(e.props.h,e.props.s,e.props.v)}else x(e.props.h,e.props.s,e.props.v)}}function n(t){if(!e.context||!I)return;const o=I[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),mn(`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]=qo(t.sRGBHex);e.props.alpha=1,x(n,r,s)}))}),e.props.__root))}function a(){l("canvas-ls",(e=>{S=e}),E,v),l("canvas-hue",(e=>{L=e}),d,m),l("canvas-alpha",(e=>{D=e}),O,g),i(`canvas-preview-${e.props.id}`,(e=>{A=e,c()}),F),i(`canvas-swatch-preview-${e.props.id}`,(e=>{C=e,u()}),V),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&&_&&r(e)},p=e=>{_&&r(e)},d=()=>{_=void 0,a()},c=()=>{_=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"),_=Zc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),_=Zc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){mn(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(){mn(`swatches-${e.props.id}`,(()=>{var t,o,n;I=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),I.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=I[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,b()}),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(!A)return;const t=A.getContext("2d");if(!t)return;$(A,A.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,A.width,A.height)}function u(){if(!C)return;const t=C.getContext("2d");if(!t)return;$(C,C.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,C.width,C.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]=nn(o),[l,i,p,d]=Go(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=()=>{_=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",l)},i=()=>{_=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;B(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,B(e.props.h,e.props.s,e.props.v)}))}function g(t){h(t,D,((t,o)=>{const n=t/D.width*100/100;e.props.alpha=n,B(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 b(){var t,o;if(!e.context||!e.props.options||!I)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`${zo(0===o||100===o&&0===t?0:e,0)}-${zo(r,0)}-${zo(o,0)}-${zo(n,2)}`}(r,s,a,l);let p=!1,d=!1;I.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&&I&&(n(I.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=I[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function y(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 x(t,o,n,r=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:zo(Math.max(Math.min(t,360),0),2),e.props.s=void 0===o||isNaN(o)?e.props.s:zo(Math.max(Math.min(o,100),0),2),e.props.v=void 0===n||isNaN(n)?e.props.v:zo(Math.max(Math.min(n,100),0),2);const{h:s,s:a,v:l,alpha:i}=e.props,[p,d,c]=Go(s,a,l),[u,f,h]=Jo(s,a,l),v=e.props.hexInputFocused?e.props.hex:en(s,a,l,i),m=zo(i,2);e.props.hsla={h:s,s:d,l:c,a:m},e.props.hslaPercent={h:zo(s,0),s:100===l&&0===a?0:zo(0===l?d/255:Math.max(Math.min(d/255*100,100),0),0),l:zo(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:m},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${m})`,e.props.hslaStringPrecise=`hsla(${s}, ${zo(0===l?d/255:d/255*100,2)}%, ${zo(c/255*100,2)}%, ${m})`,e.props.rgba={r:u,g:f,b:h,a:m},e.props.rgbaString=`rgba(${u}, ${f}, ${h}, ${m})`,y(v),setTimeout((()=>{var t;w(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),P(),k||"undefined"==typeof window||(k=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const g=e.props.valueFormat?e.props.valueFormat:e.props.format;r||("hex"===g?e.input(e.props.hex):"rgba"===g?e.input(e.props.rgbaString):"hsla"===g&&e.input(e.props.hslaStringPrecise))}function w(){E(),O(),F(),V()}let _,k=null,S=null,L=null,D=null,A=null,C=null,I=null,M=0;const T=["hex","rgba","hsla"],E=rn((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),O=rn((function(){if(!D)return;const t=D.getContext("2d");if(!t)return;const o=Math.round(D.width),n=Math.round(D.height);t.clearRect(0,0,o,n),$(D,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,l=t.createLinearGradient(0,0,o,0);l.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),l.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=l,t.fillRect(0,0,o,n)}),2),F=rn(c,2),V=rn(u,2),B=rn(x,2),P=rn(b,10,!1);e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",t)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",t),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||T[0],e.props.panelControls=sn(e.props.panelControls),e.props.eyeDropper=sn(e.props.eyeDropper),e.props.panelFormat=sn(e.props.panelFormat),e.props.showValue=sn(e.props.showValue),e.props.allowPaste=sn(e.props.allowPaste),e.props.inline=vn(e.props.inline),e.props.disabled=vn(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=vn(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},x(0,0,0,!0)):o(`${e.value}`),e.on("input",(({payload:t})=>{k&&void 0!==e.props.__root&&!k.contains(e.props.__root.activeElement)&&o(t)})),setTimeout((()=>{s()}),5),a(),e.on("prop:expanded",(()=>{function t(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}var o;if(e.props.expanded)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=on(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),`${zo(n,t)}-${zo(r,t)}-${zo(s,t)}-${zo(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},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.expanded=!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.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!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.expanded){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(an),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":x(o,n-s,r);break;case"ArrowRight":x(o,n+s,r);break;case"ArrowUp":x(o,n,r+s);break;case"ArrowDown":x(o,n,r-s);break;case"PageUp":x(o,n,r+10);break;case"PageDown":x(o,n,r-10);break;case"Home":x(o,n-10,r);break;case"End":x(o,n+10,r)}w()}},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":x(o-s,n,r);break;case"ArrowRight":case"ArrowUp":x(o+s,n,r);break;case"PageUp":x(o+10,n,r);break;case"PageDown":x(o-10,n,r);break;case"Home":x(0,n,r);break;case"End":x(360,n,r)}w()}},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=zo(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=zo(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=zo(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=zo(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}x(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,tn(r)){const[t,o,n,s]=qo(r);e.props.alpha=s,y(r),x(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!tn(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;tn(o)&&y(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]=Xo(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);x(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]=Qo(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);x(t,o,n)}else"alpha"==t&&(e.props.alpha=i,x())},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]=nn(o.dataset.colorPrecise);e.props.alpha=s,x(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,r,s,a;if(!e.context||!I||!I.length)return;const l=I.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)}(I),d=I.length;let c=0,u=d,f=!1;const h=I[l].dataset.group;if(void 0!==h){const e=I.filter((e=>e.dataset.group===h));c=I.indexOf(e[0]),u=I.indexOf(e[e.length-1])}const v=(l-c)%p;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,M=v,n(l)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void I.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),M=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-(M-v))),f=!0;break;case"ArrowDown":i=Math.max(l+p,l+(p+(M-v))),f=!0;break;case"ArrowLeft":i=l-1,M=(i-c)%p;break;case"ArrowRight":i=l+1,M=(i-c)%p}if(f&&null!==i&&(i<c||i>u)){let e;e=i<c?null===(r=null===(o=I[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=I[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=I.filter((e=>e.dataset.group===h)),n=I.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,M),e-1)}else i>u&&(i=v?Math.min(u+Math.max(d,M)+1,I.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),I.forEach((e=>{delete e.parentElement.dataset.focused}));const e=I[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},$e,In,An("eyeDropper","color"),An("close","close"),Cn("close"),Cn("next")]},zc=a("tb"),{outer:qc,inner:Gc,wrapper:Xc,label:Jc,prefix:Qc,suffix:eu,help:tu,messages:ou,message:nu,icon:ru}=l(zc),su=zc("singleToggle",(()=>({bind:"$attrs",$el:"button",attrs:{id:"$id",type:"button","aria-label":"$label","aria-pressed":"$fns.isChecked($onValue, $value)",onClick:"$handlers.toggleValue()",disabled:"$disabled",class:"$classes.input",onBlur:"$handlers.blur"}}))),au=zc("multiToggle",(()=>({bind:"$attrs",$el:"button",attrs:{type:"button",id:"$id+'_'+$index","aria-label":"$label","aria-pressed":"$fns.isChecked($option, $value)",onClick:"$handlers.toggleValue($option)",class:"$classes.input",title:"$option.help",disabled:"$disabled || $option.disabled",onBlur:"$handlers.blur"}}))),lu=zc("inputInner",(()=>({bind:"$attrs",$el:"span"}))),iu=zc("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),pu=zc("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}))),du={schema:qc(p("$options",Xc(Jc("$label"),iu(pu(au(p("$fns.isChecked($option) === true",lu("$slots.default || $slots.on || $option.onLabel || $option.label"),lu("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Xc(p("$label && ($slots.default || $slots.on || $onLabel)",Jc("$label")),su(ru("prefix"),Qc(),p("$_isChecked === true",lu("$slots.default || $slots.on || $onLabel || $label"),lu("$slots.default || $slots.off || $offLabel || $label")),eu(),ru("suffix")))),tu("$help"),ou(nu("$message.value"))),type:"input",family:"button",props:["options"],features:[function(e){var t,o,n,r;e.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),e.props._isChecked=!1,e.props.enforced=vn(e.props.enforced),e.props.multiple=vn(e.props.multiple),e.props.vertical=vn(e.props.vertical),e.props.disabled=vn(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=ln(e,null),e.props.options&&e.props.multiple&&e.input(null!==(t=e.value)&&void 0!==t?t:[],!1),e.context&&(e.context.fns.isChecked=t=>ln(e,t),e.context.handlers.toggleValue=t=>o=>function(e,t,o){if(o.preventDefault(),t=t?h(t):t,e.props.options)if(e.props.multiple){const o=Array.isArray(e.value)?[...e.value]:[],n=o.findIndex((e=>hn(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else hn(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(hn(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},In]},cu=a("ut"),{outer:uu,inner:fu,wrapper:hu,label:vu,prefix:mu,suffix:gu,help:$u,messages:bu,message:yu,icon:xu}=l(cu),wu=cu("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),_u={schema:uu(hu(vu("$label"),fu(xu("prefix"),mu(),wu(),gu(),xu("suffix"))),$u("$help"),bu(yu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).decimals)&&void 0!==o||(d.decimals=null),null!==(n=(c=e.props).minDecimals)&&void 0!==n||(c.minDecimals=null),null!==(r=(u=e.props).min)&&void 0!==r||(u.min=null),null!==(s=(f=e.props).max)&&void 0!==s||(f.max=null),null!==(a=(h=e.props).step)&&void 0!==a||(h.step=1),null!==(l=(v=e.props).unit)&&void 0!==l||(v.unit=e.props.unit||"percent"),-1===["acre","bit","byte","celsius","centimeter","day","degree","fahrenheit","fluid-ounce","foot","gallon","gigabit","gigabyte","gram","hectare","hour","inch","kilobit","kilobyte","kilogram","kilometer","liter","megabit","megabyte","meter","microsecond","mile","mile-scandinavian","milliliter","millimeter","millisecond","minute","month","nanosecond","ounce","percent","petabyte","pound","second","stone","terabit","terabyte","week","yard","year"].indexOf(e.props.unit)&&(e.props.unit="percent"),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(pn(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.init(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.setPlaceholder()}))})))}))},In]},ku=a("cr"),{outer:Su,inner:Lu,wrapper:Du,label:Au,prefix:Cu,suffix:Iu,help:Mu,messages:Tu,message:Eu,icon:Ou}=l(ku),Fu=ku("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",type:"tel",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled","data-unit":"$unit","data-currency":"$currency","data-display-locale":"$displayLocale","data-value-locale":"$valueLocale","data-decimals":"$decimals","data-trailing":"$trailingZeros","data-numeric-value":"$_numericValue","data-align":"$_valueAlignAuto"}}))),Vu={schema:Su(Du(Au("$label"),Lu(Ou("prefix"),Cu(),Fu(),Iu(),Ou("suffix"))),Mu("$help"),Tu(Eu("$message.value"))),type:"input",family:"text",props:["options"],features:[function(e){var t,o,n,r,s,a,l,i,p,d,c,u,f,h,v,m;const g=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(g),e.addProps(["inputText"]),null!==(t=(p=e.props).displayLocale)&&void 0!==t||(p.displayLocale=e.props.locale||"en-US"),null!==(o=(d=e.props).currency)&&void 0!==o||(d.currency=e.props.currency||"USD"),null!==(n=(c=e.props).decimals)&&void 0!==n||(c.decimals=null),null!==(r=(u=e.props).minDecimals)&&void 0!==r||(u.minDecimals=null),null!==(s=(f=e.props).min)&&void 0!==s||(f.min=null),null!==(a=(h=e.props).max)&&void 0!==a||(h.max=null),null!==(l=(v=e.props).step)&&void 0!==l||(v.step=1),null!==(i=(m=e.props).valueFormat)&&void 0!==i||(m.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(pn(e),e.context.handlers.init(),g.forEach((t=>{e.on(`prop:${t}`,(()=>{var t,o;null===(t=null==e?void 0:e.context)||void 0===t||t.handlers.setPlaceholder(),null===(o=null==e?void 0:e.context)||void 0===o||o.handlers.init()}))})))}))}]};var Bu=Object.freeze({__proto__:null,autocomplete:Ja,colorpicker:jc,currency:Vu,datepicker:Ki,dropdown:ps,mask:Tp,rating:Da,repeater:ra,slider:tc,taglist:pp,toggle:As,togglebuttons:du,transferlist:_d,unit:_u});const Pu="undefined"!=typeof window?setInterval:()=>0,Hu=new WeakSet;export{p as $if,Ja as autocomplete,jc as colorpicker,l as createBaseSections,dn as createProPlugin,a as createSectionFactory,Vu as currency,Ki as datepicker,ps as dropdown,Bu as inputs,Tp as mask,Da as rating,ra as repeater,tc as slider,pp as taglist,As as toggle,du as togglebuttons,_d as transferlist,_u as unit};
|