@formkit/pro 0.124.2 → 0.125.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -1 +1,73 @@
1
- "use strict";function e(e,o){e in An||(An[e]={timer:0,inputs:new Set});const n=An[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=_n((()=>{Sn[e]||(Sn[e]=_n((()=>Cn.add(e)),2e3)),function(e){if(xn){window.addEventListener(bn(),(o=>{const n=new URL(o.blockedURI).hostname;wn.some(((e,t)=>Dn(t)===n))&&(t(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let o=0;const n=Ln(vn),r="://",s=(new Date).getDate(),a=async()=>{const l=Array.from(An[e].inputs),i=l.filter((t=>!(In[e]&&In[e].has(t)))).join("");if(kn(e),i){o++;try{const a=await window[Ln(gn)](`${n}${r}${Dn((s+o)%wn.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[Ln(mn)])return t(e,p.schema);if(a.ok)return In[e]||(In[e]=new Set),void l.forEach((t=>In[e].add(t)))}catch(e){}o<2&&_n(a,1e4*Math.random())}};a()}}(e)}),500)}function t(e,t){Cn.add(e),function(e,t){Mn[e]&&Mn[e].forEach((e=>e(t)))}(e,t)}function o(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return Cn.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?un.extendSchema(p,{children:d}):p;if(c=un.extendSchema(c,i),"object"==typeof c){let a=c;if(!cn.isDOM(c)&&!cn.isComponent(c)||c.meta||(c.meta={section:n,node:r}),cn.isDOM(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(cn.isComponent(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.isRecord(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",Tn,!0),wrapper:e("wrapper","div",!1),inner:e("inner",En,!1),icon:Hn,label:e("label",On,!1),prefix:e("prefix",Pn,!1),suffix:e("suffix",Pn,!1),help:e("help",Bn,!1),messages:e("messages",Fn,!1),message:e("message",Vn,!1)}}function i(e){return{overlayPlaceholder:e("overlayPlaceholder",Nn),overlayLiteral:e("overlayLiteral",Rn),overlayChar:e("overlayChar",Kn),overlayEnum:e("overlayEnum",Wn),overlay:e("overlay",Yn),overlayParts:e("overlayParts",Un),overlayInner:e("overlayInner",qn)}}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)}:(un.isSlotCondition(s)?Object.assign(s.else,{if:e}):un.isSchemaObject(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)",Hn("selected")),i("$option.label")),t=>{const o=o=>{const n=v(t)(o),r="function"==typeof e?e(t):e;return dn.isObject(r)?(un.isSlotCondition(n)&&cn.isDOM(n.else)?n.else.attrs={...n.else.attrs,...r}:cn.isDOM(n)&&(n.attrs={...n.attrs,...r}),n):n};return o._s=v._s,o})))),n(p("$fns.isSelected($option)",Hn("selected")),i("$option.label")))),r(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",s(p("$state.loading",Hn("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))));var e,v}}function c(e){return dn.isRecord(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(_r.get(e));const o=t?e.props.debounce:0;0===o?m(e,n):_r.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=un.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=h(o[0]),e.props.options=e.props.options.concat(o)}(e,t);const o=un.normalizeOptions(t);e.props.options=o,e.props.options.length||(e.store.set(Sr),e.store.set(cn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),wr.set(e,e.props.searchValue)}function $(e,t,o){if(e.store.set(kr),e.props.optionLoadingCounter++,e.props.multiple&&"truncate"!==e.props.selectionAppearance){let o;o=dn.isPojo(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.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},s=t=>{const o=e.props.memoOptions.findIndex((e=>dn.eq(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(kr),e.props.optionsLoadingCounter++,e.store.set(cn.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const t=e.props.nonceKey&&e.props[e.props.nonceKey],o=e.props.optionsLoader(e.context,Lr.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++,Lr.set(e,t),e.store.set(cn.createMessage({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=>!dn.eq(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=Ar(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:xn&&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=>dn.eq(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)!==Dr?(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(dn.eq(n,t))return e.props.optionRemoved=!0,o.filter((e=>!dn.eq(e,t)));return[...o,t]}return dn.eq(t,e.value)&&e.props.deselect?void(e.props.optionRemoved=!0):t}function D(e,t){return dn.eq(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(dn.eq(o,h(t)))return!0;return!1}return dn.eq(e.value,h(t))}function I(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 C(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=Ar(e),o=e.props.inputStd.length>1?e.props.inputStd.filter((t=>!e.props.memoOptions.find((e=>dn.eq(h(e),t))))):e.props.inputStd;if(o.forEach((o=>{$(e,o,Array.isArray(t)&&t.find((e=>dn.eq(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);Ir.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||Ir.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]),Ir.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)),Ir.has(e)?requestAnimationFrame(n.bind(null,e,t,r)):o(e,r)):Ir.delete(e)}if(!xn)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=>dn.eq(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",(()=>{dn.whenAvailable(`${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;xn&&(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;xn&&(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===Dr)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(dn.eq(h(e.props.options[r].options[s]),t)){n=s,o=r;break}if(dn.eq(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(!xn)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||!xn)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(dn.eq(h(t),o))return!0;return!1},e.context.handlers.listitemGroupClick=Y,e.context.handlers.selectOption=t=>o=>q.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)=>dn.eq(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=Cr.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Cr.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function V(e){Cr.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&&(dn.eq(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&&(dn.eq(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 q(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},S(e,t))}function U(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=dn.undefine(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||(cn.warn(350,{node:e,inputType:e.props.type}),e.props.options=[]),"disabled"in e.props&&(e.props.disabled=dn.undefine(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:Dr},e.props.loadOptions=b,e.props.listboxStyles={},e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.searchable=dn.undefine(e.props.searchable),e.props.loadOnScroll=dn.undefine(e.props.loadOnScroll),e.props.multiple=dn.undefine(e.props.multiple)||!1,"taglist"===e.props.type&&(e.props.multiple=!0),e.props.openOnFocus=dn.undefine(e.props.openOnFocus),e.props.openOnRemove=void 0!==e.props.openOnRemove&&dn.undefine(e.props.openOnRemove),e.props.hasNextPage=y.bind(null,e),e.props.initialOptions=[...e.props.options],e.props.optionLoaderValues=[],e.props.loadOnCreated=dn.undefine(e.props.loadOnCreated),e.props.max&&"number"!=typeof e.props.max?e.props.max=parseInt(e.props.max):e.props.max&&!e.props.multiple&&(e.props.max=void 0),e.on("mounted",(()=>I(e))),e.on("prop:popoverCoordinates",(()=>setTimeout((()=>{I(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),C(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=dn.undefine(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(Sr))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Sr)})),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(xn)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 z(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 j(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(Dr);let a=-1;e.props.activeValue&&(a=o.findIndex((t=>dn.eq(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 Z(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=>dn.eq(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=>dn.eq(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=>dn.eq(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===Dr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore(!0));const t=e.props.allOptions.find((t=>dn.eq(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=>dn.eq(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=>dn.eq(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=>dn.eq(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":j(e,o,t);break;case"ArrowLeft":case"ArrowRight":Z(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":z(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":j(e,o,t);break;case"ArrowRight":case"ArrowLeft":Z(e,o);break;case"Enter":Q(e,t);break;case"Escape":ee(e);break;case"Delete":case"Backspace":z(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===Dr)return void(null===(o=e.context)||void 0===o||o.handlers.loadMore());const t=e.props.allOptions.find((t=>dn.eq(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)})),xn&&dn.whenAvailable(`${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(!xn||!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=>dn.eq(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&&cn.error(300,[e]),e.props.dropdownWrapperStyles=dn.clone(Mr),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(){Vr=document.documentElement.scrollTop;for(const e in Tr)Fr[e]=document.documentElement.style[e],document.documentElement.style[e]=Tr[e];for(const e in Er)Or[e]=document.body.style[e],document.body.style[e]=Er[e];document.body.scrollTop=Vr}():function(){for(const e in Tr)document.documentElement.style[e]=Fr[e];for(const e in Er)document.body.style[e]=Or[e];document.body.scrollTop=0,document.documentElement.scrollTop=Vr}())}))}function ve(e){e.addProps(["multiLine"]),e.on("created",(()=>{xn&&(e.props.multiLineHeight=void 0,dn.whenAvailable(`${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=dn.undefine(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=dn.undefine(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():dn.whenAvailable(`${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=Br((()=>{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=dn.undefine(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:[fn.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};fn.dragAndDrop({parent:e,getValues:o,setValues:n,config:r}),t.on("prop:disabled",(({payload:t})=>{r.disabled=t,fn.dragAndDrop({parent:e,getValues:o,setValues:n,config:r})})),t.on("prop:draggable",(({payload:t})=>{r.disabled=!t,fn.dragAndDrop({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=Os.get(e);o&&(o.abort(),Os.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}),Os.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 Ie(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 Ce(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=dn.undefine(e.props.reloadOnCommit),void 0===e.props.alwaysLoadOnOpen?e.props.alwaysLoadOnOpen=!0:e.props.alwaysLoadOnOpen=dn.undefine(e.props.alwaysLoadOnOpen),"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),e.on("created",(()=>{e.context&&xn&&(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||wr.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||!ka)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){dn.whenAvailable(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Sa.set(t,e)}),e.props.__root),ka&&!La&&(La=!0,document.addEventListener("selectionchange",(()=>{const e=f();if(e instanceof HTMLInputElement&&Sa.has(e)){const t=Sa.get(e);t&&function(e){clearTimeout(_a.get(e)),_a.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(ka&&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(!ka)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=Ar(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 qe(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(kl.has(e))return;kl.set(e,[]),t.reverse&&Bl.add(e),t.prefix&&Pl.set(e,t.prefix),t.suffix&&Hl.set(e,t.suffix),Je(e,t.pattern,t.partOverrides,t.explicitParts);const n=Al.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)&&Il.add(e),Cl.set(e,a),t.onChange&&Fl.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(zl)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=kl.get(e);if(null==r?void 0:r.length){const o=(null!==(n=Sl.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),Sl.set(e,o),Fl.has(e)&&Fl.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 Kl?void t.preventDefault():void(Ft(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=Il.has(e),n=Cl.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"===Cl.get(e)){const[o]=Ct(e),n=Pt(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){Tl.set(e,it(e,t));const n=async()=>{if(!Ul||f()!==e)return;"select"===Cl.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]=Ct(e),n=Pt(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&Tl.set(e,it(e,o[n]))}(e));const t=Tl.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),Tl.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(Tl.get(e))return;Wt(e),t=pt(e,t);const[o]=Ct(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 je(e){var t,o;if(Rl.has(e))return;const n=null!==(t=kl.get(e))&&void 0!==t?t:[],r=n[null!==(o=Sl.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=Ct(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"];Rl.set(e,[r,l])}}}function Ze(e){Rl.delete(e)}function Ge(e,t){const o="string"==typeof e||!kl.has(e),n="string"==typeof e?Xe(e):e;if(o)t.prefix&&Pl.set(n,t.prefix),t.suffix&&Hl.set(n,t.suffix),n.value=lt(n,n.value),ze(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&&Bl.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Yl);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&&Al.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;Bl.has(e)&&Kt(t);let n=!1;switch(Vl.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"===Cl.get(e)){const[s,a]=Ct(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 Dl.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=Bl.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=Cl.get(e);let i="";if("select"===l){const[o,n]=Ct(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(Bl.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)){Fl.has(e)&&Nl.set(e,(()=>{Nl.delete(e),n&&Fl.get(e)(n,e)})),Vl.set(e,"beforeCallback");let t=null!==(o=kl.get(e))&&void 0!==o?o:[];const r=Sl.get(e);r&&(t=t.slice(0,r),Sl.delete(e)),t.push(n),kl.set(e,t),Ul&&f()===e&&"function"==typeof document.execCommand&&!zl?(ct(e,[0,e.value.length,"forward"],!0),zl=!0,document.execCommand("insertText",void 0,n.valueAfter),zl=!1):ut(e,n),Ul&&f()===e&&ct(e,n.selectionAfter);const s=Nl.get(e);s&&s(),Wt(e)}Vl.set(e,"complete")}function lt(e,t){var o,n;const r=null!==(o=Pl.get(e))&&void 0!==o?o:"",s=null!==(n=Hl.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=Pl.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function pt(e,t){const o=Pl.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&&(Ll.add(e),setTimeout((()=>Ll.delete(e)),5)),Tl.get(e)&&Tl.set(e,t),e.setSelectionRange(...t)}function ut(e,t,o="After"){if(e.value=t[`value${o}`],Ul){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=Ml.test(e.charAt(0))&&Ml.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:Ml.test(e.charAt(t))&&Ml.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1: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]=Ct(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 Wl(),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 It(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"]:(Wl(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return rt(s,n)||(Ll.add(e),setTimeout((()=>Ll.delete(e)),5)),s}return l}function wt(e,t,o,n){var r,s;const a=null!==(r=Al.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:Il.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:Cl.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:Ct(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=It(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=Ct(e),a=Pt(e,r,s),[l,i]=Ct(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 It(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 Ct(e,t){const o=Al.get(e);if(!o)return[[],[]];if(El.has(e))return El.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&&El.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(!Ol.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;Ol.set(e,e.values.every((e=>e.length===t)))}return Ol.get(e)}function Ft(e,t=1){const[o]=Ct(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]=Ct(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:Ct(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=kl.get(e))&&void 0!==t?t:[];return n[null!==(o=Sl.get(e))&&void 0!==o?o:n.length-1]}function Nt(e,t=!1){const o=Ht(e);return o&&(o.complete||t)?Bl.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(jl);if(t){const e=Number(t[2]);if(e<1||e>12)return!1;if(void 0!==typeof t[3]){const e=Number(t[3]);if(e<1||e>31)return!1}if(void 0!==typeof t[4]){const e=Number(t[4]);if(e<0||e>23)return!1}return!0}return!1}(e=e.trim()))return new Date(function(e){const t=e.match(jl);return t&&void 0===t[4]?e+"T00:00:00":e}(e));throw new Error(`Non ISO 8601 compliant date (${e}).`)}function qt(e,t=1){const o=Yt(e);return o.setDate(o.getDate()+t),o}function Ut(e){const t=Yt(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=Yt(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=Yt(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 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&&ti.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=ni.get(t);if(o&&o[e])return o[e];const n=new Date(Zl);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 ni.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(ri.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(Zl)).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?oi.get("YY"):oi.get("YYYY");case"month":return s?1===r?oi.get("M"):oi.get("MM"):(a=ao(o,e,t),"long"===a?oi.get("MMMM"):oi.get("MMM"));case"day":return 1===r?oi.get("D"):oi.get("DD");case"weekday":switch(a=ao(o,e,t),a){case"narrow":return oi.get("d");case"short":return oi.get("ddd");default:return oi.get("dddd")}case"hour":return 12===n?1===r?oi.get("h"):oi.get("hh"):1===r?oi.get("H"):oi.get("HH");case"minute":return 1===r?oi.get("m"):oi.get("mm");case"second":return 1===r?oi.get("s"):oi.get("ss");case"dayPeriod":return/^[A-Z]+$/u.test(t)?oi.get("A"):oi.get("a");case"literal":return[t,{literal:t},new RegExp("")];case"timeZoneName":const l=t.split("-");return 2===l.length&&4===l[1].length?oi.get("ZZ"):oi.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}(Xl.filter(s).concat(Jl.filter(s)).map(o.bind(null,!1)).concat(Ql.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(!Gl.has(e)){const t=new Date(Zl),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})}))}}Gl.set(e,s)}const n=Gl.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 Xl.concat(Jl).concat(Ql).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=zt(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=qt(s,e);if(t(o))return o}if(e&&e<=r){const o=qt(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=ri.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 ei||o.token in ei||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=zt(new Date(`${ai(v)}-${si(m+1)}-10`));if(x<g&&"throw"===s)throw new Error(`Invalid date ${ai(v)}-${si(m+1)}-${si(g)}`);g="backward"===s?Math.min(g,x):g;const w=`${ai(v)}-${si(m+1)}-${si(g)}T${si($)}:${si(b)}:${si(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 ei)p=ei[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}(Ut(t),e.props.weekStart);let a=[];do{a.push(r),7===a.length&&(o.push(a),a=[]),r=qt(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,jt(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=>Zt(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=>jt(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)?dn.clone(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;ci.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"===Vl.get(t)&&(n=t.value),je(t),t.selectionStart=0,t.selectionEnd=t.value.length,function(e,t){var o,n;if(!kl.has(e))return;const r=null!==(o=Pl.get(e))&&void 0!==o?o:"",s=null!==(n=Hl.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((()=>Ze(t)),10))}));const[r,s]=Ao(e);ze(t,{pattern:r,explicitParts:s,onChange:({valueAfter:o})=>{if(Do(e),ii.has(e))return ii.delete(e);n&&n===o?n="":(je(t),e.props.inputText=o,setTimeout((()=>Ze(t)),10))}})}function Do(e){var t,o;if(e.props.overlay){const n=ci.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")&&ui.set(e,a),r}),[])]}function Io(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 Mo(e,t){var o,n;if(t instanceof HTMLInputElement&&!mi.get(e)&&vi){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){mi.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=dn.undefine(e.props.overlay),e.props.pickerOnly=dn.undefine(e.props.pickerOnly),e.props.overlay=e.props.pickerOnly?void 0:e.props.overlay,e.props.overlay&&dn.whenAvailable(`${e.props.id}`,Mo.bind(null,e),e.props.__root)})),e.on("prop:_isPlaceholder",(()=>{e.props._overlayStyles={...e.props._overlayStyles,pointerEvents:e.props._isPlaceholder?"auto":"none"}}))}function Eo(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);sp.set(e,t),ze(t,{...rp.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===Zp){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=>dn.eq(h(e),n)));if(r&&!r.noOptionFound){t.push(r);const s=e.props.options.findIndex((e=>dn.eq(h(e),n)));-1!==s&&(o=o.filter((e=>!dn.eq(h(e),n))))}else{const e=o.find((e=>dn.eq(h(e),n)));e?(t.push(e),o=o.filter((e=>!dn.eq(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=>dn.eq(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 dn.eq(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)===Zp)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(Zp);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===Zp)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 qo(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),xn){dn.whenAvailable(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=[],fn.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};r.plugins=[fn.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,fn.handleDragstart(t)},handleEnd(t){fn.handleEnd(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.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map((e=>h(e)))})],fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:maxReached",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})}))}(e,t)}),e.props.__root),dn.whenAvailable(`${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=[fn.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,fn.handleDragstart(t)},handleEnd(t){fn.handleEnd(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.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map((e=>h(e)))})],fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:t,getValues:o,setValues:n,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({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=Gp.has(e),r=`${e.props.id}_source_list_item`,s=[...e.props.sourceOptions],!s||!s.length||n)return s=[],r="",void(n=null)}else if(e.props.mouseOnTarget&&(n=Xp.has(e),r=`${e.props.id}_target_list_item`,s=[...e.props.targetOptions],!s||!s.length||n))return s=[],r="",void(n=null);const a=s.reduce(((t,o,n)=>{var s,a;if(null===(s=o.attrs)||void 0===s?void 0:s.disabled)return t;const l=null===(a=e.props.__root)||void 0===a?void 0:a.getElementById(r+`_${n}`);return l&&t.push([l,o]),t}),[]),l=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}_load_more`);l&&a.push([l,e.props.loadMoreOption]),e.props.mouseOnSource&&Gp.add(e),e.props.mouseOnTarget&&Xp.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 Bo(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Gp.has(e)||e.props.mouseOnTarget&&Xp.has(e)?requestAnimationFrame(zo.bind(null,e,t,o,n)):Uo(e,n):(Gp.delete(e),Xp.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[...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,jo(255*t,2),jo(255*a,2),n]}function Xo(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 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 Zo(e);if(e.startsWith("rgb")){const t=e.match(bc);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(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 Xo(o,jo(255*n,2),jo(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=>dn.eq(e,t))).length>0:void 0!==t?dn.eq(e.value,t):(e.props._isChecked=dn.eq(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(".");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(){dn.whenAvailable(`${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(!e.props.inExecCommand&&(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),e.props.inExecCommand=!0,document.execCommand("insertText",void 0,w),e.props.inExecCommand=!1,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)}})}var dn=require("@formkit/utils"),cn=require("@formkit/core"),un=require("@formkit/inputs");require("@formkit/vue");var fn=require("@formkit/drag-and-drop");const hn=[988,24029,396,13078,980],vn=18806588,mn=502357,gn=16217489;let $n=189024;const bn=()=>[30548127325,27022924,34729821653783].map(Ln).join("y"),yn=/^[0-9a-f]+$/,xn="undefined"!=typeof window,wn=n(32,(e=>e)).map((()=>{$n|=0,$n=$n+1831565813|0;let e=$n^$n>>>15|$n;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),_n=xn?setTimeout:()=>0,kn=e=>{clearTimeout(Sn[e])},Sn={},Ln=e=>e.toString(32),Dn=e=>`${Ln(wn[e]).substring(2)}.${Ln(hn[e%(hn.length-1)])}`,An={},In={},Cn=new Set(["",null,void 0]),Mn={},Tn=()=>({$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"}}),En=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),On=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Fn=()=>({$el:"ul",if:"$fns.length($messages)"}),Vn=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Bn=()=>({$el:"div",if:"$help"}),Pn=()=>({$el:null}),Hn=(e,t)=>()=>un.icon(e,t),Nn=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),Rn=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),Kn=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),Wn=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),Yn=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),qn=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),Un=()=>({$el:null,for:["part","$_overlayParts"]}),zn=a("dd"),{outer:jn,wrapper:Zn,inner:Gn,icon:Xn,label:Jn,prefix:Qn,suffix:er,help:tr,messages:or,message:nr}=l(zn),rr=zn("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"}}))),sr=zn("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),ar=zn("selection",(()=>({$el:"div"}))),lr=zn("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'}}}))),ir=zn("optionLoading","span"),pr=zn("option",(()=>({$el:"div"}))),dr=zn("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"}}))),cr=zn("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ur=zn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),fr=zn("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),hr=zn("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 || ""'}))),vr=zn("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)"}}))),mr=zn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),gr=zn("tagLabel",(()=>({$el:"span"}))),$r=zn("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),br=zn("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),yr=zn("tagLoading","span"),xr=d(zn),wr=new WeakMap,_r=new WeakMap,kr=cn.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Sr=cn.createMessage({key:"loading",type:"state",value:!1,visible:!1}),Lr=new WeakMap,Dr=Symbol(),Ar=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=>dn.eq(h(t),e)));o=dn.isPojo(e)?void 0:Array.isArray(e)?e.join(", "):e,r||(r={value:e,label:o,isPlaceholder:!1,noOptionFound:!0}),n.push(r)}return n},Ir=new WeakSet,Cr=new WeakMap,Mr={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Tr={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Er={overflow:"hidden",height:"100%"},Or={},Fr={};let Vr=0;const Br=(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))}},Pr={schema:jn(Zn(Jn("$label"),Gn(Xn("prefix"),Qn(),rr(p("$inputStd.length === 0 && $state.loading !== true",lr('$placeholder || "placeholder"'),p("$multiple !== true",sr(p("$state.loading && $selections.length === 0",ir("$ui.isLoading.value"),ar(pr("$option.label")))),p('$multiple && $selectionAppearance === "truncate"',cr(ur(p("$state.loading && $selections.length === 0",ir("$ui.isLoading.value"),hr()))),p('$multiple && $selectionAppearance === "tags"',$r(br(p("$state.loading && $isLoadingOption !== true && $selections.length === 0",ir("$ui.isLoading.value"),vr(mr(p("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",yr("$ui.isLoading.value"),gr("$option.label")),dr(Xn("close"))))))))))),p("$truncationCount && $state.loading !== true",fr("$truncationCount")),p("$state.loading",Xn("loader")),p("$inputStd.length !== 0 && $selectionRemovable",dr(Xn("close")),Xn("select"))),xr(),er(),Xn("suffix"))),tr("$help"),or(nr("$message.value"))),type:"input",family:"dropdown",props:[],features:[un.defaultIcon("select","select"),un.defaultIcon("close","close"),un.defaultIcon("selected","check"),un.defaultIcon("loader","spinner"),un.localize("isLoading"),un.localize("loadMore"),un.localize("remove"),un.options,U.bind(null,(function(e){void 0===e.props.closeOnSelect?e.props.closeOnSelect=!e.props.multiple:e.props.closeOnSelect=dn.undefine(e.props.closeOnSelect),(e.props.multiple&&void 0===e.props.selectionAppearance||"truncate"===e.props.selectionAppearance)&&(e.props.selectionAppearance="truncate",e.props.formattedSelections=[]),e.props.multiple?e.props.selectionRemovable=!1:e.props.selectionRemovable=dn.undefine(e.props.selectionRemovable)}),(function(e){e.props.alwaysLoadOnOpen=void 0!==e.props.alwaysLoadOnOpen&&dn.undefine(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),dn.whenAvailable(`${e.props.id}_selections`,(n=>{if(e.context&&n instanceof HTMLElement){const r={threshold:{horizontal:.25,vertical:0},plugins:[fn.animations()],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")};fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({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]},Hr=a("tg"),{outer:Nr,wrapper:Rr,label:Kr,prefix:Wr,suffix:Yr,help:qr,messages:Ur,message:zr,icon:jr}=l(Hr),Zr=Hr("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"}}))),Gr=Hr("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),Xr=Hr("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"}))),Jr=Hr("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"}}))),Qr=Hr("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"}}}))),es=Hr("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),ts=Hr("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),os=Hr("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),ns={schema:Nr(Rr(Xr(),es(Wr(),Zr(),ts(Jr(),os(p("$slots.default","$slots.default",jr("thumb")))),Yr()),Qr(),Gr()),qr("$help"),Ur(zr("$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=dn.undefine(e.props.disabled)),e.props.altLabelPosition=dn.undefine(e.props.altLabelPosition),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=dn.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))})),e.on("commit",(({payload:t})=>{e.props.checked=dn.eq(t,e.props.onValue)}))}]},rs=a("rp"),{outer:ss,inner:as,prefix:ls,suffix:is,help:ps,messages:ds,message:cs,icon:us}=l(rs),fs=rs("empty",(()=>({$el:"div"}))),hs=rs("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),vs=rs("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ms=rs("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),gs=rs("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),$s=rs("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),bs=rs("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),ys=rs("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),xs=rs("content","div"),ws=rs("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),_s=rs("legend",(()=>({$el:"legend",if:"$label"}))),ks=rs("group",(()=>({$formkit:"group",index:"$index"}))),Ss=rs("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Ls=rs("remove",(()=>({$el:"li",if:"$removeControl"}))),Ds=rs("insert",(()=>({$el:"li",if:"$insertControl"}))),As=rs("up",(()=>({$el:"li",if:"$upControl"}))),Is=rs("down",(()=>({$el:"li",if:"$downControl"}))),Cs=rs("controlLabel","span"),Ms=rs("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),Ts=rs("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}}))),Es={schema:ss(ws(_s("$label"),ps("$help"),as(ls(),p("$value.length === 0",p("$slots.empty",fs()),p("$slots.default",gs($s(Ms(Ts(us("dragHandle"))),xs(ks("$slots.default")),Ss(As(ys(Cs("$ui.moveUp.value"),us("moveUp"))),Ls(ms(Cs("$ui.remove.value"),us("remove"))),Ds(hs(Cs("$ui.add.value"),us("add"))),Is(bs(Cs("$ui.moveDown.value"),us("moveDown")))))),is()))),vs('$addLabel || ($ui.add.value + " " + ($label || ""))')),ds(cs("$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",(()=>{dn.whenAvailable(`${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)}))},un.disablesChildren,un.localize("remove"),un.localize("add"),un.localize("moveUp"),un.localize("moveDown"),un.defaultIcon("dragHandle","dragHandle"),un.defaultIcon("remove","trash"),un.defaultIcon("add","add"),un.defaultIcon("moveUp","arrowUp"),un.defaultIcon("moveDown","arrowDown")]},Os=new WeakMap,Fs=a("rt"),{outer:Vs,wrapper:Bs,inner:Ps,label:Hs,prefix:Ns,suffix:Rs,help:Ks,messages:Ws,message:Ys,icon:qs}=l(Fs),Us=Fs("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"}}))),zs=Fs("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"}}))),js=Fs("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),Zs=Fs("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%"'}}}))),Gs=Fs("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),Xs=Fs("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))"}}))),Js=Fs("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),Qs=Fs("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"}}}))),ea=Fs("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),ta=Fs("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),oa={schema:Vs(Bs(Hs("$label"),Ps(qs("prefix"),Ns(),Us(zs(js(Zs(Js(ea(p("$slots.onItem",(()=>()=>"$slots.onItem"),p("$slots.default",(()=>()=>"$slots.default"),qs("rating"))))),Qs(ta(p("$slots.offItem",(()=>()=>"$slots.offItem"),p("$slots.default",(()=>()=>"$slots.default"),qs("rating"))))),Gs()),Xs()))),Rs(),qs("suffix"))),Ks("$help"),Ws(Ys("$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=dn.undefine(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=dn.undefine(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&&(dn.whenAvailable(`${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=>Ie.call(null,e,t,o),e.context.handlers.handleMouseleave=()=>Ce.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))}))},un.defaultIcon("rating","star")]},na=a("ac"),{outer:ra,wrapper:sa,inner:aa,icon:la,label:ia,prefix:pa,suffix:da,help:ca,messages:ua,message:fa}=l(na),ha=na("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"}}))),va=na("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"}}))),ma=na("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)"}}))),ga=na("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),$a=na("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),ba=na("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=na("optionLoading","span"),xa=na("option",(()=>({$el:"div",if:"$value !== undefined"}))),wa=d(na),_a=new WeakMap,ka="undefined"!=typeof window,Sa=new WeakMap;let La=!1;const Da={schema:ra(sa(ia("$label"),aa(la("prefix"),pa(),ha(),p("$multiple !== true && $selectionAppearance === option && $expanded === false",$a(ma(ga(xa(p("$state.loading",ya("$ui.isLoading.value"),"$option.label"))),p("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",la("loader")),p("$selectionRemovable && $isSingleOption",ba(la("close")))))),p("$state.loading && ($isSingleOption !== true || $selections.length === 0)",la("loader")),p('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',ba(la("close")),p('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',va(la("select")))),p("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",va(la("select"))),wa(),da(),la("suffix")),p("$multiple && $selectionAppearance === option",$a(ma(ga(xa(p("$state.loading && $isLoadingOption",ya("$ui.isLoading.value"),"$option.label"))),ba(la("close")))))),ca("$help"),ua(fa("$message.value"))),type:"input",family:"dropdown",props:[],features:[un.defaultIcon("select","select"),un.defaultIcon("close","close"),un.defaultIcon("selected","check"),un.defaultIcon("loader","spinner"),un.localize("isLoading"),un.localize("loadMore"),un.localize("remove"),un.localize("open"),un.localize("close"),un.options,U.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=dn.undefine(e.props.clearSearchOnOpen)),e.props.selectionRemovable=dn.undefine(e.props.selectionRemovable),e.props.openOnClick=dn.undefine(e.props.openOnClick),"option"!==e.props.selectionAppearance||e.props.multiple||(e.props.isSingleOption=!0),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),void 0===e.props.selectionAppearance&&(e.props.selectionAppearance="text-input"),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=dn.undefine(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)}qe(e),e.on("created",(()=>{e.props.disabled&&(e.props.draggable=!1),dn.whenAvailable(`${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:[fn.animations()],touchDraggingClass:e.context.classes.touchDragging,touchDropZoneClass:e.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))}else e.props.multiple&&"text-input"===e.props.selectionAppearance&&Re(e);else Ue(e)})),$e]},Aa=a("dp"),{outer:Ia,wrapper:Ca,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:{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"}}))),Na=Aa("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"'}}}}))),Ra=Aa("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ka=Aa("nextLabel","span"),Wa=Aa("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Ya=Aa("prevLabel","span"),qa=Aa("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Ua=Aa("calendarWeeks",(()=>({$el:"tbody"}))),za=Aa("calendarHeader",(()=>({$el:"thead"}))),ja=Aa("weekDays",(()=>({$el:"tr"}))),Za=Aa("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Ga=Aa("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Xa=Aa("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")'}}))),Ja=Aa("day","div"),Qa=Aa("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'}}))),el=Aa("years",(()=>({if:'$panel === "year"',$el:"ul"}))),tl=Aa("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)"}}))),ol=Aa("months",(()=>({if:'$panel === "month"',$el:"ul"}))),nl=Aa("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)"}}))),rl=Aa("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),sl=Aa("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),al=Aa("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),ll=Aa("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),il=Aa("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),pl=Aa("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),dl=Aa("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),cl=Aa("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),ul=Aa("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),fl=Aa("time",(()=>({$el:"div",if:'$panel === "time"'}))),hl=Aa("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),vl=Aa("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:ml,overlayLiteral:gl,overlayChar:$l,overlayEnum:bl,overlay:yl,overlayParts:xl,overlayInner:wl}=i(Aa),_l=Aa("panel","div"),kl=new WeakMap,Sl=new WeakMap,Ll=new WeakSet,Dl=new WeakMap,Al=new WeakMap,Il=new WeakSet,Cl=new WeakMap,Ml=/[\uD800-\uDBFF]/,Tl=new WeakMap,El=new WeakMap,Ol=new WeakMap,Fl=new WeakMap,Vl=new WeakMap,Bl=new WeakSet,Pl=new WeakMap,Hl=new WeakMap,Nl=new WeakMap,Rl=new WeakMap;let Kl=!1;const Wl=()=>{Kl=!0,setTimeout((()=>{Kl=!1}),500)},Yl={"#":{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"}},ql=new WeakMap,Ul="undefined"!=typeof window;let zl=!1;Ul&&document.addEventListener("selectionchange",(()=>{const e=f();if(!(e instanceof HTMLInputElement))return;if(Rl.has(e))return function(e){const t=Rl.get(e);if(t){const[o,n]=t,[r,s]=Ct(e),a=s.indexOf(o);if(-1===a)return void Rl.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];rt(st(e),i)||ct(e,i)}}(e);if("select"!==Cl.get(e))return;const t=st(e);if(!rt(t,ql.get(e))){if(ql.set(e,t),Ll.has(e))return Ll.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:st(e)}))}}));var jl=/^([0-9]{4})-([0-1][0-9])(?:-([0-3][0-9]))?(?:[T ]?([0-2][0-9])(?::([0-5][0-9]))?(?::([0-5][0-9]))?)?(?:\.[0-9]+)?(Z|(?:\+|\-)[0-9]{4})?$/,Zl="1999-03-04T02:05:01.000Z",Gl=new Map,Xl=[["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"}]],Jl=[["HH",{hour:"2-digit"}],["H",{hour:"numeric"}]],Ql=[["hh",{hour:"2-digit"}],["h",{hour:"numeric"}],["a",{dayPeriod:"narrow"}],["A",{dayPeriod:"narrow"}]],ei={DD:2,HH:2,MM:2,YY:2,YYYY:4,hh:2,mm:2,ss:2,Z:5},ti=["MMMM","MMM","dddd","ddd"],oi=new Map([...Xl,...Jl,...Ql].map((e=>[e[0],e]))),ni=new Map,ri=["full","long","medium","short"],si=e=>String(e).padStart(2,"0"),ai=e=>String(e).padStart(2,"0");const li="undefined"!=typeof window,ii=new WeakSet,pi=new WeakSet,di=new WeakSet,ci=new WeakMap,ui=new WeakMap,fi=new WeakSet,hi=new WeakSet,vi="undefined"!=typeof window,mi=new WeakMap,gi={schema:Ia(Ca(Ea("$label"),Ma(Ta("prefix"),Oa(),yl(wl(xl(ml("$part.value"),gl("$part.value"),$l("$part.value"),bl("$part.value")))),Ha(),Na(rl(Wa(Ya("$ui.prev.value"),Ta("prev")),sl("$decade"),al(pl()),ll(dl(),pl()),il(dl(),cl(),pl()),Ra(Ka("$ui.next.value"),Ta("next")),vl(Ta("close"))),_l(el(tl("$fns.format($year, $yearFormat)")),ol(nl("$fns.format($month, $monthFormat)")),qa(za(ja(Za("$fns.format($day, $weekdayFormat)"))),Ua(Ga(Xa(Ja("$fns.format($day, $dateFormat)"))))),fl(hl()))),ul(Ta("clear")),Qa(Ta("calendar")),Fa(),Ta("suffix"))),Va("$help"),Ba(Pa("$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=dn.undefine(e.props.pickerOnly),"disabled"in e.props&&(e.props.disabled=dn.undefine(e.props.disabled)),"clearable"in e.props&&(e.props.clearable=dn.undefine(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):Io.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(dn.whenAvailable(`${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=ci.get(e);t&&(t.focus(),e.props._isPlaceholder=!1)},e.context.handlers.focus=()=>{e.props.pickerOnly||(e.props._isFocused=!0,e.props.pickerOnly&&!pi.has(e)&&(di.add(e),e.props.expanded=!0,setTimeout((()=>di.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(fi.has(e))return fi.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()&&!Rl.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=qt(n,t),ii.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=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),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>Ut(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=ui.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",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),dn.whenAvailable(`${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),li&&setTimeout((()=>{document.addEventListener("click",k)}),10)}else{if("time"===e.props.panel)e.emit("dateSelected",e.props.activeDate);else if(e._value){fi.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);li&&(pi.add(e),document.removeEventListener("click",k),setTimeout((()=>pi.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=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&&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=qt(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=qt(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=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||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=jt(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",(()=>{ci.get(e)&&Do(e)})),e.on("commit",(()=>{if(e.props.activeDate&&e.props._isDisabled(e.props.activeDate)){const t=cn.createMessage({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,un.localize("next"),un.localize("prev"),un.localize("changeDate"),un.localize("chooseDate"),un.defaultIcon("close","close"),un.defaultIcon("next","right"),un.defaultIcon("clear","close"),un.defaultIcon("prev","left"),un.defaultIcon("calendar","date")]},$i=a("tl"),{outer:bi,wrapper:yi,inner:xi,icon:wi,label:_i,prefix:ki,suffix:Si,help:Li,messages:Di,message:Ai}=l($i),Ii=$i("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"}}))),Ci=$i("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'}}))),Mi=$i("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)"}}))),Ti=$i("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Ei=$i("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"}}))),Oi=$i("tagLabel",(()=>({$el:"span"}))),Fi=$i("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),Vi=$i("tagLoading","span"),Bi=d($i),Pi={schema:bi(yi(_i("$label"),xi(wi("prefix"),ki(),Fi(Mi(Ti(p("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",Vi("$ui.isLoading.value"),Oi("$option.label")),Ei(wi("close")))),Ii()),p("$state.loading",wi("loader")),Ci(wi("select")),Bi(),Si(),wi("suffix"))),Li("$help"),Di(Ai("$message.value"))),type:"input",family:"dropdown",props:[],features:[un.options,U.bind(null,(function(e){e.props.multiple=!0,e.props.openOnClick=dn.undefine(e.props.openOnClick),void 0===e.props.closeOnSelect&&(e.props.closeOnSelect=!0),e.props.closeOnSelect?e.props.resetSearchOnCommit=!1:void 0===e.props.resetSearchOnCommit&&(e.props.resetSearchOnCommit=e.props.multiple),e.props.allowNewValues=dn.undefine(e.props.allowNewValues)}),Fe,(function(e){qe(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),dn.whenAvailable(`${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:[fn.animations()],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,fn.handleEnd(t)},handleDragstart(t){e.props.activeSelectionValue=void 0,fn.handleDragstart(t)},handleTouchstart(t){e.props.activeSelectionValue=void 0,fn.handleTouchstart(t)}};fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r}),e.on("prop:disabled",(({payload:e})=>{r.disabled=e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})})),e.on("prop:draggable",(({payload:e})=>{r.disabled=!e,fn.dragAndDrop({parent:n,getValues:t,setValues:o,config:r})}))}}),e.props.__root)}))})),un.defaultIcon("select","select"),un.defaultIcon("close","close"),un.defaultIcon("selected","check"),un.defaultIcon("loader","spinner"),un.localize("isLoading"),un.localize("loadMore"),un.localize("remove"),un.localize("open"),un.localize("close"),$e]},Hi=a("mk"),{outer:Ni,wrapper:Ri,inner:Ki,label:Wi,prefix:Yi,suffix:qi,help:Ui,messages:zi,message:ji,icon:Zi}=l(Hi),{overlayPlaceholder:Gi,overlayLiteral:Xi,overlayChar:Ji,overlayEnum:Qi,overlay:ep,overlayParts:tp,overlayInner:op}=i(Hi),np=Hi("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"}}))),rp=new WeakMap,sp=new WeakMap,ap=new WeakMap,lp={schema:Ni(Ri(Wi("$label"),Ki(Zi("prefix"),Yi(),ep(op(tp(Gi("$part.value"),Xi("$part.value"),Ji("$part.value"),Qi("$part.value")))),np(),qi(),Zi("suffix"))),Ui("$help"),zi(ji("$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:"");sp.set(e,a),ap.set(e,a),e.props.allowIncomplete=dn.undefine(e.props.allowIncomplete),e.props.overlay=dn.undefine(e.props.overlay);const l=!(void 0!==e.props.showMask&&!dn.undefine(e.props.showMask));e.props.unmaskValue=dn.undefine(e.props.unmaskValue),e.hook.prop(((e,t)=>("unmaskValue"===e.prop&&(e.value=dn.undefine(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:dn.undefine(e.props.reverse)};rp.set(e,i),e.hook.input(((t,o)=>{const n=function(e,t){const o=sp.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=ap.get(e);r.value=lt(r,t);const s=Ge(r,rp.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)}),dn.whenAvailable(`${e.props.id}`,Eo.bind(null,e),e.props.__root)}))}]},ip=a("tf"),{outer:pp,wrapper:dp,inner:cp,icon:up,prefix:fp,suffix:hp,help:vp,messages:mp,message:gp}=l(ip),$p=ip("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),bp=ip("legend",(()=>({if:"$label",$el:"legend"}))),yp=ip("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),xp=ip("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),wp=ip("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),_p=ip("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),kp=ip("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),Sp=ip("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"}))),Lp=ip("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),Dp=ip("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),Ap=ip("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"}}))),Ip=ip("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'}}))),Cp=ip("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"}}))),Mp=ip("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'}}))),Tp=ip("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),Ep=ip("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"}}))),Op=ip("loadMoreInner","span"),Fp=ip("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),Vp=ip("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Bp=ip("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"}}))),Pp=ip("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'}}))),Hp=ip("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Np=ip("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Rp=ip("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'}}))),Kp=ip("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'}}))),Wp=ip("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'}}))),Yp=ip("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'}}))),qp=ip("controlLabel","span"),Up=ip("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),zp=ip("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),jp=ip("emptyMessageInner","span"),Zp=Symbol(),Gp=new WeakSet,Xp=new WeakSet,Jp={schema:pp($p(bp("$label"),vp("$help"),dp(yp(xp(wp(),_p(p("$optionsLoadingCounter > 0",up("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),Lp(Dp(Ap(),Ip(up("close")))),Cp(Up(jp("$sourceEmptyMessage")),Mp(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",up("selected")),Tp("$option.label")),Ep(p("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",Op(p("$state.loading",up("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),Np(Kp(qp("$ui.addAllValues.value"),up("fastForward")),Rp(qp("$ui.addSelectedValues.value"),up("moveRight")),Wp(qp("$ui.removeSelectedValues.value"),up("moveLeft")),Yp(qp("$ui.removeAllValues.value"),up("rewind"))),Fp(Vp(kp(),Sp("$fns.getTargetItemCount($selectedTargetItems)")),Bp(zp(p("$state.loading !== true",jp("$targetEmptyMessage"))),Pp(p("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",up("selected")),Hp(p("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),mp(gp("$message.value")))),type:"input",props:[],features:[un.defaultIcon("moveRight","right"),un.defaultIcon("moveLeft","left"),un.defaultIcon("fastForward","fastForward"),un.defaultIcon("rewind","rewind"),un.defaultIcon("close","close"),un.defaultIcon("loader","spinner"),un.defaultIcon("selected","check"),un.localize("isLoading"),un.localize("loadMore"),un.localize("addAllValues"),un.localize("addSelectedValues"),un.localize("removeSelectedValues"),un.localize("removeAllValues"),un.options,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:Zp},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=dn.undefine(e.props.disabled)),e.props.searchable=dn.undefine(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=dn.undefine(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),qo(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,Gp.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===Zp)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>dn.eq(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,Gp.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,Xp.delete(e),Uo(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(Sr)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(Sr),e.props.skipSetActiveValue=!0,Po(e))}))}(e)}]},Qp=a("sl"),{outer:ed,wrapper:td,inner:od,icon:nd,label:rd,prefix:sd,suffix:ad,help:ld,messages:id,message:pd}=l(Qp),dd=Qp("chart",(()=>({$el:"div",if:"$chart"}))),cd=Qp("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 + "%"'}}}}))),ud=Qp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),fd=Qp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),hd=Qp("trackWrapper",(()=>({$el:"div"}))),vd=Qp("trackInner",(()=>({$el:"div"}))),md=Qp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),gd=Qp("linkedValues",(()=>({$el:"div"}))),$d=Qp("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"}))),bd=Qp("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=Qp("marks",(()=>({$el:"div",if:"$marks"}))),xd=Qp("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) + "%"'}}}))),wd=Qp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),_d=Qp("handles",(()=>({$el:"ul"}))),kd=Qp("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"}}))),Sd=Qp("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"}}))),Ld=Qp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Dd=Qp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Ad=Qp("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"}}))),Id=Qp("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"}}))),Cd={schema:ed(td(rd("$label"),ld("$help"),ud(nd("prefix"),sd(),fd(dd(cd()),hd(vd(md(),yd(xd(wd())),_d(Sd(Id(),Ld()),kd(Ad(),Dd()))))),ad(),nd("suffix"),p("$showInput && $isMulti === false",$d())),p("$showInput && $isMulti",gd(bd(),$d())),id(pd("$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;dn.undefine(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=dn.undefine(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=dn.undefine(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":d;const m=dn.undefine(e.props.marks);e.props.marks=!!m&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=dn.undefine(e.props.markLabels),e.props.snapToMarks=dn.undefine(e.props.snapToMarks),e.props.showInput=dn.undefine(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const g={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(g,e.props.inputAttrs):g,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs,dn.whenAvailable(`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(dn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=r,a(e.value)):a(r),n(i(r))}))},e.context.handlers.minNode=t=>{h=t,t.hook.commit(((o,n)=>{if(dn.eq(t.value,o))return n(o);const r=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=r,a(e.value)):a(r),n(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)}))}]},Md=a("cp"),{outer:Td,wrapper:Ed,inner:Od,label:Fd,prefix:Vd,suffix:Bd,help:Pd,messages:Hd,message:Nd,icon:Rd}=l(Md),Kd=Md("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'}}))),Wd=Md("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:""}}}}))),Yd=Md("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"}}}}}))),qd=Md("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"}}))),Ud=Md("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),zd=Md("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),jd=Md("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),Zd=Md("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 + "%"'}}))),Gd=Md("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Xd=Md("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),Jd=Md("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"}}))),Qd=Md("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),ec=Md("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),tc=Md("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"}}))),oc=Md("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),nc=Md("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),rc=Md("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"}}]}))),sc=Md("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),ac=Md("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),lc=Md("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),ic=Md("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"}}]}))),pc=Md("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"}}]}))),dc=Md("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"}}]}))),cc=Md("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"}}]}))),uc=Md("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"}}]}))),fc=Md("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=Md("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"}}]}))),vc=Md("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"}}]}))),mc=Md("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"}}))),gc=Md("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),$c=Md("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"}}}}))),bc=/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,xc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"},wc={schema:Td(Ed(Fd("$label"),p("$inline && $help",Pd("$help")),Od(p("($inline === undefined || $inline === false) && $prefixIcon !== undefined",Rd("prefix","label")),p("$inline === undefined || $inline === false",Vd()),p("$inline === undefined || $inline === false",Kd(rc(),p("$showValue",Wd()))),p("$inline || $expanded)",Yd(p("$showPanelClose && ($inline === undefined || $inline === false)",qd(Rd("close"))),p("$panelControls",Ud(zd(jd(),Zd()),oc(nc()),Gd(Xd(),Jd()),Qd(ec(),tc()),p("$eyeDropper && $hasNativeEyeDropper",sc(Rd("eyeDropper"))))),p("$panelFormat",ac(lc(p('$panelActiveFormat === "hex"',ic()),p('$panelActiveFormat === "rgba"',pc()),p('$panelActiveFormat === "rgba"',dc()),p('$panelActiveFormat === "rgba"',cc()),p('$panelActiveFormat === "hsla"',fc()),p('$panelActiveFormat === "hsla"',hc()),p('$panelActiveFormat === "hsla"',vc()),p('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',uc())),mc(Rd("switch")))),p("$options",gc($c())))),p("$inline === undefined || $inline === false",Bd()),p("($inline === undefined || $inline === false) && $suffixIcon !== undefined",Rd("suffix"))),p("$: ($inline === undefined || $inline === false) && $help",Pd("$help"))),Hd(Nd("$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)&&!bc.test(n)&&!yc.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)||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=on(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||!C)return;const o=C[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),dn.whenAvailable(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=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=>{I=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"),_=xc[t],r(e),document.addEventListener("mousemove",l),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{a.setAttribute("data-prevent-focus-style","true"),a.focus(),_=xc[t],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),n)}function i(t,o,n){dn.whenAvailable(t,(()=>{var s;const a=null===(s=e.props.__root)||void 0===s?void 0:s.getElementById(t);a&&(o(a),n&&r(a,n))}),e.props.__root)}function p(){dn.whenAvailable(`swatches-${e.props.id}`,(()=>{var t,o,n;C=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),C.forEach((e=>{r(e,f)})),e.props.focusedSwatch=null===(n=null===(o=C[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(!I)return;const t=I.getContext("2d");if(!t)return;$(I,I.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,I.width,I.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||!C)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;C.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&&C&&(n(C.indexOf(e)),p=!0)):(delete u.dataset.active,e.ariaSelected="false")})),p||(e.props.focusedSwatch=null===(o=null===(t=C[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]=Go(s,a,l),[u,f,h]=Jo(s,a,l),v=e.props.hexInputFocused?e.props.hex:en(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,I=null,C=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=dn.undefine(e.props.inline),e.props.disabled=dn.undefine(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=dn.undefine(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),`${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(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=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,tn(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(!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||!C||!C.length)return;const l=C.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)}(C),d=C.length;let c=0,u=d,f=!1;const h=C[l].dataset.group;if(void 0!==h){const e=C.filter((e=>e.dataset.group===h));c=C.indexOf(e[0]),u=C.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 C.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=C[c-1])||void 0===o?void 0:o.dataset)||void 0===r?void 0:r.group:null===(a=null===(s=C[u+1])||void 0===s?void 0:s.dataset)||void 0===a?void 0:a.group;const t=C.filter((e=>e.dataset.group===h)),n=C.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,C.indexOf(n[n.length-1])):Math.min(i,u))}if(null!==i&&i>=0&&i<d){n(i),C.forEach((e=>{delete e.parentElement.dataset.focused}));const e=C[i],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},$e,un.options,un.defaultIcon("eyeDropper","color"),un.defaultIcon("close","close"),un.localize("close"),un.localize("next")]},_c=a("tb"),{outer:kc,inner:Sc,wrapper:Lc,label:Dc,prefix:Ac,suffix:Ic,help:Cc,messages:Mc,message:Tc,icon:Ec}=l(_c),Oc=_c("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"}}))),Fc=_c("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"}}))),Vc=_c("inputInner",(()=>({bind:"$attrs",$el:"span"}))),Bc=_c("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),Pc=_c("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}}))),Hc={schema:kc(p("$options",Lc(Dc("$label"),Bc(Pc(Fc(p("$fns.isChecked($option) === true",Vc("$slots.default || $slots.on || $option.onLabel || $option.label"),Vc("$slots.default || $slots.off || $option.offLabel || $option.label")))))),Lc(p("$label && ($slots.default || $slots.on || $onLabel)",Dc("$label")),Oc(Ec("prefix"),Ac(),p("$_isChecked === true",Vc("$slots.default || $slots.on || $onLabel || $label"),Vc("$slots.default || $slots.off || $offLabel || $label")),Ic(),Ec("suffix")))),Cc("$help"),Mc(Tc("$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=dn.undefine(e.props.enforced),e.props.multiple=dn.undefine(e.props.multiple),e.props.vertical=dn.undefine(e.props.vertical),e.props.disabled=dn.undefine(e.props.disabled),null!==(t=(n=e.props).onValue)&&void 0!==t||(n.onValue=!0),null!==(o=(r=e.props).offValue)&&void 0!==o||(r.offValue=!1),e.on("created",(()=>{var t;e.props._isChecked=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=>dn.eq(e,t)));n>-1&&(!e.props.enforced||o.length>1)?o.splice(n,1):-1===n&&o.push(t),e.input(o)}else dn.eq(e.value,t)&&!e.props.enforced?e.input(void 0):e.input(t);else e.input(dn.eq(e.value,e.props.onValue)?e.props.offValue:e.props.onValue)}(e,t,o))}))},un.options]},Nc=a("ut"),{outer:Rc,inner:Kc,wrapper:Wc,label:Yc,prefix:qc,suffix:Uc,help:zc,messages:jc,message:Zc,icon:Gc}=l(Nc),Xc=Nc("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"}}))),Jc={schema:Rc(Wc(Yc("$label"),Kc(Gc("prefix"),qc(),Xc(),Uc(),Gc("suffix"))),zc("$help"),jc(Zc("$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()}))})))}))},un.options]},Qc=a("cr"),{outer:eu,inner:tu,wrapper:ou,label:nu,prefix:ru,suffix:su,help:au,messages:lu,message:iu,icon:pu}=l(Qc),du=Qc("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",inputmode:"decimal","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"}}))),cu={schema:eu(ou(nu("$label"),tu(pu("prefix"),ru(),du(),su(),pu("suffix"))),au("$help"),lu(iu("$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 uu=Object.freeze({__proto__:null,autocomplete:Da,colorpicker:wc,currency:cu,datepicker:gi,dropdown:Pr,mask:lp,rating:oa,repeater:Es,slider:Cd,taglist:Pi,toggle:ns,togglebuttons:Hc,transferlist:Jp,unit:Jc});const fu="undefined"!=typeof window?setInterval:()=>0,hu=new WeakSet;exports.$if=p,exports.autocomplete=Da,exports.colorpicker=wc,exports.createBaseSections=l,exports.createProPlugin=function(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:Ln(13919),children:`${Ln(451228594)}${Ln(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){Mn[e]?Mn[e].add(t):Mn[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];hu.add(o),o.define({...r,schema:n(e)})}fu((()=>Cn.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=a,exports.currency=cu,exports.datepicker=gi,exports.dropdown=Pr,exports.inputs=uu,exports.mask=lp,exports.rating=oa,exports.repeater=Es,exports.slider=Cd,exports.taglist=Pi,exports.toggle=ns,exports.togglebuttons=Hc,exports.transferlist=Jp,exports.unit=Jc;
1
+ "use strict";var e=require("@formkit/utils"),t=require("@formkit/core"),o=require("@formkit/inputs");require("@formkit/vue");var n=require("@formkit/drag-and-drop"),r=require("@formkit/tempo");const s=[988,24029,396,13078,980],a=18806588,l=502357,i=16217489;let p=189024;const d=()=>[30548127325,27022924,34729821653783].map(m).join("y"),c=/^[0-9a-f]+$/,u="undefined"!=typeof window,f=S(32,(e=>e)).map((()=>{p|=0,p=p+1831565813|0;let e=p^p>>>15|p;return e=e+e^e>>>427,((e^e>>>14)>>>0)/4294967296})),h=u?setTimeout:()=>0,v=e=>{clearTimeout($[e])},$={},m=e=>e.toString(32),g=e=>`${m(f[e]).substring(2)}.${m(s[e%(s.length-1)])}`;const b={},y={},x=new Set(["",null,void 0]);function w(e,t){e in b||(b[e]={timer:0,inputs:new Set});const o=b[e];clearTimeout(o.timer),o.inputs.add(t),o.timer=h((()=>{$[e]||($[e]=h((()=>x.add(e)),2e3)),function(e){if(u){window.addEventListener(d(),(t=>{const o=new URL(t.blockedURI).hostname;f.some(((e,t)=>g(t)===o))&&(_(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const o=m(a),n="://",r=(new Date).getDate(),s=async()=>{const a=Array.from(b[e].inputs),p=a.filter((t=>!(y[e]&&y[e].has(t)))).join("");if(v(e),p){t++;try{const s=await window[m(i)](`${o}${n}${g((r+t)%f.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${p}`)}`),d=await s.json();if(d[m(l)])return _(e,d.schema);if(s.ok)return y[e]||(y[e]=new Set),void a.forEach((t=>y[e].add(t)))}catch(e){}t<2&&h(s,1e4*Math.random())}};s()}}(e)}),500)}function _(e,t){x.add(e),function(e,t){L[e]&&L[e].forEach((e=>e(t)))}(e,t)}function k(e,t,o){if(w(t,o),!t)throw new Error("FormKitNoKey");return x.has(t)?null:e}function S(e,t){return new Array(e).fill("").map(((e,o)=>/* #__PURE__ */t(o)))}const L={};const A=()=>({$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"}}),D=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),I=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),C=()=>({$el:"ul",if:"$fns.length($messages)"}),O=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),T=()=>({$el:"div",if:"$help"}),E=()=>({$el:null}),M=(e,t)=>()=>o.icon(e,t),V=()=>({$el:"span",if:'$part.type === "placeholder" && $part.value'}),F=()=>({$el:"span",if:'$part.type === "literal" && $part.value'}),B=()=>({$el:"span",if:'$part.type === "char" && $part.value'}),P=()=>({$el:"span",if:'$part.type === "enum" && $part.value'}),H=()=>({$el:"div",if:"$overlay",attrs:{id:'$id + "_overlay"',class:"$classes.overlay",style:"$_overlayStyles",onClick:"$_isPlaceholder && $handlers.overlayClick"}}),R=()=>({$el:"div",attrs:{id:'$id + "_overlay_inner"',class:"$classes.overlayInner",style:"$_overlayInnerStyles"}}),K=()=>({$el:null,for:["part","$_overlayParts"]});function N(n,r,s,a){return(...l)=>i=>p=>{const d=function(e,n,r,s,a,l){const i=l[r],p="function"==typeof s?s():{$el:s},d=a.map((e=>"string"==typeof e?e:e(n)(l)));let c=d.length&&p?o.extendSchema(p,{children:d}):p;if(c=o.extendSchema(c,i),"object"==typeof c){let o=c;if(!t.isDOM(c)&&!t.isComponent(c)||c.meta||(c.meta={section:r,node:s}),t.isDOM(c)){const{$el:t,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${r}`,...s.attrs}):s.attrs={class:`$classes.${r}`},o=W(n,r,Object.defineProperty(s,"$el",{enumerable:!1,get:k.bind(null,t,n,e)}))}else if(t.isComponent(c)){const{$cmp:t,...s}=c;o=W(n,r,Object.defineProperty(s,"$cmp",{enumerable:!1,get:k.bind(null,t,n,e)}))}else if("$formkit"in c){c.outerClass=`$classes.${r}`;const{$formkit:t,...s}=c;o=W(n,r,Object.defineProperty(s,"$formkit",{enumerable:!1,get:k.bind(null,t,n,e)}))}return o}return W(n,r,c)}(n,i,r,s,l,p);return a&&e.isRecord(d)&&(d.memo=n+JSON.stringify(p)),a?[d]:d}}function W(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 q(e){return(t,o,n=!1)=>/* #__PURE__ */N(e,t,o,n)}function z(e){return{outer:/* #__PURE__ */e("outer",A,!0),wrapper:/* #__PURE__ */e("wrapper","div",!1),inner:/* #__PURE__ */e("inner",D,!1),icon:M,label:/* #__PURE__ */e("label",I,!1),prefix:/* #__PURE__ */e("prefix",E,!1),suffix:/* #__PURE__ */e("suffix",E,!1),help:/* #__PURE__ */e("help",T,!1),messages:/* #__PURE__ */e("messages",C,!1),message:/* #__PURE__ */e("message",O,!1)}}function U(e){return{overlayPlaceholder:/* #__PURE__ */e("overlayPlaceholder",V),overlayLiteral:/* #__PURE__ */e("overlayLiteral",F),overlayChar:/* #__PURE__ */e("overlayChar",B),overlayEnum:/* #__PURE__ */e("overlayEnum",P),overlay:/* #__PURE__ */e("overlay",H),overlayParts:/* #__PURE__ */e("overlayParts",K),overlayInner:/* #__PURE__ */e("overlayInner",R)}}function Y(e,t,n){return r=>s=>{const a="string"==typeof t?t:t(r)(s);return n?{if:e,then:a,else:"string"==typeof n?n:n(r)(s)}:(o.isSlotCondition(a)?Object.assign(a.else,{if:e}):o.isSchemaObject(a)&&Object.assign(a,{if:e}),a)}}function j(n,r){return s=>{const a=a=>{const l=r(s)(a),i="function"==typeof n?n(s):n;return e.isObject(i)?(o.isSlotCondition(l)&&t.isDOM(l.else)?l.else.attrs={...l.else.attrs,...i}:t.isDOM(l)&&(l.attrs={...l.attrs,...i}),l):l};return a._s=r._s,a}}function Z(e){const t=/* #__PURE__ */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=/* #__PURE__ */e("listbox",(()=>({$el:"ul",if:"$expanded || $setForceExpanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant","aria-labelledby":'$id + "_label"'}}))),n=/* #__PURE__ */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=/* #__PURE__ */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=/* #__PURE__ */e("loadMoreInner","span"),a=/* #__PURE__ */e("emptyMessage",(()=>({$el:"li",if:"$showEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),l=/* #__PURE__ */e("emptyMessageInner","span"),i=/* #__PURE__ */e("option",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option)"}}))),p=/* #__PURE__ */e("listitems",(()=>({$el:null,if:"$options.length",for:["option","index","$option.options || $options"]}))),d=/* #__PURE__ */e("innerListitems",(()=>({$el:null,for:["option","innerIndex","$option.options"]}))),c=/* #__PURE__ */e("listitemGroup",(()=>({$el:"li",attrs:{"aria-label":"$option.group",role:"group",onClick:"$handlers.listitemGroupClick",tabindex:"-1"}}))),u=/* #__PURE__ */e("groupLabel","span"),f=/* #__PURE__ */e("groupList",(()=>({$el:"ul",attrs:{role:"group"}})));return()=>/* #__PURE__ */t(/* #__PURE__ */o(/* #__PURE__ */a(/* #__PURE__ */l("$emptyMessage")),/* #__PURE__ */p(/* #__PURE__ */Y("$option.group",/* #__PURE__ */c(/* #__PURE__ */u("$option.group"),/* #__PURE__ */f(/* #__PURE__ */d(
2
+ /* #__PURE__ */j((()=>({id:'$id + "_listitem_" + $index + "_" + $innerIndex'})),/* #__PURE__ */n(/* #__PURE__ */Y("$fns.isSelected($option)",/* #__PURE__ */M("selected")),/* #__PURE__ */i("$option.label")))))),/* #__PURE__ */n(/* #__PURE__ */Y("$fns.isSelected($option)",/* #__PURE__ */M("selected")),/* #__PURE__ */i("$option.label")))),/* #__PURE__ */r(/* #__PURE__ */Y("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */s(/* #__PURE__ */Y("$state.loading",/* #__PURE__ */M("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value")))))}const G=/* #__PURE__ */q("dd"),{outer:X,wrapper:J,inner:Q,icon:ee,label:te,prefix:oe,suffix:ne,help:re,messages:se,message:ae}=/* #__PURE__ */z(G),le=/* #__PURE__ */G("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"}}))),ie=/* #__PURE__ */G("selectionWrapper",(()=>({if:"$option || $state.loading",$el:"div"}))),pe=/* #__PURE__ */G("selection",(()=>({$el:"div"}))),de=/* #__PURE__ */G("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'}}}))),ce=/* #__PURE__ */G("optionLoading","span"),ue=/* #__PURE__ */G("option",(()=>({$el:"div"}))),fe=/* #__PURE__ */G("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"}}))),he=/* #__PURE__ */G("selectionsWrapper",(()=>({$el:"div",attrs:{id:'$id + "_selections_wrapper"'}}))),ve=/* #__PURE__ */G("selections",(()=>({$el:"div",attrs:{"aria-live":"polite","aria-hidden":'$lastVisibleIndex && "true" || undefined',"data-test":"$lastVisibleIndex",id:'$id + "_selections"'}}))),$e=/* #__PURE__ */G("truncationCount",(()=>({$el:"div",attrs:{id:'$id + "_truncation_count"'}}))),me=/* #__PURE__ */G("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 || ""'}))),ge=/* #__PURE__ */G("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)"}}))),be=/* #__PURE__ */G("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button",tabindex:"-1"}}))),ye=/* #__PURE__ */G("tagLabel",(()=>({$el:"span"}))),xe=/* #__PURE__ */G("tagsWrapper",(()=>({$el:"span",attrs:{id:'$id + "_tags_wrapper"',"aria-live":"polite"}}))),we=/* #__PURE__ */G("tags",(()=>({$el:"span",attrs:{id:'$id + "_selections"'}}))),_e=/* #__PURE__ */G("tagLoading","span"),ke=Z(G);function Se(t){return e.isRecord(t)&&"value"in t&&"label"in t}function Le(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 Ae(){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 De(e){return"__original"in e?e.__original:e.value}const Ie=new WeakMap,Ce=new WeakMap;async function Oe(e,t,o=!1,n=!1){if("function"==typeof e.props.optionsLoader){e.props.search=t,clearTimeout(Ce.get(e));const o=t?e.props.debounce:0;0===o?Te(e,n):Ce.set(e,setTimeout((()=>{e.props.page=1,Te(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 Te(e,t){e.props.allowAppendOptions=t,Pe(e)}const Ee=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Me=/* #__PURE__ */t.createMessage({key:"loading",type:"state",value:!1,visible:!1});function Ve(e,n){if(e.props.allowAppendOptions)return e.props.allowAppendOptions=!1,function(e,t){const n=o.normalizeOptions(t);e.props.appendingOptions=!0,e.props.activeValue=De(n[0]),e.props.options=e.props.options.concat(n)}(e,n);const r=o.normalizeOptions(n);e.props.options=r,e.props.options.length||(e.store.set(Me),e.store.set(/* #__PURE__ */t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}))),Ie.set(e,e.props.searchValue)}const Fe=new WeakMap;function Be(t,o,n){if(t.store.set(Ee),t.props.optionLoadingCounter++,t.props.multiple&&"truncate"!==t.props.selectionAppearance){let n;n=e.isPojo(o)?{label:"Loading...",value:String(o)}:{label:String(o),value:o},t.props.optionLoaderValues.includes(n.value)||t.props.optionLoaderValues.push(n.value),"transferlist"===t.props.type||t.props.selections.includes(n)||(t.props.selections=[...t.props.selections,n])}const r=t.props.optionLoader(o,n),s=t=>"string"==typeof t?{label:t,value:o}:Se(t)?t:e.isRecord(t)?Object.assign({label:String(o),value:o},t):{label:String(o),value:o},a=o=>{const n=t.props.memoOptions.findIndex((t=>e.eq(De(t),De(o))));return-1===n?t.props.memoOptions=[...t.props.memoOptions,o]:t.props.memoOptions[n]=o,o};return r instanceof Promise?r.then((e=>{if("string"==typeof e||Se(e))return a(s(e))})).finally((()=>{t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--})):(t.props.optionLoaderValues=t.props.optionLoaderValues.filter((e=>e!==o)),t.props.optionLoadingCounter--,a(s(r)))}function Pe(e){e.store.set(Ee),e.props.optionsLoadingCounter++,e.store.set(/* #__PURE__ */t.createMessage({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,Fe.get(e)),r=Ve.bind(null,e),s=n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):(r(n),e.props.optionsLoadingCounter--);if(s instanceof Promise)return s.finally((()=>{e.props.optionsLoadingCounter--}))}function He(e,o){e.props.page++,Fe.set(e,o),e.store.set(/* #__PURE__ */t.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}const Re=Symbol(),Ke=t=>{const o=(e=>{const t=[...e.props.allOptions,...e.props.initialOptions];return[...e.props.memoOptions||[],...t]})(t),n=t.props.inputStd||[],r=[];for(const t of n){let n,s=o.find((o=>e.eq(De(o),t)));n=e.isPojo(t)?void 0:Array.isArray(t)?t.join(", "):t,s||(s={value:t,label:n,isPlaceholder:!1,noOptionFound:!0}),r.push(s)}return r};async function Ne(e){const t=Ke(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:u&&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 We(t){var o,n;if(t.props.allOptions&&t.props.allOptions.length)if(null===(o=t.props.highlightedRange)||void 0===o?void 0:o.option.value)t.props.activeValue=De(t.props.highlightedRange.option);else{if(t.props.activeSelectionValue){const o=t.props.allOptions.find((o=>e.eq(De(o),t.props.activeSelectionValue)));if(o)return void(t.props.activeValue=o.value)}if(t.props.reloadOnCommit)t.props.activeValue=De(t.props.allOptions[0]);else{if(t.props.searchValue&&!t.props.appendingOptions)t.props.activeValue=De(t.props.allOptions[0]);else if(t.props.inputStd.length>0&&!t.props.multiple||t.props.multiple&&(null===(n=t.context)||void 0===n?void 0:n.state.dirty))t.props.selections[t.props.selections.length-1]?t.props.activeValue=De(t.props.selections[t.props.selections.length-1]):t.props.activeValue=De(t.props.allOptions[0]);else{if(t.props.appendingOptions)return void(t.props.appendingOptions=!1);t.props.activeValue=De(t.props.allOptions[0])}t.props.appendingOptions&&(t.props.appendingOptions=!1)}}}function qe(e){return e.reduce(((e,t)=>(t.options?e.push(...qe(t.options)):e.push(t),e)),[])}function ze(e,t){var o,n;(null===(o=t.attrs)||void 0===o?void 0:o.disabled)||(De(t)!==Re?(e.props.option=t,e.props.maxReached&&!je(e,t)||(e.input(Ue(e,De(t))),je(e,t)&&e.props.closeOnSelect&&(e.props.expanded=!1))):null===(n=e.context)||void 0===n||n.handlers.loadMore(!0))}function Ue(t,o){if(t.props.multiple){const n=Array.isArray(t.value)?t.value:[];for(const r of n)if(e.eq(r,o))return t.props.optionRemoved=!0,n.filter((t=>!e.eq(t,o)));return[...n,o]}return e.eq(o,t.value)&&t.props.deselect?void(t.props.optionRemoved=!0):o}function Ye(t,o){return e.eq(t.props.activeValue,De(o))||void 0}function je(t,o){if(t.props.multiple){if(!Array.isArray(t.value))return!1;for(const n of t.value)if(e.eq(n,De(o)))return!0;return!1}return e.eq(t.value,De(o))}function Ze(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 Ge(t){t.props.firstCommit=!0;let o=null;t.on("commit",(()=>{if(0===t.props.inputStd.length&&t.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}(t),void(o=t.props.inputStd);if(t.props.inputStd.length&&"function"==typeof t.props.optionsLoader&&0===t.props.options.length&&"function"!=typeof t.props.optionLoader&&0===t.props.optionsLoadingCounter){t.props.optionsLoaded=!0;const e=Pe(t);e instanceof Promise&&e.then((()=>{Ne(t)}))}"function"!=typeof t.props.optionLoader||t.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}(o,t.props.inputStd)?0===t.props.optionsLoadingCounter&&Ne(t):(o=t.props.inputStd,async function(t){const o=Ke(t),n=t.props.inputStd.length>1?t.props.inputStd.filter((o=>!t.props.memoOptions.find((t=>e.eq(De(t),o))))):t.props.inputStd;if(n.forEach((n=>{Be(t,n,Array.isArray(o)&&o.find((t=>e.eq(De(t),n)&&!t.noOptionFound)))})),t.props.optionLoadingCounter){const e=t.on("prop:optionLoadingCounter",(()=>{Ne(t),t.props.optionLoadingCounter||t.off(e)}))}else Ne(t)}(t))}))}const Xe=new WeakMap;function Je(t){t.on("created",(()=>{if(!t.context||!u)return;t.context.fns.isActive=Ye.bind(null,t),t.context.fns.isSelected=e=>je(t,e),t.context.fns.hasOptionLoaderValue=o=>{for(const n of t.props.optionLoaderValues)if(e.eq(De(o),n))return!0;return!1},t.context.handlers.listitemGroupClick=it,t.context.handlers.selectOption=e=>o=>pt.call(null,t,e,o),t.context.handlers.loadMore=Te.bind(null,t),t.context.handlers.removeSelection=e=>o=>lt(t,e,o),t.context.handlers.tagTouchstart=e=>o=>lt(t,e,o),t.context.handlers.selectionClick=e=>t.props.multiple?ot.bind(null,t,e):tt.bind(null,t),t.context.handlers.selectionBlur=()=>nt.bind(null,t),t.context.fns.isActiveSelection=(t,o)=>e.eq(t,De(o)),t.context.handlers.tagClick=e=>rt.bind(null,t,e),t.context.handlers.tagFocus=e=>st.bind(null,t,e),t.context.handlers.tagBlur=()=>at.bind(null,t);const o=t.context.handlers.blur;t.context.handlers.blur=function(e,t){var n;if(t&&t.relatedTarget instanceof HTMLElement){const o=null===(n=e.props.__root)||void 0===n?void 0:n.getElementById(e.props.id+"_inner");if(o instanceof HTMLElement&&o.contains(t.relatedTarget))return}o(),function(e){if(e.props.disabled)return;e.props.expanded=!1,e.props.activeSelectionValue=void 0,e.emit("blur")}(e)}.bind(null,t),t.context.handlers.touchmove=Qe.bind(null,t),t.context.handlers.touchend=et.bind(null,t)}))}function Qe(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=Xe.get(e);if(o){const[e,r]=o,s=t.touches[0].clientX-r;n.scrollLeft=e-s}else Xe.set(e,[n.scrollLeft,t.changedTouches[0].clientX])}}function et(e){Xe.delete(e)}function tt(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 ot(t,o,n){n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,De(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=De(o),n.currentTarget.focus()))}function nt(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 rt(t,o,n){n.stopPropagation(),t.props.disabled||(t.props.justFocused?t.props.justFocused=!1:n.currentTarget instanceof HTMLElement&&(e.eq(t.props.activeSelectionValue,De(o))?t.props.activeSelectionValue=void 0:(t.props.activeSelectionValue=De(o),n.currentTarget.focus())))}function st(e,t,o){o.stopPropagation(),e.props.disabled||o.currentTarget instanceof HTMLElement&&(e.props.activeSelectionValue=De(t),e.props.justFocused=!0)}function at(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 lt(e,t,o){o&&o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleRemoveSelection"})}function it(e){e.stopPropagation()}function pt(e,t,o){o.stopPropagation(),e.props.disabled||(e.props.userAction={type:"handleListitemClick"},ze(e,t))}function dt(o,n,r,s){!function(o){o.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===o.props.deselect?o.props.deselect=!0:o.props.deselect=e.undefine(o.props.deselect),o.props.option={},o.props.expanded=!1,o.props.inputStd=[],void 0===o.props.draggable?o.props.draggable=!0:"false"===o.props.draggable&&(o.props.draggable=!1),o.props.options||(t.warn(350,{node:o,inputType:o.props.type}),o.props.options=[]),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),o.props.allOptions=qe(o.props.options),o.props.selections=[],o.props.memoOptions=[],o.props.invertPopover=!1,o.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},o.props.decrementCount=0,o.props.page=1,o.props.loadMoreOption={label:"Load more",value:Re},o.props.loadOptions=Pe,o.props.listboxStyles={},o.props.optionsLoadingCounter=0,o.props.optionLoadingCounter=0,o.props.searchable=e.undefine(o.props.searchable),o.props.loadOnScroll=e.undefine(o.props.loadOnScroll),o.props.multiple=e.undefine(o.props.multiple)||!1,"taglist"===o.props.type&&(o.props.multiple=!0),o.props.openOnFocus=e.undefine(o.props.openOnFocus),o.props.openOnRemove=void 0!==o.props.openOnRemove&&e.undefine(o.props.openOnRemove),o.props.hasNextPage=He.bind(null,o),o.props.initialOptions=[...o.props.options],o.props.optionLoaderValues=[],o.props.loadOnCreated=e.undefine(o.props.loadOnCreated),o.props.max&&"number"!=typeof o.props.max?o.props.max=parseInt(o.props.max):o.props.max&&!o.props.multiple&&(o.props.max=void 0),o.on("mounted",(()=>Ze(o))),o.on("prop:popoverCoordinates",(()=>setTimeout((()=>{Ze(o)}),10)))}(s),s.props.multiple?function(e){e.hook.input(((t,o)=>(e.props.highlightedRange&&!e.props.optionRemoved&&(t.splice(e.props.highlightedRange.index,1,De(e.props.option)),t=t.filter((e=>void 0!==e))),e.props.inputStd=t&&Array.isArray(t)?[...new Set(t)]:[],/* #__PURE__ */o(void 0===t?void 0:[...e.props.inputStd]))))}(s):function(e){e.hook.input(((t,o)=>(e.props.inputStd=void 0===t||""===t||null===t?[]:[t],/* #__PURE__ */o(t))))}(s),o(s),Ge(s),function(t){t.on("created",(()=>{t.context&&(t.props.trackHover=!0,void 0!==t.props.disabled||t.props.optionsLoader||!t.props.options||t.props.options.length||void 0!==t.props.emptyMessage||t.props.allowNewValues||0!==t.props.inputStd.length||(t.props.disabledInternally=!0),t.props.loadOnCreated&&!t.props.optionsLoaded?Pe(t):t.props.optionsLoaded&&(t.props.optionsLoaded=!1),t.props.forceExpanded=e.undefine(t.props.forceExpanded),t.props.forceExpanded&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:"999",pointerEvents:"auto"},setTimeout((()=>{t.props.setForceExpanded=!0}),100)))}))}(s),Je(s),n(s),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(Me))})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&e.store.set(Me)})),e.on("prop:disabled",(({payload:t})=>{t&&(e.props.expanded=!1)})),e.on("prop:options",(({payload:t})=>{e.props.allOptions=qe(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),We(e)})),e.on("prop:expanded",(({payload:o})=>{var n;if(u)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}}(s),r(s)}function ct(t){void 0===t.props.closeOnSelect?t.props.closeOnSelect=!t.props.multiple:t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),(t.props.multiple&&void 0===t.props.selectionAppearance||"truncate"===t.props.selectionAppearance)&&(t.props.selectionAppearance="truncate",t.props.formattedSelections=[]),t.props.multiple?t.props.selectionRemovable=!1:t.props.selectionRemovable=e.undefine(t.props.selectionRemovable)}function ut(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 ft(t,o,n){var r,s,a;if(n.preventDefault(),t.props.trackHover=!1,t.props.expanded){const n=t.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(De(t)),e}),[]);(null===(r=t.store.hasNextPage)||void 0===r?void 0:r.value)&&n.push(Re);let l=-1;t.props.activeValue&&(l=n.findIndex((o=>e.eq(o,t.props.activeValue)))),-1===l&&n.length?t.props.activeValue=n[0]:"ArrowDown"===o&&n.length>l+1?t.props.activeValue=n[l+1]:"ArrowUp"===o&&l>0?t.props.activeValue=n[l-1]:"ArrowUp"===o&&0===l&&(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}_tag-wrapper_${t.props.selections.length-1}`))||void 0===a||a.focus(),t.props.expanded=!1)}else t.props.expanded||"ArrowDown"!==o||(t.props.expanded=!0)}function ht(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=De(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=De(e.props.selections[0]):e.props.activeSelectionValue=void 0),e.props.expanded=!1}}function vt(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 $t(t,o,n,r=!0){var s,a,l,i,p,d,c;const u=n.key;if(n.altKey){const r=Ae(),s=t.props.selections.findIndex((t=>e.eq(De(t),De(o)))),a=[...t.props.selections];"ArrowRight"===n.key?s<t.props.selections.length-1&&(a.splice(s,1),a.splice(s+1,0,o)):"ArrowLeft"===n.key&&s>0&&(a.splice(s,1),a.splice(s-1,0,o)),t.props.activeSelectionValue=De(o),t.input([...a.map(De)]),setTimeout((()=>{r instanceof HTMLElement&&r.focus()}),100)}else{const n=t.props.selections.findIndex((t=>e.eq(De(t),De(o))));if(-1===n)return;const f="ArrowRight"===u?n+1:n-1;if(f>=t.props.selections.length){if(!r)return t.props.expanded=!0,t.props.activeSelectionValue=void 0,void(null===(a=null===(s=t.props.__root)||void 0===s?void 0:s.getElementById(`${t.props.id}`))||void 0===a||a.focus());null===(i=null===(l=t.props.__root)||void 0===l?void 0:l.getElementById(`${t.props.id}`))||void 0===i||i.focus()}else if(f<0&&0===n)null===(d=null===(p=t.props.__root)||void 0===p?void 0:p.getElementById(`${t.props.id}`))||void 0===d||d.focus();else if(f<0)return;const h=null===(c=t.props.__root)||void 0===c?void 0:c.getElementById(`${t.props.id}_tag-wrapper_${f}`);h&&h.focus(),t.props.selections[f]?t.props.activeSelectionValue=De(t.props.selections[f]):t.props.activeSelectionValue=void 0}}function mt(t,o,n){var r;if(!(n.currentTarget instanceof HTMLElement))return;if(t.props.searchValue)return;const s=t.props.selections.findIndex((t=>e.eq(De(t),De(o))));if(-1===s)return;const a=t.props.selections[s+1]?s+1:s-1,l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_tag-wrapper_${a}`);l&&l.focus(),t.props.userAction={type:"tagDelete"}}function gt(t,o){var n;if(o.preventDefault(),t.props.allowNewValues&&t.props.searchValue&&t.input(Ue(t,t.props.searchValue)),t.props.expanded){if(t.props.activeValue===Re)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore(!0));const o=t.props.allOptions.find((o=>e.eq(De(o),t.props.activeValue)));if(!o)return;ze(t,o)}else t.props.expanded=!0}function bt(e){e.props.expanded&&(e.props.expanded=!1)}function yt(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":vt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o,!1);break;case"Delete":case"Backspace":mt(e,t,o)}}function xt(t,o,n){if(t.props.disabled)return;switch(n.key){case"ArrowUp":case"ArrowDown":!function(t,o,n){var r,s,a,l;n.preventDefault();const i=n.key,p=t.props.selections.findIndex((t=>e.eq(De(t),De(o))));if(-1===p)return;const d="ArrowDown"===i?p+1:p-1;if(d<0&&(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus()),d<0||d>=t.props.selections.length)return;const c=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${d}`);c&&c.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[d])||void 0===l?void 0:l.value)||void 0}(t,o,n);break;case"Enter":break;case"Tab":!function(t,o,n){var r,s,a,l;if(o){const i=t.props.selections.findIndex((t=>e.eq(De(t),De(o))));if(-1===i)return;const p=n.shiftKey?i-1:i+1;if(p>=t.props.selections.length)return;if(p<0)return void(null===(s=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}`))||void 0===s||s.focus());const d=null===(a=t.props.__root)||void 0===a?void 0:a.getElementById(`${t.props.id}_selection_wrapper_${p}`);d&&d.focus(),t.props.activeSelectionValue=(null===(l=t.props.selections[p])||void 0===l?void 0:l.value)||void 0}}(t,o,n);break;case"Delete":case"Backspace":!function(t,o){var n;if(o){const r=t.props.selections.findIndex((t=>e.eq(De(t),De(o))));if(-1===r)return;const s=t.props.selections[r+1]?r+1:r-1,a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}_selection_wrapper_${s}`);a&&a.focus(),t.props.selections[s]?t.props.activeSelectionValue=De(t.props.selections[s]):t.props.activeSelectionValue=void 0}o&&1!==t.props.selections.length||(t.props.userAction={type:"selectionDelete"})}(t,o)}}function wt(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":ft(e,o,t);break;case"ArrowLeft":case"ArrowRight":ht(e,o);break;case"Enter":gt(e,t);break;case"Escape":bt(e);break;case"Delete":case"Backspace":ut(e);break;default:e.emit("unusedKeydown",t)}}function _t(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":ft(e,o,t);break;case"ArrowRight":case"ArrowLeft":ht(e,o);break;case"Enter":gt(e,t);break;case"Escape":bt(e);break;case"Delete":case"Backspace":ut(e)}}function kt(t){t.props.alwaysLoadOnOpen=void 0!==t.props.alwaysLoadOnOpen&&e.undefine(t.props.alwaysLoadOnOpen),t.on("created",(()=>{t.context&&(t.context.handlers.click=St.bind(null,t),t.context.handlers.focus=Lt.bind(null,t),t.context.handlers.keydown=wt.bind(null,t),t.context.handlers.selectorTagKeydownHandler=e=>yt.bind(null,t,e))}))}function St(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 Lt(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 At(t){let o,n="";t.on("unusedKeydown",(({payload:r})=>{if(!r.isComposing&&1===[...r.key].length){if(!n&&" "===r.key)return void function(t,o){var n;if(o.preventDefault(),t.props.expanded){if(t.props.activeValue===Re)return void(null===(n=t.context)||void 0===n||n.handlers.loadMore());const o=t.props.allOptions.find((o=>e.eq(De(o),t.props.activeValue)));if(!o)return;ze(t,o)}else t.props.expanded=!0}(t,r);t.props.expanded=!0,clearTimeout(o),n+=r.key;const s=t.props.allOptions.find((e=>e.label.toLowerCase().startsWith(n.toLowerCase())));s&&(t.props.activeValue=De(s)),o=setTimeout((()=>{n=""}),400)}}))}function Dt(t){It(t),t.on("prop:selections",(()=>{t.props.skipFormatSelections=!1,It(t)})),u&&e.whenAvailable(`${t.props.id}_selections`,Ot.bind(null,t),t.props.__root)}function It(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 Ct(e){var t,o;if(!u||!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((()=>{It(e)}));break}}}else e.props.lastTruncatedElText=null,e.props.lastVisibleIndex=null,It(e)}function Ot(e,t){const o=new ResizeObserver((()=>{e.props.selections&&0!==e.props.selections.length&&(e.props.skipFormatSelections?e.props.skipFormatSelections=!1:Ct(e))})),n=new ResizeObserver((()=>{Ct(e)}));o.observe(t),t.parentNode instanceof Element&&n.observe(t.parentNode)}const Tt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Et={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Mt={overflow:"hidden",height:"100%"},Vt={},Ft={};let Bt=0;function Pt(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 Ht(t,o){var n,r;let s=null;if(t.props.activeDescendant){const a=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(t.props.activeDescendant);if(!a)return s;t.props.ignoreScroll=!0;const l=null===(r=t.props.__root)||void 0===r?void 0:r.getElementById(`${t.props.id}_listbox`);if(!l)return s;const i=o.getBoundingClientRect(),p=l.getBoundingClientRect(),d=parseInt(getComputedStyle(o).paddingTop),c=parseInt(getComputedStyle(o).paddingBottom),u=a.offsetTop-d,f=Math.max(u-d,0),h=Math.max(o.scrollHeight-c-u-i.height,0),v=p.height-f-h;o.scrollTop=u;const $=()=>{o.scrollTop=h>0?h<d?o.scrollHeight:d:f<c?0:u-c},m=Math.min(150,p.height);f>0&&h>0||0===f&&0===h||v>m?o.scrollTop=u:$();o.clientHeight/2<o.scrollTop&&(s=t.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((o=>e.eq(t.value,De(o))))),-1===s&&(s=null)}return s}function Rt(o){o.addProps(["behavior"]),o.on("created",(()=>{"overscroll"===o.props.behavior&&("function"==typeof o.props.optionsLoader&&t.error(300,[o]),o.props.dropdownWrapperStyles=e.clone(Tt),o.props.listboxStyles={display:"inline-block"},o.props.styleWrapper=Pt.bind(null,o),o.props.positionListBox=Ht.bind(null,o))})),o.on("prop:expanded",(({payload:e})=>{"overscroll"===o.props.behavior&&(e?function(){Bt=document.documentElement.scrollTop;for(const e in Et)Ft[e]=document.documentElement.style[e],document.documentElement.style[e]=Et[e];for(const e in Mt)Vt[e]=document.body.style[e],document.body.style[e]=Mt[e];document.body.scrollTop=Bt}():function(){for(const e in Et)document.documentElement.style[e]=Ft[e];for(const e in Mt)document.body.style[e]=Vt[e];document.body.scrollTop=0,document.documentElement.scrollTop=Bt}())}))}function Kt(t){t.addProps(["multiLine"]),t.on("created",(()=>{u&&(t.props.multiLineHeight=void 0,e.whenAvailable(`${t.props.id}_selections`,Nt.bind(null,t),t.props.__root))}))}function Nt(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),Wt(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 Wt(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 qt(t){if(t.on("created",(()=>{t.context&&At(t)})),t.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]}))}(t),"truncate"===t.props.selectionAppearance&&(t.props.lastVisibleIndex=null,Dt(t),t.on("prop:selections",(()=>{Dt(t)}))),"tags"===t.props.selectionAppearance&&Kt(t),t.props.multiple&&"tags"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e,o){t.input(e)}t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(t.context&&e instanceof HTMLElement){const s={threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}t.on("prop:expanded",(({payload:e})=>{e&&t.props.optionsLoader&&"function"==typeof t.props.optionsLoader&&(!t.props.options.length||t.props.alwaysLoadOnOpen)&&(t.props.options=[],Pe(t))})),"overscroll"===t.props.behavior&&Rt(t)}const zt=(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))}};function Ut(t){if(t.addProps(["popover","popoverOffset","usePopover","popoverCoordinates","popoverAncestorCoordinates"]),t.props.popover=e.undefine(t.props.popover)?"manual":void 0,"input"!==t.type||"overscroll"===t.props.behavior)return;let o=null,n=null,r=[],s=null;if(t.props.popoverOffset=e.undefine(t.props.popoverOffset)?parseInt(t.props.popoverOffset):0,!t.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 a=()=>{document.removeEventListener("resize",s),document.removeEventListener("scroll",s),r.forEach((e=>{e.removeEventListener("scroll",s)}))};function l(){const{x:e,y:r,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}}(o,n);t.props.popoverAncestorCoordinates={x:e,y:r,width:s,height:a},t.props.popoverCoordinates={x:e,y:r,width:s,height:0}}function i(e){e?(null==o||o.showPopover(),setTimeout((()=>{t.props.popoverCoordinates.height=(null==o?void 0:o.offsetHeight)||0}),5)):(null==o?void 0:o.matches(":popover-open"))&&(null==o||o.hidePopover(),t.props.popoverCoordinates.height=0)}t.on("mounted",(()=>{t.context&&(t.props.usePopover=!0,t.props.popoverCoordinates={x:0,y:0,width:0,height:0},t.props.popoverAncestorCoordinates={x:0,y:0,width:0,height:0})})),t.on("destroyed",(()=>{a()})),t.on("prop:expanded",(({payload:p})=>{var d;t.context&&(!1===p?a():e.whenAvailable(`${null===(d=t.context)||void 0===d?void 0:d.id}_popover`,(()=>{if(!t.context)return;o=document.querySelector(`#${t.context.id}_popover[popover]`)||document.querySelector(`#${t.context.id}_popover [popover]`),n||(n=function(e){if(!e)return null;let t=e.parentElement;for(;t&&"static"===window.getComputedStyle(t).position;)t=t.parentElement;return t}(o)),l(),i(p),s=zt((()=>{t.context&&(l(),i(p))}),10),document.addEventListener("resize",s),document.addEventListener("scroll",s),r=[];let e=null==o?void 0:o.parentElement;for(;e;)e.scrollHeight>e.clientHeight&&r.push(e),e=e.parentElement;r.forEach((e=>{e.addEventListener("scroll",s)}))})))}))}const Yt={schema:/* #__PURE__ */X(/* #__PURE__ */J(/* #__PURE__ */te("$label"),/* #__PURE__ */Q(/* #__PURE__ */ee("prefix"),/* #__PURE__ */oe(),/* #__PURE__ */le(/* #__PURE__ */Y("$inputStd.length === 0 && $state.loading !== true",/* #__PURE__ */de('$placeholder || "placeholder"'),/* #__PURE__ */Y("$multiple !== true",/* #__PURE__ */ie(/* #__PURE__ */Y("$state.loading && $selections.length === 0",/* #__PURE__ */ce("$ui.isLoading.value"),/* #__PURE__ */pe(/* #__PURE__ */ue("$option.label")))),/* #__PURE__ */Y('$multiple && $selectionAppearance === "truncate"',/* #__PURE__ */he(/* #__PURE__ */ve(/* #__PURE__ */Y("$state.loading && $selections.length === 0",/* #__PURE__ */ce("$ui.isLoading.value"),/* #__PURE__ */me()))),/* #__PURE__ */Y('$multiple && $selectionAppearance === "tags"',/* #__PURE__ */xe(/* #__PURE__ */we(/* #__PURE__ */Y("$state.loading && $isLoadingOption !== true && $selections.length === 0",/* #__PURE__ */ce("$ui.isLoading.value"),/* #__PURE__ */ge(/* #__PURE__ */be(/* #__PURE__ */Y("$state.loading && $optionLoaderValues.includes($option.value) || $option.label === undefined",/* #__PURE__ */_e("$ui.isLoading.value"),/* #__PURE__ */ye("$option.label")),/* #__PURE__ */fe(/* #__PURE__ */ee("close"))))))))))),/* #__PURE__ */Y("$truncationCount && $state.loading !== true",/* #__PURE__ */$e("$truncationCount")),/* #__PURE__ */Y("$state.loading",/* #__PURE__ */ee("loader")),/* #__PURE__ */Y("$inputStd.length !== 0 && $selectionRemovable",/* #__PURE__ */fe(/* #__PURE__ */ee("close")),/* #__PURE__ */ee("select"))),/* #__PURE__ */ke(),/* #__PURE__ */ne(),/* #__PURE__ */ee("suffix"))),/* #__PURE__ */re("$help"),/* #__PURE__ */se(/* #__PURE__ */ae("$message.value"))),type:"input",family:"dropdown",props:[],features:[
3
+ /* #__PURE__ */o.defaultIcon("select","select"),
4
+ /* #__PURE__ */o.defaultIcon("close","close"),
5
+ /* #__PURE__ */o.defaultIcon("selected","check"),
6
+ /* #__PURE__ */o.defaultIcon("loader","spinner"),
7
+ /* #__PURE__ */o.localize("isLoading"),
8
+ /* #__PURE__ */o.localize("loadMore"),
9
+ /* #__PURE__ */o.localize("remove"),o.options,
10
+ /* #__PURE__ */dt.bind(null,ct,kt,qt),Ut]},jt=/* #__PURE__ */q("tg"),{outer:Zt,wrapper:Gt,label:Xt,prefix:Jt,suffix:Qt,help:eo,messages:to,message:oo,icon:no}=/* #__PURE__ */z(jt),ro=/* #__PURE__ */jt("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"}}))),so=/* #__PURE__ */jt("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner) && $altLabelPosition !== true",$el:"label",attrs:{for:"$id"},children:"$label"}))),ao=/* #__PURE__ */jt("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"}))),lo=/* #__PURE__ */jt("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"}}))),io=/* #__PURE__ */jt("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"}}}))),po=/* #__PURE__ */jt("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),co=/* #__PURE__ */jt("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),uo=/* #__PURE__ */jt("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}})));const fo={schema:/* #__PURE__ */Zt(/* #__PURE__ */Gt(/* #__PURE__ */ao(),/* #__PURE__ */po(/* #__PURE__ */Jt(),/* #__PURE__ */ro(),/* #__PURE__ */co(/* #__PURE__ */lo(),/* #__PURE__ */uo(/* #__PURE__ */Y("$slots.default","$slots.default",/* #__PURE__ */no("thumb")))),/* #__PURE__ */Qt()),/* #__PURE__ */io(),/* #__PURE__ */so()),/* #__PURE__ */eo("$help"),/* #__PURE__ */to(/* #__PURE__ */oo("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay","altLabelPosition"],features:[function(t){function o(e,t){t.target instanceof HTMLInputElement&&(e.input(t.target.checked?e.props.onValue:e.props.offValue),e.props.checked=t.target.checked)}t.on("created",(()=>{"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.altLabelPosition=e.undefine(t.props.altLabelPosition),void 0===t.props.offValue&&(t.props.offValue=!1),void 0===t.props.onValue&&(t.props.onValue=!0),t.props.checked=e.eq(t.value,t.props.onValue),t.context&&(t.context.handlers.toggles=o.bind(null,t))})),t.on("commit",(({payload:o})=>{t.props.checked=e.eq(o,t.props.onValue)}))}]},ho=/* #__PURE__ */q("rp"),{outer:vo,inner:$o,prefix:mo,suffix:go,help:bo,messages:yo,message:xo,icon:wo}=/* #__PURE__ */z(ho),_o=/* #__PURE__ */ho("empty",(()=>({$el:"div"}))),ko=/* #__PURE__ */ho("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($index)",type:"button"}}))),So=/* #__PURE__ */ho("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Lo=/* #__PURE__ */ho("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($index)",type:"button"}}))),Ao=/* #__PURE__ */ho("items",(()=>({$el:"ul",meta:{autoAnimate:!0},attrs:{role:"list",id:'$id + "_items"'}}))),Do=/* #__PURE__ */ho("item",(()=>({$el:"li",for:["item","index","$items"],attrs:{role:"listitem",key:"$item","data-index":"$index"}}))),Io=/* #__PURE__ */ho("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($index, 1)",type:"button"}}))),Co=/* #__PURE__ */ho("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($index, -1)",type:"button"}}))),Oo=/* #__PURE__ */ho("content","div"),To=/* #__PURE__ */ho("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id"}}))),Eo=/* #__PURE__ */ho("legend",(()=>({$el:"legend",if:"$label"}))),Mo=/* #__PURE__ */ho("group",(()=>({$formkit:"group",index:"$index"}))),Vo=/* #__PURE__ */ho("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Fo=/* #__PURE__ */ho("remove",(()=>({$el:"li",if:"$removeControl"}))),Bo=/* #__PURE__ */ho("insert",(()=>({$el:"li",if:"$insertControl"}))),Po=/* #__PURE__ */ho("up",(()=>({$el:"li",if:"$upControl"}))),Ho=/* #__PURE__ */ho("down",(()=>({$el:"li",if:"$downControl"}))),Ro=/* #__PURE__ */ho("controlLabel","span"),Ko=/* #__PURE__ */ho("dragHandleWrapper",(()=>({if:"$draggable",$el:"div"}))),No=/* #__PURE__ */ho("dragHandle",(()=>({$el:"div",attrs:{id:'$id + "_drag_handle"'}})));function Wo(t){var o,n,r,s,a,l,i,p,d,c,u,f,h,v;if(null!==(o=(p=t.props).removeControl)&&void 0!==o||(p.removeControl=!0),null!==(n=(d=t.props).upControl)&&void 0!==n||(d.upControl=!0),null!==(r=(c=t.props).downControl)&&void 0!==r||(c.downControl=!0),null!==(s=(u=t.props).insertControl)&&void 0!==s||(u.insertControl=!1),null!==(a=(f=t.props).addButton)&&void 0!==a||(f.addButton=!0),null!==(l=(h=t.props).addLabel)&&void 0!==l||(h.addLabel=!1),null!==(i=(v=t.props).addAttrs)&&void 0!==i||(v.addAttrs={}),t.props.draggable=e.undefine(t.props.draggable),t.props.min=void 0!==t.props.min?Number(t.props.min):1,t.props.max=void 0!==t.props.max?Number(t.props.max):1/0,t.props.min>t.props.max)throw Error("Repeater: min must be less than max");if(Array.isArray(t.value))if(t.value.length<t.props.min){const e=S(t.props.min-t.value.length,(()=>({})));t.input(t.value.concat(e),!1)}else t.value.length>t.props.max&&t.input(t.value.slice(0,t.props.max),!1);else t.input(S(t.props.min,(()=>({}))),!1);t.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)}}(t,t.context.fns)}function qo(e,t){if(!t.context)return;const o={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:[n.animations({duration:100})],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>"LI"===e.tagName};function r(){return Array.isArray(t.value)?t.value:[]}function s(e){t.input(e)}n.dragAndDrop({parent:e,getValues:r,setValues:s,config:o}),t.on("prop:disabled",(({payload:t})=>{o.disabled=t,n.dragAndDrop({parent:e,getValues:r,setValues:s,config:o})})),t.on("prop:draggable",(({payload:t})=>{o.disabled=!t,n.dragAndDrop({parent:e,getValues:r,setValues:s,config:o})}))}const zo={schema:/* #__PURE__ */vo(/* #__PURE__ */To(/* #__PURE__ */Eo("$label"),/* #__PURE__ */bo("$help"),/* #__PURE__ */$o(/* #__PURE__ */mo(),/* #__PURE__ */Y("$value.length === 0",/* #__PURE__ */Y("$slots.empty",/* #__PURE__ */_o()),/* #__PURE__ */Y("$slots.default",/* #__PURE__ */Ao(/* #__PURE__ */Do(/* #__PURE__ */Ko(/* #__PURE__ */No(/* #__PURE__ */wo("dragHandle"))),/* #__PURE__ */Oo(/* #__PURE__ */Mo("$slots.default")),/* #__PURE__ */Vo(/* #__PURE__ */Po(/* #__PURE__ */Co(/* #__PURE__ */Ro("$ui.moveUp.value"),/* #__PURE__ */wo("moveUp"))),/* #__PURE__ */Fo(/* #__PURE__ */Lo(/* #__PURE__ */Ro("$ui.remove.value"),/* #__PURE__ */wo("remove"))),/* #__PURE__ */Bo(/* #__PURE__ */ko(/* #__PURE__ */Ro("$ui.add.value"),/* #__PURE__ */wo("add"))),/* #__PURE__ */Ho(/* #__PURE__ */Io(/* #__PURE__ */Ro("$ui.moveDown.value"),/* #__PURE__ */wo("moveDown")))))),/* #__PURE__ */go()))),/* #__PURE__ */So('$addLabel || ($ui.add.value + " " + ($label || ""))')),/* #__PURE__ */yo(/* #__PURE__ */xo("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs","draggable"],features:[function(t){t._c.sync=!0,t.on("created",Wo.bind(null,t)),t.on("mounted",(()=>{e.whenAvailable(`${t.props.id}_items`,(e=>{if(e instanceof HTMLElement){qo(e,t);function o(e){for(const o of e)for(const e of Array.from(o.addedNodes))if(e instanceof HTMLElement&&e.id===`${t.props.id}_items`)return void qo(e,t)}new MutationObserver(o).observe(e.parentNode,{childList:!0})}}),t.props.__root)}))},o.disablesChildren,
11
+ /* #__PURE__ */o.localize("remove"),
12
+ /* #__PURE__ */o.localize("add"),
13
+ /* #__PURE__ */o.localize("moveUp"),
14
+ /* #__PURE__ */o.localize("moveDown"),
15
+ /* #__PURE__ */o.defaultIcon("dragHandle","dragHandle"),
16
+ /* #__PURE__ */o.defaultIcon("remove","trash"),
17
+ /* #__PURE__ */o.defaultIcon("add","add"),
18
+ /* #__PURE__ */o.defaultIcon("moveUp","arrowUp"),
19
+ /* #__PURE__ */o.defaultIcon("moveDown","arrowDown")]},Uo=new WeakMap;function Yo(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 jo(e,t){var o;null===(o=e.context)||void 0===o||o.handlers.blur(t)}function Zo(e,t){const{x:o,y:n}=rn(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 Go(e,t,o){e.props.disabled||(o.preventDefault(),e.props.hoverHighlight=!0,e.props.touchStarted=!0,1!==e.props.step?sn(e,t,o):e.input(t+1,!1))}function Xo(e,t){if(!e.props.dragStarted)return;t.preventDefault(),e.props.hoverHighlight=!1,e.props.dragStarted=!1,Yo(e);const o=Uo.get(e);o&&(o.abort(),Uo.delete(e))}function Jo(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=>Xo(e,t)),{signal:n.signal}),Uo.set(e,n),1===e.props.step?e.input(t+1,!1):sn(e,t,o)}function Qo(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?an(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?an(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 en(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 tn(e,t,o){e.props.hoverHighlight&&(e.props.disabled||(1===e.props.step?(Yo(e,t+1),e.props.dragStarted&&e.input(t+1,!1)):sn(e,t,o,!!e.props.dragStarted)))}function on(e){Yo(e)}function nn(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 sn(e,t,o)}function rn(e){return e instanceof MouseEvent?{x:e.clientX,y:e.clientY}:{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}}function sn(e,t,o,n=!0){if(!(o.currentTarget instanceof HTMLElement))return;const{x:r,y:s}=rn(o),a=o.currentTarget.getBoundingClientRect();let l=an((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):Yo(e,l):e.input(0)}function an(e,t){t||(t=1);const o=1/t;return Math.ceil(e*o)/o}const ln=/* #__PURE__ */q("rt"),{outer:pn,wrapper:dn,inner:cn,label:un,prefix:fn,suffix:hn,help:vn,messages:$n,message:mn,icon:gn}=/* #__PURE__ */z(ln),bn=/* #__PURE__ */ln("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"}}))),yn=/* #__PURE__ */ln("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"}}))),xn=/* #__PURE__ */ln("template",(()=>({for:["increment","stepIndex","$stepsPerValue"],$el:null}))),wn=/* #__PURE__ */ln("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%"'}}}))),_n=/* #__PURE__ */ln("itemLabelInner",(()=>({$el:"span",children:"$fns.getValue($item, $increment)"}))),kn=/* #__PURE__ */ln("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))"}}))),Sn=/* #__PURE__ */ln("onItemRow",(()=>({$el:"span",attrs:{style:{width:"$fns.getPercentage($itemsToPercentages, $item)",display:"flex",position:"relative",overflow:"hidden",top:"0",left:"0",bottom:"0"}}}))),Ln=/* #__PURE__ */ln("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"}}}))),An=/* #__PURE__ */ln("onItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$onColor"}}}))),Dn=/* #__PURE__ */ln("offItemWrapper",(()=>({$el:"div",attrs:{style:{color:"$offColor"}}}))),In={schema:/* #__PURE__ */pn(/* #__PURE__ */dn(/* #__PURE__ */un("$label"),/* #__PURE__ */cn(/* #__PURE__ */gn("prefix"),/* #__PURE__ */fn(),/* #__PURE__ */bn(/* #__PURE__ */yn(/* #__PURE__ */xn(/* #__PURE__ */wn(/* #__PURE__ */Sn(/* #__PURE__ */An(
20
+ /* #__PURE__ */Y("$slots.onItem",(()=>()=>"$slots.onItem"),
21
+ /* #__PURE__ */Y("$slots.default",(()=>()=>"$slots.default"),/* #__PURE__ */gn("rating"))))),/* #__PURE__ */Ln(/* #__PURE__ */Dn(
22
+ /* #__PURE__ */Y("$slots.offItem",(()=>()=>"$slots.offItem"),
23
+ /* #__PURE__ */Y("$slots.default",(()=>()=>"$slots.default"),/* #__PURE__ */gn("rating"))))),/* #__PURE__ */_n()),/* #__PURE__ */kn()))),/* #__PURE__ */hn(),/* #__PURE__ */gn("suffix"))),/* #__PURE__ */vn("$help"),/* #__PURE__ */$n(/* #__PURE__ */mn("$message.value"))),type:"input",props:[],features:[function(t){function o(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`}}))}t.addProps(["max","step","stepsPerValue","itemsToPercentages","rightToLeft","onItemStyles","offItemStyles","hoverHighlight","deselect","disabled","wrapperWidth","onColor","offColor"]),!1!==t.props.hoverHighlight&&"false"!==t.props.hoverHighlight&&(t.props.hoverHighlight=!0),t.props.deselect=e.undefine(t.props.deselect),t.props.max=Number(t.props.max)||5,t.props.min=Number(t.props.min)||0,t.props.step=Number(t.props.step)||1,t.props.numberOfSteps=t.props.max/t.props.step,t.props.lastIndex=1/t.props.step-1,t.props.itemsToPercentages={},"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.rightToLeft?(t.props.onItemStyles=void 0,t.props.offItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%",zIndex:100}):t.props.onItemStyles={position:"absolute",top:"0",left:"0",overflow:"hidden",height:"100%"},t.props.stepsPerValue=1/t.props.step,t.hook.input(((e,o)=>{if(null===e||""===e||isNaN(e))
24
+ return o(e);const n=Number(e),r=Number(t.props.min),s=Number(t.props.max);return n>s?/* #__PURE__ */o(s):t.props.min&&n<=r?/* #__PURE__ */o(r):/* #__PURE__ */o(n)})),t.on("commit",(({payload:e})=>{const o=Number(e||0);Yo(t,o)})),t.on("created",(()=>{t.context&&(e.whenAvailable(`${t.props.id}_items_wrapper`,(()=>{o(t),function(e){var t;const n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`${e.props.id}_items_wrapper`);if(!n)return;new ResizeObserver((()=>{o(e)})).observe(n)}(t),setTimeout((()=>o(t)),100)}),t.props.__root),t.context.fns.getPercentage=(e,t,o=!0)=>(o?e.onItems:e.offItems)[t],t.context.fns.getValue=(e,o)=>e+Number((o*t.props.step+t.props.step).toFixed(1)),t.context.fns.showLabel=(e,o)=>{const n=Number(t.value||0);return 0===n&&0===o||n&&e===n||e>n&&0===o||n>e&&o===t.props.lastIndex},t.context.handlers.handleFocus=e=>en.call(null,t,e),t.context.handlers.handleWrapperKeydown=e=>Qo.call(null,t,e),t.context.handlers.handleWrapperBlur=e=>jo.call(null,t,e),t.context.handlers.handleItemClick=e=>o=>nn.call(null,t,e,o),t.context.handlers.handleMousemove=e=>o=>tn.call(null,t,e,o),t.context.handlers.handleMouseleave=()=>on.call(null,t),t.context.handlers.handleDragstart=e=>o=>Jo.call(null,t,e,o),t.context.handlers.handleMouseup=e=>Xo.call(null,t,e),t.context.handlers.handleTouchstart=e=>o=>Go.call(null,t,e,o),t.context.handlers.handleTouchmove=e=>Zo.call(null,t,e),t.context.handlers.handleKeydown=e=>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)}(t,e,o))}))},/* #__PURE__ */o.defaultIcon("rating","star")]},Cn=/* #__PURE__ */q("ac"),{outer:On,wrapper:Tn,inner:En,icon:Mn,label:Vn,prefix:Fn,suffix:Bn,help:Pn,messages:Hn,message:Rn}=/* #__PURE__ */z(Cn),Kn=/* #__PURE__ */Cn("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"}}))),Nn=/* #__PURE__ */Cn("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"}}))),Wn=/* #__PURE__ */Cn("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)"}}))),qn=/* #__PURE__ */Cn("selection",(()=>({$el:"div",attrs:{id:'$id + "_selection_" + $index'}}))),zn=/* #__PURE__ */Cn("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"'}}))),Un=/* #__PURE__ */Cn("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"}}))),Yn=/* #__PURE__ */Cn("optionLoading","span"),jn=/* #__PURE__ */Cn("option",(()=>({$el:"div",if:"$value !== undefined"}))),Zn=Z(Cn);function Gn(t){"option"!==t.props.selectionAppearance||t.props.multiple||!1===t.props.selectionRemovable||"false"===t.props.selectionRemovable||(t.props.selectionRemovable=!0),t.props.multiple||(t.props.clearSearchOnOpen=e.undefine(t.props.clearSearchOnOpen)),t.props.selectionRemovable=e.undefine(t.props.selectionRemovable),t.props.openOnClick=e.undefine(t.props.openOnClick),"option"!==t.props.selectionAppearance||t.props.multiple||(t.props.isSingleOption=!0),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),void 0===t.props.selectionAppearance&&(t.props.selectionAppearance="text-input"),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function Xn(t){t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter","hasHighlightedRange","clearOnClick","debounce"]),void 0===t.props.debounce?t.props.debounce=200:t.props.debounce=parseInt(t.props.debounce),t.props.nonceKey="searchValue",t.props.searchValue="",t.props.inputText="",t.props.filterOptions=Oe.bind(null,t),t.props.reloadOnCommit=e.undefine(t.props.reloadOnCommit),void 0===t.props.alwaysLoadOnOpen?t.props.alwaysLoadOnOpen=!0:t.props.alwaysLoadOnOpen=e.undefine(t.props.alwaysLoadOnOpen),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.on("created",(()=>{t.context&&u&&(t.context.handlers.focus=er.bind(null,t),t.context.handlers.input=Jn.bind(null,t),t.context.handlers.focus=er.bind(null,t),t.context.handlers.click=Qn.bind(null,t),t.context.handlers.toggleListbox=tr.bind(null,t),t.context.handlers.toggleListboxKeydown=or.bind(null,t),t.context.handlers.keydown=_t.bind(null,t),t.context.handlers.selectionKeydown=e=>o=>xt(t,e,o),t.context.handlers.searchInputTagKeydown=e=>o=>function(e,t,o){if(o.stopPropagation(),e.props.disabled)return;switch(o.key){case"ArrowDown":vt(e);break;case"ArrowRight":case"ArrowLeft":$t(e,t,o);break;case"Delete":case"Backspace":mt(e,t,o)}}(t,e,o),t.on("prop:options",(({payload:e})=>{if((0===t.props.initialOptions.length&&"function"!=typeof t.props.optionsLoader||!t.props.searchValue&&e.length)&&(t.props.initialOptions=[...e]),t.props.selections&&t.props.selections.length&&e.length)for(let o=0;o<t.props.selections.length;o++){const n=t.props.selections[o],r=e.find((e=>De(e)===n.value));r&&(t.props.selections[o]=r)}})))})),t.on("prop:expanded",(({payload:e})=>{e||Ie.delete(t)}))}function Jn(e,t){if(e.props.disabled)return;const o=t.target;e.props.inputText=o.value,e.emit("handleSearchInput",o.value),e.props.searchValue&&Oe(e,e.props.searchValue,!0)}function Qn(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 er(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 tr(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 or(e,t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),tr(e))}const nr=new WeakMap,rr="undefined"!=typeof window,sr=new WeakMap;let ar=!1;function lr(t){t.props.searchValue=null,t.on("commit",(()=>{t.props.searchValue=null,t.props.highlightedRange||ir(t)})),t.on("created",(()=>{if(!t.context||!rr)return;t.on("handleSearchInput",(({payload:e})=>{""===e?(t.props.searchValue=null,t.input([])):e&&0===t.props.inputStd.length?t.props.searchValue=e:e&&t.props.inputStd.length>0&&(t.props.searchValue=function(e){var t;const o=dr(e);if(e.props.highlightedRange){const[t,n]=pr(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)}(t)),!t.props.expanded&&e?t.props.expanded=!0:!e&&t.props.expanded&&(t.props.expanded=!1)})),function(t){e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLInputElement&&sr.set(e,t)}),t.props.__root),rr&&!ar&&(ar=!0,document.addEventListener("selectionchange",(()=>{const e=Ae();if(e instanceof HTMLInputElement&&sr.has(e)){const t=sr.get(e);t&&function(e){clearTimeout(nr.get(e)),nr.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=dr(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]=pr(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,ir(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)}})))}(t);const n=t.context.handlers.keydown;t.context.handlers.keydown=e=>{n(e),function(e,t){var n,r,s,a;if(["ArrowRight","ArrowLeft"].includes(t.key)&&t.target instanceof HTMLInputElement&&null!==t.target.selectionEnd&&null!==t.target.selectionStart){if(0===t.target.selectionStart&&t.target.selectionEnd===(null===(n=e.props.inputText)||void 0===n?void 0:n.length))"ArrowLeft"===t.key?o(0):o(-1);else if(!e.props.searchValue){e.props.searchValue=null;const o=dr(e),n=null===(r=o[o.length-1])||void 0===r?void 0:r.end;t.target.selectionStart<n&&(t.target.selectionStart=Math.max(0,"ArrowLeft"===t.key?t.target.selectionStart-2:t.target.selectionEnd+2))}}else if(["Delete","Backspace"].includes(t.key))e.props.highlightedRange&&!e.props.searchValue?(e.props.highlightedRange.option,0===e.props.inputStd.length&&(e.props.highlightedRange=void 0)):t.target instanceof HTMLInputElement&&(e.props.searchValue=null,o(-1,!0)&&t.preventDefault());else if(t.target instanceof HTMLInputElement&&0===t.target.selectionStart&&t.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)t.preventDefault();else if("Tab"===t.key)return;"ArrowLeft"===t.key&&o(-1,!0)&&t.preventDefault()}(t,e)};const r=t.context.handlers.focus;t.context.handlers.focus=e=>{r(t,e);const o=new Event("selectionchange");document.dispatchEvent(o)},t.on("blur",(()=>{t.props.selections.length?(t.props.inputText=t.props.selections.map((e=>e.label)).join(", "),t.props.searchValue=null):t.props.selections.length||(t.props.inputText="",t.props.searchValue="")}))})),t.on("prop:expanded",(({payload:e})=>{e||t.props.inputStd.length?e&&(t.props.options.length&&!t.props.alwaysLoadOnOpen||(t.props.options=[],Oe(t,t.props.searchValue))):(t.props.searchValue="",t.props.inputText="")})),t.on("prop:selections",(()=>{var e;const o=[...t.props.selections].map((e=>e.label)).join(", ");let n="";if(rr&&t.isCreated){const o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`${t.props.id}`);if(null==o||o.focus(),Ae()===o&&Array.isArray(t._value)&&t._value.length){if(t.props.max&&t._value.length>=Number(t.props.max))return;n=", "}}t.props.inputText=`${o}${n}`,t.props.reloadOnCommit&&(t.props.searchValue="",Oe(t,t.props.searchValue))}));const o=(e,o=!1)=>{var n,r;const s=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(`${t.props.id}`);if(!(s instanceof HTMLInputElement))return!1;const a=dr(t),l=e>=0?e: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 n;t.on("selectRange",(({payload:e})=>o(...e))),t.on("prop:highlightedRange",(({payload:e})=>{t.props.hasHighlightedRange=!!e,e&&t.props.expanded&&n!==e.option&&(n=e.option,We(t))}))}function ir(e){var t;if(!rr)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 pr(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 dr(e){const t=Ke(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 cr(e){!function(e){e.on("prop:expanded",(({payload:t})=>{t?(e.props.searchValue="",e.props.options.length&&!e.props.alwaysLoadOnOpen||(e.props.options=[],Oe(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&&Oe(e,e.props.searchValue,!0))}))}(e)}function ur(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=[],Oe(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&&Oe(e,e.props.searchValue,!0)}))}(e)}function fr(t){if(t.props.multiple)if(t.props.multiple&&"option"===t.props.selectionAppearance){function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}cr(t),t.on("created",(()=>{t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement&&t.context){const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,root:t.props.__root,disabled:!t.props.draggable,plugins:[n.animations()],touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-selection")};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}else t.props.multiple&&"text-input"===t.props.selectionAppearance&&lr(t);else ur(t)}const hr={schema:/* #__PURE__ */On(/* #__PURE__ */Tn(/* #__PURE__ */Vn("$label"),/* #__PURE__ */En(/* #__PURE__ */Mn("prefix"),/* #__PURE__ */Fn(),/* #__PURE__ */Kn(),/* #__PURE__ */Y("$multiple !== true && $selectionAppearance === option && $expanded === false",/* #__PURE__ */zn(/* #__PURE__ */Wn(/* #__PURE__ */qn(/* #__PURE__ */jn(/* #__PURE__ */Y("$state.loading",/* #__PURE__ */Yn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Y("$state.loading && $isSingleOption !== true && $optionLoaderValues.includes($option.value)",/* #__PURE__ */Mn("loader")),/* #__PURE__ */Y("$selectionRemovable && $isSingleOption",/* #__PURE__ */Un(/* #__PURE__ */Mn("close")))))),/* #__PURE__ */Y("$state.loading && ($isSingleOption !== true || $selections.length === 0)",/* #__PURE__ */Mn("loader")),/* #__PURE__ */Y('$selectionRemovable && $selectionAppearance === "text-input" && $selections.length > 0',/* #__PURE__ */Un(/* #__PURE__ */Mn("close")),/* #__PURE__ */Y('$selectionAppearance === "text-input" || ($selectionAppearance === "option" && $multiple)',/* #__PURE__ */Nn(/* #__PURE__ */Mn("select")))),/* #__PURE__ */Y("$isSingleOption && ($inputStd.length === 0 || $selectionRemovable === undefined || ($expanded) || $state.loading || $optionLoaderValues.length > 0)",/* #__PURE__ */Nn(/* #__PURE__ */Mn("select"))),/* #__PURE__ */Zn(),/* #__PURE__ */Bn(),/* #__PURE__ */Mn("suffix")),/* #__PURE__ */Y("$multiple && $selectionAppearance === option",/* #__PURE__ */zn(/* #__PURE__ */Wn(/* #__PURE__ */qn(/* #__PURE__ */jn(/* #__PURE__ */Y("$state.loading && $isLoadingOption",/* #__PURE__ */Yn("$ui.isLoading.value"),"$option.label"))),/* #__PURE__ */Un(/* #__PURE__ */Mn("close")))))),/* #__PURE__ */Pn("$help"),/* #__PURE__ */Hn(/* #__PURE__ */Rn("$message.value"))),type:"input",family:"dropdown",props:[],features:[
25
+ /* #__PURE__ */o.defaultIcon("select","select"),
26
+ /* #__PURE__ */o.defaultIcon("close","close"),
27
+ /* #__PURE__ */o.defaultIcon("selected","check"),
28
+ /* #__PURE__ */o.defaultIcon("loader","spinner"),
29
+ /* #__PURE__ */o.localize("isLoading"),
30
+ /* #__PURE__ */o.localize("loadMore"),
31
+ /* #__PURE__ */o.localize("remove"),
32
+ /* #__PURE__ */o.localize("open"),
33
+ /* #__PURE__ */o.localize("close"),o.options,
34
+ /* #__PURE__ */dt.bind(null,Gn,Xn,fr),Ut]},vr=/* #__PURE__ */q("dp"),{outer:$r,wrapper:mr,inner:gr,icon:br,label:yr,prefix:xr,suffix:wr,help:_r,messages:kr,message:Sr}=/* #__PURE__ */z(vr),Lr=/* #__PURE__ */vr("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"}}))),Ar=/* #__PURE__ */vr("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"'}}}}))),Dr=/* #__PURE__ */vr("next",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _next_button",type:"button",onClick:"$handlers.next"}}))),Ir=/* #__PURE__ */vr("nextLabel","span"),Cr=/* #__PURE__ */vr("prev",(()=>({$el:"button",if:"$showPagination",attrs:{id:"$id + _prev_button",type:"button",onClick:"$handlers.prev"}}))),Or=/* #__PURE__ */vr("prevLabel","span"),Tr=/* #__PURE__ */vr("calendar",(()=>({if:'$panel === "day"',$el:"table",for:["month","$calendar"],attrs:{key:'$fns.format($month.monthDay, "YYYY-MM")'}}))),Er=/* #__PURE__ */vr("calendarWeeks",(()=>({$el:"tbody"}))),Mr=/* #__PURE__ */vr("calendarHeader",(()=>({$el:"thead"}))),Vr=/* #__PURE__ */vr("weekDays",(()=>({$el:"tr"}))),Fr=/* #__PURE__ */vr("weekDay",(()=>({$el:"th",for:["day","$month.weeks.0"],attrs:{"aria-label":'$fns.format($day, "dddd")'}}))),Br=/* #__PURE__ */vr("week",(()=>({$el:"tr",for:["week","$month.weeks"]}))),Pr=/* #__PURE__ */vr("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")'}}))),Hr=/* #__PURE__ */vr("day","div"),Rr=/* #__PURE__ */vr("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'}}))),Kr=/* #__PURE__ */vr("years",(()=>({if:'$panel === "year"',$el:"ul"}))),Nr=/* #__PURE__ */vr("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)"}}))),Wr=/* #__PURE__ */vr("months",(()=>({if:'$panel === "month"',$el:"ul"}))),qr=/* #__PURE__ */vr("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)"}}))),zr=/* #__PURE__ */vr("panelHeader",(()=>({$el:"header",attrs:{"aria-live":"polite"}}))),Ur=/* #__PURE__ */vr("yearsHeader",(()=>({$el:"div",if:'$panel === "year"'}))),Yr=/* #__PURE__ */vr("monthsHeader",(()=>({$el:"div",if:'$panel === "month"'}))),jr=/* #__PURE__ */vr("daysHeader",(()=>({$el:"div",if:'$panel === "day"'}))),Zr=/* #__PURE__ */vr("timeHeader",(()=>({$el:"div",if:'$panel === "time"'}))),Gr=/* #__PURE__ */vr("yearButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _year_button",onClick:"$handlers.jumpTo(year)"},children:"$fns.format($renderedDate, $yearFormat)"}))),Xr=/* #__PURE__ */vr("monthButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _month_button",onClick:"$handlers.jumpTo(month)"},children:"$fns.format($renderedDate, $monthButtonFormat)"}))),Jr=/* #__PURE__ */vr("dayButton",(()=>({$el:"button",attrs:{type:"button",id:"$id + _day_button",onClick:"$handlers.jumpTo(day)",tabindex:"2"},children:"$fns.format($renderedDate, $dayButtonFormat)"}))),Qr=/* #__PURE__ */vr("removeSelection",(()=>({$el:"button",if:"$clearable && $_value",attrs:{id:'$id + "_remove_selection"',type:"button",onClick:"$handlers.clear","aria-controls":"$id"}}))),es=/* #__PURE__ */vr("time",(()=>({$el:"div",if:'$panel === "time"'}))),ts=/* #__PURE__ */vr("timeInput",(()=>({$el:"input",attrs:{type:"time",value:"$localTime",onInput:"$handlers.localTime",onKeydown:"$handlers.keyDown",spellcheck:"false",onBlur:"$handlers._blurOut(time)"}}))),os=/* #__PURE__ */vr("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:ns,overlayLiteral:rs,overlayChar:ss,overlayEnum:as,overlay:ls,overlayParts:is,overlayInner:ps}=/* #__PURE__ */U(vr),ds=/* #__PURE__ */vr("panel","div"),cs=/* #__PURE__ */new WeakMap,us=/* #__PURE__ */new WeakMap,fs=new WeakSet,hs=/* #__PURE__ */new WeakMap,vs=/* #__PURE__ */new WeakMap,$s=new WeakSet,ms=/* #__PURE__ */new WeakMap,gs=/[\uD800-\uDBFF]/,bs=/* #__PURE__ */new WeakMap,ys=/* #__PURE__ */new WeakMap,xs=/* #__PURE__ */new WeakMap,ws=/* #__PURE__ */new WeakMap,_s=/* #__PURE__ */new WeakMap,ks=new WeakSet,Ss=/* #__PURE__ */new WeakMap,Ls=/* #__PURE__ */new WeakMap,As=/* #__PURE__ */new WeakMap,Ds=/* #__PURE__ */new WeakMap;let Is=!1;const Cs=()=>{Is=!0,setTimeout((()=>{Is=!1}),500)},Os={"#":{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"}},Ts=/* #__PURE__ */new WeakMap,Es="undefined"!=typeof window;let Ms=!1,Vs=!1;function Fs(){Es&&!Vs&&(Vs=!0,document.addEventListener("selectionchange",(()=>{const e=Ae();if(!(e instanceof HTMLInputElement))return;if(Ds.has(e))return function(e){const t=Ds.get(e);if(t){const[o,n]=t,[r,s]=ba(e),a=s.indexOf(o);if(-1===a)return void Ds.delete(e);const l=r[a],i=[l[0]+n[0],l[1],"none"];js(/* #__PURE__ */Zs(e),i)||ta(e,i)}}(e);if("select"!==ms.get(e))return;const t=/* #__PURE__ */Zs(e);if(!js(t,Ts.get(e))){if(Ts.set(e,t),fs.has(e))return fs.delete(e);e.dispatchEvent(new CustomEvent("selection",{detail:/* #__PURE__ */Zs(e)}))}})))}function Bs(e,t){var o;if(Fs(),cs.has(e))return;cs.set(e,[]),t.reverse&&ks.add(e),t.prefix&&Ss.set(e,t.prefix),t.suffix&&Ls.set(e,t.suffix),Ns(e,t.pattern,t.partOverrides,t.explicitParts);const n=vs.get(e),r=null==n?void 0:n.some((e=>zs(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)&&$s.add(e),ms.set(e,a),t.onChange&&ws.set(e,t.onChange),e.addEventListener("beforeinput",(o=>{if(Ms)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=cs.get(e);if(null==r?void 0:r.length){const o=(null!==(n=us.get(e))&&void 0!==n?n:r.length-1)+(t.endsWith("Undo")?-1:1),s=r[o];if(!s)return;e.setSelectionRange(...s.selectionAfter),us.set(e,o),ws.has(e)&&ws.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=/* #__PURE__ */Zs(e),a=e.value;n&&Gs(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(),ka(e);case"ArrowLeft":return t.preventDefault(),ka(e,-1);case"ArrowUp":return void(Sa(e,1)&&t.preventDefault());case"ArrowDown":return void(Sa(e,-1)&&t.preventDefault());case"Tab":return Is?void t.preventDefault():void(ka(e,t.shiftKey?-1:1)&&t.preventDefault())}})),e.addEventListener("focus",(()=>function(e){var t;const o=$s.has(e),n=ms.get(e);if(o){let o=null,r=null,s=!1;const a="shift"===n?0:1,l=e.value;ca(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),(qs(t)||zs(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"===ms.get(e)){const[o]=ba(e),n=Aa(e,t);void 0!==n&&n in o&&(t=o[n])}return function(e,t,o=50){bs.set(e,Js(e,t));const n=async()=>{if(!Es||Ae()!==e)return;"select"===ms.get(e)&&(await new Promise((e=>setTimeout(e,10))),function(e){let t=/* #__PURE__ */Zs(e);if(t[0]===t[1]&&0===t[0]||e.value.length===t[1]&&0===t[0])return;t=Qs(e,t);const[o]=ba(e),n=Aa(e,t),r=t[0];void 0!==n&&o.some((e=>r>=e[0]&&r<e[1]))&&bs.set(e,Js(e,o[n]))}(e));const t=bs.get(e);t&&e.setSelectionRange(...t)};n(),document.addEventListener("selectionchange",n),setTimeout((()=>{document.removeEventListener("selectionchange",n),bs.delete(e)}),o)}(e,t)}}}(e))),e.addEventListener("selection",(t=>function(e,t){if(bs.get(e))return;Ta(e),t=Qs(e,t);const[o]=ba(e),n=Aa(e,t),r=void 0!==n&&Js(e,o[n]);r&&!js(t,r)&&ta(e,r,!0)}(e,t.detail))),Gs(e,{type:"insert",selectionBefore:[0,0,"forward"],data:e.value,valueBefore:"",suffix:t.suffix,prefix:t.prefix})}function Ps(e){var t,o;if(Ds.has(e))return;const n=null!==(t=cs.get(e))&&void 0!==t?t:[],r=n[null!==(o=us.get(e))&&void 0!==o?o:n.length-1];if(r){const t=r.selectionAfter,[o,n]=ba(e,r.valueAfter),s=Aa(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"];Ds.set(e,[r,l])}}}function Hs(e){Ds.delete(e)}function Rs(e,t){const o="string"==typeof e||!cs.has(e),n="string"==typeof e?Ks(e):e;if(o)t.prefix&&Ss.set(n,t.prefix),t.suffix&&Ls.set(n,t.suffix),n.value=Xs(n,n.value),Bs(n,t);else{const e=Da(n),o=n.value;n.value="",Gs(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 Ks(e){return{value:e,selectionStart:0,selectionEnd:0,scrollWidth:0,clientWidth:0,addEventListener:()=>{},dispatchEvent:()=>{},setSelectionRange:()=>{}}}function Ns(e,t,o,n,r){r=e&&ks.has(e)||r;const s=(null!=n?n:function(e){const t=Object.values(Os);if(!e)return t;const o={...e},n=[];for(const r of t)if(!Ys(r))if("token"in r&&r.token in e){const t={...r,...e[r.token]};Ws(t)&&n.push(t),delete o[r.token]}else n.push(r);const r=Object.values(o);for(const e of r)Ws(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=oa(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=Ns(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&&vs.set(e,c),c}function Ws(e){return!!e&&(Ys(e)||qs(e)||zs(e))}function qs(e){return!!e&&("char"===e.type&&e.pattern instanceof RegExp&&Us(e))}function zs(e){return!!e&&("enum"===e.type&&Array.isArray(e.values)&&Us(e))}function Us(e){return!!e&&("placeholder"in e&&"token"in e)}function Ys(e){return!!e&&("literal"===e.type&&"string"==typeof e.value)}function js(e,t){return e===t||void 0!==e&&void 0!==t&&(e[0]===t[0]&&e[1]===t[1])}function Zs(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 Gs(e,t){var o;ks.has(e)&&Oa(t);let n=!1;switch(_s.set(e,"playing"),t.type){case"insert":n=function(e,t){let o=ea(t);const n=t.selectionBefore,r=function(e,t){var o,n,r;if("select"===ms.get(e)){const[s,a]=ba(e),l=s.findIndex((e=>js(e,t.selectionBefore))),i=null!==(o=a[l])&&void 0!==o?o:null;if(qs(i)){const e=t.selectionBefore,o=e[1]-e[0],s=t.valueBefore.substring(e[0],e[1]),a="left"===i.selectDirection,l=pa(s,i),p=a?0:function(e,t,o){if(!e)return 0;let n="";for(;e.length;){const o=oa(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(zs(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=ca(e,t,o);return hs.set(e,s.endPos),{...t,valueAfter:s.value,selectionAfter:da(e,s),unmasked:s.unmasked,complete:s.complete,meta:s.meta}}(e,t);break;case"deleteContentBackward":case"deleteContentForward":n=function(e,t){const o=ea(t),n=t.selectionBefore,r=ks.has(e);let s=n[0],a=n[1];s===a&&("deleteContentBackward"!==t.type||r?a+=na(o,s):s-=na(o,s,"backward"));const l=ms.get(e);let i="";if("select"===l){const[o,n]=ba(e),r=Aa(e,[s,a,"none"]);if(void 0!==r){const l=n[r],p=o[r];qs(l)?i=l.placeholder.repeat(a-s):zs(l)&&([i,s]=js(p,/* #__PURE__ */Zs(e))?[l.placeholder,s]:function(e,t,o,n){const r=n.valueBefore,s=na(r,n.selectionBefore[0],"backward"),a=Math.max(o[0],n.selectionBefore[0]-s),l=r.substring(o[0],a),i=xa(t.values,l);let p=null==i?void 0:i.substring(l.length);i&&!p&&wa(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=ca(e,t,p);return{...t,valueAfter:d.value,selectionAfter:$a(e,d,t,s),unmasked:d.unmasked,complete:d.complete,meta:d.meta}}(e,t)}if(ks.has(e)&&n&&Oa(n),n&&function(e,t){t.prefix&&(t.valueAfter=t.prefix+t.valueAfter,t.selectionAfter=Js(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)){ws.has(e)&&As.set(e,(()=>{As.delete(e),n&&ws.get(e)(n,e)})),_s.set(e,"beforeCallback");let t=null!==(o=cs.get(e))&&void 0!==o?o:[];const r=us.get(e);r&&(t=t.slice(0,r),us.delete(e)),t.push(n),cs.set(e,t),Es&&Ae()===e&&"function"==typeof document.execCommand&&!Ms&&(ta(e,[0,e.value.length,"forward"],!0),Ms=!0,document.execCommand("insertText",void 0,n.valueAfter),Ms=!1),Es&&Ae()===e&&ta(e,n.selectionAfter);const s=As.get(e);s&&s(),Ta(e)}_s.set(e,"complete")}function Xs(e,t){var o,n;const r=null!==(o=Ss.get(e))&&void 0!==o?o:"",s=null!==(n=Ls.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 Js(e,t){const o=Ss.get(e),n=[...t];return o&&(n[0]+=o.length,n[1]+=o.length),n}function Qs(e,t){const o=Ss.get(e),n=[...t];return o&&(n[0]-=o.length,n[1]-=o.length),n}function ea(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 ta(e,t,o=!1){o&&(fs.add(e),setTimeout((()=>fs.delete(e)),5)),bs.get(e)&&bs.set(e,t),e.setSelectionRange(...t)}function oa(e){if(null==e)return"";const t=gs.test(e.charAt(0))&&gs.test(e.charAt(1))?2:1;return e.substring(0,t)}function na(e,t,o="forward"){if("backward"===o)return 0===t?0:1===t?1:gs.test(e.charAt(t))&&gs.test(e.charAt(t-1))?2:1;const n=e.length-t;return 0===n?0:1===n?1:oa(e.substring(t)).length}function ra(e,t){const o=oa(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 sa(e){const t=oa(e.buffer),o=t.length;e.value+=t,e.pos+=o,e.buffer=e.buffer.substring(o)}function aa(e,t){const o=oa(t),n=o.length;return e.value+=o,e.pos+=n,t.substring(n)}function la(e,t){for(;t.buffer;){const o=oa(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 ia(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(na(t.buffer,0))}return null}function pa(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 da(e,t){let o=[t.endPos,t.endPos,"forward"];if("select"!==t.mode)return o;const n=/* #__PURE__ */Zs(e);o=[n[0],t.endPos,"none"];const[r,s]=ba(e,t.value),a=Aa(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(qs(i)&&pa(p,i).length===p.length&&a<r.length-1)return Cs(),r[a+1];if(zs(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=xa(o.values,r);if(s)return ga(r,s).length-n.length;return 0}(t,l[0],i);if(t.insertPos+o===l[1])return wa(i.values,p)?[l[1],l[1],"forward"]:(Cs(),r[a+1]?r[a+1]:r[a]);const s=[t.insertPos+o,l[1],"none"];return js(s,n)||(fs.add(e),setTimeout((()=>fs.delete(e)),5)),s}return l}function ca(e,t,o,n){var r,s;const a=null!==(r=vs.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:$s.has(e),buffer:o,data:t.data,originalData:t.data,value:"",mode:ms.get(e)||"replace",endPos:t.selectionBefore[0],rangeParts:ba(e),unmasked:"",complete:!0,cycle:t.cycle,meta:[]};return ua(a,l,void 0,n),l}function ua(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":ha(o,t,e.at(-1)===o);break;case"char":va(o,t,l);break;case"enum":fa(o,t);break;case"group":const a={repeat:null!==(s=o.repeat)&&void 0!==s&&s,nextPart:r,repeats:0,placeholder:!!o.placeholder};ua(o.parts,t,a,n)}if(n){if(!1===n(t,o))break}const a=Ys(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++,ua(e,t,o,n);if(!s){t.complete=!1;const o=e.reverse().find((e=>"literal"===e.type));e.reverse(),Ys(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 fa(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=xa(e.values.concat([e.placeholder]),n);if(r){const s=ga(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):ia(e,t),t.endPos=t.pos+s.length,void(t.pos=t.value.length)}t.data=""}if(t.buffer){const o=ia(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 ha(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?oa(t.data):"",s=oa(n);if(e===s)n=ra(t,n),t.meta.push({type:"literal",value:s}),r=!0;else if(!r||t.data||null===t.data||t.placeholder||o)n=aa(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 va(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=oa(t.data);if(e.pattern.test(n))return ra(t),t.meta.push({type:"char",value:n}),t.chars++,t.unmasked+=n,void la(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=oa(t.buffer);if(e.pattern.test(n))return t.chars++,t.unmasked+=n,sa(t),void t.meta.push({type:"char",value:n});if(t.placeholder&&n===e.placeholder)return sa(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 $a(e,t,o,n){const r=[n,n,"none"];if("select"===t.mode){const s=ba(e),a=Aa(e,r,s),[l,i]=ba(e,t.value),p=void 0!==a&&ma(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)=>ma(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 ma(e,t,o){if(Ys(o))return!1;if(qs(o)){let n=t[0];for(;n<t[1];){const t=oa(e.substring(n));if(t!==o.placeholder)return!1;n+=t.length}}return!zs(o)||e.substring(t[0],t[1])===o.placeholder}function ga(e,t){let o="";do{const n=oa(e).toLowerCase(),r=oa(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 ba(e,t){const o=vs.get(e);if(!o)return[[],[]];if(ys.has(e))return ys.get(e);const n=null!=t?t:Xs(e,e.value),r=[],s=[];let a=null,l=null,i=0,p=!0;for(const e of o)if(Ys(e))a=e,null!==l&&(r.push([l,i,"none"]),l=null),i+=e.value.length;else{if(qs(a)&&qs(e)&&e.token===a.token)i++;else if(qs(e))null===l?(l=i,s.push(e)):(r.push([l,i,"none"]),l=i,s.push(e)),i++;else if(zs(e)){l&&r.push([l,i,"none"]),_a(e)||(p=!1);const t=ya(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&&ys.set(e,d),d}function ya(e,t,o){if(_a(t))return t.values[0].length;const n=e.slice(o),r=xa(t.values.concat([t.placeholder]),n);return r?r.length:0}function xa(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=oa(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=xa(l,t.substring(s.length),o,a))&&void 0!==r?r:l[0])}function wa(e,t){return t=t.toLowerCase(),e.some((e=>(e=e.toLowerCase()).startsWith(t.toLocaleLowerCase())&&e!==t))}function _a(e){if(!xs.has(e)&&Array.isArray(e.values)&&e.values.length>0){const t=e.values[0].length;if(e.placeholder.length!==t)return!1;xs.set(e,e.values.every((e=>e.length===t)))}return xs.get(e)}function ka(e,t=1){const[o]=ba(e),n=Aa(e,Qs(e,/* #__PURE__ */Zs(e)));return void 0!==n&&void 0!==o[n+t]&&(e.setSelectionRange(...Js(e,o[n+t])),!0)}function Sa(e,t=1){const[o,n]=ba(e),r=Aa(e,/* #__PURE__ */Zs(e));if(void 0!==r&&r in n){const s=n[r];if(zs(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((()=>Gs(e,t)),0),!0}}}return!1}function La(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 La(e.slice(...r),t)}function Aa(e,t,o){const[n]=null!=o?o:ba(e),r=n.findIndex((e=>e[0]!==e[1]&&(!!js(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=La([...s],t[1]);return l in a?a[l]:void 0}function Da(e){var t,o;const n=null!==(t=cs.get(e))&&void 0!==t?t:[];return n[null!==(o=us.get(e))&&void 0!==o?o:n.length-1]}function Ia(e,t=!1){const o=Da(e);return o&&(o.complete||t)?ks.has(e)?[...o.unmasked].reverse().join(""):o.unmasked:t?"":null}function Ca(e){var t;const o=Da(e);return null!==(t=null==o?void 0:o.meta)&&void 0!==t?t:null}function Oa(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 Ta(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}))}}const Ea="undefined"!=typeof window,Ma=new WeakSet,Va=new WeakSet,Fa=new WeakSet,Ba=new WeakMap,Pa=new WeakMap,Ha=new WeakSet,Ra=new WeakSet;function Ka(e){return"timeZoneName"!==e.partName}function Na(e){e.props.calendar=S(e.props.showMonths,(e=>e)).map((t=>function(e,t){const o=[],n=r.date(t);n.setDate(1);let s=r.weekStart(n,e.props.weekStart);s.setHours(n.getHours(),n.getMinutes(),n.getSeconds());const a=r.weekEnd(r.monthEnd(t),e.props.weekStart);let l=[];do{l.push(s),7===l.length&&(o.push(l),l=[]),s=r.addDay(s)}while(s.getTime()<=a.getTime());return{monthDay:n,weeks:o}}(e,r.addMonth(e.props.renderedDate,t)))),e.props.years=function(e){const t=Number(r.format(e.props.renderedDate,"YYYY")),o=t-t%10;return e.props.decade=`${o} - ${o+9}`,S(10,(n=>r.addYear(e.props.renderedDate,o+n-t)))}(e),e.props.months=function(e){const t=r.date(e.props.renderedDate);return t.setMonth(0),S(12,(e=>r.addMonth(t,e)))}(e)}function Wa(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 qa(e,t){if(!t)return e.props.inputText="",new Date;const o=t instanceof Date?t:r.parse(t,e.props.valueFormat,e.props.valueLocale);return e.props.inputText=e.props.formatDate(o,e.props.format,e.props.locale,!1,Ka),o}function za(t){return Array.isArray(t.props.sequence)?e.clone(t.props.sequence):["day"]}function Ua(e,t,o=!0){var n,s;if(e._value===t)return;if(null==t)return e.input(t,o);e.props.offset=e.props.timezone?r.offset(t,e.props.timezone):"+0000";const a=r.applyOffset(t,null!==(n=(s=e.props).offset)&&void 0!==n?n:s.offset="+0000");e.input(r.format(a,e.props.valueFormat,e.props.valueLocale,!1),o)}function Ya(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 ja(e,t){var o;let n="";if(!(t instanceof HTMLInputElement)||e.props.pickerOnly)return;Ba.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`)?Ra.add(e):Ra.delete(e)})),e.on("prop:inputText",(({payload:e})=>{e!==t.value&&("beforeCallback"===_s.get(t)&&(n=t.value),Ps(t),t.selectionStart=0,t.selectionEnd=t.value.length,t.value=e,setTimeout((()=>Hs(t)),10))}));const[s,a]=function(e){const t=e.props.locale,o=["full","long","medium","short"].includes(e.props.format)||"object"==typeof e.props.format,n=r.parts(e.props.format,t),s=r.formatStr(e.props.format,t,!0,Ka);return[s,n.reduce(((n,s)=>{if("literal"===s.partName)return n;let a=r.range(s.token,t,o);if("YYYY"===s.token&&e.props.minDate&&e.props.maxDate){const t=e.props.minDate.getFullYear();a=S(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 n.push(l),s.token.startsWith("D")&&Pa.set(e,a),n}),[])]}(e);Bs(t,{pattern:s,explicitParts:a,onChange:({valueAfter:o})=>{if(Za(e),Ma.has(e))return Ma.delete(e);n&&n===o?n="":(Ps(t),e.props.inputText=o,setTimeout((()=>Hs(t)),10))}})}function Za(e){var t,o;if(e.props.overlay){const n=Ba.get(e);!n||!(null===(t=e.props.attrs)||void 0===t?void 0:t.placeholder)||e._value||Ia(n,!0)||e.props._isFocused||e.props.activeDate&&e.props.expanded?n&&(e.props._isPlaceholder=!1,e.props._overlayParts=Le(Ca(n))):(e.props._isPlaceholder=!0,e.props._overlayParts=[{type:"placeholder",value:null===(o=e.props.attrs)||void 0===o?void 0:o.placeholder}])}}function Ga(e,t){return!t||(!!(e.props.minDate&&t<e.props.minDate)||(!!(e.props.maxDate&&t>e.props.maxDate)||void 0))}function Xa(e){return"function"==typeof e.props.validationLabel?e.props.validationLabel(e):e.props.validationLabel||e.props.label||e.props.name||String(e.name)}const Ja="undefined"!=typeof window,Qa=new WeakMap;function el(e,t){var o,n;if(t instanceof HTMLInputElement&&!Qa.get(e)&&Ja){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){Qa.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 tl(t){t.addProps(["_overlayStyles","_overlayParts","_overlayInnerStyles","_isPlaceholder"]),t.props._overlayStyles={position:"absolute",top:"0",left:"0",pointerEvents:t.props._isPlaceholder?"auto":"none"},t.props._overlayInnerStyles={overflow:"hidden",whiteSpace:"nowrap",paddingRight:"20px"},t.on("created",(()=>{t.props.overlay=e.undefine(t.props.overlay),t.props.pickerOnly=e.undefine(t.props.pickerOnly),t.props.overlay=t.props.pickerOnly?void 0:t.props.overlay,t.props.overlay&&e.whenAvailable(`${t.props.id}`,el.bind(null,t),t.props.__root)})),t.on("prop:_isPlaceholder",(()=>{t.props._overlayStyles={...t.props._overlayStyles,pointerEvents:t.props._isPlaceholder?"auto":"none"}}))}const ol={schema:/* #__PURE__ */$r(/* #__PURE__ */mr(/* #__PURE__ */yr("$label"),/* #__PURE__ */gr(/* #__PURE__ */br("prefix"),/* #__PURE__ */xr(),/* #__PURE__ */ls(/* #__PURE__ */ps(/* #__PURE__ */is(/* #__PURE__ */ns("$part.value"),/* #__PURE__ */rs("$part.value"),/* #__PURE__ */ss("$part.value"),/* #__PURE__ */as("$part.value")))),/* #__PURE__ */Lr(),/* #__PURE__ */Ar(/* #__PURE__ */zr(/* #__PURE__ */Cr(/* #__PURE__ */Or("$ui.prev.value"),/* #__PURE__ */br("prev")),/* #__PURE__ */Ur("$decade"),/* #__PURE__ */Yr(/* #__PURE__ */Gr()),/* #__PURE__ */jr(/* #__PURE__ */Xr(),/* #__PURE__ */Gr()),/* #__PURE__ */Zr(/* #__PURE__ */Xr(),/* #__PURE__ */Jr(),/* #__PURE__ */Gr()),/* #__PURE__ */Dr(/* #__PURE__ */Ir("$ui.next.value"),/* #__PURE__ */br("next")),/* #__PURE__ */os(/* #__PURE__ */br("close"))),/* #__PURE__ */ds(/* #__PURE__ */Kr(/* #__PURE__ */Nr("$fns.format($year, $yearFormat)")),/* #__PURE__ */Wr(/* #__PURE__ */qr("$fns.format($month, $monthFormat)")),/* #__PURE__ */Tr(/* #__PURE__ */Mr(/* #__PURE__ */Vr(/* #__PURE__ */Fr("$fns.format($day, $weekdayFormat)"))),/* #__PURE__ */Er(/* #__PURE__ */Br(/* #__PURE__ */Pr(/* #__PURE__ */Hr("$fns.format($day, $dateFormat)"))))),/* #__PURE__ */es(/* #__PURE__ */ts()))),/* #__PURE__ */Qr(/* #__PURE__ */br("clear")),/* #__PURE__ */Rr(/* #__PURE__ */br("calendar")),/* #__PURE__ */wr(),/* #__PURE__ */br("suffix"))),/* #__PURE__ */_r("$help"),/* #__PURE__ */kr(/* #__PURE__ */Sr("$message.value"))),type:"input",family:"text",props:["dateFormat","dayButtonFormat","format","monthButtonFormat","monthFormat","overlay","pickerOnly","showMonths","showPagination","weekStart","weekdayFormat","yearFormat","years"],features:[tl,function(o){var n,s,a,l,i,p,d,c,u,f,h,v,$,m,g,b,y,x,w,_,k,L;o.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"]),o.hook.prop(((e,t)=>("expanded"===e.prop&&o.props.disabled&&(e.value=!1),"weekStart"===e.prop&&(e.value=Number(e.value||0)),"showMonths"===e.prop&&(e.value=Number(e.value||1)),"maxScan"===e.prop&&(e.value=Number(e.value||7)),"timezone"===e.prop&&("string"==typeof o._value||o._value instanceof Date)&&(o.props.offset=r.offset(o._value,e.value)),/* #__PURE__ */t(e)))),o.props._isFocused=!1,o.props._isPlaceholder=!1,null!==(n=(v=o.props).valueFormat)&&void 0!==n||(v.valueFormat="ISO8601"),null!==(s=($=o.props).weekdayFormat)&&void 0!==s||($.weekdayFormat="d"),null!==(a=(m=o.props).monthFormat)&&void 0!==a||(m.monthFormat="MMM"),null!==(l=(g=o.props).monthButtonFormat)&&void 0!==l||(g.monthButtonFormat="MMMM"),null!==(i=(b=o.props).dayButtonFormat)&&void 0!==i||(b.dayButtonFormat="D"),null!==(p=(y=o.props).dateFormat)&&void 0!==p||(y.dateFormat="D"),null!==(d=(x=o.props).yearFormat)&&void 0!==d||(x.yearFormat="YYYY"),null!==(c=(w=o.props).paginatedPanels)&&void 0!==c||(w.paginatedPanels=["day","year"]),null!==(u=(_=o.props).valueLocale)&&void 0!==u||(_.valueLocale=o.props.locale),null!==(f=(k=o.props).format)&&void 0!==f||(k.format="long"),o.props.panels=za(o),o.props.pickerOnly=e.undefine(o.props.pickerOnly),"disabled"in o.props&&(o.props.disabled=e.undefine(o.props.disabled)),"clearable"in o.props&&(o.props.clearable=e.undefine(o.props.clearable)),null!==(h=(L=o.props).maxScan)&&void 0!==h||(L.maxScan=7),o.props._isDisabled="function"==typeof o.props.disabledDays?o.props.disabledDays.bind(null,o):Ga.bind(null,o),function(e){const t=e._value;let o=new Date;if(t instanceof Date)o=r.date(t);else if("string"==typeof t)try{const n=r.parse(t,e.props.valueFormat,e.props.valueLocale);o=r.date(n)}catch{console.warn(`Date (${t}) does not match format (${r.formatStr(e.props.valueFormat,e.props.valueLocale)})`),o=void 0}else t||(o=void 0);if(e.props.offset=e.props.timezone?r.offset(o||new Date,e.props.timezone):"+0000",e.props.minDate){const t="string"==typeof e.props.minDate?r.parse(e.props.minDate):e.props.minDate;e.props.minDate=r.removeOffset(t,e.props.offset)}if(e.props.maxDate){const t="string"==typeof e.props.maxDate?r.parse(e.props.maxDate):e.props.maxDate;e.props.maxDate=r.removeOffset(t,e.props.offset)}o=o&&r.removeOffset(o,e.props.offset),o&&Ua(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&&r.format(o,"HH:mm")||"12:00"}(o),o.props.calendar=[],o.props.inputText="",o.props.showMonths=o.props.showMonths||1,"function"==typeof o.props.format?(o.props.formatDate=o.props.format,o.props.format=null):o.props.formatDate=r.format,o.on("created",(()=>{if(e.whenAvailable(`${o.props.id}`,ja.bind(null,o),o.props.__root),o.context){let e;o.context.fns.format=(e,t)=>r.format(e,t,o.props.locale||"en",!1,Ka),o.context.fns.isDisabled=o.props._isDisabled,o.context.fns.isDisabledMonth=e=>!r.nearestDay(e,(e=>!o.props._isDisabled(e)),"month"),o.context.fns.isDisabledYear=e=>!r.nearestDay(e,(e=>!o.props._isDisabled(e)),"year"),o.context.fns.isSelected=e=>{var t;const n=null===(t=o.context)||void 0===t?void 0:t.value;if(null==n)return;const s=r.removeOffset(n instanceof Date?n:r.parse(n,o.props.valueFormat,o.props.valueLocale),o.props.offset);return r.sameDay(e,s)},o.context.handlers._blur=e=>{var t,n;o.props._isFocused=!1,"function"==typeof(null===(t=o.context)||void 0===t?void 0:t.handlers.blur)&&(null===(n=o.context)||void 0===n||n.handlers.blur(e))},o.context.handlers.closePanel=()=>{o.props.expanded=!1},o.context.handlers._blurOut=e=>t=>{var n;t.preventDefault(),e&&e!==o.props.panel||o.props.pickerOnly&&t.relatedTarget instanceof Element&&(t.relatedTarget===document.getElementById(`${o.props.id}_inner`)||t.relatedTarget.closest(`#${o.props.id}_inner`))||t.relatedTarget&&t.relatedTarget instanceof Element&&(t.relatedTarget.closest(`#${o.props.id}_popover`)||!(null===(n=o.props.__root)||void 0===n?void 0:n.contains(t.relatedTarget))||t.relatedTarget.id===`${o.props.id}_popover`)||(o.props.expanded=!1)},o.context.handlers.overlayClick=()=>{const e=Ba.get(o);e&&(e.focus(),o.props._isPlaceholder=!1)},o.context.handlers.focus=()=>{o.props.pickerOnly||(o.props._isFocused=!0,o.props.pickerOnly&&!Va.has(o)&&(Fa.add(o),o.props.expanded=!0,setTimeout((()=>Fa.delete(o)),200)))},o.context.handlers.clear=()=>{var e,t;Ua(o,void 0,!0),qa(o,void 0);const n=null===(t=null===(e=o.props)||void 0===e?void 0:e.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`);n instanceof HTMLInputElement&&(n.focus(),setTimeout((()=>{n.setSelectionRange(0,0)}),50))},o.context.handlers.dateInput=e=>{var t;if(Ha.has(o))return Ha.delete(o);if(e.target instanceof HTMLInputElement&&!o.props.expanded)try{let n=r.parse({date:e.target.value,format:o.props.format,locale:o.props.locale,partFilter:Ka});if(function(e){return r.parts(e.props.format,e.props.locale).some((e=>"weekday"===e.partName))}(o)&&o.props.activeDate instanceof Date&&o.props.activeDate.getTime()===n.getTime()&&!Ds.get(e.target)&&r.format(n,o.props.format,o.props.locale,!1,Ka)!==e.target.value){const s=r.range("dddd",o.props.locale),a=r.parts(o.props.format,o.props.locale),l=null===(t=r.parseParts(e.target.value,a).find((e=>"dddd"===e.token)))||void 0===t?void 0:t.value,i=r.format(n,"dddd",o.props.locale);if(l&&s.includes(l)&&i!==l){let e=s.indexOf(l)-s.indexOf(i);e=e<-1?7+e:e,n=r.addDay(n,e),Ma.add(o)}}Ua(o,n)}catch(e){Ua(o,void 0)}},o.context.handlers.open=()=>{o.props.expanded=!0},o.context.handlers.next=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,1))}},o.context.handlers.prev=()=>{switch(o.props.panel){case"year":return void(o.props.renderedDate=r.addYear(o.props.renderedDate,-10));case"day":return void(o.props.renderedDate=r.addMonth(o.props.renderedDate,-1))}},o.context.handlers.setDate=e=>()=>{var t;"month"!==o.props.panel&&"year"!==o.props.panel||!o.props.activeDate||(e=o.props.activeDate),(null===(t=o.context)||void 0===t?void 0:t.fns.isDisabled(e))||o.emit("dateSelected",e)},o.context.handlers.localTime=e=>{const t=e.target;if(!t.value)return;const[n,r]=t.value.split(":");o.props.localTime=t.value,o.props.activeDate.setHours(n,r),qa(o,o.props.activeDate)},o.context.handlers.keyDown=e=>{switch(o.props.panel){case"day":return o.emit("calendarKeydown",e);case"year":return o.emit("yearKeydown",e);case"month":return o.emit("monthKeydown",e);case"time":return o.emit("timeKeydown",e);default:return}},o.context.handlers.inputKeydown=e=>{o.emit("keydown",e)},o.context.handlers.openKeydown=e=>{"Enter"!==e.key&&"Space"!==e.key||(o.props.expanded=!0)},o.context.handlers.mouseEnter=t=>n=>{clearTimeout(e),n.target instanceof HTMLElement&&"-1"===n.target.getAttribute("tabindex")&&"true"!==n.target.getAttribute("data-is-extra")&&("month"===o.props.panel||"year"===o.props.panel?o.props.activeDate=r.nearestDay(t,(e=>!o.props._isDisabled(e)),o.props.panel):o.props.activeDate=t)},o.context.handlers.mouseLeave=()=>{clearTimeout(e),e=setTimeout((()=>{}),100)},o.context.handlers.jumpTo=e=>()=>{o.props.panels.unshift(o.props.panel),o.props.panel=e},o.context.fns.sameDay=e=>{var t;return(null===(t=o.context)||void 0===t?void 0:t.activeDate)instanceof Date&&r.sameDay(e,o.context.activeDate)},o.context.fns.sameMonth=e=>{var t;return(null===(t=o.context)||void 0===t?void 0:t.activeDate)instanceof Date&&e.getMonth()===o.context.activeDate.getMonth()},o.context.fns.sameYear=e=>{var t,n;return(null===(t=o.context)||void 0===t?void 0:t.activeDate)instanceof Date&&e.getFullYear()===(null===(n=o.context)||void 0===n?void 0:n.activeDate.getFullYear())},o.context.fns.notInMonth=(e,t)=>{const o=r.dayStart(t).getTime();return o<r.monthStart(e).getTime()||o>r.monthEnd(e).getTime()||void 0}}}));const A=Wa.bind(null,o);o.on("prop:panel",(({payload:e})=>{o.props.showPagination=o.props.paginatedPanels.includes(e)})),o.on("dateSelected",(({payload:e})=>{var t,n;e&&o.props._isDisabled(e)||(Array.isArray(o.props.panels)&&o.props.panels.length?o.props.panel=o.props.panels.shift():(o.props.expanded=!1,null===(n=null===(t=o.props.__root)||void 0===t?void 0:t.getElementById(`${o.props.id}`))||void 0===n||n.focus()),Ua(o,e))})),o.on("input",(({payload:e})=>{if(void 0===e&&!o.props._isFocused)return void qa(o,void 0);const t=new Date,n=e?qa(o,r.removeOffset("string"==typeof e?r.parse(e,o.props.valueFormat,o.props.valueLocale):e,o.props.offset)):t;o.props.activeDate=!e&&o.props.activeDate?o.props.activeDate:n,o.props.renderedDate=!e&&o.props.renderedDate?o.props.renderedDate:n,o.props.localTime=r.format(n,"HH:mm"),function(e){const t=Pa.get(e);if(e._value&&t){const o=r.monthDays(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))}}(o)})),o.on("prop:renderedDate",Na.bind(null,o)),o.on("prop:expanded",(({payload:t})=>{if(t){if(Ra.delete(o),o.props.panels=za(o),o.props.panel=o.props.panels.shift(),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?o.props.showPanelClose=!0:o.props.showPanelClose=!1,"day"===o.props.panel){const e=o.props.activeDate;o.props.activeDate=r.nearestDay(o.props.activeDate,(e=>!o.props._isDisabled(e)),"month")||e}Na(o),e.whenAvailable(`${o.props.id}_popover`,(e=>{const t=e.querySelector('[tabindex="0"]');t&&setTimeout((()=>{t.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())}))}(o,e)}),0)}),o.props.__root),Ea&&setTimeout((()=>{document.addEventListener("click",A)}),10)}else{if("time"===o.props.panel)o.emit("dateSelected",o.props.activeDate);else if(o._value){Ha.add(o);const e="string"==typeof o._value?r.parse(o._value,o.props.valueFormat,o.props.valueLocale):o._value;qa(o,r.removeOffset(e,o.props.offset))}else qa(o,void 0);Ea&&(Va.add(o),document.removeEventListener("click",A),setTimeout((()=>Va.delete(o)),50))}})),o.on("prop:activeDate",(({payload:e})=>{if(Array.isArray(o.props.calendar)&&o.props.calendar.length)if("day"===o.props.panel){const t=o.props.calendar,n=r.monthStart(o.props.renderedDate),s=r.monthEnd(r.addMonth(o.props.renderedDate,t.length-1));e.getTime()<n.getTime()?o.props.renderedDate=r.addMonth(o.props.renderedDate,-1):e.getTime()>s.getTime()&&(o.props.renderedDate=r.addMonth(o.props.renderedDate))}else if("year"===o.props.panel){const e=o.props.years,t=e[0].getFullYear(),n=e[e.length-1].getFullYear(),s=o.props.activeDate.getFullYear();s>n?o.props.renderedDate=r.addYear(o.props.renderedDate,10):s<t&&(o.props.renderedDate=r.addYear(o.props.renderedDate,-10))}o.props.expanded&&qa(o,o.props.activeDate)})),o.on("keydown",(({payload:e})=>{switch(e.key){case"ArrowDown":case"ArrowUp":case" ":e.preventDefault(),o.props.pickerOnly&&(o.props.expanded=!0);break;case"Enter":case"Return":o.props.expanded||(o.props.expanded=!0);break;case"Escape":o.props.expanded=!1}})),o.on("calendarKeydown",(({payload:e})=>{e.preventDefault();let t=null,n=0;switch(e.key){case"ArrowRight":n=1;break;case"ArrowLeft":n=-1;break;case"ArrowDown":n=7;break;case"ArrowUp":n=-7;break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Tab":e.shiftKey||Ya(o,e);break;case"Escape":o.props.expanded=!1}if(n&&(e.preventDefault(),t=r.addDay(o.props.activeDate,n)),t&&!o.props._isDisabled(t))o.props.activeDate=t;else if(t&&o.props._isDisabled(t)){const e=n>0?1:-1;S(Number(o.props.maxScan),(t=>e*t)).some((e=>{const n=r.addDay(t,e);return!o.props._isDisabled(n)&&(o.props.activeDate=n,!0)}))}})),o.on("yearKeydown",(({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=5;break;case"ArrowRight":t=1;break;case"ArrowUp":t=-5;break;case"ArrowLeft":t=-1;break;case"Tab":e.shiftKey||Ya(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}const n=o.props.activeDate.getFullYear()+t-o.props.renderedDate.getFullYear();o.props.activeDate=r.addYear(o.props.renderedDate,n)})),o.on("monthKeydown",(({payload:e})=>{let t=0;switch(e.key){case"ArrowDown":t=3;break;case"ArrowRight":t=1;break;case"ArrowLeft":t=-1;break;case"ArrowUp":t=-3;break;case"Tab":e.shiftKey||Ya(o,e);break;case"Return":case"Enter":o.emit("dateSelected",o.props.activeDate);break;case"Escape":o.props.expanded=!1}t&&e.preventDefault();let n=(o.props.activeDate.getMonth()+t)%12;n=n<0?12+n:n;const s=n-o.props.renderedDate.getMonth();let a=r.addMonth(o.props.renderedDate,s);if(o.props._isDisabled(a)){const e=r.nearestDay(a,(e=>!o.props._isDisabled(e)),"month");e&&(a=e)}o.props.activeDate=a})),o.on("timeKeydown",(({payload:e})=>{switch(e.key){case"Return":case"Enter":e.preventDefault(),o.emit("dateSelected",o.props.activeDate)}})),o.on("prop:_isFocused",(()=>{Ba.get(o)&&Za(o)})),o.on("commit",(()=>{if(o.props.activeDate&&o.props._isDisabled(o.props.activeDate)){const e=/* #__PURE__ */t.createMessage({blocking:!0,key:"rule_invalidDate",meta:{messageKey:"invalidDate",removeImmediately:!1,localize:!0,i18nArgs:[{node:o,name:Xa(o),args:[]}]},type:"validation",value:"The selected date is invalid."});o.store.set(e)}else o.store.remove("rule_invalidDate")}))},Ut,
35
+ /* #__PURE__ */o.localize("next"),
36
+ /* #__PURE__ */o.localize("prev"),
37
+ /* #__PURE__ */o.localize("changeDate"),
38
+ /* #__PURE__ */o.localize("chooseDate"),
39
+ /* #__PURE__ */o.defaultIcon("close","close"),
40
+ /* #__PURE__ */o.defaultIcon("next","right"),
41
+ /* #__PURE__ */o.defaultIcon("clear","close"),
42
+ /* #__PURE__ */o.defaultIcon("prev","left"),
43
+ /* #__PURE__ */o.defaultIcon("calendar","date")]},nl=/* #__PURE__ */q("tl"),{outer:rl,wrapper:sl,inner:al,icon:ll,label:il,prefix:pl,suffix:dl,help:cl,messages:ul,message:fl}=/* #__PURE__ */z(nl),hl=/* #__PURE__ */nl("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"}}))),vl=/* #__PURE__ */nl("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'}}))),$l=/* #__PURE__ */nl("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)"}}))),ml=/* #__PURE__ */nl("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),gl=/* #__PURE__ */nl("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"}}))),bl=/* #__PURE__ */nl("tagLabel",(()=>({$el:"span"}))),yl=/* #__PURE__ */nl("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite"}}))),xl=/* #__PURE__ */nl("tagLoading","span"),wl=Z(nl);function _l(t){t.props.multiple=!0,t.props.openOnClick=e.undefine(t.props.openOnClick),void 0===t.props.closeOnSelect&&(t.props.closeOnSelect=!0),t.props.closeOnSelect?t.props.resetSearchOnCommit=!1:void 0===t.props.resetSearchOnCommit&&(t.props.resetSearchOnCommit=t.props.multiple),t.props.allowNewValues=e.undefine(t.props.allowNewValues)}function kl(t){cr(t),Kt(t),t.on("created",(()=>{function o(){return Array.isArray(t.value)?t.value:[]}function r(e){t.input(e)}t.props.disabled&&(t.props.draggable=!1),e.whenAvailable(`${t.props.id}_selections`,(e=>{if(e instanceof HTMLElement){if(!t.context)return;const s={draggingClass:t.context.classes.dragging,dropZoneClass:t.context.classes.dropZone,disabled:!t.props.draggable,threshold:{horizontal:.25,vertical:0},plugins:[n.animations()],root:t.props.__root,touchDraggingClass:t.context.classes.touchDragging,touchDropZoneClass:t.context.classes.touchDropZone,draggable:e=>e.hasAttribute("data-is-tag"),handleEnd(e){t.props.activeSelectionValue=void 0,n.handleEnd(e)},handleDragstart(e){t.props.activeSelectionValue=void 0,n.handleDragstart(e)},handleTouchstart(e){t.props.activeSelectionValue=void 0,n.handleTouchstart(e)}};n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s}),t.on("prop:disabled",(({payload:t})=>{s.disabled=t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})})),t.on("prop:draggable",(({payload:t})=>{s.disabled=!t,n.dragAndDrop({parent:e,getValues:o,setValues:r,config:s})}))}}),t.props.__root)}))}const Sl={schema:/* #__PURE__ */rl(/* #__PURE__ */sl(/* #__PURE__ */il("$label"),/* #__PURE__ */al(/* #__PURE__ */ll("prefix"),/* #__PURE__ */pl(),/* #__PURE__ */yl(/* #__PURE__ */$l(/* #__PURE__ */ml(/* #__PURE__ */Y("$state.loading && $fns.hasOptionLoaderValue && $fns.hasOptionLoaderValue($option) || $option.label === undefined",/* #__PURE__ */xl("$ui.isLoading.value"),/* #__PURE__ */bl("$option.label")),/* #__PURE__ */gl(/* #__PURE__ */ll("close")))),/* #__PURE__ */hl()),/* #__PURE__ */Y("$state.loading",/* #__PURE__ */ll("loader")),/* #__PURE__ */vl(/* #__PURE__ */ll("select")),/* #__PURE__ */wl(),/* #__PURE__ */dl(),/* #__PURE__ */ll("suffix"))),/* #__PURE__ */cl("$help"),/* #__PURE__ */ul(/* #__PURE__ */fl("$message.value"))),type:"input",family:"dropdown",props:[],features:[o.options,
44
+ /* #__PURE__ */dt.bind(null,_l,Xn,kl),
45
+ /* #__PURE__ */o.defaultIcon("select","select"),
46
+ /* #__PURE__ */o.defaultIcon("close","close"),
47
+ /* #__PURE__ */o.defaultIcon("selected","check"),
48
+ /* #__PURE__ */o.defaultIcon("loader","spinner"),
49
+ /* #__PURE__ */o.localize("isLoading"),
50
+ /* #__PURE__ */o.localize("loadMore"),
51
+ /* #__PURE__ */o.localize("remove"),
52
+ /* #__PURE__ */o.localize("open"),
53
+ /* #__PURE__ */o.localize("close"),Ut]},Ll=/* #__PURE__ */q("mk"),{outer:Al,wrapper:Dl,inner:Il,label:Cl,prefix:Ol,suffix:Tl,help:El,messages:Ml,message:Vl,icon:Fl}=/* #__PURE__ */z(Ll),{overlayPlaceholder:Bl,overlayLiteral:Pl,overlayChar:Hl,overlayEnum:Rl,overlay:Kl,overlayParts:Nl,overlayInner:Wl}=/* #__PURE__ */U(Ll),ql=/* #__PURE__ */Ll("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"}}))),zl=new WeakMap,Ul=new WeakMap,Yl=new WeakMap;function jl(e,t){if(!(t instanceof HTMLInputElement))throw new Error(`Masks can only be applied to an HTMLInputElement (id: ${t.id}).`);Ul.set(e,t),Bs(t,{...zl.get(e),onChange:({valueAfter:t,meta:o})=>{e.props._maskValue=t,e.input({maskValue:t}),e.props._overlayParts=Le(o)}})}const Zl={schema:/* #__PURE__ */Al(/* #__PURE__ */Dl(/* #__PURE__ */Cl("$label"),/* #__PURE__ */Il(/* #__PURE__ */Fl("prefix"),/* #__PURE__ */Ol(),/* #__PURE__ */Kl(/* #__PURE__ */Wl(/* #__PURE__ */Nl(/* #__PURE__ */Bl("$part.value"),/* #__PURE__ */Pl("$part.value"),/* #__PURE__ */Hl("$part.value"),/* #__PURE__ */Rl("$part.value")))),/* #__PURE__ */ql(),/* #__PURE__ */Tl(),/* #__PURE__ */Fl("suffix"))),/* #__PURE__ */El("$help"),/* #__PURE__ */Ml(/* #__PURE__ */Vl("$message.value"))),type:"input",props:["allowIncomplete","mask","mode","tokens","showMask","unmaskValue","prefix","suffix","reverse","overlay"],family:"text",features:[tl,function(t){t.addProps(["_maskValue","_overlayParts"]),t.on("created",(()=>{var o,n,r,s,a;const l=Ks("string"==typeof t._value?t._value:"");Ul.set(t,l),Yl.set(t,l),t.props.allowIncomplete=e.undefine(t.props.allowIncomplete),t.props.overlay=e.undefine(t.props.overlay);const i=!(void 0!==t.props.showMask&&!e.undefine(t.props.showMask));t.props.unmaskValue=e.undefine(t.props.unmaskValue),t.hook.prop(((t,o)=>("unmaskValue"===t.prop&&(t.value=e.undefine(t)),/* #__PURE__ */o(t))));const p={placeholder:i,pattern:null!==(o=t.props.mask)&&void 0!==o?o:"",mode:null!==(n=t.props.mode)&&void 0!==n?n:"shift",partOverrides:null!==(r=t.props.tokens)&&void 0!==r?r:{},prefix:null!==(s=t.props.prefix)&&void 0!==s?s:void 0,suffix:null!==(a=t.props.suffix)&&void 0!==a?a:void 0,reverse:e.undefine(t.props.reverse)};zl.set(t,p),t.hook.input(((e,o)=>{const n=function(e,t){const o=Ul.get(e),n="object"==typeof t&&"maskValue"in t;t="string"==typeof t?t:n?t.maskValue:"";const r=Yl.get(e);r.value=Xs(r,t);const s=Rs(r,zl.get(e)),a=Ia(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=Le(Ca(r)||[]));return null===a?"":e.props.unmaskValue?a:s}(t,e);
54
+ return o(n)})),t.props._maskValue=Rs(l,p),t.input(t.props._maskValue,!1),t.context&&(t.context.handlers.DOMInput=e=>{t.emit("dom-input-event",e)}),e.whenAvailable(`${t.props.id}`,jl.bind(null,t),t.props.__root)}))}]},Gl=/* #__PURE__ */q("tf"),{outer:Xl,wrapper:Jl,inner:Ql,icon:ei,prefix:ti,suffix:oi,help:ni,messages:ri,message:si}=/* #__PURE__ */z(Gl),ai=/* #__PURE__ */Gl("fieldset",(()=>({$el:"fieldset",attrs:{id:'$id + "_fieldset"',role:"presentation","aria-describedby":{if:"$help",then:'$: "help-" + $id',else:void 0}}}))),li=/* #__PURE__ */Gl("legend",(()=>({if:"$label",$el:"legend"}))),ii=/* #__PURE__ */Gl("source",(()=>({$el:"div",attrs:{id:'$id + "_source"',class:'$classes.transferlist + " " + $classes.source'}}))),pi=/* #__PURE__ */Gl("sourceHeader",(()=>({$el:"div",attrs:{id:'$id + "_source_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.sourceHeader'}}))),di=/* #__PURE__ */Gl("sourceHeaderLabel",(()=>({if:"$sourceLabel",$el:"label",attrs:{id:'$id + "_source_header_label"',for:'$id + "_source_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.sourceHeaderLabel'},children:"$sourceLabel || $label"}))),ci=/* #__PURE__ */Gl("sourceHeaderItemCount",(()=>({$el:"span",attrs:{id:'$id + "_source_header_item_count"',role:"presentation","aria-label":'$sourceOptions.length " items"',class:'$classes.transferlistHeaderItemCount + " " + $classes.sourceHeaderItemCount'}}))),ui=/* #__PURE__ */Gl("targetHeaderLabel",(()=>({if:"$targetLabel",$el:"label",attrs:{id:'$id + "_target_header_label"',for:'$id + "_target_search_input"',class:'$classes.transferlistHeaderLabel + " " + $classes.targetHeaderLabel'},children:"$targetLabel || $label"}))),fi=/* #__PURE__ */Gl("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"}))),hi=/* #__PURE__ */Gl("sourceControls",(()=>({$el:"div",if:"$searchable",attrs:{id:'$id + "_source_controls"',class:'$classes.transferlistControls + " " + $classes.sourceControls'}}))),vi=/* #__PURE__ */Gl("sourceSearch",(()=>({if:"$searchable",$el:"div",attrs:{id:'$id + "_source_search"',class:'$classes.transferlistSearch + " " + $classes.sourceSearch'}}))),$i=/* #__PURE__ */Gl("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"}}))),mi=/* #__PURE__ */Gl("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'}}))),gi=/* #__PURE__ */Gl("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"}}))),bi=/* #__PURE__ */Gl("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'}}))),yi=/* #__PURE__ */Gl("sourceOption",(()=>({$el:"div",attrs:{"data-checked":"$fns.isSelected($option, $selectedSourceItems)",class:'$classes.transferlistOption + " " + $classes.sourceOption'}}))),xi=/* #__PURE__ */Gl("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"}}))),wi=/* #__PURE__ */Gl("loadMoreInner","span"),_i=/* #__PURE__ */Gl("target",(()=>({$el:"div",attrs:{id:'$id + "_target"',class:'$classes.transferlist + " " + $classes.target'}}))),ki=/* #__PURE__ */Gl("targetHeader",(()=>({$el:"div",attrs:{id:'$id + "_target_header"',role:"presentation",class:'$classes.transferlistHeader + " " + $classes.targetHeader'}}))),Si=/* #__PURE__ */Gl("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"}}))),Li=/* #__PURE__ */Gl("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'}}))),Ai=/* #__PURE__ */Gl("targetOption",(()=>({$el:"div",attrs:{id:'$id + "_target_list_item_" + $index + "_option"',"data-checked":"$fns.isSelected($option, $selectedTargetItems)",class:'$classes.transferlistOption + " " + $classes.targetOption'}}))),Di=/* #__PURE__ */Gl("transferControls",(()=>({$el:"div",attrs:{id:'$id + "_transfer_controls"'}}))),Ii=/* #__PURE__ */Gl("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'}}))),Ci=/* #__PURE__ */Gl("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'}}))),Oi=/* #__PURE__ */Gl("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'}}))),Ti=/* #__PURE__ */Gl("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'}}))),Ei=/* #__PURE__ */Gl("controlLabel","span"),Mi=/* #__PURE__ */Gl("sourceEmptyMessage",(()=>({$el:"li",if:"$showSourceEmptyMessage && $sourceEmptyMessage && $state.loading !== true",attrs:{id:'$id + "_source_empty_message"',key:"$sourceEmptyMessage",role:"presentation"}}))),Vi=/* #__PURE__ */Gl("targetEmptyMessage",(()=>({$el:"li",if:"$showTargetEmptyMessage && $targetEmptyMessage",attrs:{id:'$id + "_empty_message"',key:"$emptyMessage",role:"presentation"}}))),Fi=/* #__PURE__ */Gl("emptyMessageInner","span"),Bi=Symbol(),Pi=new WeakSet,Hi=new WeakSet;function Ri(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 Ki(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=>De(e)));Array.isArray(e.value)?e.input([...e.value,...o]):e.input(o),e.props.selectedSourceItems=[]}function Ni(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=>De(e)));if(Array.isArray(e.value)){const t=e.value.filter((e=>!o.includes(e)));e.input(t)}e.props.selectedTargetItems=[]}function Wi(e){var t,o;if(e.props.activeValue===Bi){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 qi(t){var o;if(Array.isArray(t.value)){const o=[];let n=[...t.props.options];t.value.forEach((r=>{const s=t.props.memoOptions.find((t=>e.eq(De(t),r)));if(s&&!s.noOptionFound){o.push(s);const a=t.props.options.findIndex((t=>e.eq(De(t),r)));-1!==a&&(n=n.filter((t=>!e.eq(De(t),r))))}else{const t=n.find((t=>e.eq(De(t),r)));t?(o.push(t),n=n.filter((t=>!e.eq(De(t),r)))):o.push({label:String(r),value:r,noOptionFound:!0})}})),t.props.targetOptions=o,t.props.sourceOptions=n}else t.props.sourceOptions=[...t.props.options],t.props.targetOptions=[];if(t.props.skipSetActiveValue)return void(t.props.skipSetActiveValue=!1);(null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.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=De(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=De(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=De(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()}}(t)}function zi(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 Ui(t){Array.isArray(t.value)&&t.value.forEach((async o=>{Be(t,o,function(t,o){const n=[...t.props.options,...t.props.memoOptions];return n.find((t=>e.eq(De(t),o)))}(t,o))}))}function Yi(t){t.context&&(t.context.handlers.loadMore=Te.bind(null,t),t.context.fns.getSourceItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.sourceOptions.length:t.props.sourceOptions.length,t.context.fns.getTargetItemCount=e=>!1===t.props.transferOnSelect&&e.length?e.length+"/"+t.props.targetOptions.length:t.props.targetOptions.length,t.context.fns.isActive=(o,n)=>{if(!t.props.isDragging&&!t.props.touchStarted)return e.eq(n,De(o))||void 0},t.context.fns.isSelected=(e,t)=>!!t&&(!!Array.isArray(t)&&t.includes(e)),t.context.fns.optionLoading=e=>t.props.optionLoaderValues.includes(De(e)),t.context.handlers.clearSearch=()=>{!function(e){var t;e.props.sourceSearchActive=!1,e.props.inputText="",Oe(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()}(t)},t.context.handlers.sourceSearchBlur=e=>{setTimeout((()=>{var o;if(e.relatedTarget&&e.relatedTarget instanceof HTMLElement&&(e.relatedTarget.id===`${t.props.id}_source_list_items`||e.relatedTarget.id===`${t.props.id}`)){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}_source_search_input`);if(!e)return;e.focus()}else t.props.activeValue=void 0}))},t.context.handlers.listitemClick=(e,o)=>n=>{ji(t,e,o)},t.context.handlers.transferForward=Ki.bind(null,t,void 0),t.context.handlers.transferForwardAll=()=>{let e;if(t.props.maxReached)return;const o=t.props.sourceOptions.map((e=>De(e)));e=Array.isArray(t.value)?[...t.value,...o]:[...o],t.input(e),t.props.selectedSourceItems=[]},t.context.handlers.transferBackward=Ni.bind(null,t,void 0),t.context.handlers.transferBackwardAll=()=>{Array.isArray(t.value)&&(t.input([]),t.props.selectedTargetItems=[])},t.context.handlers.onSearch=e=>{!function(e,t){e.props.sourceSearchActive=!0;const o=t.target;e.props.inputText=o.value,Oe(e,o.value,!0)}(t,e)},t.context.handlers.onMouseenter=e=>o=>{"touchstart"!==o.type&&(e?t.props.mouseOnSource=!0:t.props.mouseOnTarget=!0)},t.context.handlers.onMouseleave=e=>o=>{var n;if("touchend"===o.type)return;const r=null===(n=t.props.__root)||void 0===n?void 0:n.getElementById(e?`${t.props.id}_source_list_items`:`${t.props.id}`);r&&(r.contains(o.relatedTarget)||(t.props.trackHover=!1,t.props.activeValue=void 0,t.props.activeDescendant=void 0,t.props.activeIndex=void 0,e?t.props.mouseOnSource=!1:t.props.mouseOnTarget=!1))},t.context.handlers.listitemClick=(e,o)=>n=>{n instanceof MouseEvent&&t.props.touchStarted||ji(t,e,o)},t.context.handlers.listitemTouchstart=()=>()=>{!function(e){e.props.touchStarted=!0}(t)},t.context.handlers.listitemTouchend=(e,o)=>n=>{!function(e,t,o,n){if(e.props.touchMoved)return e.props.touchMoved=!1,void(e.props.touchStarted=!1);const r=De(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>De(e)===r)),e.props.transferOnSelect?o?Ki(e,r):Ni(e,r):Ri(e,t,o)}(t,e,o)},t.context.handlers.listitemTouchmove=()=>e=>{!function(e){e.props.touchMoved=!0}(t)},t.context.handlers.sourceSearchFocus=e=>{Zi(t,!0)},t.context.handlers.sourceListFocused=e=>{Zi(t,!0)},t.context.handlers.targetListFocused=()=>{Zi(t,!1)},t.context.handlers.sourceListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.targetListBlurred=e=>{t.props.activeValue=void 0},t.context.handlers.sourceListKeydown=e=>{Gi(t,e,!0)},t.context.handlers.targetListKeydown=e=>{Gi(t,e,!1)},t.context.handlers.sourceSearchKeydown=e=>{Gi(t,e,!0)})}function ji(e,t,o,n){var r;if(De(t)===Bi)return void(null===(r=e.context)||void 0===r||r.handlers.loadMore(!0));const s=De(t);e.props.activeIndex=e.props.sourceOptions.findIndex((e=>De(e)===s)),e.props.transferOnSelect?o?Ki(e,s):Ni(e,s):Ri(e,t,o)}function Zi(e,t){const o=zi(e,t);o&&(e.props.sourceListOrigin=t,e.props.activeValue=De(o))}function Gi(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(De(t)),e}),[]);(null===(n=t.store.hasNextPage)||void 0===n?void 0:n.value)&&l.push(Bi);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}Wi(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(zi(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===Bi)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=>De(e)===t.props.activeValue));t.props.activeIndex=s;const a=r[s];if(!a)return;t.props.transferOnSelect?o?Ki(t,De(a)):Ni(t,De(a)):Ri(t,a,o)}(t,e,o)}function Xi(t){t.on("created",(()=>{if(t.props.skipSetActiveValue=!0,"function"==typeof t.props.optionsLoader&&Pe(t),Yi(t),t.props.disabled&&(t.props.draggable=!1),u){e.whenAvailable(t.props.id+"_source_list_items",(e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return e.props.sourceOptions.map((e=>De(e)))}function r(){return[]}const s={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=[],n.handleTouchmove(t)},draggable:e=>"option"===e.getAttribute("role")};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,e.props.activeDescendant=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(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,n.handleTouchstart(t)},selections:()=>e.props.selectedSourceItems.map((e=>De(e)))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})),e.on("prop:maxReached",(({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}))}(t,e)}),t.props.__root),e.whenAvailable(`${t.props.id}`,(e=>{e instanceof HTMLElement&&function(e,t){if(!e.context)return;function o(){return Array.isArray(e.value)?[...e.value]:[]}function r(t,o){e.props.sourceListOrigin=!0,e.input(t)}const s={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:[]};s.plugins=[n.multiDrag({handleDragstart(t){e.props.isDragging=!0,e.props.trackHover=!1,e.props.activeValue=void 0,n.handleDragstart(t)},handleEnd(t){n.handleEnd(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,n.handleTouchstart(t)},selections:()=>e.props.selectedTargetItems.map((e=>De(e)))})],n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s}),e.on("prop:disabled",(({payload:e})=>{s.disabled=e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})})),e.on("prop:draggable",(({payload:e})=>{s.disabled=!e,n.dragAndDrop({parent:t,getValues:o,setValues:r,config:s})}))}(t,e)}),t.props.__root);const o=e=>{var o;if(t.props.isDragging)return;t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const n=t.props.mouseOnSource?`${t.props.id}_source_list_items`:`${t.props.id}`,r=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(n);if(r){const o=r.getBoundingClientRect();e.clientX>o.x&&e.clientX<o.x+o.width&&e.clientY>o.y&&e.clientY<o.y+o.height&&(t.props.trackHover=!0)}};document.addEventListener("mousemove",o)}}))}function Ji(e,t){var o;let n=null,r="",s=[];if(e.props.mouseOnSource){if(n=Pi.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=Hi.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&&Pi.add(e),e.props.mouseOnTarget&&Hi.add(e),a.length&&Qi(e,a,null,t)}function Qi(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)?De(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 Wi(e);e.props.mouseOnSource||e.props.mouseOnTarget?e.props.mouseOnSource&&Pi.has(e)||e.props.mouseOnTarget&&Hi.has(e)?requestAnimationFrame(Qi.bind(null,e,t,o,n)):Ji(e,n):(Pi.delete(e),Hi.delete(e))}const ep={schema:/* #__PURE__ */Xl(/* #__PURE__ */ai(/* #__PURE__ */li("$label"),/* #__PURE__ */ni("$help"),/* #__PURE__ */Jl(/* #__PURE__ */ii(/* #__PURE__ */pi(/* #__PURE__ */di(),/* #__PURE__ */ci(/* #__PURE__ */Y("$optionsLoadingCounter > 0",/* #__PURE__ */ei("loader"),"$fns.getSourceItemCount($selectedSourceItems)"))),/* #__PURE__ */hi(/* #__PURE__ */vi(/* #__PURE__ */$i(),/* #__PURE__ */mi(/* #__PURE__ */ei("close")))),/* #__PURE__ */gi(/* #__PURE__ */Mi(/* #__PURE__ */Fi("$sourceEmptyMessage")),/* #__PURE__ */bi(/* #__PURE__ */Y("$transferOnSelect !== true && $fns.isSelected($option, $selectedSourceItems)",/* #__PURE__ */ei("selected")),/* #__PURE__ */yi("$option.label")),/* #__PURE__ */xi(/* #__PURE__ */Y("$state.loading && $optionLoadingCounter === 0 || $state.hasNextPage",/* #__PURE__ */wi(/* #__PURE__ */Y("$state.loading",/* #__PURE__ */ei("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))),/* #__PURE__ */Di(/* #__PURE__ */Ci(/* #__PURE__ */Ei("$ui.addAllValues.value"),/* #__PURE__ */ei("fastForward")),/* #__PURE__ */Ii(/* #__PURE__ */Ei("$ui.addSelectedValues.value"),/* #__PURE__ */ei("moveRight")),/* #__PURE__ */Oi(/* #__PURE__ */Ei("$ui.removeSelectedValues.value"),/* #__PURE__ */ei("moveLeft")),/* #__PURE__ */Ti(/* #__PURE__ */Ei("$ui.removeAllValues.value"),/* #__PURE__ */ei("rewind"))),/* #__PURE__ */_i(/* #__PURE__ */ki(/* #__PURE__ */ui(),/* #__PURE__ */fi("$fns.getTargetItemCount($selectedTargetItems)")),/* #__PURE__ */Si(/* #__PURE__ */Vi(/* #__PURE__ */Y("$state.loading !== true",/* #__PURE__ */Fi("$targetEmptyMessage"))),/* #__PURE__ */Li(/* #__PURE__ */Y("$transferOnSelect !== true && $fns.isSelected($option, $selectedTargetItems)",/* #__PURE__ */ei("selected")),/* #__PURE__ */Ai(/* #__PURE__ */Y("$fns.optionLoading($option, $optionLoaderValues)","$ui.isLoading.value","$option.label")))))),/* #__PURE__ */ri(/* #__PURE__ */si("$message.value")))),type:"input",props:[],features:[
55
+ /* #__PURE__ */o.defaultIcon("moveRight","right"),
56
+ /* #__PURE__ */o.defaultIcon("moveLeft","left"),
57
+ /* #__PURE__ */o.defaultIcon("fastForward","fastForward"),
58
+ /* #__PURE__ */o.defaultIcon("rewind","rewind"),
59
+ /* #__PURE__ */o.defaultIcon("close","close"),
60
+ /* #__PURE__ */o.defaultIcon("loader","spinner"),
61
+ /* #__PURE__ */o.defaultIcon("selected","check"),
62
+ /* #__PURE__ */o.localize("isLoading"),
63
+ /* #__PURE__ */o.localize("loadMore"),
64
+ /* #__PURE__ */o.localize("addAllValues"),
65
+ /* #__PURE__ */o.localize("addSelectedValues"),
66
+ /* #__PURE__ */o.localize("removeSelectedValues"),
67
+ /* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.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"]),t.props.loadMoreOption={label:"Load more",value:Bi},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=He.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map((e=>De(e)))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),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?(Oe(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),qi(e)),"function"==typeof e.props.optionLoader?Ui(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(t),Xi(t),function(t){t.on("prop:options",(()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),qi(t)})),t.on("prop:memoOptions",(()=>{t.props.skipSetActiveValue=!0,qi(t)})),t.on("prop:sourceOptions",(()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,Pi.delete(t)})),t.on("prop:targetOptions",(()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1})),t.on("prop:activeValue",(({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===Bi)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex((t=>e.eq(De(t),o)));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0})),t.on("prop:mouseOnSource",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,Pi.delete(t),Ji(t,e)}})),t.on("prop:mouseOnTarget",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,Hi.delete(t),Ji(t,e)}})),t.on("prop:optionsLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Me)})),t.on("prop:optionLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Me),t.props.skipSetActiveValue=!0,qi(t))}))}(t)}]};const tp=/* #__PURE__ */q("sl"),{outer:op,wrapper:np,inner:rp,icon:sp,label:ap,prefix:lp,suffix:ip,help:pp,messages:dp,message:cp}=/* #__PURE__ */z(tp),up=/* #__PURE__ */tp("chart",(()=>({$el:"div",if:"$chart"}))),fp=/* #__PURE__ */tp("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 + "%"'}}}}))),hp=/* #__PURE__ */tp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),vp=/* #__PURE__ */tp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),$p=/* #__PURE__ */tp("trackWrapper",(()=>({$el:"div"}))),mp=/* #__PURE__ */tp("trackInner",(()=>({$el:"div"}))),gp=/* #__PURE__ */tp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),bp=/* #__PURE__ */tp("linkedValues",(()=>({$el:"div"}))),yp=/* #__PURE__ */tp("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"}))),xp=/* #__PURE__ */tp("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"}))),wp=/* #__PURE__ */tp("marks",(()=>({$el:"div",if:"$marks"}))),_p=/* #__PURE__ */tp("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) + "%"'}}}))),kp=/* #__PURE__ */tp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Sp=/* #__PURE__ */tp("handles",(()=>({$el:"ul"}))),Lp=/* #__PURE__ */tp("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"}}))),Ap=/* #__PURE__ */tp("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"}}))),Dp=/* #__PURE__ */tp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Ip=/* #__PURE__ */tp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Cp=/* #__PURE__ */tp("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"}}))),Op=/* #__PURE__ */tp("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"}}))),Tp={schema:/* #__PURE__ */op(/* #__PURE__ */np(/* #__PURE__ */ap("$label"),/* #__PURE__ */pp("$help"),/* #__PURE__ */hp(/* #__PURE__ */sp("prefix"),/* #__PURE__ */lp(),/* #__PURE__ */vp(/* #__PURE__ */up(/* #__PURE__ */fp()),/* #__PURE__ */$p(/* #__PURE__ */mp(/* #__PURE__ */gp(),/* #__PURE__ */wp(/* #__PURE__ */_p(/* #__PURE__ */kp())),/* #__PURE__ */Sp(/* #__PURE__ */Ap(/* #__PURE__ */Op(),/* #__PURE__ */Dp()),/* #__PURE__ */Lp(/* #__PURE__ */Cp(),/* #__PURE__ */Ip()))))),/* #__PURE__ */ip(),/* #__PURE__ */sp("suffix"),/* #__PURE__ */Y("$showInput && $isMulti === false",/* #__PURE__ */yp())),/* #__PURE__ */Y("$showInput && $isMulti",/* #__PURE__ */bp(/* #__PURE__ */xp(),/* #__PURE__ */yp())),/* #__PURE__ */dp(/* #__PURE__ */cp("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){g();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=p(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return v(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function i(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){g();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=p(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function p(e,o=t.props.min,n=t.props.max){(e=[...e]).sort(((e,t)=>e.value-t.value)),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map(((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function d(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(c);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${i(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${i(r,e,o)}%`},t.props.fillStyles={left:`${i(r,e,o)}%`,width:i(n,e,o)-i(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${i(n,e,o)}%`}}function c(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function u(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([t.props.min,t.props.max]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(e)}return d(),void f()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1;t._value[n]=e;const[s,a]=[...t._value];if(s>=a){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=$([...t._value].sort(c))}else Array.isArray(e)?r=$(e):(r=$(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=m(r));const s=h(r);n&&t.input(s),d(),f()}function f(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(e),r&&r.input(o)}else r&&r.input(t._value)}function h(e){return t.props.isMulti&&Array.isArray(e)?[h(e[0]),h(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function v(e){return parseFloat(e.toFixed(t.props.decimals))}function $(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map((e=>v(Math.round(e/t.props.step)*t.props.step))):v(Math.round(e/t.props.step)*t.props.step);const o=p(t.props.intervals);if(Array.isArray(e))return e.map((e=>{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return v(n.value+Math.round((e-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return v(n.value+Math.round((e-n.value)/n.step)*n.step)}}function m(e){if(Array.isArray(e))return e[0]=m(e[0]),e[1]=m(e[1]),e;{const o=t.props.marks,n=o.reduce(((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t),o[0]);return n.at}}function g(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",(()=>{var s;g(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=parseFloat(`${t.props.min}`),t.props.max=parseFloat(`${t.props.max}`);const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const f=e.undefine(t.props.marks);t.props.marks=!!f&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):t.props.largestBar;const v={disabled:t.props.disabled,min:t.props.min,max:t.props.max,step:t.props.step};if(t.props.inputAttrs=t.props.inputAttrs&&"object"==typeof t.props.inputAttrs?Object.assign(v,t.props.inputAttrs):v,t.props.computedMaxInputAttrs=t.props.maxInputAttrs&&"object"==typeof t.props.maxInputAttrs?Object.assign({},t.props.inputAttrs,t.props.maxInputAttrs):t.props.inputAttrs,t.props.computedMinInputAttrs=t.props.minInputAttrs&&"object"==typeof t.props.minInputAttrs?Object.assign({},t.props.inputAttrs,t.props.minInputAttrs):t.props.inputAttrs,e.whenAvailable(`track-${t.props.id}`,(()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),u(t.value,!1),d()}),t.props.__root),t.context){let s=0,a="";const d=t.context.handlers.blur;t.context.handlers.blur=e=>{d(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=l(100*s),u(t._value)}else u(l(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,u(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,$,{passive:!1}),document.addEventListener(s,(()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,$),n&&e.target instanceof HTMLElement&&e.target.blur())}))},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout((()=>{"-"!==a?(u(parseFloat(a)*t),a=""):a=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=p(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=m(n),r=t.props.marks.find((e=>e.at===o)),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void u(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?u(t.props.min):u(t.props.max));if("Home"===e.key)return void u(t.props.min);if("End"===e.key)return void u(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){u(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?u(n+10*r):"PageDown"===e.key&&u(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))
68
+ return r(n);const s=parseFloat(n);return t.props.isMulti&&Array.isArray(t.value)?(t.value[1]=s,u(t.value)):u(s),/* #__PURE__ */r(h(s))}))},t.context.handlers.minNode=o=>{n=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))
69
+ return r(n);const s=parseFloat(n);return t.props.isMulti&&Array.isArray(t.value)?(t.value[0]=s,u(t.value)):u(s),/* #__PURE__ */r(h(s))}))},t.context.handlers.inputBlur=()=>{t.props.isMulti&&Array.isArray(t.value)&&(t.value.sort(c),n&&n.input(t.value[0]),r&&r.input(t.value[1]))},t.context.fns.calculateMarkPosition=e=>i(e,t.props.min,t.props.max)}function $(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect();u(l((r-s)/a*100))}u(t.value,!1)})),t.on("input",(({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||u(e,!1):t.value!==e&&u(e,!1)})),t.on("prop:max",(()=>{t.props.max=parseFloat(`${t.props.max}`),u(t.value)})),t.on("prop:min",(()=>{t.props.min=parseFloat(`${t.props.min}`),u(t.value)}))}]},Ep=/* #__PURE__ */q("cp"),{outer:Mp,wrapper:Vp,inner:Fp,label:Bp,prefix:Pp,suffix:Hp,help:Rp,messages:Kp,message:Np,icon:Wp}=/* #__PURE__ */z(Ep),qp=/* #__PURE__ */Ep("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'}}))),zp=/* #__PURE__ */Ep("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:""}}}}))),Up=/* #__PURE__ */Ep("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"}}}}}))),Yp=/* #__PURE__ */Ep("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"}}))),jp=/* #__PURE__ */Ep("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Zp=/* #__PURE__ */Ep("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),Gp=/* #__PURE__ */Ep("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),Xp=/* #__PURE__ */Ep("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 + "%"'}}))),Jp=/* #__PURE__ */Ep("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Qp=/* #__PURE__ */Ep("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),ed=/* #__PURE__ */Ep("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"}}))),td=/* #__PURE__ */Ep("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),od=/* #__PURE__ */Ep("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),nd=/* #__PURE__ */Ep("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"}}))),rd=/* #__PURE__ */Ep("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),sd=/* #__PURE__ */Ep("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),ad=/* #__PURE__ */Ep("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"}}]}))),ld=/* #__PURE__ */Ep("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),id=/* #__PURE__ */Ep("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),pd=/* #__PURE__ */Ep("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),dd=/* #__PURE__ */Ep("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"}}]}))),cd=/* #__PURE__ */Ep("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"}}]}))),ud=/* #__PURE__ */Ep("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"}}]}))),fd=/* #__PURE__ */Ep("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"}}]}))),hd=/* #__PURE__ */Ep("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"}}]}))),vd=/* #__PURE__ */Ep("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"}}]}))),$d=/* #__PURE__ */Ep("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"}}]}))),md=/* #__PURE__ */Ep("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"}}]}))),gd=/* #__PURE__ */Ep("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"}}))),bd=/* #__PURE__ */Ep("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),yd=/* #__PURE__ */Ep("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"}}}}))),xd=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,wd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function _d(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function kd(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[...Ld(t,o,n,r)]}function Sd(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,_d(255*t,2),_d(255*a,2),n]}function Ld(e,t,o,n=1){const r=_d(t/255,4),s=_d(o/255,4);if(1===s)return[e,0,100,n];const a=_d(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,_d(l,2),_d(100*a,2),n]}function Ad(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 Dd(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 Id(e,t,o,n=1){const[r,s,a,l]=Ad(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 Cd(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Od(e){if(e){if(Cd(e))return kd(e);if(e.startsWith("rgb")){const t=e.match(xd);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Dd(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(wd);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 Ld(o,_d(255*n,2),_d(255*r,2),s)}}}function Td(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Ed(e,t=150,o=!0){let n=null;return(...o)=>{const r=()=>{e(...o),n=null};n||(n=setTimeout(r,t))}}function Md(e){return!1!==e&&"false"!==e}function Vd(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const Fd={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const Bd={schema:/* #__PURE__ */Mp(/* #__PURE__ */Vp(/* #__PURE__ */Bp("$label"),/* #__PURE__ */Y("$inline && $help",/* #__PURE__ */Rp("$help")),/* #__PURE__ */Fp(/* #__PURE__ */Y("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Wp("prefix","label")),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Pp()),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */qp(/* #__PURE__ */ad(),/* #__PURE__ */Y("$showValue",/* #__PURE__ */zp()))),/* #__PURE__ */Y("$inline || $expanded)",/* #__PURE__ */Up(/* #__PURE__ */Y("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */Yp(/* #__PURE__ */Wp("close"))),/* #__PURE__ */Y("$panelControls",/* #__PURE__ */jp(/* #__PURE__ */Zp(/* #__PURE__ */Gp(),/* #__PURE__ */Xp()),/* #__PURE__ */rd(/* #__PURE__ */sd()),/* #__PURE__ */Jp(/* #__PURE__ */Qp(),/* #__PURE__ */ed()),/* #__PURE__ */td(/* #__PURE__ */od(),/* #__PURE__ */nd()),/* #__PURE__ */Y("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */ld(/* #__PURE__ */Wp("eyeDropper"))))),/* #__PURE__ */Y("$panelFormat",/* #__PURE__ */id(/* #__PURE__ */pd(/* #__PURE__ */Y('$panelActiveFormat === "hex"',/* #__PURE__ */dd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */cd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */ud()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */fd()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */vd()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */$d()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */md()),/* #__PURE__ */Y('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */hd())),/* #__PURE__ */gd(/* #__PURE__ */Wp("switch")))),/* #__PURE__ */Y("$options",/* #__PURE__ */bd(/* #__PURE__ */yd())))),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Hp()),/* #__PURE__ */Y("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Wp("suffix"))),/* #__PURE__ */Y("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */Rp("$help"))),/* #__PURE__ */Kp(/* #__PURE__ */Np("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=Ed((function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)}),2),f=Ed((function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)}),2),h=Ed(D,2),v=Ed(I,2),$=Ed(P,2),m=Ed(F,10,!1);function g(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Cd(o)&&!xd.test(o)&&!wd.test(o))return;(Cd(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout((()=>{t.props.hexInputFocused=!0}),10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=Od(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||_d(o,2)===t.props.h&&_d(r,2)===t.props.s&&_d(s,2)===t.props.v&&_d(a,2)===t.props.alpha)||(t.props.alpha=_d(a,2),P(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find((t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()}));if(n&&n.value){const e=Od(n.value);if(e){const[o,n,r,s]=e;t.props.alpha=_d(s,2),P(o,n,r)}else P(t.props.h,t.props.s,t.props.v)}else P(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(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 w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,(()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",(async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=kd(e.sRGBHex);t.props.alpha=1,P(n,r,s)}))}),t.props.__root))}function _(){k("canvas-ls",(e=>{r=e}),u,T),k("canvas-hue",(e=>{s=e}),A,E),k("canvas-alpha",(e=>{a=e}),f,M),S(`canvas-preview-${t.props.id}`,(e=>{l=e,D()}),h),S(`canvas-swatch-preview-${t.props.id}`,(e=>{i=e,I()}),v),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,(t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!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")}))}(l,t),t.addEventListener("mousedown",(t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=Fd[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),t.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=Fd[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),r)}function S(o,n,r){e.whenAvailable(o,(()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))}),t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,(()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach((e=>{x(e,C)})),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()}),t.props.__root)}function A(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function I(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Td(o),[l,i,p,d]=Sd(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 O(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function T(e){O(e,r,((e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;$(t.props.hue,n,s)}))}function E(e){O(e,s,((e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,$(t.props.h,t.props.s,t.props.v)}))}function M(e){O(e,a,((e,o)=>{const n=e/a.width*100/100;t.props.alpha=n,$(t.props.hue,t.props.s,t.props.v)}))}function V(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 F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,alpha:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${_d(0===o||100===o&&0===t?0:e,0)}-${_d(r,0)}-${_d(o,0)}-${_d(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function B(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function P(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:_d(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:_d(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:_d(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,alpha:p}=t.props,[d,c,u]=Sd(a,l,i),[f,h,v]=Ad(a,l,i),$=t.props.hexInputFocused?t.props.hex:Id(a,l,i,p),g=_d(p,2);t.props.hsla={h:a,s:c,l:u,a:g},t.props.hslaPercent={h:_d(a,0),s:100===i&&0===l?0:_d(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:_d(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:g},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${g})`,t.props.hslaStringPrecise=`hsla(${a}, ${_d(0===i?c/255:c/255*100,2)}%, ${_d(u/255*100,2)}%, ${g})`,t.props.rgba={r:f,g:h,b:v,a:g},t.props.rgbaString=`rgba(${f}, ${h}, ${v}, ${g})`,B($),setTimeout((()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),m(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))}),0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),h(),v()}t.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.alpha=t.props.alpha||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.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>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",(()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",g)})),t.on("created",(()=>{t.context&&("undefined"!=typeof window&&document.addEventListener("paste",g),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=Md(t.props.panelControls),t.props.eyeDropper=Md(t.props.eyeDropper),t.props.panelFormat=Md(t.props.panelFormat),t.props.showValue=Md(t.props.showValue),t.props.allowPaste=Md(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},P(0,0,0,!0)):b(`${t.value}`),t.on("input",(({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)})),setTimeout((()=>{w()}),5),_(),t.on("prop:expanded",(()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout((()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}})),t.context.fns.anyToHsvaString=(e,t)=>{const o=Od(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),`${_d(n,t)}-${_d(r,t)}-${_d(s,t)}-${_d(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Vd),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":P(o,n-s,r);break;case"ArrowRight":P(o,n+s,r);break;case"ArrowUp":P(o,n,r+s);break;case"ArrowDown":P(o,n,r-s);break;case"PageUp":P(o,n,r+10);break;case"PageDown":P(o,n,r-10);break;case"Home":P(o,n-10,r);break;case"End":P(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":P(o-s,n,r);break;case"ArrowRight":case"ArrowUp":P(o+s,n,r);break;case"PageUp":P(o+10,n,r);break;case"PageDown":P(o-10,n,r);break;case"Home":P(0,n,r);break;case"End":P(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,alpha:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.alpha=_d(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.alpha=_d(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.alpha=_d(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.alpha=_d(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.alpha=0;break;case"End":t.props.alpha=1}P(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,Cd(r)){const[e,o,n,s]=kd(r);t.props.alpha=s,B(r),P(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Cd(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=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.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}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Cd(o)&&B(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.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"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=Ld(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);P(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Dd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);P(e,o,n)}else"alpha"==e&&(t.props.alpha=i,P())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.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}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=Td(o.dataset.colorPrecise);t.props.alpha=s,P(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=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)}(p),c=p.length;let u=0,f=c,h=!1;const v=p[a].dataset.group;if(void 0!==v){const e=p.filter((e=>e.dataset.group===v));u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const $=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=$,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=$,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-$))),h=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-$))),h=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(h&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter((e=>e.dataset.group===v)),c=p.filter((t=>t.dataset.group===e)),h=(a-u)%i,$=t.length%i||i,m=a>=u+t.length-$;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(h,d),e-1)}else l>f&&(l=m?Math.min(f+Math.max(h,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach((e=>{delete e.parentElement.dataset.focused}));const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Ut,o.options,
70
+ /* #__PURE__ */o.defaultIcon("eyeDropper","color"),
71
+ /* #__PURE__ */o.defaultIcon("close","close"),
72
+ /* #__PURE__ */o.localize("close"),
73
+ /* #__PURE__ */o.localize("next")]},Pd=/* #__PURE__ */q("tb"),{outer:Hd,inner:Rd,wrapper:Kd,label:Nd,prefix:Wd,suffix:qd,help:zd,messages:Ud,message:Yd,icon:jd}=/* #__PURE__ */z(Pd),Zd=/* #__PURE__ */Pd("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"}}))),Gd=/* #__PURE__ */Pd("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"}}))),Xd=/* #__PURE__ */Pd("inputInner",(()=>({bind:"$attrs",$el:"span"}))),Jd=/* #__PURE__ */Pd("options",(()=>({$el:"ul",attrs:{id:"$id","data-vertical":'$vertical && "true" || "false"',"aria-labelledby":"$id"}}))),Qd=/* #__PURE__ */Pd("option",(()=>({$el:"li",for:["option","index","$options"],attrs:{key:"$option.value","data-index":"$index"}})));function ec(t,o){return o=(null==o?void 0:o.hasOwnProperty("__original"))?null==o?void 0:o.__original:null==o?void 0:o.value,t.props.multiple?!!Array.isArray(t.value)&&t.value.filter((t=>e.eq(t,o))).length>0:void 0!==o?e.eq(t.value,o):(t.props._isChecked=e.eq(t.value,t.props.onValue),t.props._isChecked)}const tc={schema:/* #__PURE__ */Hd(/* #__PURE__ */Y("$options",/* #__PURE__ */Kd(/* #__PURE__ */Nd("$label"),/* #__PURE__ */Jd(/* #__PURE__ */Qd(/* #__PURE__ */Gd(/* #__PURE__ */Y("$fns.isChecked($option) === true",/* #__PURE__ */Xd("$slots.default || $slots.on || $option.onLabel || $option.label"),/* #__PURE__ */Xd("$slots.default || $slots.off || $option.offLabel || $option.label")))))),/* #__PURE__ */Kd(/* #__PURE__ */Y("$label && ($slots.default || $slots.on || $onLabel)",/* #__PURE__ */Nd("$label")),/* #__PURE__ */Zd(/* #__PURE__ */jd("prefix"),/* #__PURE__ */Wd(),/* #__PURE__ */Y("$_isChecked === true",/* #__PURE__ */Xd("$slots.default || $slots.on || $onLabel || $label"),/* #__PURE__ */Xd("$slots.default || $slots.off || $offLabel || $label")),/* #__PURE__ */qd(),/* #__PURE__ */jd("suffix")))),/* #__PURE__ */zd("$help"),/* #__PURE__ */Ud(/* #__PURE__ */Yd("$message.value"))),type:"input",family:"button",props:["options"],features:[function(t){var o,n,r,s;t.addProps(["enforced","multiple","offLabel","offValue","onLabel","onValue","vertical","_isChecked"]),t.props._isChecked=!1,t.props.enforced=e.undefine(t.props.enforced),t.props.multiple=e.undefine(t.props.multiple),t.props.vertical=e.undefine(t.props.vertical),t.props.disabled=e.undefine(t.props.disabled),null!==(o=(r=t.props).onValue)&&void 0!==o||(r.onValue=!0),null!==(n=(s=t.props).offValue)&&void 0!==n||(s.offValue=!1),t.on("created",(()=>{var o;t.props._isChecked=ec(t,null),t.props.options&&t.props.multiple&&t.input(null!==(o=t.value)&&void 0!==o?o:[],!1),t.context&&(t.context.fns.isChecked=e=>ec(t,e),t.context.handlers.toggleValue=o=>n=>function(t,o,n){if(n.preventDefault(),o=o?De(o):o,t.props.options)if(t.props.multiple){const n=Array.isArray(t.value)?[...t.value]:[],r=n.findIndex((t=>e.eq(t,o)));r>-1&&(!t.props.enforced||n.length>1)?n.splice(r,1):-1===r&&n.push(o),t.input(n)}else e.eq(t.value,o)&&!t.props.enforced?t.input(void 0):t.input(o);else t.input(e.eq(t.value,t.props.onValue)?t.props.offValue:t.props.onValue)}(t,o,n))}))},o.options]},oc=/* #__PURE__ */q("ut"),{outer:nc,inner:rc,wrapper:sc,label:ac,prefix:lc,suffix:ic,help:pc,messages:dc,message:cc,icon:uc}=/* #__PURE__ */z(oc),fc=/* #__PURE__ */oc("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"}})));function hc(t){let o=null,n=!1;function r(e){var r,s,a;const p=(`${e}`.match(/\-/g)||[]).length%2==1;e=function(e){e=function(e){return e.replace(/[\u0660-\u0669\u06f0-\u06f9]/g,(e=>(15&e.charCodeAt(0)).toString()))}(`${e}`),isNaN(e)&&(e=e.split(o.decimal).map((e=>e.replace(/[^0-9]/g,""))).join("."));if(e=e.replace(/[^0-9\.]/g,""),e.includes(".")){const o=e.split(".");0===t.props.decimals?e=o[0]:(o[1]=o[1].padEnd(c(),"0").slice(0,c()),e=o.join("."))}return e}(e);const d={};"unit"===l()&&(d.minimumFractionDigits=e.includes(".")?1:0),d.maximumFractionDigits=c(),t.props.minDecimals&&(d.minimumFractionDigits=t.props.minDecimals,e.includes(".")||(e+=".".padEnd(t.props.minDecimals,"0"))),0===d.maximumFractionDigits&&e.includes(".")&&(e=e.split(".")[0]);let u="";isNaN(e)||""===e.trim()||(e=p?`-${e}`:e,t.props.max&&!isNaN(t.props.max)&&(e=`${Math.min(e,t.props.max)}`),t.props.min&&!isNaN(t.props.min)&&(e=`${Math.max(e,t.props.min)}`),e.includes(".")?e=e.split(".")[0].padStart(1,"0")+"."+(null!==(r=e.split(".")[1])&&void 0!==r?r:"0"):d.maximumFractionDigits=null!==(s=d.minimumFractionDigits)&&void 0!==s?s:0,u=i(t.props.displayLocale,d).format(e));let f,h=e.split(".");h=h[0]+(null!==(a=h[1])&&void 0!==a?a:"").padEnd(c(),"0"),h.length>1&&(h=h.replace(/^0+/,""),h=""!==e&&""===h?"0":h),t.props.valueStore={number:e,integer:h,string:u},n=!0,t.props.valueStore&&(f=t.props.valueStore.hasOwnProperty(t.props.valueFormat)?t.props.valueStore[t.props.valueFormat]:t.props.valueStore.number),t.input(""===f?void 0:f).then((()=>(n=!1,Promise.resolve())))}function s(){e.whenAvailable(`${t.props.id}`,(e=>{var o,n;e instanceof HTMLInputElement&&(e.value=null!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.string)&&void 0!==n?n:"")}),t.props.__root)}function a(){var e,o;const n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);return null!==(o=null==n?void 0:n.value)&&void 0!==o?o:""}function l(){return t.props.currency?"currency":"unit"}function i(e,o={}){const n=l(),r=Object.assign({},{style:n,roundingMode:"trunc"},o);return r[n]=t.props[n],new Intl.NumberFormat(e,r)}function p(){var e,n,r;const s=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`#${t.props.id}_inner input`);if(s){s.dataset.placeholder||(s.dataset.placeholder=null!==(n=s.getAttribute("placeholder"))&&void 0!==n?n:"");const e=((o.unitLeft?`${o.unit} `:"")+(null!==(r=s.dataset.placeholder)&&void 0!==r?r:"")+(o.unitLeft?"":` ${o.unit}`)).trim();s.setAttribute("placeholder",e)}}function d(e){var n;const r=null===(n=t.props.__root)||void 0===n?void 0:n.querySelector(`#${t.props.id}_inner input`);if(!r)return;const s=o.unit.length+o.literal.length;e=o.unitLeft?Math.max(e,s):Math.min(e,a().length-s),r.setSelectionRange(e,e)}function c(){return!1===t.props.decimals||"false"===t.props.decimals?0:isNaN(`${t.props.decimals}`)?o.fractionLength:t.props.decimals}t.props.valueStore=null,t.on("input",(({payload:e})=>{n||(r(e),s())})),t.on("mounted",(()=>{p()})),t.context&&(t.context.handlers.setPlaceholder=p,t.context.handlers.init=(e=null)=>{var n;!function(){var e,n,r,s,a,l,p;const d=i(t.props.displayLocale).formatToParts(12345678.12345678);o={decimal:null===(e=d.find((e=>"decimal"==e.type)))||void 0===e?void 0:e.value,group:null===(n=d.find((e=>"group"==e.type)))||void 0===n?void 0:n.value,unit:null===(r=d.find((e=>["unit","currency"].includes(e.type))))||void 0===r?void 0:r.value,unitLeft:["unit","currency"].includes(d[0].type),literal:null!==(a=null===(s=d.find((e=>"literal"==e.type)))||void 0===s?void 0:s.value)&&void 0!==a?a:"",fractionLength:null!==(p=null===(l=d.find((e=>"fraction"==e.type)))||void 0===l?void 0:l.value.length)&&void 0!==p?p:0}}();let a=null!==(n=null!=e?e:t._value)&&void 0!==n?n:"";t.props.valueStore?a=t.props.valueStore.number:"integer"===t.props.valueFormat&&(a=function(e){var t;return(parseFloat(`${e}`)/Math.pow(10,null!==(t=c())&&void 0!==t?t:0)).toString().replace(".",c())}(`${null!=a?a:""}`)),r(a),s()},t.context.handlers.handleBeforeInput=e=>{var n,s,a,l,i,p,c,u,f;if(!t.props.inExecCommand&&(e.preventDefault(),e.stopPropagation(),e.target instanceof HTMLInputElement)){const h=e.target,v=null!==(n=e.data)&&void 0!==n?n:"",$=null!==(s=e.target.value)&&void 0!==s?s:"",m=null!==(a=e.target.selectionStart)&&void 0!==a?a:0,g=null!==(l=e.target.selectionEnd)&&void 0!==l?l:0,b=g-m,y=$.indexOf(o.decimal);let x=(null!==(i=e.target.selectionStart)&&void 0!==i?i:0)+(e.data?0:-1),w=$,_=1;if($.includes(o.decimal)&&v===o.decimal)return v===o.decimal&&(x=w.indexOf(o.decimal)+1),void d(x);if(!(null===t.props.min||t.props.min<0||t.props.max<0)&&"-"===v)return;if(v.match(/[a-zA-Z]/))return;if(v===o.decimal&&(!1===t.props.decimals||"false"===t.props.decimals))return;if("deleteByCut"===e.inputType&&b>0&&(w=w.slice(0,m)+w.slice(g),x=g),"insertFromPaste"===e.inputType){const t=null!==(p=e.data)&&void 0!==p?p:"";w=w.slice(0,m)+t+w.slice(g)}if("deleteContentBackward"===e.inputType&&$[m-1]===o.group?(_+=1,x-=1):"deleteContentForward"===e.inputType&&$[m]===o.group&&(_+=1,x+=1),-1!==y&&x>y&&"insertText"===e.inputType?w=function(e,t,o){return e.substring(0,t)+o+e.substring(t+o.length)}(w,x,null!==(c=e.data)&&void 0!==c?c:"0"):"insertText"===e.inputType?(x=g,w=w.slice(0,m)+e.data+w.slice(g)):"deleteContentForward"===e.inputType?(x+=2,w=0===b?w.slice(0,m)+w.slice(g+_):w.slice(0,m)+w.slice(g)):"deleteContentBackward"===e.inputType&&(x+=1,0===b?w=w.slice(0,Math.max(m-_,0))+w.slice(g):b>0&&(w=w.slice(0,m)+w.slice(g))),"deleteContentForward"===e.inputType&&$[m]===o.decimal){const e=w.slice(m-1);w=w.slice(0,m),e.includes(o.unit)&&(w+=" "+o.unit)}else if("deleteContentBackward"===e.inputType&&$[m-1]===o.decimal){const e=w.slice(m-1);w=w.slice(0,m-1),e.includes(o.unit)&&(w+=" "+o.unit)}r(w),w=null!==(f=null===(u=t.props.valueStore)||void 0===u?void 0:u.string)&&void 0!==f?f:"",x=w.length-$.length+x,w.length===$.length&&(x+=e.inputType.includes("delete")?-1:1),h.setSelectionRange(0,$.length),t.props.inExecCommand=!0,document.execCommand("insertText",void 0,w),t.props.inExecCommand=!1,v===o.decimal?x=w.indexOf(o.decimal)+1:$.includes(o.decimal)&&!w.includes(o.decimal)&&(x=w.length),d(Math.max(0,x))}},t.context.handlers.handleInput=e=>{e.target instanceof HTMLInputElement&&(t.props.inputText=e.target.value,r(e.target.value))},t.context.handlers.handleKeyDown=e=>{var o,n;if(e.target instanceof HTMLInputElement&&("ArrowUp"===e.key||"ArrowDown"===e.key)){const l="ArrowUp"===e.key?1*t.props.step:-1*t.props.step;r(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!==(n=null===(o=t.props.valueStore)||void 0===o?void 0:o.number)&&void 0!==n?n:0,l)),s(),setTimeout((()=>{d(a().length)}),1)}})}const vc={schema:/* #__PURE__ */nc(/* #__PURE__ */sc(/* #__PURE__ */ac("$label"),/* #__PURE__ */rc(/* #__PURE__ */uc("prefix"),/* #__PURE__ */lc(),/* #__PURE__ */fc(),/* #__PURE__ */ic(),/* #__PURE__ */uc("suffix"))),/* #__PURE__ */pc("$help"),/* #__PURE__ */dc(/* #__PURE__ */cc("$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,$;const m=["unit","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(m),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=($=e.props).valueFormat)&&void 0!==i||($.valueFormat="number"),-1===["string","number"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(hc(e),e.context.handlers.init(),m.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()}))})))}))},o.options]},$c=/* #__PURE__ */q("cr"),{outer:mc,inner:gc,wrapper:bc,label:yc,prefix:xc,suffix:wc,help:_c,messages:kc,message:Sc,icon:Lc}=/* #__PURE__ */z($c),Ac=/* #__PURE__ */$c("input",(()=>({$el:"input",bind:"$attrs",attrs:{name:"$node.name",autocomplete:"$attrs.autocomplete || off",id:"$id",onChange:"$handlers.handleInput",onInput:"$handlers.handleInput",onKeydown:"$handlers.handleKeyDown",onBeforeinput:"$handlers.handleBeforeInput",readonly:"$readonly",disabled:"$disabled",inputmode:"decimal","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"}})));const Dc={schema:/* #__PURE__ */mc(/* #__PURE__ */bc(/* #__PURE__ */yc("$label"),/* #__PURE__ */gc(/* #__PURE__ */Lc("prefix"),/* #__PURE__ */xc(),/* #__PURE__ */Ac(),/* #__PURE__ */wc(),/* #__PURE__ */Lc("suffix"))),/* #__PURE__ */_c("$help"),/* #__PURE__ */kc(/* #__PURE__ */Sc("$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,$;const m=["currency","decimals","minDecimals","displayLocale","min","max","step","valueFormat"];e.addProps(m),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=($=e.props).valueFormat)&&void 0!==i||($.valueFormat="number"),-1===["string","number","integer"].indexOf(e.props.valueFormat)&&(e.props.valueFormat="number"),e.on("created",(()=>{e.context&&(hc(e),e.context.handlers.init(),m.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 Ic=/*#__PURE__*/Object.freeze({__proto__:null,autocomplete:hr,colorpicker:Bd,currency:Dc,datepicker:ol,dropdown:Yt,mask:Zl,rating:In,repeater:zo,slider:Tp,taglist:Sl,toggle:fo,togglebuttons:tc,transferlist:ep,unit:vc});const Cc="undefined"!=typeof window?setInterval:()=>0,Oc=new WeakSet;exports.$if=Y,exports.autocomplete=hr,exports.colorpicker=Bd,exports.createBaseSections=z,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){if(Oc.has(t)){const o=e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:m(13919),children:`${m(451228594)}${m(32863693)}`}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)};!function(e,t){L[e]?L[e].add(t):L[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(!c.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,s=n.substring(r,r+(n.length-6)),a=n.substring(0,r)+n.substring(r+s.length),l=a.slice(0,2),i=`${a[a.length-1]}${a[0]}`;Number(s)!==Math.floor(Number(a)*Number(l)/Number(i))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];Oc.add(o),o.define({...r,schema:n(e)})}Cc((()=>x.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}},exports.createSectionFactory=q,exports.currency=Dc,exports.datepicker=ol,exports.dropdown=Yt,exports.inputs=Ic,exports.mask=Zl,exports.rating=In,exports.repeater=zo,exports.slider=Tp,exports.taglist=Sl,exports.toggle=fo,exports.togglebuttons=tc,exports.transferlist=ep,exports.unit=vc;