@formkit/pro 1.0.0-alpha.33-06fc9e8 → 1.0.0-alpha.34

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.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.mjs +1 -1
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e,o){e in we||(we[e]={timer:0,inputs:new Set});const n=we[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=$e(t.bind(null,e),500)}function t(e){if(ge){window.addEventListener([30548127325,27022924,34729821653783].map(be).join("y"),(t=>{const n=new URL(t.blockedURI).hostname;he.some(((e,t)=>xe(t)===n))&&(o(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const n=be(18806588),r="://",i=(new Date).getDate(),s=async()=>{(e=>{clearTimeout(ye[e]),delete ye[e]})(e);const l=Array.from(we[e].inputs),a=l.filter((t=>!(_e[e]&&_e[e].has(t)))).join("");if(a){t++;try{const s=await window[be(16217489)](`${n}${r}${xe((i+t)%he.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${a}`)}`),p=await s.json();if(p[be(502357)])return o(e,p.schema);if(s.ok)return _e[e]||(_e[e]=new Set),void l.forEach((t=>_e[e].add(t)))}catch(e){}t<2&&$e(s,1e4*Math.random())}};s()}}function o(e,t){ke.add(e),function(e,t){Te[e]&&Te[e].forEach((e=>e(t)))}(e,t)}function n(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return ye[o]||(ye[o]=$e((()=>ke.add(o)),3e3)),ke.has(o)?null:t}function r(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function i(e){const t=e&&de.isObject(e)&&e.__v_raw;return t?i(t):e}function s(e,t){if(ge){const o=document.getElementById(e);if(o)return t(o);const n=new MutationObserver((()=>{const o=document.getElementById(e);o&&(n.disconnect(),t(o))}));n.observe(document.body,{childList:!0,subtree:!0})}}function l(e){return de.isRecord(e)&&"value"in e&&"label"in e}function a(e,t,o,r){return(...i)=>s=>l=>{const a=function(e,t,o,r,i,s){const l=s[o],a="function"==typeof r?r():{$el:r},d=i.map((e=>"string"==typeof e?e:e(t)(s)));let c=d.length&&a?ue.extendSchema(a,{children:d}):a;if(c=ue.extendSchema(c,l),"object"==typeof c){let r=c;if(!ce.isDOM(c)&&!ce.isComponent(c)||c.meta||(c.meta={section:o}),ce.isDOM(c)){const{$el:i,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${o}`,...s.attrs}):s.attrs={class:`$classes.${o}`},r=p(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:n.bind(null,i,t,e)}))}else if(ce.isComponent(c)){const{$cmp:i,...s}=c;r=p(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:n.bind(null,i,t,e)}))}else"$formkit"in c&&(c.outerClass=`$classes.${o}`);return r}return p(t,o,c)}(e,s,t,o,i,l);return r&&de.isRecord(a)&&(a.memo=e+JSON.stringify(l)),r?[a]:a}}function p(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 d(e){return(t,o,n=!1)=>a(e,t,o,n)}function c(e){return{outer:e("outer",Ie,!0),wrapper:e("wrapper","div",!1),inner:e("inner",Oe,!1),icon:We,label:e("label",Me,!1),prefix:e("prefix",He,!1),suffix:e("suffix",He,!1),help:e("help",De,!1),messages:e("messages",Ve,!1),message:e("message",Be,!1)}}function u(e,t,o){return n=>r=>{const i="string"==typeof t?t:t(n)(r);return o?{if:e,then:i,else:"string"==typeof o?o:o(n)(r)}:(ue.isSlotCondition(i)?Object.assign(i.else,{if:e}):ue.isSchemaObject(i)&&Object.assign(i,{if:e}),i)}}function f(e){return"__original"in e?e.__original:e.value}function m(e,t=!0){e.store.set(ze),e.props.loadingCounter++,e.store.set(ce.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,Ne.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function v(e,t,o){const n=ue.normalizeOptions(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=f(r))}function g(e,t){new MutationObserver((()=>{const o=e.props.positionListBox(t);Re.delete(e),h(e,o);let n,r=null;const i=new ResizeObserver((()=>{clearTimeout(n),n=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),r||(r=e.on("prop:expanded",(()=>{i.disconnect(),e.off(r)})))}),100)}));i.observe(t)})).observe(t,{childList:!0,subtree:!0})}function h(e,t){if(!e.props.expanded||!e.props.options||!e.props.options.length||Re.has(e))return;const o=e.props.options.reduce(((t,o,n)=>{var r;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const i=document.getElementById(`${e.props.id}_listitem_${n}`);return i&&t.push([i,o]),t}),[]),n=document.getElementById(`${e.props.id}_load_more`);n&&o.push([n,e.props.loadMoreOption]),Re.add(e),o.length&&b(e,o,t)}function $(e,t){let o=null;if(e.props.activeDescendant){o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>de.eq(e.value,f(t)))),-1===o&&(o=null);document.getElementById(e.props.activeDescendant)&&x(e)}if("undefined"==typeof window)return o;const n=t.getBoundingClientRect(),r=document.getElementById(`${e.props.id}`);if(r){const t=r.getBoundingClientRect();t.top+t.height+n.height>window.innerHeight&&t.top+t.height>n.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return o}function y(){}function b(e,t,o){var n,r,i;const s=document.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const n=s?s.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const i=(t,n)=>{var r;const i=n[0],{y:s,height:l,x:a,width:p}=i.getBoundingClientRect();if(e.props.mouseX>a&&e.props.mouseX<a+p&&e.props.mouseY>s&&e.props.mouseY<s+l){o=t;const i=n[1];return e.props.activeValue=i&&!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)?f(i):void 0,!0}return!1};do{if(null!==n&&i(n,t[n]))break;if(null!==r&&i(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||x(e),e.props.expanded?(s&&e.props.loadOnScroll&&!(null===(n=e.store.loading)||void 0===n?void 0:n.value)&&(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&s.scrollTop+s.offsetHeight>s.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!1)),Re.has(e)?requestAnimationFrame(b.bind(null,e,t,o)):h(e,o)):Re.delete(e)}function x(e){const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(e.props.activeDescendant);if(!t||!o)return;const{y:n,height:r}=o.getBoundingClientRect(),{y:i,height:s}=t.getBoundingClientRect();n<i?(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop):n+r>i+s&&(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop+r-s)}function w(e,t){e.props.page++,Ne.set(e,t),e.store.set(ce.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function _(...e){return t=>{t.addProps(["activeDescendant","activeValue","dropdownWrapperStyles","expanded","hasNextPage","isLoadingOption","listboxStyles","loadMoreOption","loadOnScroll","option","optionLoader","options","optionsLoader","page","placeholder","selections"]),t.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},t.props.page=1,t.props.loadMoreOption={label:"Load more",value:je},t.props.listboxStyles={},t.props.styleWrapper=y.bind(null,t),t.props.positionListBox=$.bind(null,t),t.props.hasNextPage=w.bind(null,t),t.props.applyLoadedOptions=v,t.props.loadingCounter=0,t.props.disabled=de.undefine(t.props.disabled),t.on("created",(()=>{if(!t.context)return;t.props.trackHover=!0,t.props.loadOnScroll=de.undefine(t.props.loadOnScroll),t.context.touch=()=>{var e;null===(e=t.context)||void 0===e||e._value},t.context.handlers.loadMore=e=>{var o;t.props.didLoadMore=!0,setTimeout((()=>{t.props.didLoadMore=!1}),300),e instanceof MouseEvent&&(t.props.ignoreClickAway=!0,null===(o=document.getElementById(`${t.props.id}`))||void 0===o||o.focus()),m(t)},t.context.handlers.click=e=>{if(t.props.disabled)return;document.getElementById(`${t.props.id}`)&&"mouse"!==e.pointerType?(t.props.mouseX=-1,t.props.mouseY=-1):(t.props.mouseX=e.clientX,t.props.mouseY=e.clientY),t.emit("click",e)};const e=t.context.handlers.blur;t.context.handlers.blur=o=>{t.props.expanded?setTimeout((()=>e(o)),300):e(o),t.emit("blur")},t.context.handlers.keydown=e=>{t.props.disabled||(t.props.trackHover=!1,t.emit("keydown",e))},t.context.handlers.selectOption=e=>()=>{t.emit("optionSelected",e)},t.context.fns.isActive=e=>de.eq(t.props.activeValue,f(e))||void 0,Pe&&(s(`${t.props.id}_dropdown_wrapper`,(e=>{"overscroll"!==t.props.behavior&&"none"===getComputedStyle(e).maxHeight&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,maxHeight:"400px"})})),s(`${t.props.id}_dropdown_wrapper`,g.bind(null,t)))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e?"999":"-1",pointerEvents:e?"auto":"none"}}));const o=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};if(t.on("prop:trackHover",(({payload:e})=>{var n,r;Pe&&(e?null===(r=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===r||r.removeEventListener("scroll",o):null===(n=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===n||n.addEventListener("scroll",o))})),t.on("prop:activeValue",(({payload:e})=>{if(e===je)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const o=t.props.options.findIndex((t=>de.eq(f(t),e)));t.props.activeDescendant=o>=0?`${t.props.id}_listitem_${o}`:void 0})),"undefined"!=typeof window){const e=e=>{e.target&&e.target instanceof Element&&e.target.closest(`#${t.props.id}_listbox`)||t.props.ignoreClickAway?t.props.ignoreClickAway=!1:(t.props.searchValue="",t.props.expanded=!1)},o=e=>{t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const o=document.getElementById(`${t.props.id}_dropdown_wrapper`);if(o){const n=o.getBoundingClientRect();e.clientX>n.x&&e.clientX<n.x+n.width&&e.clientY>n.y&&e.clientY<n.y+n.height&&(t.props.trackHover=!0)}};t.on("prop:expanded",(({payload:n})=>{n?(setTimeout((()=>document.addEventListener("click",e)),10),t.props.styleWrapper(),document.addEventListener("mousemove",o),t.props.optionsLoader&&0===t.props.options.length&&m(t)):(document.removeEventListener("click",e),document.removeEventListener("mousemove",o))}))}t.on("prop:loadingCounter",(({payload:e})=>{0===e&&t.store.set(Ke)})),Pe&&window.addEventListener("blur",(e=>{e.target===window&&t.props.expanded&&(t.props.expanded=!1)})),e.map((e=>e(t)))}}function k(e,t,o){const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:l(e)?e:de.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},i=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);return n instanceof Promise?(e.props.loadingCounter++,e.store.set(ze),S(e),n.then((e=>{if("string"==typeof e||l(e))return i(r(e))})).finally((()=>{e.props.loadingCounter--}))):i(r(n))}function T(e){return t=>{t.on("commit",(({payload:o})=>{if(qe&&void 0!==o&&"function"==typeof t.props.optionLoader){const n=e(t,o);if(t.props.multiple&&Array.isArray(o))if(o.forEach((e=>k(t,e,Array.isArray(n)&&n.find((t=>de.eq(t.value,e)))))),t.props.loadingCounter){t.props.isLoadingOption=!0;const n=t.on("prop:loadingCounter",(()=>{t.props.loadingCounter||(t.props.isLoadingOption=!1,S(t,e(t,o)),t.off(n))}))}else S(t,e(t,o));else if(!t.props.multiple&&!Array.isArray(n)&&o){const e=k(t,o,n);e instanceof Promise?(t.props.isLoadingOption=!0,e.then((e=>{S(t,e,o),t.props.isLoadingOption=!1}))):S(t,e,o)}return}const n=e(t,o);if(!qe||n||void 0===o||t.props.options&&t.props.options.length||"function"!=typeof t.props.optionsLoader)S(t,n,o);else{const n=m(t);S(t),n.then((()=>{S(t,e(t,o),o)}))}}))}}function E(e,t){const o=Array.isArray(e.props.options)?e.props.options:[],n=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(o);return!!n.length&&(e.props.multiple?!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const o=n.find((e=>de.eq(t,f(e))));return o&&e.push(o),e}),[]):n.find((e=>de.eq(f(e),t)))||!1)}function L(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>de.eq(f(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function S(e,t,o){var n;if(e.props.multiple&&Array.isArray(t))return e.props.option={label:t.map((e=>e.label)).join(", "),value:e.value},void(e.props.selections=t);"string"==typeof t?e.props.option={label:t,value:o}:t?e.props.option=t:t||null==o||(null===(n=e.store.loading)||void 0===n?void 0:n.value)?(e.props.option={label:e.props.placeholder||" ",value:void 0,isPlaceholder:!0},e.props.selections=[]):e.props.option={label:o,value:o},e.props.option.isPlaceholder||(e.props.selections=[e.props.option])}function A(e){e.on("keydown",(({payload:t})=>{var o,n;if("Tab"===t.key&&e.props.expanded)t.preventDefault();else if(["ArrowDown","ArrowUp"].includes(t.key)&&e.props.expanded){t.preventDefault(),t.stopPropagation();const n=e.props.options;if(!Array.isArray(n)||!n.length)return;const r=n.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(f(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&r.push(je);const i=r.indexOf(e.props.activeValue);-1===i&&r.length?e.props.activeValue=r[0]:"ArrowDown"===t.key&&r.length>i+1?e.props.activeValue=r[i+1]:"ArrowUp"===t.key&&i>0&&(e.props.activeValue=r[i-1])}else if(!e.props.expanded&&["ArrowDown","Up","Down","ArrowUp","Enter"].includes(t.key)&&e.props.id===(null===(n=document.activeElement)||void 0===n?void 0:n.id))t.preventDefault(),!e.props.expanded&&e.isSettled&&(e.props.expanded=!0);else if("Enter"===t.key&&e.props.expanded){if(t.preventDefault(),e.props.activeValue===je)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>de.eq(f(t),e.props.activeValue)));o&&e.emit("optionSelected",o)}else["Esc","Escape"].includes(t.key)?(t.preventDefault(),e.props.expanded=!1):e.emit("unusedKeyDown",t)}))}function C(e){e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t=>de.eq(e.value,f(t)))})),e.on("prop:expanded",(({payload:t})=>{t&&L(e)})),e.on("optionSelected",(({payload:t})=>{var o,n,r;f(t)!==je?(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||(e.props.skipNextFilter=!0,e.input(f(t)),e.props.expanded=!1,e.props.id&&(null===(r=document.getElementById(e.props.id))||void 0===r||r.focus())):null===(o=e.context)||void 0===o||o.handlers.loadMore()}))}function I(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant"}}))),n=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$fns.isSelected($option)","data-is-active":"$fns.isActive($option)"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.loadMore","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)"}}))),i=e("loadMoreInner","span"),s=e("option","div");return()=>t(o(n(u("$fns.isSelected($option)",We("selected")),s("$option.label")),r(i(u("$state.loading",We("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))}function O(e){if("undefined"==typeof window)return;const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(`${e.props.id}`);if(!o||!t)return;const n=t.style.paddingTop,r=t.style.paddingBottom,i=t.style.paddingLeft;t.style.paddingTop="0",t.style.paddingBottom="0",t.style.paddingLeft="0";const s=o.getBoundingClientRect(),l=t.getBoundingClientRect(),a=Math.round(s.top-l.top)+"px",p=Math.round(s.left-l.left-5)+"px",d=Math.max(Math.round(Math.min(l.height-l.top,window.innerHeight)-(s.top+s.height)),0)+"px";t.style.paddingTop=n,t.style.paddingBottom=r,t.style.paddingLeft=i,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:a,paddingLeft:p,paddingBottom:d},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${s.width+"px"}, calc(100vw - 4em))`:s.width+"px",maxWidth:"calc(100vw - 4em)"}}function M(e,t){let o=null;if(e.props.activeDescendant){const n=document.getElementById(e.props.activeDescendant);if(!n)return o;e.props.ignoreScroll=!0;const r=document.getElementById(`${e.props.id}_listbox`);if(!r)return o;const i=t.getBoundingClientRect(),s=r.getBoundingClientRect(),l=parseInt(getComputedStyle(t).paddingTop),a=parseInt(getComputedStyle(t).paddingBottom),p=n.offsetTop-l,d=Math.max(p-l,0),c=Math.max(t.scrollHeight-a-p-i.height,0),u=s.height-d-c;t.scrollTop=p;const m=()=>{t.scrollTop=c>0?c<l?t.scrollHeight:l:d<a?0:p-a},v=Math.min(150,s.height);d>0&&c>0||0===d&&0===c||u>v?t.scrollTop=p:m();t.clientHeight/2<t.scrollTop&&(o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>de.eq(e.value,f(t))))),-1===o&&(o=null)}return o}function V(e){return"radio"===e.props.type&&(e.props.altName=`${e.name}_${oo++}`),!0}function B(e){return!de.isObject(e)||"__key"in e||"__shim"in e||Object.defineProperty(e,"__key",{enumerable:!1,writable:!0,value:de.token()}),e}function D({payload:e}){if(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(e.props.disabled=de.undefine(e.props.disabled),Array.isArray(e.value))if(e.value.length<e.props.min){const t=r(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(r(e.props.min,(()=>({}))),!1);e.context&&(e.context.fns.createRemover=e=>()=>{var t,o;null===(t=ce.getNode(e))||void 0===t||t.each((e=>e.destroy())),null===(o=ce.getNode(e))||void 0===o||o.destroy()},e.context.fns.createInsert=t=>()=>{if(Array.isArray(e.value)){const o=e.value.findIndex((e=>e.__key===t)),n=e.value;n.splice(o+1,0,{}),e.input(n,!1)}},e.context.fns.createShift=(e,t)=>()=>{const o=ce.getNode(e);if(!o||!o.parent)return;const n=o.index+t;n>=0&&n<o.parent.children.length&&(o.index=o.index+t)},e.context.fns.createAppend=()=>()=>{if(Array.isArray(e.value)){const t=e.value;t.push({}),e.input(t,!1)}})}function H(e,t){const o=e._c.children.find((e=>e.props.id===t));o&&(o.props.preserve=!0,o.destroy())}function W(e,t,o,n){if(Array.isArray(e)){const r=function(e,t){const o=e.map((e=>e.__key));return t.children.reduce(((e,t,n)=>{const r=t.props.id;return r&&!o.includes(r)&&e.set(n,r),e}),new Map)}(e,t);e.forEach(((i,s)=>{B(i);const[l,a]=function(e,t,o,n,r){if(!o.has(e.__key)&&!e.__shim&&!Object.isFrozen(e)){const i=r&&r.get(t);e.__key=de.token();const s=Object.freeze(Object.defineProperties({},{__key:{value:e.__key},__original:{value:e},__index:{value:t},__prevKey:{value:i}}));return o.add(e.__key),n.value++,[!0,s]}return[!1,e]}(i,s,o,n,r);l&&(e.splice(s,1,a),H(t,a.__prevKey),r.delete(s))})),r.size&&r.forEach((o=>{const n=e.findIndex((e=>e.__key===o));-1!==n&&e.splice(n,1),H(t,o)})),no.delete(t)}return e}function R(e,t){t.sort(((e,t)=>"__shim"in e||"__shim"in t?"__shim"in t&&!("__shim"in e)?-1:1:"__index"in e&&"__index"in t?e.__index>t.__index?1:-1:0)),e._c.children.sort(((e,o)=>{const n=t.findIndex((t=>t.__key===e.props.id)),r=t.findIndex((e=>e.__key===o.props.id));return-1!==n&&-1!==r?n>r?1:-1:-1===n&&-1==r?0:n>-1?1:-1}))}function N(e,t){return"group"===t.type&&t.hook.input(((o,n)=>(void 0===o?o={__shim:!0}:(B(o),e.has(o.__key)||o.__shim||!t.parent||no.add(t.parent)),n(o)))),!1}function P(e,t,o){void 0===e.props[t]&&(e.props[t]=o)}function z(e,t){var o;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let n;t instanceof MouseEvent?n=t.clientX:(n=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let r=q(e,n,t.currentTarget)||0;r=r>e.props.min?r:e.props.min,r=r<e.props.max?r:e.props.max,e.input(r),null===(o=document.getElementById(`${e.props.id}`))||void 0===o||o.focus()}}function K(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){F(e,q(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function j(e){F(e)}function q(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function X(e){setTimeout((()=>{const t=document.getElementById(`${e.props.id}`);t&&(e.props.wrapperWidth=`0 0 ${t.offsetWidth/e.props.max}px`)}))}function F(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function Y(e,t,o){const n=So.get(e);if(n===e.props.searchValue||!n&&!e.props.searchValue)return v(e,t,o);const r=ue.normalizeOptions(o);e.props.options=r,L(e),So.set(e,e.props.searchValue)}function U(e){var t;e.props.expanded=!e.props.expanded,e.props.expanded&&(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus())}function Z(e,t,o=!0){return()=>{e.props.multiple?e.emit("optionRemoved",t):(e.input(void 0),e.props.searchValue=""),o&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)}}function J(e,t=!1){if("function"==typeof e.props.optionsLoader){if(t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(Eo.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Eo.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else Array.isArray(e.props.options)&&(To.add(e),"string"==typeof e.props.searchValue&&(e.props.options=e.props.initialOptions.filter((t=>e.props.filter(t,e.props.searchValue)))));e.props.skipNextFilter=!1,L(e)}function G(e,t){var o;const n=e.props.highlightedRange,r=n.index,i=n.start+(r?1:0),s=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[i,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-s+(t.length-1>n.index?-1:0)]}function Q(e,t){const o=document.getElementById(`${e.props.id}`);if(o instanceof HTMLInputElement){const n=Ao.get(e);if(n){const[e,r]=n,i=t.touches[0].clientX-r;o.scrollLeft=e-i}else Ao.set(e,[o.scrollLeft,t.changedTouches[0].clientX])}}function ee(e){Ao.delete(e)}function te(e,t){const o=t.target;e.props.expanded=!0,e.props.searchValue=o.value,""===e.props.searchValue&&e.input(void 0)}function oe(e,t){const o=t.target.value;e.props.inputText=o,e.props.expanded=!0,"option"!==e.props.selectionAppearance?""===o?(e.props.searchValue=null,e.input([])):!e._value||Array.isArray(e._value)&&!e._value.length?e.props.searchValue=o:Array.isArray(e._value)&&e._value.length&&(e.props.searchValue=function(e){var t;const o=ne(e);if(e.props.highlightedRange){const[t,n]=G(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.searchValue=o}function ne(e){const t=e.props.getSelections(e,e._value);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const i=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let s=0;return t.length-1!==n&&s++,0!==n&&s++,e.push({option:o,index:n,start:i,end:i+o.label.length+s}),e}),[]):[]}function re(e){clearTimeout(Lo.get(e)),Lo.set(e,setTimeout((()=>{var t,o,n;const r=document.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const i=ne(e),s=i.findIndex((e=>null!==r.selectionStart?r.selectionStart>=e.start&&r.selectionStart<=e.end:null!==r.selectionEnd&&(r.selectionEnd>=e.start&&r.selectionEnd<=e.end))),l=null===(t=i[i.length-1])||void 0===t?void 0:t.end;if(0===r.selectionStart&&r.selectionEnd===(null===(o=e.props.inputText)||void 0===o?void 0:o.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(i.length){const t=e.props.highlightedRange,[o,n]=G(e,i);if(null!==r.selectionEnd&&(r.selectionEnd<o||r.selectionEnd>n)){const i=t.end-t.start-(n-o),s=r.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,r.value=e.props.inputText,r.selectionStart=r.selectionEnd=s+(s>o?i:0)}}}else if(s>=0&&null!==r.selectionStart&&(l!==(null===(n=e.props.inputText)||void 0===n?void 0:n.length)||r.selectionStart<l)){const t=i[s],o=e.props.inputText.substr(0,l),n=t.start+(t.index>0?1:0),a=t.end+(i.length-1>t.index?-1:0);o!==e.props.inputText&&(e.props.inputText=o,r.value=o),e.props.highlightedRange=t,r.selectionStart=n,r.selectionEnd=a}else e.props.highlightedRange=void 0,e.emit("scrollToEnd");if(null!==r.selectionStart&&r.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)&&null===e.props.searchValue){const t=e.props.inputText.substring(0,l);e.props.inputText=`${t}, ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}function ie(e){"option"===e.props.selectionAppearance?(e.on("prop:option",(()=>{e.props.inputText="",void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("blur",(()=>{e.props.inputText=""})),e.on("optionSelected",(({payload:t})=>{t.value!==je&&(e.props.expanded=!1)}))):function(e){e.props.searchValue=null;const t=(t,o=!1)=>{var n;const r=document.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const i=ne(e),s=t>=0?t:i.length-1;if(void 0===i[s])return!1;const l=null===(n=i[s])||void 0===n?void 0:n.end;return null!==r.selectionStart&&(!o||r.selectionStart>=l&&r.selectionStart<=l+2)&&(r.selectionStart=i[s].start+(s>0?1:0),r.selectionEnd=i[s].end+(s<i.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("keydown",(({payload:o})=>{var n,r,i,s;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){const t=ne(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["Delete","Backspace"].includes(o.key)?e.props.highlightedRange&&!e.props.searchValue?e.emit("optionRemoved",e.props.highlightedRange.option):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault()):o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(i=e.props.inputText)||void 0===i?void 0:i.length)&&(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&0===e.props.selections.length&&o.preventDefault();"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault(),re(e)})),e.on("prop:highlightedRange",(({payload:t})=>{t&&e.props.expanded&&o!==t.option&&(o=t.option,e.props.activeValue=f(t.option))})),e.on("scrollToEnd",(()=>{const t=document.getElementById(`${e.props.id}`);t&&t.scrollTo({left:t.scrollWidth,behavior:"smooth"})})),e.on("prop:option",(({payload:t})=>{if(!t.isPlaceholder){let o="";if(Io){const t=document.getElementById(`${e.props.id}`);document.activeElement===t&&Array.isArray(e._value)&&e._value.length&&(o=", ")}e.props.inputText=t.label+o}})),e.on("blur",(()=>{if(e._value){const t=e.props.option;de.isRecord(t)&&void 0!==t.value?e.props.inputText=t.label:e.props.inputText=""}else e.props.inputText=""}))}(e),e.on("commit",(()=>{void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("created",(()=>{if("option"!==e.props.selectionAppearance&&function(e){s(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Co.set(t,e)})),Io&&!Oo&&(Oo=!0,document.addEventListener("selectionchange",(()=>{if(document.activeElement instanceof HTMLInputElement&&Co.has(document.activeElement)){const e=Co.get(document.activeElement);e&&re(e)}})))}(e),e.props.option&&Array.isArray(e.props.option.value))for(const t of e.props.option.value)e.props.initialOptions.find((o=>{f(o)===t&&e.props.memoOptions.push(o)}));e.context&&(e.context.handlers.input=oe.bind(null,e))})),e.on("optionRemoved",(async({payload:t})=>{if(Array.isArray(e._value)){let o=-1;await e.input(e._value.filter(((e,n)=>e!==f(t)||(o=n,!1)))),e._value.length?setTimeout((()=>e.emit("selectRange",[o])),20):e.props.expanded=!1}})),e.on("prop:expanded",(({payload:t})=>{t||(e.props.searchValue=null)}))}function se(e){return t=>{let o;t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter"]),t.props.memoOptions=[],t.props.initialOptions=t.props.options,t.props.applyLoadedOptions=Y,t.props.getSelections=e,t.props.nonceKey="searchValue",t.props.multiple=de.undefine(t.props.multiple),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.props.selectionStyles={position:"absolute",pointerEvents:"none",width:"100%",left:"0",top:"0",bottom:"0",opacity:"0",overflow:"hidden"},t.props.multiple?(!function(e){function t(t){return!!Array.isArray(e.value)&&e.value.some((e=>de.eq(e,f(t))))}e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t)})),e.on("optionSelected",(({payload:o})=>{var n,r,i;if(f(o)===je)return void(null===(n=e.context)||void 0===n||n.handlers.loadMore());if(null===(r=null==o?void 0:o.attrs)||void 0===r?void 0:r.disabled)return;const s=Array.isArray(e._value)?e._value:[];t(o)?e.emit("optionRemoved",o):(e.props.memoOptions=[...e.props.memoOptions,o],e.props.highlightedRange?(s.splice(e.props.highlightedRange.index,1,f(o)),e.input(s),e.props.highlightedRange=void 0,e.props.expanded=!1):(e.input(s.concat(f(o))),e.emit("scrollToEnd"))),e.props.id&&(null===(i=document.getElementById(e.props.id))||void 0===i||i.focus())}))}(t),ie(t)):(C(t),function(e){e.props.searchValue="",e.on("created",(()=>{e.context&&(e.context.handlers.input=te.bind(null,e))})),e.on("input",(({payload:t})=>{const o=e.props.getSelections(e,t);e.props.searchValue=o&&(null==o?void 0:o.label)||e.props.searchValue,e.props.selectionStyles={...e.props.selectionStyles,opacity:void 0===t?"0":"1",pointerEvents:void 0===t?"none":"auto"}})),e.on("optionSelected",(({payload:t})=>{t.value!==je&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)})),e.on("prop:option",(({payload:t})=>{de.isRecord(t)&&!t.isPlaceholder?e.props.searchValue=t.label:t.isPlaceholder&&(e.props.searchValue="")})),e.on("blur",(()=>{setTimeout((()=>{var t;if(e.props.didLoadMore)return e.props.didLoadMore=!1,void(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus());if(e._value){const t=e.props.option;de.isRecord(t)&&void 0!==t.value?e.props.searchValue=t.label:e.props.searchValue=""}else e.props.searchValue=""}),150)}))}(t)),t.on("prop:options",(({payload:e})=>{"function"!=typeof t.props.optionsLoader&&(To.has(t)?To.delete(t):(t.props.initialOptions=[...e],setTimeout((()=>J(t)),0)))})),t.on("click",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("created",(()=>{t.props.openOnClick=de.undefine(t.props.openOnClick),t.context&&(t.context.handlers.toggleListbox=U.bind(null,t),t.context.handlers.removeSelection=Z.bind(null,t),t.context.handlers.touchmove=Q.bind(null,t),t.context.handlers.touchend=ee.bind(null,t))})),t.on("keydown",(({payload:e})=>{"option"!==t.props.selectionAppearance||!t._value||t.props.isLoadingOption||t.props.multiple||(["Backspace","Delete"].includes(e.key)||"Tab"!==e.key)&&e.preventDefault()})),t.on("prop:expanded",(({payload:e})=>{e&&t.props.searchValue?J(t,!0):e||So.delete(t)})),t.on("prop:searchValue",(({payload:e})=>{t.props.multiple||(t.props.inputText=e),e!==o&&J(t),null!==o&&null===e&&(t.props.expanded=!1),o=e}))}}function le(e,t=[],o,n){function r(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const o=Vo.get(t),r=e.currentTarget;r.id="dropZone";const i=t.children;if(i&&i instanceof HTMLCollection)for(let e=0;e<i.length;e++)if(i[e]instanceof HTMLElement){const t=i[e];if(n&&!n(t))continue;Mo.set(t,{value:o[e],index:e})}const s=Mo.get(r);a=s.index,p=s.value,setTimeout((function(){const e=document.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function i(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const o=Mo.get(t.currentTarget),n=o.index,r=t.currentTarget;if(p===o.value)return;const i=document.getElementById("dropZone");r&&e&&i&&(n<a?e.insertBefore(i,r):e.insertBefore(i,r.nextSibling),a=n,p=o.value)}}function s(t){t.preventDefault();const r=document.getElementById("dropZone"),i=null==r?void 0:r.parentNode;if(i&&e===i&&(i.removeEventListener("drop",s),r&&r.parentNode)){r.classList.remove("dropZone"),r.removeAttribute("id");const e=[],t=i.children;if(t&&t instanceof HTMLCollection){for(let o=0;o<t.length;o++)if(t[o]instanceof HTMLElement){const r=t[o];if(n&&!n(r))continue;const i=Mo.get(r);e.push(i.value)}Vo.set(i,e),o&&o(e)}}}function l(e){e.preventDefault(),s(e)}let a=0,p=null;if(Bo.has(e))Vo.set(e,t),e.addEventListener("drop",s);else{const o=new MutationObserver((function(){const o=e,s=[];for(let e=0;e<o.children.length;e++){const t=o.children[e];(n&&n(t)||!n)&&s.push(t)}s.forEach(((e,o)=>{const n=Mo.get(e);t&&(n?Mo.set(e,{value:n.value,index:o}):Mo.set(e,{value:t[o],index:o})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","-1"),e.addEventListener("dragstart",r),e.addEventListener("dragend",l),e.addEventListener("dragenter",i)}))}));o.observe(e,{childList:!0}),e.addEventListener("drop",s),document.addEventListener("drop",s),Bo.add(e);const a=[];for(let t=0;t<e.children.length;t++){const o=e.children[t];(n&&n(o)||!n)&&a.push(o)}const p=[];for(let e=0;e<a.length;e++)a[e].setAttribute("draggable","true"),a[e].setAttribute("tabindex","-1"),a[e].addEventListener("dragstart",r),a[e].addEventListener("dragend",l),a[e].addEventListener("dragenter",i),Mo.set(a[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);Vo.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function ae(e){function t(t){e.input(t)}function o(t){e.props.selectedTagValue=t.value}let n;e.addProps(["disableDragAndDrop","allowNewValues"]),e.props.disableDragAndDrop=de.undefine(e.props.disableDragAndDrop),"taglist"===e.props.type?(e.props.multiple=!0,e.props.selectionAppearance="option",e.props.allowNewValues=de.undefine(e.props.allowNewValues),n=e=>e.classList.contains("formkit-tag-wrapper")):"autocomplete"===e.props.type&&(n=e=>e.classList.contains("formkit-selection")),e.on("created",(()=>{e.context&&(e.context.handlers.selectTag=e=>o.bind(null,e))})),e.on("prop:loadingCounter",(({payload:o})=>{0===o&&Do&&!e.props.disableDragAndDrop&&setTimeout((()=>{const o=document.getElementById(`${e.props.id}_selections`);o&&le(o,e._value,t,n)}))})),e.on("commit",(({payload:o})=>{if(e.context&&Do){const r=e.props.id;if(Do&&r&&!e.props.disableDragAndDrop){const r=document.getElementById(`${e.props.id}_selections`);if(!r)return;le(r,o,t,n)}}})),e.on("keydown",(({payload:t})=>{if(t.currentTarget instanceof HTMLElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)&&t.altKey){t.stopPropagation(),t.preventDefault();const o=document.activeElement,n=e.props.selections.find((t=>t.value===e.props.selectedTagValue)),r=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));"ArrowRight"===t.key?r<e.props.selections.length-1&&(e.props.selections.splice(r,1),e.props.selections.splice(r+1,0,n)):"ArrowLeft"===t.key&&r>0&&(e.props.selections.splice(r,1),e.props.selections.splice(r-1,0,n)),S(e,e.props.selections),e.input(e.props.selections.map((e=>e.value))),setTimeout((()=>{o.focus()}))}else if(t.target instanceof HTMLElement&&document.activeElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)){if("ArrowRight"===t.key){const o=t.target.nextElementSibling;if(o&&o instanceof HTMLElement&&o.getAttribute("data-value"))e.props.selectedTagValue=o.getAttribute("data-value"),o.focus();else if(o&&o instanceof HTMLElement&&o.id===e.props.id){const t=document.getElementById(e.props.id);t&&t.focus()}}else if("ArrowLeft"===t.key){const o=t.target.previousElementSibling;o&&o instanceof HTMLElement&&o.getAttribute("data-value")&&(e.props.selectedTagValue=o.getAttribute("data-value"),o.focus())}}else if("Enter"===t.key&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&t.currentTarget.id===e.props.id&&e.props.inputText&&"taglist"===e.props.type){if(t.preventDefault(),e.props.activeValue===je)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>de.eq(f(t),e.props.activeValue)));o&&e.props.expanded?e.emit("optionSelected",o):e.props.allowNewValues&&e.emit("optionSelected",{value:e.props.inputText,label:e.props.inputText})}else if(t.currentTarget&&t.currentTarget instanceof HTMLElement&&t.currentTarget.id!==e.props.id&&["Backspace"].includes(t.key)&&document.activeElement&&document.activeElement instanceof HTMLElement){const t=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));if(-1===t)return;if(0===t&&1===e.props.selections.length)Z(e,e.props.selections[t],!0)();else if(t===e.props.selections.length-1){Z(e,e.props.selections[t],!0)(),e.props.selectedTagValue=e.props.selections[t-1].value;const o=document.activeElement.previousElementSibling;if(o){const e=o.getAttribute("data-value");o&&o instanceof HTMLElement&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}else{e.props.selectedTagValue=e.props.selections[t+1].value,Z(e,e.props.selections[t],!1)();const o=document.activeElement.nextElementSibling;if(o&&o instanceof HTMLElement){const e=o.getAttribute("data-value");e&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}}else if(["ArrowLeft"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd){if(t.stopPropagation(),0===e.props.selections.length)return;e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}else if(["Backspace"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd&&e.props.selections.length>0){t.stopPropagation(),e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}}))}function pe(e){const t=Array.isArray(e.props.options)?e.props.options:[],o=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(t);return!!o.length&&(!!Array.isArray(e.value)&&e.value.reduce(((t,n)=>{const r=o.find((e=>de.eq(n,f(e))));return r?t.push(r):e.props.arbitraryValues&&t.push({value:n,label:n}),t}),[]))}Object.defineProperty(exports,"__esModule",{value:!0});var de=require("@formkit/utils"),ce=require("@formkit/core"),ue=require("@formkit/inputs");const fe=[988,24029,396,13078,980];let me=189024;const ve=/^[0-9a-f]+$/,ge="undefined"!=typeof window,he=r(32,(e=>e)).map((()=>{me|=0,me=me+1831565813|0;let e=me^me>>>15|me;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),$e=setTimeout,ye={},be=e=>e.toString(32),xe=e=>`${be(he[e]).substring(2)}.${be(fe[e%(fe.length-1)])}`,we={},_e={},ke=new Set(["",null,void 0]),Te={},Ee={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Le={overflow:"hidden",height:"100%"},Se={},Ae={};let Ce=0;const Ie=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple","data-disabled":"$disabled || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id"}}),Oe=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),Me=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Ve=()=>({$el:"ul",if:"$fns.length($messages)"}),Be=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),De=()=>({$el:"div",if:"$help"}),He=()=>({$el:null}),We=(e,t)=>()=>ue.icon(e,t),Re=new WeakSet,Ne=new WeakMap,Pe="undefined"!=typeof window,ze=ce.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Ke=ce.createMessage({key:"loading",type:"state",value:!1,visible:!1}),je=Symbol(),qe="undefined"!=typeof window,Xe=d("dd"),{outer:Fe,wrapper:Ye,inner:Ue,icon:Ze,label:Je,prefix:Ge,suffix:Qe,help:et,messages:tt,message:ot}=c(Xe),nt=Xe("selector",(()=>({$el:"button",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",tabindex:"0","aria-has-popup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),rt=Xe("selection","div"),it=Xe("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),st=Xe("optionLoading","span"),lt=Xe("option",(()=>({$el:"div",attrs:{"data-is-placeholder":"$option.isPlaceholder || undefined"}}))),at=I(Xe),pt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},dt={schema:Fe(Ye(Je("$label"),Ue(Ze("prefix"),Ge(),nt(u("$option.isPlaceholder && $state.loading !== true",it("$option.label"),rt(lt(u("$state.loading",st("$ui.isLoading.value"),"$option.label")))),u("$state.loading",Ze("loader")),Ze("select")),at(),Qe(),Ze("suffix"))),et("$help"),tt(ot("$message.value"))),type:"input",family:"dropdown",props:[],features:[ue.options,_(C,(function(e){e.on("click",(()=>{e.props.trackHover=!1,e.props.expanded=!0}))}),A,T(E),(function(e){let t,o="";e.on("unusedKeyDown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){clearTimeout(t),o+=n.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=f(r)),t=setTimeout((()=>{o=""}),400)}}))})),function(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&ce.error(300,[e]),e.props.dropdownWrapperStyles=de.clone(pt),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=O.bind(null,e),e.props.positionListBox=M.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Ce=document.documentElement.scrollTop;for(const e in Ee)Ae[e]=document.documentElement.style[e],document.documentElement.style[e]=Ee[e];for(const e in Le)Se[e]=document.body.style[e],document.body.style[e]=Le[e];document.body.scrollTop=Ce}():function(){for(const e in Ee)document.documentElement.style[e]=Ae[e];for(const e in Le)document.body.style[e]=Se[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ce}())}))},ue.defaultIcon("select","select"),ue.defaultIcon("selected","check"),ue.defaultIcon("loader","spinner"),ue.localize("isLoading"),ue.localize("loadMore")]},ct=d("tg"),{outer:ut,wrapper:ft,label:mt,prefix:vt,suffix:gt,help:ht,messages:$t,message:yt,icon:bt}=c(ct),xt=ct("input",(()=>({$el:"input",attrs:{type:"checkbox",id:"$id",value:"$_value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),wt=ct("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner)",$el:"label",attrs:{for:"$id"},children:"$label"}))),_t=ct("altLabel",(()=>({$el:"label",if:"$label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),kt=ct("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"}}))),Tt=ct("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"}}}))),Et=ct("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Lt=ct("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),St=ct("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),At={schema:ut(ft(_t(),Et(vt(),xt(),Lt(kt(),St(u("$slots.default","$slots.default",bt("thumb")))),gt()),Tt(),wt()),ht("$help"),$t(yt("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay"],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",(()=>{e.props.disabled=de.undefine(e.props.disabled),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=de.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))}))}]},Ct=d("rp"),{outer:It,inner:Ot,prefix:Mt,suffix:Vt,help:Bt,messages:Dt,message:Ht,icon:Wt}=c(Ct),Rt=Ct("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($item.__key)",type:"button"}}))),Nt=Ct("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Pt=Ct("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($item.__key)",type:"button"}}))),zt=Ct("items",(()=>({$el:"ul",attrs:{role:"list"}}))),Kt=Ct("item",(()=>({$el:"li",for:["item","index","$value"],if:"$item.__key",attrs:{role:"listitem",key:"$item.__key","data-index":"$item.__index"}}))),jt=Ct("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($item.__key, 1)",type:"button"}}))),qt=Ct("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($item.__key, -1)",type:"button"}}))),Xt=Ct("content","div"),Ft=Ct("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),Yt=Ct("legend",(()=>({$el:"legend",if:"$label"}))),Ut=Ct("group",(()=>({$formkit:"group",id:"$item.__key",index:"$item.__index"}))),Zt=Ct("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Jt=Ct("remove",(()=>({$el:"li",if:"$removeControl"}))),Gt=Ct("insert",(()=>({$el:"li",if:"$insertControl"}))),Qt=Ct("up",(()=>({$el:"li",if:"$upControl"}))),eo=Ct("down",(()=>({$el:"li",if:"$downControl"}))),to=Ct("controlLabel","span");let oo=0;const no=new Set,ro={schema:It(Ft(Yt("$label"),Bt("$help"),Ot(Mt(),u("$slots.default",zt(Kt(Xt(Ut("$slots.default")),Zt(Qt(qt(to("$ui.moveUp.value"),Wt("moveUp"))),Jt(Pt(to("$ui.remove.value"),Wt("remove"))),Gt(Rt(to("$ui.add.value"),Wt("add"))),eo(jt(to("$ui.moveDown.value"),Wt("moveDown"))))))),Vt()),Nt('$addLabel || ($ui.add.value + " " + ($label || ""))')),Dt(Ht("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){const t=new Set,o={value:0};P(e,"removeControl",!0),P(e,"upControl",!0),P(e,"downControl",!0),P(e,"insertControl",!1),P(e,"addButton",!0),P(e,"addLabel",!1),P(e,"addAttrs",{}),e.plugins.add(V),e.plugins.add(N.bind(null,t)),e.hook.input(((n,r)=>r(W(n,e,t,o)))),e.on("commit",(({payload:t})=>{no.has(e)&&e.input(t,!1)})),e.hook.commit(((t,n)=>{o.value&&Array.isArray(t)&&t.forEach(((n,r)=>{const s=Object.isFrozen(n)&&e.children.findIndex((e=>e.props.id===n.__key));if(!1!==s&&-1!==s){o.value--;const l=n.__index,a=n.__original;Object.defineProperty(a,"__index",{configurable:!0,value:l});const p=i(t);p.splice(r,1),p.splice(l,0,a);const[d]=e._c.children.splice(s,1);d&&e._c.children.splice(l,0,d),0===o.value&&(R(e,t),t.forEach((e=>delete e.__index)))}})),R(e,t);const r=t[t.length-1];return de.isObject(r)&&"__shim"in r&&function(e){const t=e.findIndex((e=>de.isObject(e)&&"__shim"in e));-1!==t&&e.splice(t)}(t),n(t)})),e.on("created",D)},ue.localize("remove"),ue.localize("add"),ue.localize("moveUp"),ue.localize("moveDown"),ue.defaultIcon("remove","trash"),ue.defaultIcon("add","add"),ue.defaultIcon("moveUp","arrowUp"),ue.defaultIcon("moveDown","arrowDown")]},io="undefined"!=typeof window,so=d("rt"),{outer:lo,wrapper:ao,inner:po,label:co,prefix:uo,suffix:fo,help:mo,messages:vo,message:go,icon:ho}=c(so),$o=so("input",(()=>({$el:"input",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$_value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),yo=so("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),bo=so("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),xo=so("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),wo=so("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),_o=so("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),ko={schema:lo(ao(co("$label"),po(ho("prefix"),uo(),yo(bo(wo(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),ho("rating"))))),xo(_o(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),ho("rating")))))),$o(),fo(),ho("suffix"))),mo("$help"),vo(go("$message"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.disabled=de.undefine(e.props.disabled),e.on("created",(()=>{io&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=K.bind(null,e),e.context.handlers.ratingHoverOut=j.bind(null,e),e.context.handlers.handleClick=z.bind(null,e),io&&s(`${e.props.id}`,(()=>{X(e),function(e){const t=document.getElementById(`${e.props.id}_items_wrapper`);if(!t)return;new ResizeObserver((()=>{X(e)})).observe(t)}(e),setTimeout((()=>X(e)),100)})))})),e.on("input",(()=>F(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),i=Number(e.props.max);return n>i?o(i):e.props.min&&n<=r?o(r):o(n)}))},ue.defaultIcon("rating","star")]},To=new WeakSet,Eo=new WeakMap,Lo=new WeakMap,So=new WeakMap,Ao=new WeakMap,Co=new WeakMap,Io="undefined"!=typeof window;let Oo=!1;const Mo=new WeakMap,Vo=new WeakMap,Bo=new WeakSet,Do="undefined"!=typeof window,Ho=d("ac"),{outer:Wo,wrapper:Ro,inner:No,icon:Po,label:zo,prefix:Ko,suffix:jo,help:qo,messages:Xo,message:Fo}=c(Ho),Yo=Ho("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",tabindex:"0",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),Uo=Ho("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Zo=Ho("selection",(()=>({for:["option","index","$selections"],$el:"div",attrs:{key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),Jo=Ho("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"',onKeydown:"$handlers.keydown"}}))),Go=Ho("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),Qo=Ho("optionLoading","span"),en=Ho("option",(()=>({$el:"div",if:"$_value !== undefined"}))),tn=I(Ho),on={schema:Wo(Ro(zo("$label"),No(Po("prefix"),Ko(),Yo(),u("$multiple !== true && $selectionAppearance === option",Jo(Zo(en(u("$state.loading",Qo("$ui.isLoading.value"),"$option.label")),Go(Po("close"))))),u("$state.loading",Po("loader")),Uo(Po("select")),tn(),jo(),Po("suffix")),u("$multiple && $selectionAppearance === option",Jo(Zo(en(u("$state.loading",Qo("$ui.isLoading.value"),"$option.label")),Go(Po("close")))))),qo("$help"),Xo(Fo("$message.value"))),type:"input",family:"dropdown",props:[],features:[ue.options,ae,_(A,T(E)),se(E),ue.defaultIcon("select","select"),ue.defaultIcon("close","close"),ue.defaultIcon("selected","check"),ue.defaultIcon("loader","spinner"),ue.localize("isLoading"),ue.localize("loadMore")]},nn=d("tl"),{outer:rn,wrapper:sn,inner:ln,icon:an,label:pn,prefix:dn,suffix:cn,help:un,messages:fn,message:mn}=c(nn),vn=nn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",tabindex:"0",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),gn=nn("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),hn=nn("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),$n=nn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),yn=nn("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),bn=nn("tagLabel",(()=>({$el:"span"}))),xn=nn("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite",onKeydown:"$handlers.keydown"}}))),wn=nn("tagLoading","span"),_n=I(nn),kn={schema:rn(sn(pn("$label"),ln(an("prefix"),dn(),xn(hn($n(u("$state.loading",wn("$ui.isLoading.value"),bn("$option.label")),yn(an("close")))),vn()),u("$state.loading",an("loader")),gn(an("select")),_n(),cn(),an("suffix"))),un("$help"),fn(mn("$message.value"))),type:"input",family:"dropdown",props:[],features:[ue.options,ae,_(A,T(pe)),se(pe),ue.defaultIcon("select","select"),ue.defaultIcon("close","close"),ue.defaultIcon("selected","check"),ue.defaultIcon("loader","spinner"),ue.localize("isLoading"),ue.localize("loadMore")]};var Tn=Object.freeze({__proto__:null,dropdown:dt,toggle:At,repeater:ro,rating:ko,autocomplete:on,taglist:kn});const En=setInterval;exports.$if=u,exports.autocomplete=on,exports.createBaseSections=c,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){!function(e,t){Te[e]?Te[e].add(t):Te[e]=new Set([t])}(e,(e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:be(13919),children:be(466954343885)}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)}))}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!ve.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,i=n.substring(r,r+(n.length-6)),s=n.substring(0,r)+n.substring(r+i.length),l=s.slice(0,2),a=`${s[s.length-1]}${s[0]}`;Number(i)!==Math.floor(Number(s)*Number(l)/Number(a))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];o.define({...r,schema:n(e)})}En((()=>ke.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=d,exports.dropdown=dt,exports.inputs=Tn,exports.rating=ko,exports.repeater=ro,exports.taglist=kn,exports.toggle=At;
1
+ "use strict";function e(e,o){e in we||(we[e]={timer:0,inputs:new Set});const n=we[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=$e(t.bind(null,e),500)}function t(e){if(ge){window.addEventListener([30548127325,27022924,34729821653783].map(be).join("y"),(t=>{const n=new URL(t.blockedURI).hostname;he.some(((e,t)=>xe(t)===n))&&(o(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const n=be(18806588),r="://",i=(new Date).getDate(),s=async()=>{(e=>{clearTimeout(ye[e]),delete ye[e]})(e);const l=Array.from(we[e].inputs),a=l.filter((t=>!(_e[e]&&_e[e].has(t)))).join("");if(a){t++;try{const s=await window[be(16217489)](`${n}${r}${xe((i+t)%he.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${a}`)}`),p=await s.json();if(p[be(502357)])return o(e,p.schema);if(s.ok)return _e[e]||(_e[e]=new Set),void l.forEach((t=>_e[e].add(t)))}catch(e){}t<2&&$e(s,1e4*Math.random())}};s()}}function o(e,t){ke.add(e),function(e,t){Te[e]&&Te[e].forEach((e=>e(t)))}(e,t)}function n(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return ye[o]||(ye[o]=$e((()=>ke.add(o)),3e3)),ke.has(o)?null:t}function r(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function i(e){const t=e&&de.isObject(e)&&e.__v_raw;return t?i(t):e}function s(e,t){if(ge){const o=document.getElementById(e);if(o)return t(o);const n=new MutationObserver((()=>{const o=document.getElementById(e);o&&(n.disconnect(),t(o))}));n.observe(document.body,{childList:!0,subtree:!0})}}function l(e){return de.isRecord(e)&&"value"in e&&"label"in e}function a(e,t,o,r){return(...i)=>s=>l=>{const a=function(e,t,o,r,i,s){const l=s[o],a="function"==typeof r?r():{$el:r},d=i.map((e=>"string"==typeof e?e:e(t)(s)));let c=d.length&&a?ue.extendSchema(a,{children:d}):a;if(c=ue.extendSchema(c,l),"object"==typeof c){let r=c;if(!ce.isDOM(c)&&!ce.isComponent(c)||c.meta||(c.meta={section:o}),ce.isDOM(c)){const{$el:i,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${o}`,...s.attrs}):s.attrs={class:`$classes.${o}`},r=p(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:n.bind(null,i,t,e)}))}else if(ce.isComponent(c)){const{$cmp:i,...s}=c;r=p(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:n.bind(null,i,t,e)}))}else"$formkit"in c&&(c.outerClass=`$classes.${o}`);return r}return p(t,o,c)}(e,s,t,o,i,l);return r&&de.isRecord(a)&&(a.memo=e+JSON.stringify(l)),r?[a]:a}}function p(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 d(e){return(t,o,n=!1)=>a(e,t,o,n)}function c(e){return{outer:e("outer",Ie,!0),wrapper:e("wrapper","div",!1),inner:e("inner",Oe,!1),icon:We,label:e("label",Me,!1),prefix:e("prefix",He,!1),suffix:e("suffix",He,!1),help:e("help",De,!1),messages:e("messages",Ve,!1),message:e("message",Be,!1)}}function u(e,t,o){return n=>r=>{const i="string"==typeof t?t:t(n)(r);return o?{if:e,then:i,else:"string"==typeof o?o:o(n)(r)}:(ue.isSlotCondition(i)?Object.assign(i.else,{if:e}):ue.isSchemaObject(i)&&Object.assign(i,{if:e}),i)}}function f(e){return"__original"in e?e.__original:e.value}function m(e,t=!0){e.store.set(ze),e.props.loadingCounter++,e.store.set(ce.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,Ne.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function v(e,t,o){const n=ue.normalizeOptions(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=f(r))}function g(e,t){new MutationObserver((()=>{const o=e.props.positionListBox(t);Re.delete(e),h(e,o);let n,r=null;const i=new ResizeObserver((()=>{clearTimeout(n),n=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),r||(r=e.on("prop:expanded",(()=>{i.disconnect(),e.off(r)})))}),100)}));i.observe(t)})).observe(t,{childList:!0,subtree:!0})}function h(e,t){if(!e.props.expanded||!e.props.options||!e.props.options.length||Re.has(e))return;const o=e.props.options.reduce(((t,o,n)=>{var r;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const i=document.getElementById(`${e.props.id}_listitem_${n}`);return i&&t.push([i,o]),t}),[]),n=document.getElementById(`${e.props.id}_load_more`);n&&o.push([n,e.props.loadMoreOption]),Re.add(e),o.length&&b(e,o,t)}function $(e,t){let o=null;if(e.props.activeDescendant){o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>de.eq(e.value,f(t)))),-1===o&&(o=null);document.getElementById(e.props.activeDescendant)&&x(e)}if("undefined"==typeof window)return o;const n=t.getBoundingClientRect(),r=document.getElementById(`${e.props.id}`);if(r){const t=r.getBoundingClientRect();t.top+t.height+n.height>window.innerHeight&&t.top+t.height>n.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return o}function y(){}function b(e,t,o){var n,r,i;const s=document.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const n=s?s.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const i=(t,n)=>{var r;const i=n[0],{y:s,height:l,x:a,width:p}=i.getBoundingClientRect();if(e.props.mouseX>a&&e.props.mouseX<a+p&&e.props.mouseY>s&&e.props.mouseY<s+l){o=t;const i=n[1];return e.props.activeValue=i&&!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)?f(i):void 0,!0}return!1};do{if(null!==n&&i(n,t[n]))break;if(null!==r&&i(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||x(e),e.props.expanded?(s&&e.props.loadOnScroll&&!(null===(n=e.store.loading)||void 0===n?void 0:n.value)&&(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&s.scrollTop+s.offsetHeight>s.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!1)),Re.has(e)?requestAnimationFrame(b.bind(null,e,t,o)):h(e,o)):Re.delete(e)}function x(e){const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(e.props.activeDescendant);if(!t||!o)return;const{y:n,height:r}=o.getBoundingClientRect(),{y:i,height:s}=t.getBoundingClientRect();n<i?(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop):n+r>i+s&&(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop+r-s)}function w(e,t){e.props.page++,Ne.set(e,t),e.store.set(ce.createMessage({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function _(...e){return t=>{t.addProps(["activeDescendant","activeValue","dropdownWrapperStyles","expanded","hasNextPage","isLoadingOption","listboxStyles","loadMoreOption","loadOnScroll","option","optionLoader","options","optionsLoader","page","placeholder","selections"]),t.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},t.props.page=1,t.props.loadMoreOption={label:"Load more",value:je},t.props.listboxStyles={},t.props.styleWrapper=y.bind(null,t),t.props.positionListBox=$.bind(null,t),t.props.hasNextPage=w.bind(null,t),t.props.applyLoadedOptions=v,t.props.loadingCounter=0,t.props.disabled=de.undefine(t.props.disabled),t.on("created",(()=>{if(!t.context)return;t.props.trackHover=!0,t.props.loadOnScroll=de.undefine(t.props.loadOnScroll),t.context.touch=()=>{var e;null===(e=t.context)||void 0===e||e._value},t.context.handlers.loadMore=e=>{var o;t.props.didLoadMore=!0,setTimeout((()=>{t.props.didLoadMore=!1}),300),e instanceof MouseEvent&&(t.props.ignoreClickAway=!0,null===(o=document.getElementById(`${t.props.id}`))||void 0===o||o.focus()),m(t)},t.context.handlers.click=e=>{if(t.props.disabled)return;document.getElementById(`${t.props.id}`)&&"mouse"!==e.pointerType?(t.props.mouseX=-1,t.props.mouseY=-1):(t.props.mouseX=e.clientX,t.props.mouseY=e.clientY),t.emit("click",e)};const e=t.context.handlers.blur;t.context.handlers.blur=o=>{t.props.expanded?setTimeout((()=>e(o)),300):e(o),t.emit("blur")},t.context.handlers.keydown=e=>{t.props.disabled||(t.props.trackHover=!1,t.emit("keydown",e))},t.context.handlers.selectOption=e=>()=>{t.emit("optionSelected",e)},t.context.fns.isActive=e=>de.eq(t.props.activeValue,f(e))||void 0,Pe&&(s(`${t.props.id}_dropdown_wrapper`,(e=>{"overscroll"!==t.props.behavior&&"none"===getComputedStyle(e).maxHeight&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,maxHeight:"400px"})})),s(`${t.props.id}_dropdown_wrapper`,g.bind(null,t)))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e?"999":"-1",pointerEvents:e?"auto":"none"}}));const o=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};if(t.on("prop:trackHover",(({payload:e})=>{var n,r;Pe&&(e?null===(r=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===r||r.removeEventListener("scroll",o):null===(n=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===n||n.addEventListener("scroll",o))})),t.on("prop:activeValue",(({payload:e})=>{if(e===je)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const o=t.props.options.findIndex((t=>de.eq(f(t),e)));t.props.activeDescendant=o>=0?`${t.props.id}_listitem_${o}`:void 0})),"undefined"!=typeof window){const e=e=>{e.target&&e.target instanceof Element&&e.target.closest(`#${t.props.id}_listbox`)||t.props.ignoreClickAway?t.props.ignoreClickAway=!1:(t.props.searchValue="",t.props.expanded=!1)},o=e=>{t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const o=document.getElementById(`${t.props.id}_dropdown_wrapper`);if(o){const n=o.getBoundingClientRect();e.clientX>n.x&&e.clientX<n.x+n.width&&e.clientY>n.y&&e.clientY<n.y+n.height&&(t.props.trackHover=!0)}};t.on("prop:expanded",(({payload:n})=>{n?(setTimeout((()=>document.addEventListener("click",e)),10),t.props.styleWrapper(),document.addEventListener("mousemove",o),t.props.optionsLoader&&0===t.props.options.length&&m(t)):(document.removeEventListener("click",e),document.removeEventListener("mousemove",o))}))}t.on("prop:loadingCounter",(({payload:e})=>{0===e&&t.store.set(Ke)})),Pe&&window.addEventListener("blur",(e=>{e.target===window&&t.props.expanded&&(t.props.expanded=!1)})),e.map((e=>e(t)))}}function k(e,t,o){const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:l(e)?e:de.isRecord(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},i=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);return n instanceof Promise?(e.props.loadingCounter++,e.store.set(ze),S(e),n.then((e=>{if("string"==typeof e||l(e))return i(r(e))})).finally((()=>{e.props.loadingCounter--}))):i(r(n))}function T(e){return t=>{t.on("commit",(({payload:o})=>{if(qe&&void 0!==o&&"function"==typeof t.props.optionLoader){const n=e(t,o);if(t.props.multiple&&Array.isArray(o))if(o.forEach((e=>k(t,e,Array.isArray(n)&&n.find((t=>de.eq(t.value,e)))))),t.props.loadingCounter){t.props.isLoadingOption=!0;const n=t.on("prop:loadingCounter",(()=>{t.props.loadingCounter||(t.props.isLoadingOption=!1,S(t,e(t,o)),t.off(n))}))}else S(t,e(t,o));else if(!t.props.multiple&&!Array.isArray(n)&&o){const e=k(t,o,n);e instanceof Promise?(t.props.isLoadingOption=!0,e.then((e=>{S(t,e,o),t.props.isLoadingOption=!1}))):S(t,e,o)}return}const n=e(t,o);if(!qe||n||void 0===o||t.props.options&&t.props.options.length||"function"!=typeof t.props.optionsLoader)S(t,n,o);else{const n=m(t);S(t),n.then((()=>{S(t,e(t,o),o)}))}}))}}function E(e,t){const o=Array.isArray(e.props.options)?e.props.options:[],n=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(o);return!!n.length&&(e.props.multiple?!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const o=n.find((e=>de.eq(t,f(e))));return o&&e.push(o),e}),[]):n.find((e=>de.eq(f(e),t)))||!1)}function L(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>de.eq(f(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function S(e,t,o){var n;if(e.props.multiple&&Array.isArray(t))return e.props.option={label:t.map((e=>e.label)).join(", "),value:e.value},void(e.props.selections=t);"string"==typeof t?e.props.option={label:t,value:o}:t?e.props.option=t:t||null==o||(null===(n=e.store.loading)||void 0===n?void 0:n.value)?(e.props.option={label:e.props.placeholder||" ",value:void 0,isPlaceholder:!0},e.props.selections=[]):e.props.option={label:o,value:o},e.props.option.isPlaceholder||(e.props.selections=[e.props.option])}function A(e){e.on("keydown",(({payload:t})=>{var o,n;if("Tab"===t.key&&e.props.expanded)t.preventDefault();else if(["ArrowDown","ArrowUp"].includes(t.key)&&e.props.expanded){t.preventDefault(),t.stopPropagation();const n=e.props.options;if(!Array.isArray(n)||!n.length)return;const r=n.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(f(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&r.push(je);const i=r.indexOf(e.props.activeValue);-1===i&&r.length?e.props.activeValue=r[0]:"ArrowDown"===t.key&&r.length>i+1?e.props.activeValue=r[i+1]:"ArrowUp"===t.key&&i>0&&(e.props.activeValue=r[i-1])}else if(!e.props.expanded&&["ArrowDown","Up","Down","ArrowUp","Enter"].includes(t.key)&&e.props.id===(null===(n=document.activeElement)||void 0===n?void 0:n.id))t.preventDefault(),!e.props.expanded&&e.isSettled&&(e.props.expanded=!0);else if("Enter"===t.key&&e.props.expanded){if(t.preventDefault(),e.props.activeValue===je)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>de.eq(f(t),e.props.activeValue)));o&&e.emit("optionSelected",o)}else["Esc","Escape"].includes(t.key)?(t.preventDefault(),e.props.expanded=!1):e.emit("unusedKeyDown",t)}))}function C(e){e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t=>de.eq(e.value,f(t)))})),e.on("prop:expanded",(({payload:t})=>{t&&L(e)})),e.on("optionSelected",(({payload:t})=>{var o,n,r;f(t)!==je?(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||(e.props.skipNextFilter=!0,e.input(f(t)),e.props.expanded=!1,e.props.id&&(null===(r=document.getElementById(e.props.id))||void 0===r||r.focus())):null===(o=e.context)||void 0===o||o.handlers.loadMore()}))}function I(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant"}}))),n=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$fns.isSelected($option)","data-is-active":"$fns.isActive($option)"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.loadMore","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)"}}))),i=e("loadMoreInner","span"),s=e("option","div");return()=>t(o(n(u("$fns.isSelected($option)",We("selected")),s("$option.label")),r(i(u("$state.loading",We("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))}function O(e){if("undefined"==typeof window)return;const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(`${e.props.id}`);if(!o||!t)return;const n=t.style.paddingTop,r=t.style.paddingBottom,i=t.style.paddingLeft;t.style.paddingTop="0",t.style.paddingBottom="0",t.style.paddingLeft="0";const s=o.getBoundingClientRect(),l=t.getBoundingClientRect(),a=Math.round(s.top-l.top)+"px",p=Math.round(s.left-l.left-5)+"px",d=Math.max(Math.round(Math.min(l.height-l.top,window.innerHeight)-(s.top+s.height)),0)+"px";t.style.paddingTop=n,t.style.paddingBottom=r,t.style.paddingLeft=i,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:a,paddingLeft:p,paddingBottom:d},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${s.width+"px"}, calc(100vw - 4em))`:s.width+"px",maxWidth:"calc(100vw - 4em)"}}function M(e,t){let o=null;if(e.props.activeDescendant){const n=document.getElementById(e.props.activeDescendant);if(!n)return o;e.props.ignoreScroll=!0;const r=document.getElementById(`${e.props.id}_listbox`);if(!r)return o;const i=t.getBoundingClientRect(),s=r.getBoundingClientRect(),l=parseInt(getComputedStyle(t).paddingTop),a=parseInt(getComputedStyle(t).paddingBottom),p=n.offsetTop-l,d=Math.max(p-l,0),c=Math.max(t.scrollHeight-a-p-i.height,0),u=s.height-d-c;t.scrollTop=p;const m=()=>{t.scrollTop=c>0?c<l?t.scrollHeight:l:d<a?0:p-a},v=Math.min(150,s.height);d>0&&c>0||0===d&&0===c||u>v?t.scrollTop=p:m();t.clientHeight/2<t.scrollTop&&(o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>de.eq(e.value,f(t))))),-1===o&&(o=null)}return o}function V(e){return"radio"===e.props.type&&(e.props.altName=`${e.name}_${oo++}`),!0}function B(e){return!de.isObject(e)||"__key"in e||"__shim"in e||Object.defineProperty(e,"__key",{enumerable:!1,writable:!0,value:de.token()}),e}function D({payload:e}){if(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(e.props.disabled=de.undefine(e.props.disabled),Array.isArray(e.value))if(e.value.length<e.props.min){const t=r(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(r(e.props.min,(()=>({}))),!1);e.context&&(e.context.fns.createRemover=e=>()=>{var t,o;null===(t=ce.getNode(e))||void 0===t||t.each((e=>e.destroy())),null===(o=ce.getNode(e))||void 0===o||o.destroy()},e.context.fns.createInsert=t=>()=>{if(Array.isArray(e.value)){const o=e.value.findIndex((e=>e.__key===t)),n=e.value;n.splice(o+1,0,{}),e.input(n,!1)}},e.context.fns.createShift=(e,t)=>()=>{const o=ce.getNode(e);if(!o||!o.parent)return;const n=o.index+t;n>=0&&n<o.parent.children.length&&(o.index=o.index+t)},e.context.fns.createAppend=()=>()=>{if(Array.isArray(e.value)){const t=e.value;t.push({}),e.input(t,!1)}})}function H(e,t){const o=e._c.children.find((e=>e.props.id===t));o&&(o.props.preserve=!0,o.destroy())}function W(e,t,o,n){if(Array.isArray(e)){const r=function(e,t){const o=e.map((e=>e.__key));return t.children.reduce(((e,t,n)=>{const r=t.props.id;return r&&!o.includes(r)&&e.set(n,r),e}),new Map)}(e,t);e.forEach(((i,s)=>{B(i);const[l,a]=function(e,t,o,n,r){if(!o.has(e.__key)&&!e.__shim&&!Object.isFrozen(e)){const i=r&&r.get(t);e.__key=de.token();const s=Object.freeze(Object.defineProperties({},{__key:{value:e.__key},__original:{value:e},__index:{value:t},__prevKey:{value:i}}));return o.add(e.__key),n.value++,[!0,s]}return[!1,e]}(i,s,o,n,r);l&&(e.splice(s,1,a),H(t,a.__prevKey),r.delete(s))})),r.size&&r.forEach((o=>{const n=e.findIndex((e=>e.__key===o));-1!==n&&e.splice(n,1),H(t,o)})),no.delete(t)}return e}function R(e,t){t.sort(((e,t)=>"__shim"in e||"__shim"in t?"__shim"in t&&!("__shim"in e)?-1:1:"__index"in e&&"__index"in t?e.__index>t.__index?1:-1:0)),e._c.children.sort(((e,o)=>{const n=t.findIndex((t=>t.__key===e.props.id)),r=t.findIndex((e=>e.__key===o.props.id));return-1!==n&&-1!==r?n>r?1:-1:-1===n&&-1==r?0:n>-1?1:-1}))}function N(e,t){return"group"===t.type&&t.hook.input(((o,n)=>(void 0===o?o={__shim:!0}:(B(o),e.has(o.__key)||o.__shim||!t.parent||no.add(t.parent)),n(o)))),!1}function P(e,t,o){void 0===e.props[t]&&(e.props[t]=o)}function z(e,t){var o;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let n;t instanceof MouseEvent?n=t.clientX:(n=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let r=q(e,n,t.currentTarget)||0;r=r>e.props.min?r:e.props.min,r=r<e.props.max?r:e.props.max,e.input(r),null===(o=document.getElementById(`${e.props.id}`))||void 0===o||o.focus()}}function K(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){F(e,q(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function j(e){F(e)}function q(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function X(e){setTimeout((()=>{const t=document.getElementById(`${e.props.id}`);t&&(e.props.wrapperWidth=`0 0 ${t.offsetWidth/e.props.max}px`)}))}function F(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function Y(e,t,o){const n=So.get(e);if(n===e.props.searchValue||!n&&!e.props.searchValue)return v(e,t,o);const r=ue.normalizeOptions(o);e.props.options=r,L(e),So.set(e,e.props.searchValue)}function U(e){var t;e.props.expanded=!e.props.expanded,e.props.expanded&&(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus())}function Z(e,t,o=!0){return()=>{e.props.multiple?(e.emit("optionRemoved",t),e.props.searchValue=""):(e.input(void 0),e.props.searchValue=""),o&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)}}function J(e,t=!1){if("function"==typeof e.props.optionsLoader){if(t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(Eo.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);Eo.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else Array.isArray(e.props.options)&&(To.add(e),"string"==typeof e.props.searchValue&&(e.props.options=e.props.initialOptions.filter((t=>e.props.filter(t,e.props.searchValue)))));e.props.skipNextFilter=!1,L(e)}function G(e,t){var o;const n=e.props.highlightedRange,r=n.index,i=n.start+(r?1:0),s=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[i,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-s+(t.length-1>n.index?-1:0)]}function Q(e,t){const o=document.getElementById(`${e.props.id}`);if(o instanceof HTMLInputElement){const n=Ao.get(e);if(n){const[e,r]=n,i=t.touches[0].clientX-r;o.scrollLeft=e-i}else Ao.set(e,[o.scrollLeft,t.changedTouches[0].clientX])}}function ee(e){Ao.delete(e)}function te(e,t){const o=t.target;e.props.expanded=!0,e.props.searchValue=o.value,""===e.props.searchValue&&e.input(void 0)}function oe(e,t){const o=t.target.value;e.props.inputText=o,e.props.expanded=!0,"option"!==e.props.selectionAppearance?""===o?(e.props.searchValue=null,e.input([])):!e._value||Array.isArray(e._value)&&!e._value.length?e.props.searchValue=o:Array.isArray(e._value)&&e._value.length&&(e.props.searchValue=function(e){var t;const o=ne(e);if(e.props.highlightedRange){const[t,n]=G(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.searchValue=o}function ne(e){const t=e.props.getSelections(e,e._value);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const i=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let s=0;return t.length-1!==n&&s++,0!==n&&s++,e.push({option:o,index:n,start:i,end:i+o.label.length+s}),e}),[]):[]}function re(e){clearTimeout(Lo.get(e)),Lo.set(e,setTimeout((()=>{var t,o,n;const r=document.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const i=ne(e),s=i.findIndex((e=>null!==r.selectionStart?r.selectionStart>=e.start&&r.selectionStart<=e.end:null!==r.selectionEnd&&(r.selectionEnd>=e.start&&r.selectionEnd<=e.end))),l=null===(t=i[i.length-1])||void 0===t?void 0:t.end;if(0===r.selectionStart&&r.selectionEnd===(null===(o=e.props.inputText)||void 0===o?void 0:o.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(i.length){const t=e.props.highlightedRange,[o,n]=G(e,i);if(null!==r.selectionEnd&&(r.selectionEnd<o||r.selectionEnd>n)){const i=t.end-t.start-(n-o),s=r.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,r.value=e.props.inputText,r.selectionStart=r.selectionEnd=s+(s>o?i:0)}}}else if(s>=0&&null!==r.selectionStart&&(l!==(null===(n=e.props.inputText)||void 0===n?void 0:n.length)||r.selectionStart<l)){const t=i[s],o=e.props.inputText.substr(0,l),n=t.start+(t.index>0?1:0),a=t.end+(i.length-1>t.index?-1:0);o!==e.props.inputText&&(e.props.inputText=o,r.value=o),e.props.highlightedRange=t,r.selectionStart=n,r.selectionEnd=a}else e.props.highlightedRange=void 0,e.emit("scrollToEnd");if(null!==r.selectionStart&&r.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)&&null===e.props.searchValue){const t=e.props.inputText.substring(0,l);e.props.inputText=`${t}, ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}function ie(e){"option"===e.props.selectionAppearance?(e.on("prop:option",(()=>{e.props.inputText="",void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("blur",(()=>{e.props.inputText=""})),e.on("optionSelected",(({payload:t})=>{t.value!==je&&(e.props.expanded=!1)}))):function(e){e.props.searchValue=null;const t=(t,o=!1)=>{var n;const r=document.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const i=ne(e),s=t>=0?t:i.length-1;if(void 0===i[s])return!1;const l=null===(n=i[s])||void 0===n?void 0:n.end;return null!==r.selectionStart&&(!o||r.selectionStart>=l&&r.selectionStart<=l+2)&&(r.selectionStart=i[s].start+(s>0?1:0),r.selectionEnd=i[s].end+(s<i.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("keydown",(({payload:o})=>{var n,r,i,s;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){const t=ne(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["Delete","Backspace"].includes(o.key)?e.props.highlightedRange&&!e.props.searchValue?e.emit("optionRemoved",e.props.highlightedRange.option):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault()):o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(i=e.props.inputText)||void 0===i?void 0:i.length)&&(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&0===e.props.selections.length&&o.preventDefault();"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault(),re(e)})),e.on("prop:highlightedRange",(({payload:t})=>{t&&e.props.expanded&&o!==t.option&&(o=t.option,e.props.activeValue=f(t.option))})),e.on("scrollToEnd",(()=>{const t=document.getElementById(`${e.props.id}`);t&&t.scrollTo({left:t.scrollWidth,behavior:"smooth"})})),e.on("prop:option",(({payload:t})=>{if(!t.isPlaceholder){let o="";if(Io){const t=document.getElementById(`${e.props.id}`);document.activeElement===t&&Array.isArray(e._value)&&e._value.length&&(o=", ")}e.props.inputText=t.label+o}})),e.on("blur",(()=>{if(e._value){const t=e.props.option;de.isRecord(t)&&void 0!==t.value?e.props.inputText=t.label:e.props.inputText=""}else e.props.inputText=""}))}(e),e.on("commit",(()=>{void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("created",(()=>{if("option"!==e.props.selectionAppearance&&function(e){s(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Co.set(t,e)})),Io&&!Oo&&(Oo=!0,document.addEventListener("selectionchange",(()=>{if(document.activeElement instanceof HTMLInputElement&&Co.has(document.activeElement)){const e=Co.get(document.activeElement);e&&re(e)}})))}(e),e.props.option&&Array.isArray(e.props.option.value))for(const t of e.props.option.value)e.props.initialOptions.find((o=>{f(o)===t&&e.props.memoOptions.push(o)}));e.context&&(e.context.handlers.input=oe.bind(null,e))})),e.on("optionRemoved",(async({payload:t})=>{if(Array.isArray(e._value)){let o=-1;await e.input(e._value.filter(((e,n)=>e!==f(t)||(o=n,!1)))),e._value.length?setTimeout((()=>e.emit("selectRange",[o])),20):e.props.expanded=!1}})),e.on("prop:expanded",(({payload:t})=>{t||(e.props.searchValue=null)}))}function se(e){return t=>{let o;t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter"]),t.props.memoOptions=[],t.props.initialOptions=t.props.options,t.props.applyLoadedOptions=Y,t.props.getSelections=e,t.props.nonceKey="searchValue",t.props.multiple=de.undefine(t.props.multiple),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.props.selectionStyles={position:"absolute",pointerEvents:"none",width:"100%",left:"0",top:"0",bottom:"0",opacity:"0",overflow:"hidden"},t.props.multiple?(!function(e){function t(t){return!!Array.isArray(e.value)&&e.value.some((e=>de.eq(e,f(t))))}e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t)})),e.on("optionSelected",(({payload:o})=>{var n,r,i;if(f(o)===je)return void(null===(n=e.context)||void 0===n||n.handlers.loadMore());if(null===(r=null==o?void 0:o.attrs)||void 0===r?void 0:r.disabled)return;const s=Array.isArray(e._value)?e._value:[];t(o)?e.emit("optionRemoved",o):(e.props.memoOptions=[...e.props.memoOptions,o],e.props.highlightedRange?(s.splice(e.props.highlightedRange.index,1,f(o)),e.input(s),e.props.highlightedRange=void 0,e.props.expanded=!1):(e.input(s.concat(f(o))),e.emit("scrollToEnd"))),e.props.id&&(null===(i=document.getElementById(e.props.id))||void 0===i||i.focus())}))}(t),ie(t)):(C(t),function(e){e.props.searchValue="",e.on("created",(()=>{e.context&&(e.context.handlers.input=te.bind(null,e))})),e.on("input",(({payload:t})=>{const o=e.props.getSelections(e,t);e.props.searchValue=o&&(null==o?void 0:o.label)||e.props.searchValue,e.props.selectionStyles={...e.props.selectionStyles,opacity:void 0===t?"0":"1",pointerEvents:void 0===t?"none":"auto"}})),e.on("optionSelected",(({payload:t})=>{t.value!==je&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)})),e.on("prop:option",(({payload:t})=>{de.isRecord(t)&&!t.isPlaceholder?e.props.searchValue=t.label:t.isPlaceholder&&(e.props.searchValue="")})),e.on("blur",(()=>{setTimeout((()=>{var t;if(e.props.didLoadMore)return e.props.didLoadMore=!1,void(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus());if(e._value){const t=e.props.option;de.isRecord(t)&&void 0!==t.value?e.props.searchValue=t.label:e.props.searchValue=""}else e.props.searchValue=""}),150)}))}(t)),t.on("prop:options",(({payload:e})=>{"function"!=typeof t.props.optionsLoader&&(To.has(t)?To.delete(t):(t.props.initialOptions=[...e],setTimeout((()=>J(t)),0)))})),t.on("click",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("created",(()=>{t.props.openOnClick=de.undefine(t.props.openOnClick),t.context&&(t.context.handlers.toggleListbox=U.bind(null,t),t.context.handlers.removeSelection=Z.bind(null,t),t.context.handlers.touchmove=Q.bind(null,t),t.context.handlers.touchend=ee.bind(null,t))})),t.on("keydown",(({payload:e})=>{"option"!==t.props.selectionAppearance||!t._value||t.props.isLoadingOption||t.props.multiple||(["Backspace","Delete"].includes(e.key)||"Tab"!==e.key)&&e.preventDefault()})),t.on("prop:expanded",(({payload:e})=>{e&&t.props.searchValue?J(t,!0):e||So.delete(t)})),t.on("prop:searchValue",(({payload:e})=>{t.props.multiple||(t.props.inputText=e),e!==o&&J(t),null!==o&&null===e&&(t.props.expanded=!1),o=e}))}}function le(e,t=[],o,n){function r(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const o=Vo.get(t),r=e.currentTarget;r.id="dropZone";const i=t.children;if(i&&i instanceof HTMLCollection)for(let e=0;e<i.length;e++)if(i[e]instanceof HTMLElement){const t=i[e];if(n&&!n(t))continue;Mo.set(t,{value:o[e],index:e})}const s=Mo.get(r);a=s.index,p=s.value,setTimeout((function(){const e=document.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function i(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const o=Mo.get(t.currentTarget),n=o.index,r=t.currentTarget;if(p===o.value)return;const i=document.getElementById("dropZone");r&&e&&i&&(n<a?e.insertBefore(i,r):e.insertBefore(i,r.nextSibling),a=n,p=o.value)}}function s(t){t.preventDefault();const r=document.getElementById("dropZone"),i=null==r?void 0:r.parentNode;if(i&&e===i&&(i.removeEventListener("drop",s),r&&r.parentNode)){r.classList.remove("dropZone"),r.removeAttribute("id");const e=[],t=i.children;if(t&&t instanceof HTMLCollection){for(let o=0;o<t.length;o++)if(t[o]instanceof HTMLElement){const r=t[o];if(n&&!n(r))continue;const i=Mo.get(r);e.push(i.value)}Vo.set(i,e),o&&o(e)}}}function l(e){e.preventDefault(),s(e)}let a=0,p=null;if(Bo.has(e))Vo.set(e,t),e.addEventListener("drop",s);else{const o=new MutationObserver((function(){const o=e,s=[];for(let e=0;e<o.children.length;e++){const t=o.children[e];(n&&n(t)||!n)&&s.push(t)}s.forEach(((e,o)=>{const n=Mo.get(e);t&&(n?Mo.set(e,{value:n.value,index:o}):Mo.set(e,{value:t[o],index:o})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","-1"),e.addEventListener("dragstart",r),e.addEventListener("dragend",l),e.addEventListener("dragenter",i)}))}));o.observe(e,{childList:!0}),e.addEventListener("drop",s),document.addEventListener("drop",s),Bo.add(e);const a=[];for(let t=0;t<e.children.length;t++){const o=e.children[t];(n&&n(o)||!n)&&a.push(o)}const p=[];for(let e=0;e<a.length;e++)a[e].setAttribute("draggable","true"),a[e].setAttribute("tabindex","-1"),a[e].addEventListener("dragstart",r),a[e].addEventListener("dragend",l),a[e].addEventListener("dragenter",i),Mo.set(a[e],{value:t[e],index:e}),p.push(t[e]?t[e]:e);Vo.set(e,p)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function ae(e){function t(t){e.input(t)}function o(t){e.props.selectedTagValue=t.value}let n;e.addProps(["disableDragAndDrop","allowNewValues"]),e.props.disableDragAndDrop=de.undefine(e.props.disableDragAndDrop),"taglist"===e.props.type?(e.props.multiple=!0,e.props.selectionAppearance="option",e.props.allowNewValues=de.undefine(e.props.allowNewValues),n=e=>e.classList.contains("formkit-tag-wrapper")):"autocomplete"===e.props.type&&(n=e=>e.classList.contains("formkit-selection")),e.on("created",(()=>{e.context&&(e.context.handlers.selectTag=e=>o.bind(null,e))})),e.on("prop:loadingCounter",(({payload:o})=>{0===o&&Do&&!e.props.disableDragAndDrop&&setTimeout((()=>{const o=document.getElementById(`${e.props.id}_selections`);o&&le(o,e._value,t,n)}))})),e.on("commit",(({payload:o})=>{if(e.context&&Do){const r=e.props.id;if(Do&&r&&!e.props.disableDragAndDrop){const r=document.getElementById(`${e.props.id}_selections`);if(!r)return;le(r,o,t,n)}}})),e.on("keydown",(({payload:t})=>{if(t.currentTarget instanceof HTMLElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)&&t.altKey){t.stopPropagation(),t.preventDefault();const o=document.activeElement,n=e.props.selections.find((t=>t.value===e.props.selectedTagValue)),r=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));"ArrowRight"===t.key?r<e.props.selections.length-1&&(e.props.selections.splice(r,1),e.props.selections.splice(r+1,0,n)):"ArrowLeft"===t.key&&r>0&&(e.props.selections.splice(r,1),e.props.selections.splice(r-1,0,n)),S(e,e.props.selections),e.input(e.props.selections.map((e=>e.value))),setTimeout((()=>{o.focus()}))}else if(t.target instanceof HTMLElement&&document.activeElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)){if("ArrowRight"===t.key){const o=t.target.nextElementSibling;if(o&&o instanceof HTMLElement&&o.getAttribute("data-value"))e.props.selectedTagValue=o.getAttribute("data-value"),o.focus();else if(o&&o instanceof HTMLElement&&o.id===e.props.id){const t=document.getElementById(e.props.id);t&&t.focus()}}else if("ArrowLeft"===t.key){const o=t.target.previousElementSibling;o&&o instanceof HTMLElement&&o.getAttribute("data-value")&&(e.props.selectedTagValue=o.getAttribute("data-value"),o.focus())}}else if("Enter"===t.key&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&t.currentTarget.id===e.props.id&&e.props.inputText&&"taglist"===e.props.type){if(t.preventDefault(),e.props.activeValue===je)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>de.eq(f(t),e.props.activeValue)));o&&e.props.expanded?e.emit("optionSelected",o):e.props.allowNewValues&&e.emit("optionSelected",{value:e.props.inputText,label:e.props.inputText})}else if(t.currentTarget&&t.currentTarget instanceof HTMLElement&&t.currentTarget.id!==e.props.id&&["Backspace"].includes(t.key)&&document.activeElement&&document.activeElement instanceof HTMLElement){const t=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));if(-1===t)return;if(0===t&&1===e.props.selections.length)Z(e,e.props.selections[t],!0)();else if(t===e.props.selections.length-1){Z(e,e.props.selections[t],!0)(),e.props.selectedTagValue=e.props.selections[t-1].value;const o=document.activeElement.previousElementSibling;if(o){const e=o.getAttribute("data-value");o&&o instanceof HTMLElement&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}else{e.props.selectedTagValue=e.props.selections[t+1].value,Z(e,e.props.selections[t],!1)();const o=document.activeElement.nextElementSibling;if(o&&o instanceof HTMLElement){const e=o.getAttribute("data-value");e&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}}else if(["ArrowLeft"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd){if(t.stopPropagation(),0===e.props.selections.length)return;e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}else if(["Backspace"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd&&e.props.selections.length>0){t.stopPropagation(),e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}}))}function pe(e){const t=Array.isArray(e.props.options)?e.props.options:[],o=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(t);return!!o.length&&(!!Array.isArray(e.value)&&e.value.reduce(((t,n)=>{const r=o.find((e=>de.eq(n,f(e))));return r?t.push(r):e.props.arbitraryValues&&t.push({value:n,label:n}),t}),[]))}Object.defineProperty(exports,"__esModule",{value:!0});var de=require("@formkit/utils"),ce=require("@formkit/core"),ue=require("@formkit/inputs");const fe=[988,24029,396,13078,980];let me=189024;const ve=/^[0-9a-f]+$/,ge="undefined"!=typeof window,he=r(32,(e=>e)).map((()=>{me|=0,me=me+1831565813|0;let e=me^me>>>15|me;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),$e=setTimeout,ye={},be=e=>e.toString(32),xe=e=>`${be(he[e]).substring(2)}.${be(fe[e%(fe.length-1)])}`,we={},_e={},ke=new Set(["",null,void 0]),Te={},Ee={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Le={overflow:"hidden",height:"100%"},Se={},Ae={};let Ce=0;const Ie=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple","data-disabled":"$disabled || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id"}}),Oe=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),Me=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Ve=()=>({$el:"ul",if:"$fns.length($messages)"}),Be=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),De=()=>({$el:"div",if:"$help"}),He=()=>({$el:null}),We=(e,t)=>()=>ue.icon(e,t),Re=new WeakSet,Ne=new WeakMap,Pe="undefined"!=typeof window,ze=ce.createMessage({key:"loading",type:"state",value:!0,visible:!1}),Ke=ce.createMessage({key:"loading",type:"state",value:!1,visible:!1}),je=Symbol(),qe="undefined"!=typeof window,Xe=d("dd"),{outer:Fe,wrapper:Ye,inner:Ue,icon:Ze,label:Je,prefix:Ge,suffix:Qe,help:et,messages:tt,message:ot}=c(Xe),nt=Xe("selector",(()=>({$el:"button",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",tabindex:"0","aria-has-popup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),rt=Xe("selection","div"),it=Xe("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),st=Xe("optionLoading","span"),lt=Xe("option",(()=>({$el:"div",attrs:{"data-is-placeholder":"$option.isPlaceholder || undefined"}}))),at=I(Xe),pt={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},dt={schema:Fe(Ye(Je("$label"),Ue(Ze("prefix"),Ge(),nt(u("$option.isPlaceholder && $state.loading !== true",it("$option.label"),rt(lt(u("$state.loading",st("$ui.isLoading.value"),"$option.label")))),u("$state.loading",Ze("loader")),Ze("select")),at(),Qe(),Ze("suffix"))),et("$help"),tt(ot("$message.value"))),type:"input",family:"dropdown",props:[],features:[ue.options,_(C,(function(e){e.on("click",(()=>{e.props.trackHover=!1,e.props.expanded=!0}))}),A,T(E),(function(e){let t,o="";e.on("unusedKeyDown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){clearTimeout(t),o+=n.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=f(r)),t=setTimeout((()=>{o=""}),400)}}))})),function(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&ce.error(300,[e]),e.props.dropdownWrapperStyles=de.clone(pt),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=O.bind(null,e),e.props.positionListBox=M.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Ce=document.documentElement.scrollTop;for(const e in Ee)Ae[e]=document.documentElement.style[e],document.documentElement.style[e]=Ee[e];for(const e in Le)Se[e]=document.body.style[e],document.body.style[e]=Le[e];document.body.scrollTop=Ce}():function(){for(const e in Ee)document.documentElement.style[e]=Ae[e];for(const e in Le)document.body.style[e]=Se[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ce}())}))},ue.defaultIcon("select","select"),ue.defaultIcon("selected","check"),ue.defaultIcon("loader","spinner"),ue.localize("isLoading"),ue.localize("loadMore")]},ct=d("tg"),{outer:ut,wrapper:ft,label:mt,prefix:vt,suffix:gt,help:ht,messages:$t,message:yt,icon:bt}=c(ct),xt=ct("input",(()=>({$el:"input",attrs:{type:"checkbox",id:"$id",value:"$_value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),wt=ct("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner)",$el:"label",attrs:{for:"$id"},children:"$label"}))),_t=ct("altLabel",(()=>({$el:"label",if:"$label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),kt=ct("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"}}))),Tt=ct("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"}}}))),Et=ct("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Lt=ct("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),St=ct("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),At={schema:ut(ft(_t(),Et(vt(),xt(),Lt(kt(),St(u("$slots.default","$slots.default",bt("thumb")))),gt()),Tt(),wt()),ht("$help"),$t(yt("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay"],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",(()=>{e.props.disabled=de.undefine(e.props.disabled),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=de.eq(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))}))}]},Ct=d("rp"),{outer:It,inner:Ot,prefix:Mt,suffix:Vt,help:Bt,messages:Dt,message:Ht,icon:Wt}=c(Ct),Rt=Ct("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($item.__key)",type:"button"}}))),Nt=Ct("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),Pt=Ct("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($item.__key)",type:"button"}}))),zt=Ct("items",(()=>({$el:"ul",attrs:{role:"list"}}))),Kt=Ct("item",(()=>({$el:"li",for:["item","index","$value"],if:"$item.__key",attrs:{role:"listitem",key:"$item.__key","data-index":"$item.__index"}}))),jt=Ct("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($item.__key, 1)",type:"button"}}))),qt=Ct("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($item.__key, -1)",type:"button"}}))),Xt=Ct("content","div"),Ft=Ct("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),Yt=Ct("legend",(()=>({$el:"legend",if:"$label"}))),Ut=Ct("group",(()=>({$formkit:"group",id:"$item.__key",index:"$item.__index"}))),Zt=Ct("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),Jt=Ct("remove",(()=>({$el:"li",if:"$removeControl"}))),Gt=Ct("insert",(()=>({$el:"li",if:"$insertControl"}))),Qt=Ct("up",(()=>({$el:"li",if:"$upControl"}))),eo=Ct("down",(()=>({$el:"li",if:"$downControl"}))),to=Ct("controlLabel","span");let oo=0;const no=new Set,ro={schema:It(Ft(Yt("$label"),Bt("$help"),Ot(Mt(),u("$slots.default",zt(Kt(Xt(Ut("$slots.default")),Zt(Qt(qt(to("$ui.moveUp.value"),Wt("moveUp"))),Jt(Pt(to("$ui.remove.value"),Wt("remove"))),Gt(Rt(to("$ui.add.value"),Wt("add"))),eo(jt(to("$ui.moveDown.value"),Wt("moveDown"))))))),Vt()),Nt('$addLabel || ($ui.add.value + " " + ($label || ""))')),Dt(Ht("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){const t=new Set,o={value:0};P(e,"removeControl",!0),P(e,"upControl",!0),P(e,"downControl",!0),P(e,"insertControl",!1),P(e,"addButton",!0),P(e,"addLabel",!1),P(e,"addAttrs",{}),e.plugins.add(V),e.plugins.add(N.bind(null,t)),e.hook.input(((n,r)=>r(W(n,e,t,o)))),e.on("commit",(({payload:t})=>{no.has(e)&&e.input(t,!1)})),e.hook.commit(((t,n)=>{o.value&&Array.isArray(t)&&t.forEach(((n,r)=>{const s=Object.isFrozen(n)&&e.children.findIndex((e=>e.props.id===n.__key));if(!1!==s&&-1!==s){o.value--;const l=n.__index,a=n.__original;Object.defineProperty(a,"__index",{configurable:!0,value:l});const p=i(t);p.splice(r,1),p.splice(l,0,a);const[d]=e._c.children.splice(s,1);d&&e._c.children.splice(l,0,d),0===o.value&&(R(e,t),t.forEach((e=>delete e.__index)))}})),R(e,t);const r=t[t.length-1];return de.isObject(r)&&"__shim"in r&&function(e){const t=e.findIndex((e=>de.isObject(e)&&"__shim"in e));-1!==t&&e.splice(t)}(t),n(t)})),e.on("created",D)},ue.localize("remove"),ue.localize("add"),ue.localize("moveUp"),ue.localize("moveDown"),ue.defaultIcon("remove","trash"),ue.defaultIcon("add","add"),ue.defaultIcon("moveUp","arrowUp"),ue.defaultIcon("moveDown","arrowDown")]},io="undefined"!=typeof window,so=d("rt"),{outer:lo,wrapper:ao,inner:po,label:co,prefix:uo,suffix:fo,help:mo,messages:vo,message:go,icon:ho}=c(so),$o=so("input",(()=>({$el:"input",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$_value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),yo=so("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),bo=so("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),xo=so("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),wo=so("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),_o=so("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),ko={schema:lo(ao(co("$label"),po(ho("prefix"),uo(),yo(bo(wo(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),ho("rating"))))),xo(_o(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),ho("rating")))))),$o(),fo(),ho("suffix"))),mo("$help"),vo(go("$message"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.disabled=de.undefine(e.props.disabled),e.on("created",(()=>{io&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=K.bind(null,e),e.context.handlers.ratingHoverOut=j.bind(null,e),e.context.handlers.handleClick=z.bind(null,e),io&&s(`${e.props.id}`,(()=>{X(e),function(e){const t=document.getElementById(`${e.props.id}_items_wrapper`);if(!t)return;new ResizeObserver((()=>{X(e)})).observe(t)}(e),setTimeout((()=>X(e)),100)})))})),e.on("input",(()=>F(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),i=Number(e.props.max);return n>i?o(i):e.props.min&&n<=r?o(r):o(n)}))},ue.defaultIcon("rating","star")]},To=new WeakSet,Eo=new WeakMap,Lo=new WeakMap,So=new WeakMap,Ao=new WeakMap,Co=new WeakMap,Io="undefined"!=typeof window;let Oo=!1;const Mo=new WeakMap,Vo=new WeakMap,Bo=new WeakSet,Do="undefined"!=typeof window,Ho=d("ac"),{outer:Wo,wrapper:Ro,inner:No,icon:Po,label:zo,prefix:Ko,suffix:jo,help:qo,messages:Xo,message:Fo}=c(Ho),Yo=Ho("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",tabindex:"0",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),Uo=Ho("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),Zo=Ho("selection",(()=>({for:["option","index","$selections"],$el:"div",attrs:{key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),Jo=Ho("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"',onKeydown:"$handlers.keydown"}}))),Go=Ho("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),Qo=Ho("optionLoading","span"),en=Ho("option",(()=>({$el:"div",if:"$_value !== undefined"}))),tn=I(Ho),on={schema:Wo(Ro(zo("$label"),No(Po("prefix"),Ko(),Yo(),u("$multiple !== true && $selectionAppearance === option",Jo(Zo(en(u("$state.loading",Qo("$ui.isLoading.value"),"$option.label")),Go(Po("close"))))),u("$state.loading",Po("loader")),Uo(Po("select")),tn(),jo(),Po("suffix")),u("$multiple && $selectionAppearance === option",Jo(Zo(en(u("$state.loading",Qo("$ui.isLoading.value"),"$option.label")),Go(Po("close")))))),qo("$help"),Xo(Fo("$message.value"))),type:"input",family:"dropdown",props:[],features:[ue.options,ae,_(A,T(E)),se(E),ue.defaultIcon("select","select"),ue.defaultIcon("close","close"),ue.defaultIcon("selected","check"),ue.defaultIcon("loader","spinner"),ue.localize("isLoading"),ue.localize("loadMore")]},nn=d("tl"),{outer:rn,wrapper:sn,inner:ln,icon:an,label:pn,prefix:dn,suffix:cn,help:un,messages:fn,message:mn}=c(nn),vn=nn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",tabindex:"0",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),gn=nn("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),hn=nn("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),$n=nn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),yn=nn("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),bn=nn("tagLabel",(()=>({$el:"span"}))),xn=nn("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite",onKeydown:"$handlers.keydown"}}))),wn=nn("tagLoading","span"),_n=I(nn),kn={schema:rn(sn(pn("$label"),ln(an("prefix"),dn(),xn(hn($n(u("$state.loading",wn("$ui.isLoading.value"),bn("$option.label")),yn(an("close")))),vn()),u("$state.loading",an("loader")),gn(an("select")),_n(),cn(),an("suffix"))),un("$help"),fn(mn("$message.value"))),type:"input",family:"dropdown",props:[],features:[ue.options,ae,_(A,T(pe)),se(pe),ue.defaultIcon("select","select"),ue.defaultIcon("close","close"),ue.defaultIcon("selected","check"),ue.defaultIcon("loader","spinner"),ue.localize("isLoading"),ue.localize("loadMore")]};var Tn=Object.freeze({__proto__:null,dropdown:dt,toggle:At,repeater:ro,rating:ko,autocomplete:on,taglist:kn});const En=setInterval;exports.$if=u,exports.autocomplete=on,exports.createBaseSections=c,exports.createProPlugin=function(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){!function(e,t){Te[e]?Te[e].add(t):Te[e]=new Set([t])}(e,(e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:be(13919),children:be(466954343885)}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)}))}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!ve.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,i=n.substring(r,r+(n.length-6)),s=n.substring(0,r)+n.substring(r+i.length),l=s.slice(0,2),a=`${s[s.length-1]}${s[0]}`;Number(i)!==Math.floor(Number(s)*Number(l)/Number(a))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];o.define({...r,schema:n(e)})}En((()=>ke.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=d,exports.dropdown=dt,exports.inputs=Tn,exports.rating=ko,exports.repeater=ro,exports.taglist=kn,exports.toggle=At;
package/index.mjs CHANGED
@@ -1 +1 @@
1
- function e(e,o){e in Re||(Re[e]={timer:0,inputs:new Set});const n=Re[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=Be(t.bind(null,e),500)}function t(e){if(Me){window.addEventListener([30548127325,27022924,34729821653783].map(De).join("y"),(t=>{const n=new URL(t.blockedURI).hostname;Oe.some(((e,t)=>We(t)===n))&&(o(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const n=De(18806588),r="://",i=(new Date).getDate(),s=async()=>{(e=>{clearTimeout(He[e]),delete He[e]})(e);const l=Array.from(Re[e].inputs),p=l.filter((t=>!(Ne[e]&&Ne[e].has(t)))).join("");if(p){t++;try{const s=await window[De(16217489)](`${n}${r}${We((i+t)%Oe.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}`)}`),a=await s.json();if(a[De(502357)])return o(e,a.schema);if(s.ok)return Ne[e]||(Ne[e]=new Set),void l.forEach((t=>Ne[e].add(t)))}catch(e){}t<2&&Be(s,1e4*Math.random())}};s()}}function o(e,t){Pe.add(e),function(e,t){Ke[e]&&Ke[e].forEach((e=>e(t)))}(e,t)}function n(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return He[o]||(He[o]=Be((()=>Pe.add(o)),3e3)),Pe.has(o)?null:t}function r(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function i(e){const t=e&&ce(e)&&e.__v_raw;return t?i(t):e}function s(e,t){if(Me){const o=document.getElementById(e);if(o)return t(o);const n=new MutationObserver((()=>{const o=document.getElementById(e);o&&(n.disconnect(),t(o))}));n.observe(document.body,{childList:!0,subtree:!0})}}function l(e){return ue(e)&&"value"in e&&"label"in e}function p(e,t,o,r){return(...i)=>s=>l=>{const p=function(e,t,o,r,i,s){const l=s[o],p="function"==typeof r?r():{$el:r},d=i.map((e=>"string"==typeof e?e:e(t)(s)));let c=d.length&&p?Te(p,{children:d}):p;if(c=Te(c,l),"object"==typeof c){let r=c;if(!ge(c)&&!$e(c)||c.meta||(c.meta={section:o}),ge(c)){const{$el:i,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${o}`,...s.attrs}):s.attrs={class:`$classes.${o}`},r=a(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:n.bind(null,i,t,e)}))}else if($e(c)){const{$cmp:i,...s}=c;r=a(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:n.bind(null,i,t,e)}))}else"$formkit"in c&&(c.outerClass=`$classes.${o}`);return r}return a(t,o,c)}(e,s,t,o,i,l);return r&&ue(p)&&(p.memo=e+JSON.stringify(l)),r?[p]:p}}function a(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 d(e){return(t,o,n=!1)=>p(e,t,o,n)}function c(e){return{outer:e("outer",Ue,!0),wrapper:e("wrapper","div",!1),inner:e("inner",Ze,!1),icon:tt,label:e("label",qe,!1),prefix:e("prefix",et,!1),suffix:e("suffix",et,!1),help:e("help",Qe,!1),messages:e("messages",Je,!1),message:e("message",Ge,!1)}}function u(e,t,o){return n=>r=>{const i="string"==typeof t?t:t(n)(r);return o?{if:e,then:i,else:"string"==typeof o?o:o(n)(r)}:(_e(i)?Object.assign(i.else,{if:e}):ke(i)&&Object.assign(i,{if:e}),i)}}function f(e){return"__original"in e?e.__original:e.value}function m(e,t=!0){e.store.set(it),e.props.loadingCounter++,e.store.set(ye({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,nt.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function v(e,t,o){const n=Ee(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=f(r))}function h(e,t){new MutationObserver((()=>{const o=e.props.positionListBox(t);ot.delete(e),g(e,o);let n,r=null;const i=new ResizeObserver((()=>{clearTimeout(n),n=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),r||(r=e.on("prop:expanded",(()=>{i.disconnect(),e.off(r)})))}),100)}));i.observe(t)})).observe(t,{childList:!0,subtree:!0})}function g(e,t){if(!e.props.expanded||!e.props.options||!e.props.options.length||ot.has(e))return;const o=e.props.options.reduce(((t,o,n)=>{var r;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const i=document.getElementById(`${e.props.id}_listitem_${n}`);return i&&t.push([i,o]),t}),[]),n=document.getElementById(`${e.props.id}_load_more`);n&&o.push([n,e.props.loadMoreOption]),ot.add(e),o.length&&b(e,o,t)}function $(e,t){let o=null;if(e.props.activeDescendant){o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>me(e.value,f(t)))),-1===o&&(o=null);document.getElementById(e.props.activeDescendant)&&x(e)}if("undefined"==typeof window)return o;const n=t.getBoundingClientRect(),r=document.getElementById(`${e.props.id}`);if(r){const t=r.getBoundingClientRect();t.top+t.height+n.height>window.innerHeight&&t.top+t.height>n.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return o}function y(){}function b(e,t,o){var n,r,i;const s=document.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const n=s?s.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const i=(t,n)=>{var r;const i=n[0],{y:s,height:l,x:p,width:a}=i.getBoundingClientRect();if(e.props.mouseX>p&&e.props.mouseX<p+a&&e.props.mouseY>s&&e.props.mouseY<s+l){o=t;const i=n[1];return e.props.activeValue=i&&!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)?f(i):void 0,!0}return!1};do{if(null!==n&&i(n,t[n]))break;if(null!==r&&i(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||x(e),e.props.expanded?(s&&e.props.loadOnScroll&&!(null===(n=e.store.loading)||void 0===n?void 0:n.value)&&(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&s.scrollTop+s.offsetHeight>s.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!1)),ot.has(e)?requestAnimationFrame(b.bind(null,e,t,o)):g(e,o)):ot.delete(e)}function x(e){const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(e.props.activeDescendant);if(!t||!o)return;const{y:n,height:r}=o.getBoundingClientRect(),{y:i,height:s}=t.getBoundingClientRect();n<i?(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop):n+r>i+s&&(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop+r-s)}function w(e,t){e.props.page++,nt.set(e,t),e.store.set(ye({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function _(...e){return t=>{t.addProps(["activeDescendant","activeValue","dropdownWrapperStyles","expanded","hasNextPage","isLoadingOption","listboxStyles","loadMoreOption","loadOnScroll","option","optionLoader","options","optionsLoader","page","placeholder","selections"]),t.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},t.props.page=1,t.props.loadMoreOption={label:"Load more",value:lt},t.props.listboxStyles={},t.props.styleWrapper=y.bind(null,t),t.props.positionListBox=$.bind(null,t),t.props.hasNextPage=w.bind(null,t),t.props.applyLoadedOptions=v,t.props.loadingCounter=0,t.props.disabled=fe(t.props.disabled),t.on("created",(()=>{if(!t.context)return;t.props.trackHover=!0,t.props.loadOnScroll=fe(t.props.loadOnScroll),t.context.touch=()=>{var e;null===(e=t.context)||void 0===e||e._value},t.context.handlers.loadMore=e=>{var o;t.props.didLoadMore=!0,setTimeout((()=>{t.props.didLoadMore=!1}),300),e instanceof MouseEvent&&(t.props.ignoreClickAway=!0,null===(o=document.getElementById(`${t.props.id}`))||void 0===o||o.focus()),m(t)},t.context.handlers.click=e=>{if(t.props.disabled)return;document.getElementById(`${t.props.id}`)&&"mouse"!==e.pointerType?(t.props.mouseX=-1,t.props.mouseY=-1):(t.props.mouseX=e.clientX,t.props.mouseY=e.clientY),t.emit("click",e)};const e=t.context.handlers.blur;t.context.handlers.blur=o=>{t.props.expanded?setTimeout((()=>e(o)),300):e(o),t.emit("blur")},t.context.handlers.keydown=e=>{t.props.disabled||(t.props.trackHover=!1,t.emit("keydown",e))},t.context.handlers.selectOption=e=>()=>{t.emit("optionSelected",e)},t.context.fns.isActive=e=>me(t.props.activeValue,f(e))||void 0,rt&&(s(`${t.props.id}_dropdown_wrapper`,(e=>{"overscroll"!==t.props.behavior&&"none"===getComputedStyle(e).maxHeight&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,maxHeight:"400px"})})),s(`${t.props.id}_dropdown_wrapper`,h.bind(null,t)))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e?"999":"-1",pointerEvents:e?"auto":"none"}}));const o=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};if(t.on("prop:trackHover",(({payload:e})=>{var n,r;rt&&(e?null===(r=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===r||r.removeEventListener("scroll",o):null===(n=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===n||n.addEventListener("scroll",o))})),t.on("prop:activeValue",(({payload:e})=>{if(e===lt)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const o=t.props.options.findIndex((t=>me(f(t),e)));t.props.activeDescendant=o>=0?`${t.props.id}_listitem_${o}`:void 0})),"undefined"!=typeof window){const e=e=>{e.target&&e.target instanceof Element&&e.target.closest(`#${t.props.id}_listbox`)||t.props.ignoreClickAway?t.props.ignoreClickAway=!1:(t.props.searchValue="",t.props.expanded=!1)},o=e=>{t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const o=document.getElementById(`${t.props.id}_dropdown_wrapper`);if(o){const n=o.getBoundingClientRect();e.clientX>n.x&&e.clientX<n.x+n.width&&e.clientY>n.y&&e.clientY<n.y+n.height&&(t.props.trackHover=!0)}};t.on("prop:expanded",(({payload:n})=>{n?(setTimeout((()=>document.addEventListener("click",e)),10),t.props.styleWrapper(),document.addEventListener("mousemove",o),t.props.optionsLoader&&0===t.props.options.length&&m(t)):(document.removeEventListener("click",e),document.removeEventListener("mousemove",o))}))}t.on("prop:loadingCounter",(({payload:e})=>{0===e&&t.store.set(st)})),rt&&window.addEventListener("blur",(e=>{e.target===window&&t.props.expanded&&(t.props.expanded=!1)})),e.map((e=>e(t)))}}function k(e,t,o){const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:l(e)?e:ue(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},i=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);return n instanceof Promise?(e.props.loadingCounter++,e.store.set(it),S(e),n.then((e=>{if("string"==typeof e||l(e))return i(r(e))})).finally((()=>{e.props.loadingCounter--}))):i(r(n))}function T(e){return t=>{t.on("commit",(({payload:o})=>{if(pt&&void 0!==o&&"function"==typeof t.props.optionLoader){const n=e(t,o);if(t.props.multiple&&Array.isArray(o))if(o.forEach((e=>k(t,e,Array.isArray(n)&&n.find((t=>me(t.value,e)))))),t.props.loadingCounter){t.props.isLoadingOption=!0;const n=t.on("prop:loadingCounter",(()=>{t.props.loadingCounter||(t.props.isLoadingOption=!1,S(t,e(t,o)),t.off(n))}))}else S(t,e(t,o));else if(!t.props.multiple&&!Array.isArray(n)&&o){const e=k(t,o,n);e instanceof Promise?(t.props.isLoadingOption=!0,e.then((e=>{S(t,e,o),t.props.isLoadingOption=!1}))):S(t,e,o)}return}const n=e(t,o);if(!pt||n||void 0===o||t.props.options&&t.props.options.length||"function"!=typeof t.props.optionsLoader)S(t,n,o);else{const n=m(t);S(t),n.then((()=>{S(t,e(t,o),o)}))}}))}}function E(e,t){const o=Array.isArray(e.props.options)?e.props.options:[],n=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(o);return!!n.length&&(e.props.multiple?!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const o=n.find((e=>me(t,f(e))));return o&&e.push(o),e}),[]):n.find((e=>me(f(e),t)))||!1)}function L(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>me(f(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function S(e,t,o){var n;if(e.props.multiple&&Array.isArray(t))return e.props.option={label:t.map((e=>e.label)).join(", "),value:e.value},void(e.props.selections=t);"string"==typeof t?e.props.option={label:t,value:o}:t?e.props.option=t:t||null==o||(null===(n=e.store.loading)||void 0===n?void 0:n.value)?(e.props.option={label:e.props.placeholder||" ",value:void 0,isPlaceholder:!0},e.props.selections=[]):e.props.option={label:o,value:o},e.props.option.isPlaceholder||(e.props.selections=[e.props.option])}function A(e){e.on("keydown",(({payload:t})=>{var o,n;if("Tab"===t.key&&e.props.expanded)t.preventDefault();else if(["ArrowDown","ArrowUp"].includes(t.key)&&e.props.expanded){t.preventDefault(),t.stopPropagation();const n=e.props.options;if(!Array.isArray(n)||!n.length)return;const r=n.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(f(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&r.push(lt);const i=r.indexOf(e.props.activeValue);-1===i&&r.length?e.props.activeValue=r[0]:"ArrowDown"===t.key&&r.length>i+1?e.props.activeValue=r[i+1]:"ArrowUp"===t.key&&i>0&&(e.props.activeValue=r[i-1])}else if(!e.props.expanded&&["ArrowDown","Up","Down","ArrowUp","Enter"].includes(t.key)&&e.props.id===(null===(n=document.activeElement)||void 0===n?void 0:n.id))t.preventDefault(),!e.props.expanded&&e.isSettled&&(e.props.expanded=!0);else if("Enter"===t.key&&e.props.expanded){if(t.preventDefault(),e.props.activeValue===lt)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>me(f(t),e.props.activeValue)));o&&e.emit("optionSelected",o)}else["Esc","Escape"].includes(t.key)?(t.preventDefault(),e.props.expanded=!1):e.emit("unusedKeyDown",t)}))}function C(e){e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t=>me(e.value,f(t)))})),e.on("prop:expanded",(({payload:t})=>{t&&L(e)})),e.on("optionSelected",(({payload:t})=>{var o,n,r;f(t)!==lt?(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||(e.props.skipNextFilter=!0,e.input(f(t)),e.props.expanded=!1,e.props.id&&(null===(r=document.getElementById(e.props.id))||void 0===r||r.focus())):null===(o=e.context)||void 0===o||o.handlers.loadMore()}))}function V(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant"}}))),n=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$fns.isSelected($option)","data-is-active":"$fns.isActive($option)"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.loadMore","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)"}}))),i=e("loadMoreInner","span"),s=e("option","div");return()=>t(o(n(u("$fns.isSelected($option)",tt("selected")),s("$option.label")),r(i(u("$state.loading",tt("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))}function I(e){if("undefined"==typeof window)return;const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(`${e.props.id}`);if(!o||!t)return;const n=t.style.paddingTop,r=t.style.paddingBottom,i=t.style.paddingLeft;t.style.paddingTop="0",t.style.paddingBottom="0",t.style.paddingLeft="0";const s=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=Math.round(s.top-l.top)+"px",a=Math.round(s.left-l.left-5)+"px",d=Math.max(Math.round(Math.min(l.height-l.top,window.innerHeight)-(s.top+s.height)),0)+"px";t.style.paddingTop=n,t.style.paddingBottom=r,t.style.paddingLeft=i,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:p,paddingLeft:a,paddingBottom:d},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${s.width+"px"}, calc(100vw - 4em))`:s.width+"px",maxWidth:"calc(100vw - 4em)"}}function M(e,t){let o=null;if(e.props.activeDescendant){const n=document.getElementById(e.props.activeDescendant);if(!n)return o;e.props.ignoreScroll=!0;const r=document.getElementById(`${e.props.id}_listbox`);if(!r)return o;const i=t.getBoundingClientRect(),s=r.getBoundingClientRect(),l=parseInt(getComputedStyle(t).paddingTop),p=parseInt(getComputedStyle(t).paddingBottom),a=n.offsetTop-l,d=Math.max(a-l,0),c=Math.max(t.scrollHeight-p-a-i.height,0),u=s.height-d-c;t.scrollTop=a;const m=()=>{t.scrollTop=c>0?c<l?t.scrollHeight:l:d<p?0:a-p},v=Math.min(150,s.height);d>0&&c>0||0===d&&0===c||u>v?t.scrollTop=a:m();t.clientHeight/2<t.scrollTop&&(o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>me(e.value,f(t))))),-1===o&&(o=null)}return o}function O(e){return"radio"===e.props.type&&(e.props.altName=`${e.name}_${bo++}`),!0}function B(e){return!ce(e)||"__key"in e||"__shim"in e||Object.defineProperty(e,"__key",{enumerable:!1,writable:!0,value:he()}),e}function H({payload:e}){if(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(e.props.disabled=fe(e.props.disabled),Array.isArray(e.value))if(e.value.length<e.props.min){const t=r(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(r(e.props.min,(()=>({}))),!1);e.context&&(e.context.fns.createRemover=e=>()=>{var t,o;null===(t=xe(e))||void 0===t||t.each((e=>e.destroy())),null===(o=xe(e))||void 0===o||o.destroy()},e.context.fns.createInsert=t=>()=>{if(Array.isArray(e.value)){const o=e.value.findIndex((e=>e.__key===t)),n=e.value;n.splice(o+1,0,{}),e.input(n,!1)}},e.context.fns.createShift=(e,t)=>()=>{const o=xe(e);if(!o||!o.parent)return;const n=o.index+t;n>=0&&n<o.parent.children.length&&(o.index=o.index+t)},e.context.fns.createAppend=()=>()=>{if(Array.isArray(e.value)){const t=e.value;t.push({}),e.input(t,!1)}})}function D(e,t){const o=e._c.children.find((e=>e.props.id===t));o&&(o.props.preserve=!0,o.destroy())}function W(e,t,o,n){if(Array.isArray(e)){const r=function(e,t){const o=e.map((e=>e.__key));return t.children.reduce(((e,t,n)=>{const r=t.props.id;return r&&!o.includes(r)&&e.set(n,r),e}),new Map)}(e,t);e.forEach(((i,s)=>{B(i);const[l,p]=function(e,t,o,n,r){if(!o.has(e.__key)&&!e.__shim&&!Object.isFrozen(e)){const i=r&&r.get(t);e.__key=he();const s=Object.freeze(Object.defineProperties({},{__key:{value:e.__key},__original:{value:e},__index:{value:t},__prevKey:{value:i}}));return o.add(e.__key),n.value++,[!0,s]}return[!1,e]}(i,s,o,n,r);l&&(e.splice(s,1,p),D(t,p.__prevKey),r.delete(s))})),r.size&&r.forEach((o=>{const n=e.findIndex((e=>e.__key===o));-1!==n&&e.splice(n,1),D(t,o)})),xo.delete(t)}return e}function R(e,t){t.sort(((e,t)=>"__shim"in e||"__shim"in t?"__shim"in t&&!("__shim"in e)?-1:1:"__index"in e&&"__index"in t?e.__index>t.__index?1:-1:0)),e._c.children.sort(((e,o)=>{const n=t.findIndex((t=>t.__key===e.props.id)),r=t.findIndex((e=>e.__key===o.props.id));return-1!==n&&-1!==r?n>r?1:-1:-1===n&&-1==r?0:n>-1?1:-1}))}function N(e,t){return"group"===t.type&&t.hook.input(((o,n)=>(void 0===o?o={__shim:!0}:(B(o),e.has(o.__key)||o.__shim||!t.parent||xo.add(t.parent)),n(o)))),!1}function P(e,t,o){void 0===e.props[t]&&(e.props[t]=o)}function K(e,t){var o;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let n;t instanceof MouseEvent?n=t.clientX:(n=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let r=z(e,n,t.currentTarget)||0;r=r>e.props.min?r:e.props.min,r=r<e.props.max?r:e.props.max,e.input(r),null===(o=document.getElementById(`${e.props.id}`))||void 0===o||o.focus()}}function j(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){Y(e,z(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function X(e){Y(e)}function z(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function F(e){setTimeout((()=>{const t=document.getElementById(`${e.props.id}`);t&&(e.props.wrapperWidth=`0 0 ${t.offsetWidth/e.props.max}px`)}))}function Y(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function U(e,t,o){const n=zo.get(e);if(n===e.props.searchValue||!n&&!e.props.searchValue)return v(e,t,o);const r=Ee(o);e.props.options=r,L(e),zo.set(e,e.props.searchValue)}function Z(e){var t;e.props.expanded=!e.props.expanded,e.props.expanded&&(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus())}function q(e,t,o=!0){return()=>{e.props.multiple?e.emit("optionRemoved",t):(e.input(void 0),e.props.searchValue=""),o&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)}}function J(e,t=!1){if("function"==typeof e.props.optionsLoader){if(t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(jo.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);jo.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else Array.isArray(e.props.options)&&(Ko.add(e),"string"==typeof e.props.searchValue&&(e.props.options=e.props.initialOptions.filter((t=>e.props.filter(t,e.props.searchValue)))));e.props.skipNextFilter=!1,L(e)}function G(e,t){var o;const n=e.props.highlightedRange,r=n.index,i=n.start+(r?1:0),s=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[i,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-s+(t.length-1>n.index?-1:0)]}function Q(e,t){const o=document.getElementById(`${e.props.id}`);if(o instanceof HTMLInputElement){const n=Fo.get(e);if(n){const[e,r]=n,i=t.touches[0].clientX-r;o.scrollLeft=e-i}else Fo.set(e,[o.scrollLeft,t.changedTouches[0].clientX])}}function ee(e){Fo.delete(e)}function te(e,t){const o=t.target;e.props.expanded=!0,e.props.searchValue=o.value,""===e.props.searchValue&&e.input(void 0)}function oe(e,t){const o=t.target.value;e.props.inputText=o,e.props.expanded=!0,"option"!==e.props.selectionAppearance?""===o?(e.props.searchValue=null,e.input([])):!e._value||Array.isArray(e._value)&&!e._value.length?e.props.searchValue=o:Array.isArray(e._value)&&e._value.length&&(e.props.searchValue=function(e){var t;const o=ne(e);if(e.props.highlightedRange){const[t,n]=G(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.searchValue=o}function ne(e){const t=e.props.getSelections(e,e._value);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const i=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let s=0;return t.length-1!==n&&s++,0!==n&&s++,e.push({option:o,index:n,start:i,end:i+o.label.length+s}),e}),[]):[]}function re(e){clearTimeout(Xo.get(e)),Xo.set(e,setTimeout((()=>{var t,o,n;const r=document.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const i=ne(e),s=i.findIndex((e=>null!==r.selectionStart?r.selectionStart>=e.start&&r.selectionStart<=e.end:null!==r.selectionEnd&&(r.selectionEnd>=e.start&&r.selectionEnd<=e.end))),l=null===(t=i[i.length-1])||void 0===t?void 0:t.end;if(0===r.selectionStart&&r.selectionEnd===(null===(o=e.props.inputText)||void 0===o?void 0:o.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(i.length){const t=e.props.highlightedRange,[o,n]=G(e,i);if(null!==r.selectionEnd&&(r.selectionEnd<o||r.selectionEnd>n)){const i=t.end-t.start-(n-o),s=r.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,r.value=e.props.inputText,r.selectionStart=r.selectionEnd=s+(s>o?i:0)}}}else if(s>=0&&null!==r.selectionStart&&(l!==(null===(n=e.props.inputText)||void 0===n?void 0:n.length)||r.selectionStart<l)){const t=i[s],o=e.props.inputText.substr(0,l),n=t.start+(t.index>0?1:0),p=t.end+(i.length-1>t.index?-1:0);o!==e.props.inputText&&(e.props.inputText=o,r.value=o),e.props.highlightedRange=t,r.selectionStart=n,r.selectionEnd=p}else e.props.highlightedRange=void 0,e.emit("scrollToEnd");if(null!==r.selectionStart&&r.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)&&null===e.props.searchValue){const t=e.props.inputText.substring(0,l);e.props.inputText=`${t}, ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}function ie(e){"option"===e.props.selectionAppearance?(e.on("prop:option",(()=>{e.props.inputText="",void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("blur",(()=>{e.props.inputText=""})),e.on("optionSelected",(({payload:t})=>{t.value!==lt&&(e.props.expanded=!1)}))):function(e){e.props.searchValue=null;const t=(t,o=!1)=>{var n;const r=document.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const i=ne(e),s=t>=0?t:i.length-1;if(void 0===i[s])return!1;const l=null===(n=i[s])||void 0===n?void 0:n.end;return null!==r.selectionStart&&(!o||r.selectionStart>=l&&r.selectionStart<=l+2)&&(r.selectionStart=i[s].start+(s>0?1:0),r.selectionEnd=i[s].end+(s<i.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("keydown",(({payload:o})=>{var n,r,i,s;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){const t=ne(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["Delete","Backspace"].includes(o.key)?e.props.highlightedRange&&!e.props.searchValue?e.emit("optionRemoved",e.props.highlightedRange.option):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault()):o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(i=e.props.inputText)||void 0===i?void 0:i.length)&&(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&0===e.props.selections.length&&o.preventDefault();"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault(),re(e)})),e.on("prop:highlightedRange",(({payload:t})=>{t&&e.props.expanded&&o!==t.option&&(o=t.option,e.props.activeValue=f(t.option))})),e.on("scrollToEnd",(()=>{const t=document.getElementById(`${e.props.id}`);t&&t.scrollTo({left:t.scrollWidth,behavior:"smooth"})})),e.on("prop:option",(({payload:t})=>{if(!t.isPlaceholder){let o="";if(Uo){const t=document.getElementById(`${e.props.id}`);document.activeElement===t&&Array.isArray(e._value)&&e._value.length&&(o=", ")}e.props.inputText=t.label+o}})),e.on("blur",(()=>{if(e._value){const t=e.props.option;ue(t)&&void 0!==t.value?e.props.inputText=t.label:e.props.inputText=""}else e.props.inputText=""}))}(e),e.on("commit",(()=>{void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("created",(()=>{if("option"!==e.props.selectionAppearance&&function(e){s(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Yo.set(t,e)})),Uo&&!Zo&&(Zo=!0,document.addEventListener("selectionchange",(()=>{if(document.activeElement instanceof HTMLInputElement&&Yo.has(document.activeElement)){const e=Yo.get(document.activeElement);e&&re(e)}})))}(e),e.props.option&&Array.isArray(e.props.option.value))for(const t of e.props.option.value)e.props.initialOptions.find((o=>{f(o)===t&&e.props.memoOptions.push(o)}));e.context&&(e.context.handlers.input=oe.bind(null,e))})),e.on("optionRemoved",(async({payload:t})=>{if(Array.isArray(e._value)){let o=-1;await e.input(e._value.filter(((e,n)=>e!==f(t)||(o=n,!1)))),e._value.length?setTimeout((()=>e.emit("selectRange",[o])),20):e.props.expanded=!1}})),e.on("prop:expanded",(({payload:t})=>{t||(e.props.searchValue=null)}))}function se(e){return t=>{let o;t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter"]),t.props.memoOptions=[],t.props.initialOptions=t.props.options,t.props.applyLoadedOptions=U,t.props.getSelections=e,t.props.nonceKey="searchValue",t.props.multiple=fe(t.props.multiple),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.props.selectionStyles={position:"absolute",pointerEvents:"none",width:"100%",left:"0",top:"0",bottom:"0",opacity:"0",overflow:"hidden"},t.props.multiple?(!function(e){function t(t){return!!Array.isArray(e.value)&&e.value.some((e=>me(e,f(t))))}e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t)})),e.on("optionSelected",(({payload:o})=>{var n,r,i;if(f(o)===lt)return void(null===(n=e.context)||void 0===n||n.handlers.loadMore());if(null===(r=null==o?void 0:o.attrs)||void 0===r?void 0:r.disabled)return;const s=Array.isArray(e._value)?e._value:[];t(o)?e.emit("optionRemoved",o):(e.props.memoOptions=[...e.props.memoOptions,o],e.props.highlightedRange?(s.splice(e.props.highlightedRange.index,1,f(o)),e.input(s),e.props.highlightedRange=void 0,e.props.expanded=!1):(e.input(s.concat(f(o))),e.emit("scrollToEnd"))),e.props.id&&(null===(i=document.getElementById(e.props.id))||void 0===i||i.focus())}))}(t),ie(t)):(C(t),function(e){e.props.searchValue="",e.on("created",(()=>{e.context&&(e.context.handlers.input=te.bind(null,e))})),e.on("input",(({payload:t})=>{const o=e.props.getSelections(e,t);e.props.searchValue=o&&(null==o?void 0:o.label)||e.props.searchValue,e.props.selectionStyles={...e.props.selectionStyles,opacity:void 0===t?"0":"1",pointerEvents:void 0===t?"none":"auto"}})),e.on("optionSelected",(({payload:t})=>{t.value!==lt&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)})),e.on("prop:option",(({payload:t})=>{ue(t)&&!t.isPlaceholder?e.props.searchValue=t.label:t.isPlaceholder&&(e.props.searchValue="")})),e.on("blur",(()=>{setTimeout((()=>{var t;if(e.props.didLoadMore)return e.props.didLoadMore=!1,void(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus());if(e._value){const t=e.props.option;ue(t)&&void 0!==t.value?e.props.searchValue=t.label:e.props.searchValue=""}else e.props.searchValue=""}),150)}))}(t)),t.on("prop:options",(({payload:e})=>{"function"!=typeof t.props.optionsLoader&&(Ko.has(t)?Ko.delete(t):(t.props.initialOptions=[...e],setTimeout((()=>J(t)),0)))})),t.on("click",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("created",(()=>{t.props.openOnClick=fe(t.props.openOnClick),t.context&&(t.context.handlers.toggleListbox=Z.bind(null,t),t.context.handlers.removeSelection=q.bind(null,t),t.context.handlers.touchmove=Q.bind(null,t),t.context.handlers.touchend=ee.bind(null,t))})),t.on("keydown",(({payload:e})=>{"option"!==t.props.selectionAppearance||!t._value||t.props.isLoadingOption||t.props.multiple||(["Backspace","Delete"].includes(e.key)||"Tab"!==e.key)&&e.preventDefault()})),t.on("prop:expanded",(({payload:e})=>{e&&t.props.searchValue?J(t,!0):e||zo.delete(t)})),t.on("prop:searchValue",(({payload:e})=>{t.props.multiple||(t.props.inputText=e),e!==o&&J(t),null!==o&&null===e&&(t.props.expanded=!1),o=e}))}}function le(e,t=[],o,n){function r(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const o=Jo.get(t),r=e.currentTarget;r.id="dropZone";const i=t.children;if(i&&i instanceof HTMLCollection)for(let e=0;e<i.length;e++)if(i[e]instanceof HTMLElement){const t=i[e];if(n&&!n(t))continue;qo.set(t,{value:o[e],index:e})}const s=qo.get(r);p=s.index,a=s.value,setTimeout((function(){const e=document.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function i(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const o=qo.get(t.currentTarget),n=o.index,r=t.currentTarget;if(a===o.value)return;const i=document.getElementById("dropZone");r&&e&&i&&(n<p?e.insertBefore(i,r):e.insertBefore(i,r.nextSibling),p=n,a=o.value)}}function s(t){t.preventDefault();const r=document.getElementById("dropZone"),i=null==r?void 0:r.parentNode;if(i&&e===i&&(i.removeEventListener("drop",s),r&&r.parentNode)){r.classList.remove("dropZone"),r.removeAttribute("id");const e=[],t=i.children;if(t&&t instanceof HTMLCollection){for(let o=0;o<t.length;o++)if(t[o]instanceof HTMLElement){const r=t[o];if(n&&!n(r))continue;const i=qo.get(r);e.push(i.value)}Jo.set(i,e),o&&o(e)}}}function l(e){e.preventDefault(),s(e)}let p=0,a=null;if(Go.has(e))Jo.set(e,t),e.addEventListener("drop",s);else{const o=new MutationObserver((function(){const o=e,s=[];for(let e=0;e<o.children.length;e++){const t=o.children[e];(n&&n(t)||!n)&&s.push(t)}s.forEach(((e,o)=>{const n=qo.get(e);t&&(n?qo.set(e,{value:n.value,index:o}):qo.set(e,{value:t[o],index:o})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","-1"),e.addEventListener("dragstart",r),e.addEventListener("dragend",l),e.addEventListener("dragenter",i)}))}));o.observe(e,{childList:!0}),e.addEventListener("drop",s),document.addEventListener("drop",s),Go.add(e);const p=[];for(let t=0;t<e.children.length;t++){const o=e.children[t];(n&&n(o)||!n)&&p.push(o)}const a=[];for(let e=0;e<p.length;e++)p[e].setAttribute("draggable","true"),p[e].setAttribute("tabindex","-1"),p[e].addEventListener("dragstart",r),p[e].addEventListener("dragend",l),p[e].addEventListener("dragenter",i),qo.set(p[e],{value:t[e],index:e}),a.push(t[e]?t[e]:e);Jo.set(e,a)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){e.input(t)}function o(t){e.props.selectedTagValue=t.value}let n;e.addProps(["disableDragAndDrop","allowNewValues"]),e.props.disableDragAndDrop=fe(e.props.disableDragAndDrop),"taglist"===e.props.type?(e.props.multiple=!0,e.props.selectionAppearance="option",e.props.allowNewValues=fe(e.props.allowNewValues),n=e=>e.classList.contains("formkit-tag-wrapper")):"autocomplete"===e.props.type&&(n=e=>e.classList.contains("formkit-selection")),e.on("created",(()=>{e.context&&(e.context.handlers.selectTag=e=>o.bind(null,e))})),e.on("prop:loadingCounter",(({payload:o})=>{0===o&&Qo&&!e.props.disableDragAndDrop&&setTimeout((()=>{const o=document.getElementById(`${e.props.id}_selections`);o&&le(o,e._value,t,n)}))})),e.on("commit",(({payload:o})=>{if(e.context&&Qo){const r=e.props.id;if(Qo&&r&&!e.props.disableDragAndDrop){const r=document.getElementById(`${e.props.id}_selections`);if(!r)return;le(r,o,t,n)}}})),e.on("keydown",(({payload:t})=>{if(t.currentTarget instanceof HTMLElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)&&t.altKey){t.stopPropagation(),t.preventDefault();const o=document.activeElement,n=e.props.selections.find((t=>t.value===e.props.selectedTagValue)),r=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));"ArrowRight"===t.key?r<e.props.selections.length-1&&(e.props.selections.splice(r,1),e.props.selections.splice(r+1,0,n)):"ArrowLeft"===t.key&&r>0&&(e.props.selections.splice(r,1),e.props.selections.splice(r-1,0,n)),S(e,e.props.selections),e.input(e.props.selections.map((e=>e.value))),setTimeout((()=>{o.focus()}))}else if(t.target instanceof HTMLElement&&document.activeElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)){if("ArrowRight"===t.key){const o=t.target.nextElementSibling;if(o&&o instanceof HTMLElement&&o.getAttribute("data-value"))e.props.selectedTagValue=o.getAttribute("data-value"),o.focus();else if(o&&o instanceof HTMLElement&&o.id===e.props.id){const t=document.getElementById(e.props.id);t&&t.focus()}}else if("ArrowLeft"===t.key){const o=t.target.previousElementSibling;o&&o instanceof HTMLElement&&o.getAttribute("data-value")&&(e.props.selectedTagValue=o.getAttribute("data-value"),o.focus())}}else if("Enter"===t.key&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&t.currentTarget.id===e.props.id&&e.props.inputText&&"taglist"===e.props.type){if(t.preventDefault(),e.props.activeValue===lt)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>me(f(t),e.props.activeValue)));o&&e.props.expanded?e.emit("optionSelected",o):e.props.allowNewValues&&e.emit("optionSelected",{value:e.props.inputText,label:e.props.inputText})}else if(t.currentTarget&&t.currentTarget instanceof HTMLElement&&t.currentTarget.id!==e.props.id&&["Backspace"].includes(t.key)&&document.activeElement&&document.activeElement instanceof HTMLElement){const t=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));if(-1===t)return;if(0===t&&1===e.props.selections.length)q(e,e.props.selections[t],!0)();else if(t===e.props.selections.length-1){q(e,e.props.selections[t],!0)(),e.props.selectedTagValue=e.props.selections[t-1].value;const o=document.activeElement.previousElementSibling;if(o){const e=o.getAttribute("data-value");o&&o instanceof HTMLElement&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}else{e.props.selectedTagValue=e.props.selections[t+1].value,q(e,e.props.selections[t],!1)();const o=document.activeElement.nextElementSibling;if(o&&o instanceof HTMLElement){const e=o.getAttribute("data-value");e&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}}else if(["ArrowLeft"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd){if(t.stopPropagation(),0===e.props.selections.length)return;e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}else if(["Backspace"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd&&e.props.selections.length>0){t.stopPropagation(),e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}}))}function ae(e){const t=Array.isArray(e.props.options)?e.props.options:[],o=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(t);return!!o.length&&(!!Array.isArray(e.value)&&e.value.reduce(((t,n)=>{const r=o.find((e=>me(n,f(e))));return r?t.push(r):e.props.arbitraryValues&&t.push({value:n,label:n}),t}),[]))}function de(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){!function(e,t){Ke[e]?Ke[e].add(t):Ke[e]=new Set([t])}(e,(e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:De(13919),children:De(466954343885)}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)}))}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!Ie.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,i=n.substring(r,r+(n.length-6)),s=n.substring(0,r)+n.substring(r+i.length),l=s.slice(0,2),p=`${s[s.length-1]}${s[0]}`;Number(i)!==Math.floor(Number(s)*Number(l)/Number(p))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];o.define({...r,schema:n(e)})}jn((()=>Pe.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}import{isObject as ce,isRecord as ue,undefine as fe,eq as me,clone as ve,token as he}from"@formkit/utils";import{isDOM as ge,isComponent as $e,createMessage as ye,error as be,getNode as xe}from"@formkit/core";import{icon as we,isSlotCondition as _e,isSchemaObject as ke,extendSchema as Te,normalizeOptions as Ee,options as Le,defaultIcon as Se,localize as Ae}from"@formkit/inputs";const Ce=[988,24029,396,13078,980];let Ve=189024;const Ie=/^[0-9a-f]+$/,Me="undefined"!=typeof window,Oe=r(32,(e=>e)).map((()=>{Ve|=0,Ve=Ve+1831565813|0;let e=Ve^Ve>>>15|Ve;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),Be=setTimeout,He={},De=e=>e.toString(32),We=e=>`${De(Oe[e]).substring(2)}.${De(Ce[e%(Ce.length-1)])}`,Re={},Ne={},Pe=new Set(["",null,void 0]),Ke={},je={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Xe={overflow:"hidden",height:"100%"},ze={},Fe={};let Ye=0;const Ue=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple","data-disabled":"$disabled || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id"}}),Ze=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),qe=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Je=()=>({$el:"ul",if:"$fns.length($messages)"}),Ge=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Qe=()=>({$el:"div",if:"$help"}),et=()=>({$el:null}),tt=(e,t)=>()=>we(e,t),ot=new WeakSet,nt=new WeakMap,rt="undefined"!=typeof window,it=ye({key:"loading",type:"state",value:!0,visible:!1}),st=ye({key:"loading",type:"state",value:!1,visible:!1}),lt=Symbol(),pt="undefined"!=typeof window,at=d("dd"),{outer:dt,wrapper:ct,inner:ut,icon:ft,label:mt,prefix:vt,suffix:ht,help:gt,messages:$t,message:yt}=c(at),bt=at("selector",(()=>({$el:"button",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",tabindex:"0","aria-has-popup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),xt=at("selection","div"),wt=at("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),_t=at("optionLoading","span"),kt=at("option",(()=>({$el:"div",attrs:{"data-is-placeholder":"$option.isPlaceholder || undefined"}}))),Tt=V(at),Et={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Lt={schema:dt(ct(mt("$label"),ut(ft("prefix"),vt(),bt(u("$option.isPlaceholder && $state.loading !== true",wt("$option.label"),xt(kt(u("$state.loading",_t("$ui.isLoading.value"),"$option.label")))),u("$state.loading",ft("loader")),ft("select")),Tt(),ht(),ft("suffix"))),gt("$help"),$t(yt("$message.value"))),type:"input",family:"dropdown",props:[],features:[Le,_(C,(function(e){e.on("click",(()=>{e.props.trackHover=!1,e.props.expanded=!0}))}),A,T(E),(function(e){let t,o="";e.on("unusedKeyDown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){clearTimeout(t),o+=n.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=f(r)),t=setTimeout((()=>{o=""}),400)}}))})),function(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&be(300,[e]),e.props.dropdownWrapperStyles=ve(Et),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=I.bind(null,e),e.props.positionListBox=M.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Ye=document.documentElement.scrollTop;for(const e in je)Fe[e]=document.documentElement.style[e],document.documentElement.style[e]=je[e];for(const e in Xe)ze[e]=document.body.style[e],document.body.style[e]=Xe[e];document.body.scrollTop=Ye}():function(){for(const e in je)document.documentElement.style[e]=Fe[e];for(const e in Xe)document.body.style[e]=ze[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ye}())}))},Se("select","select"),Se("selected","check"),Se("loader","spinner"),Ae("isLoading"),Ae("loadMore")]},St=d("tg"),{outer:At,wrapper:Ct,label:Vt,prefix:It,suffix:Mt,help:Ot,messages:Bt,message:Ht,icon:Dt}=c(St),Wt=St("input",(()=>({$el:"input",attrs:{type:"checkbox",id:"$id",value:"$_value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Rt=St("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner)",$el:"label",attrs:{for:"$id"},children:"$label"}))),Nt=St("altLabel",(()=>({$el:"label",if:"$label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),Pt=St("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"}}))),Kt=St("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"}}}))),jt=St("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Xt=St("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),zt=St("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Ft={schema:At(Ct(Nt(),jt(It(),Wt(),Xt(Pt(),zt(u("$slots.default","$slots.default",Dt("thumb")))),Mt()),Kt(),Rt()),Ot("$help"),Bt(Ht("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay"],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",(()=>{e.props.disabled=fe(e.props.disabled),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=me(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))}))}]},Yt=d("rp"),{outer:Ut,inner:Zt,prefix:qt,suffix:Jt,help:Gt,messages:Qt,message:eo,icon:to}=c(Yt),oo=Yt("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($item.__key)",type:"button"}}))),no=Yt("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ro=Yt("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($item.__key)",type:"button"}}))),io=Yt("items",(()=>({$el:"ul",attrs:{role:"list"}}))),so=Yt("item",(()=>({$el:"li",for:["item","index","$value"],if:"$item.__key",attrs:{role:"listitem",key:"$item.__key","data-index":"$item.__index"}}))),lo=Yt("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($item.__key, 1)",type:"button"}}))),po=Yt("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($item.__key, -1)",type:"button"}}))),ao=Yt("content","div"),co=Yt("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),uo=Yt("legend",(()=>({$el:"legend",if:"$label"}))),fo=Yt("group",(()=>({$formkit:"group",id:"$item.__key",index:"$item.__index"}))),mo=Yt("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),vo=Yt("remove",(()=>({$el:"li",if:"$removeControl"}))),ho=Yt("insert",(()=>({$el:"li",if:"$insertControl"}))),go=Yt("up",(()=>({$el:"li",if:"$upControl"}))),$o=Yt("down",(()=>({$el:"li",if:"$downControl"}))),yo=Yt("controlLabel","span");let bo=0;const xo=new Set,wo={schema:Ut(co(uo("$label"),Gt("$help"),Zt(qt(),u("$slots.default",io(so(ao(fo("$slots.default")),mo(go(po(yo("$ui.moveUp.value"),to("moveUp"))),vo(ro(yo("$ui.remove.value"),to("remove"))),ho(oo(yo("$ui.add.value"),to("add"))),$o(lo(yo("$ui.moveDown.value"),to("moveDown"))))))),Jt()),no('$addLabel || ($ui.add.value + " " + ($label || ""))')),Qt(eo("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){const t=new Set,o={value:0};P(e,"removeControl",!0),P(e,"upControl",!0),P(e,"downControl",!0),P(e,"insertControl",!1),P(e,"addButton",!0),P(e,"addLabel",!1),P(e,"addAttrs",{}),e.plugins.add(O),e.plugins.add(N.bind(null,t)),e.hook.input(((n,r)=>r(W(n,e,t,o)))),e.on("commit",(({payload:t})=>{xo.has(e)&&e.input(t,!1)})),e.hook.commit(((t,n)=>{o.value&&Array.isArray(t)&&t.forEach(((n,r)=>{const s=Object.isFrozen(n)&&e.children.findIndex((e=>e.props.id===n.__key));if(!1!==s&&-1!==s){o.value--;const l=n.__index,p=n.__original;Object.defineProperty(p,"__index",{configurable:!0,value:l});const a=i(t);a.splice(r,1),a.splice(l,0,p);const[d]=e._c.children.splice(s,1);d&&e._c.children.splice(l,0,d),0===o.value&&(R(e,t),t.forEach((e=>delete e.__index)))}})),R(e,t);const r=t[t.length-1];return ce(r)&&"__shim"in r&&function(e){const t=e.findIndex((e=>ce(e)&&"__shim"in e));-1!==t&&e.splice(t)}(t),n(t)})),e.on("created",H)},Ae("remove"),Ae("add"),Ae("moveUp"),Ae("moveDown"),Se("remove","trash"),Se("add","add"),Se("moveUp","arrowUp"),Se("moveDown","arrowDown")]},_o="undefined"!=typeof window,ko=d("rt"),{outer:To,wrapper:Eo,inner:Lo,label:So,prefix:Ao,suffix:Co,help:Vo,messages:Io,message:Mo,icon:Oo}=c(ko),Bo=ko("input",(()=>({$el:"input",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$_value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),Ho=ko("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Do=ko("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),Wo=ko("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),Ro=ko("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),No=ko("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Po={schema:To(Eo(So("$label"),Lo(Oo("prefix"),Ao(),Ho(Do(Ro(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),Oo("rating"))))),Wo(No(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),Oo("rating")))))),Bo(),Co(),Oo("suffix"))),Vo("$help"),Io(Mo("$message"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.disabled=fe(e.props.disabled),e.on("created",(()=>{_o&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=j.bind(null,e),e.context.handlers.ratingHoverOut=X.bind(null,e),e.context.handlers.handleClick=K.bind(null,e),_o&&s(`${e.props.id}`,(()=>{F(e),function(e){const t=document.getElementById(`${e.props.id}_items_wrapper`);if(!t)return;new ResizeObserver((()=>{F(e)})).observe(t)}(e),setTimeout((()=>F(e)),100)})))})),e.on("input",(()=>Y(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),i=Number(e.props.max);return n>i?o(i):e.props.min&&n<=r?o(r):o(n)}))},Se("rating","star")]},Ko=new WeakSet,jo=new WeakMap,Xo=new WeakMap,zo=new WeakMap,Fo=new WeakMap,Yo=new WeakMap,Uo="undefined"!=typeof window;let Zo=!1;const qo=new WeakMap,Jo=new WeakMap,Go=new WeakSet,Qo="undefined"!=typeof window,en=d("ac"),{outer:tn,wrapper:on,inner:nn,icon:rn,label:sn,prefix:ln,suffix:pn,help:an,messages:dn,message:cn}=c(en),un=en("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",tabindex:"0",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),fn=en("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),mn=en("selection",(()=>({for:["option","index","$selections"],$el:"div",attrs:{key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),vn=en("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"',onKeydown:"$handlers.keydown"}}))),hn=en("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),gn=en("optionLoading","span"),$n=en("option",(()=>({$el:"div",if:"$_value !== undefined"}))),yn=V(en),bn={schema:tn(on(sn("$label"),nn(rn("prefix"),ln(),un(),u("$multiple !== true && $selectionAppearance === option",vn(mn($n(u("$state.loading",gn("$ui.isLoading.value"),"$option.label")),hn(rn("close"))))),u("$state.loading",rn("loader")),fn(rn("select")),yn(),pn(),rn("suffix")),u("$multiple && $selectionAppearance === option",vn(mn($n(u("$state.loading",gn("$ui.isLoading.value"),"$option.label")),hn(rn("close")))))),an("$help"),dn(cn("$message.value"))),type:"input",family:"dropdown",props:[],features:[Le,pe,_(A,T(E)),se(E),Se("select","select"),Se("close","close"),Se("selected","check"),Se("loader","spinner"),Ae("isLoading"),Ae("loadMore")]},xn=d("tl"),{outer:wn,wrapper:_n,inner:kn,icon:Tn,label:En,prefix:Ln,suffix:Sn,help:An,messages:Cn,message:Vn}=c(xn),In=xn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",tabindex:"0",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),Mn=xn("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),On=xn("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),Bn=xn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Hn=xn("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),Dn=xn("tagLabel",(()=>({$el:"span"}))),Wn=xn("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite",onKeydown:"$handlers.keydown"}}))),Rn=xn("tagLoading","span"),Nn=V(xn),Pn={schema:wn(_n(En("$label"),kn(Tn("prefix"),Ln(),Wn(On(Bn(u("$state.loading",Rn("$ui.isLoading.value"),Dn("$option.label")),Hn(Tn("close")))),In()),u("$state.loading",Tn("loader")),Mn(Tn("select")),Nn(),Sn(),Tn("suffix"))),An("$help"),Cn(Vn("$message.value"))),type:"input",family:"dropdown",props:[],features:[Le,pe,_(A,T(ae)),se(ae),Se("select","select"),Se("close","close"),Se("selected","check"),Se("loader","spinner"),Ae("isLoading"),Ae("loadMore")]};var Kn=Object.freeze({__proto__:null,dropdown:Lt,toggle:Ft,repeater:wo,rating:Po,autocomplete:bn,taglist:Pn});const jn=setInterval;export{u as $if,bn as autocomplete,c as createBaseSections,de as createProPlugin,d as createSectionFactory,Lt as dropdown,Kn as inputs,Po as rating,wo as repeater,Pn as taglist,Ft as toggle};
1
+ function e(e,o){e in Re||(Re[e]={timer:0,inputs:new Set});const n=Re[e];clearTimeout(n.timer),n.inputs.add(o),n.timer=Be(t.bind(null,e),500)}function t(e){if(Me){window.addEventListener([30548127325,27022924,34729821653783].map(De).join("y"),(t=>{const n=new URL(t.blockedURI).hostname;Oe.some(((e,t)=>We(t)===n))&&(o(e),console.warn("[FormKit]: Enterprise license required for restrictive CSP."))}));let t=0;const n=De(18806588),r="://",i=(new Date).getDate(),s=async()=>{(e=>{clearTimeout(He[e]),delete He[e]})(e);const l=Array.from(Re[e].inputs),p=l.filter((t=>!(Ne[e]&&Ne[e].has(t)))).join("");if(p){t++;try{const s=await window[De(16217489)](`${n}${r}${We((i+t)%Oe.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}`)}`),a=await s.json();if(a[De(502357)])return o(e,a.schema);if(s.ok)return Ne[e]||(Ne[e]=new Set),void l.forEach((t=>Ne[e].add(t)))}catch(e){}t<2&&Be(s,1e4*Math.random())}};s()}}function o(e,t){Pe.add(e),function(e,t){Ke[e]&&Ke[e].forEach((e=>e(t)))}(e,t)}function n(t,o,n){if(e(o,n),!o)throw new Error("FormKitNoKey");return He[o]||(He[o]=Be((()=>Pe.add(o)),3e3)),Pe.has(o)?null:t}function r(e,t){return new Array(e).fill("").map(((e,o)=>t(o)))}function i(e){const t=e&&ce(e)&&e.__v_raw;return t?i(t):e}function s(e,t){if(Me){const o=document.getElementById(e);if(o)return t(o);const n=new MutationObserver((()=>{const o=document.getElementById(e);o&&(n.disconnect(),t(o))}));n.observe(document.body,{childList:!0,subtree:!0})}}function l(e){return ue(e)&&"value"in e&&"label"in e}function p(e,t,o,r){return(...i)=>s=>l=>{const p=function(e,t,o,r,i,s){const l=s[o],p="function"==typeof r?r():{$el:r},d=i.map((e=>"string"==typeof e?e:e(t)(s)));let c=d.length&&p?Te(p,{children:d}):p;if(c=Te(c,l),"object"==typeof c){let r=c;if(!ge(c)&&!$e(c)||c.meta||(c.meta={section:o}),ge(c)){const{$el:i,...s}=c;s.attrs?"class"in s.attrs||"if"in s.attrs||(s.attrs={class:`$classes.${o}`,...s.attrs}):s.attrs={class:`$classes.${o}`},r=a(t,o,Object.defineProperty(s,"$el",{enumerable:!1,get:n.bind(null,i,t,e)}))}else if($e(c)){const{$cmp:i,...s}=c;r=a(t,o,Object.defineProperty(s,"$cmp",{enumerable:!1,get:n.bind(null,i,t,e)}))}else"$formkit"in c&&(c.outerClass=`$classes.${o}`);return r}return a(t,o,c)}(e,s,t,o,i,l);return r&&ue(p)&&(p.memo=e+JSON.stringify(l)),r?[p]:p}}function a(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 d(e){return(t,o,n=!1)=>p(e,t,o,n)}function c(e){return{outer:e("outer",Ue,!0),wrapper:e("wrapper","div",!1),inner:e("inner",Ze,!1),icon:tt,label:e("label",qe,!1),prefix:e("prefix",et,!1),suffix:e("suffix",et,!1),help:e("help",Qe,!1),messages:e("messages",Je,!1),message:e("message",Ge,!1)}}function u(e,t,o){return n=>r=>{const i="string"==typeof t?t:t(n)(r);return o?{if:e,then:i,else:"string"==typeof o?o:o(n)(r)}:(_e(i)?Object.assign(i.else,{if:e}):ke(i)&&Object.assign(i,{if:e}),i)}}function f(e){return"__original"in e?e.__original:e.value}function m(e,t=!0){e.store.set(it),e.props.loadingCounter++,e.store.set(ye({key:"hasNextPage",type:"state",value:!1,visible:!1}));const o=e.props.nonceKey&&e.props[e.props.nonceKey],n=e.props.optionsLoader(e.context,nt.get(e)),r=e.props.applyLoadedOptions.bind(null,e,t);return(n instanceof Promise?n.then(((...t)=>{void 0!==e.props.nonceKey&&o!==e.props[e.props.nonceKey]||r(...t)})):Promise.resolve(r(n))).finally((()=>{e.props.loadingCounter--}))}function v(e,t,o){const n=Ee(o),r=[...n,...[...e.props.options].reverse()].find((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)}));e.props.options=e.props.options.concat(n),t&&r&&(e.props.activeValue=f(r))}function h(e,t){new MutationObserver((()=>{const o=e.props.positionListBox(t);ot.delete(e),g(e,o);let n,r=null;const i=new ResizeObserver((()=>{clearTimeout(n),n=setTimeout((()=>{e.props.styleWrapper(),e.props.positionListBox(t),r||(r=e.on("prop:expanded",(()=>{i.disconnect(),e.off(r)})))}),100)}));i.observe(t)})).observe(t,{childList:!0,subtree:!0})}function g(e,t){if(!e.props.expanded||!e.props.options||!e.props.options.length||ot.has(e))return;const o=e.props.options.reduce(((t,o,n)=>{var r;if(null===(r=o.attrs)||void 0===r?void 0:r.disabled)return t;const i=document.getElementById(`${e.props.id}_listitem_${n}`);return i&&t.push([i,o]),t}),[]),n=document.getElementById(`${e.props.id}_load_more`);n&&o.push([n,e.props.loadMoreOption]),ot.add(e),o.length&&b(e,o,t)}function $(e,t){let o=null;if(e.props.activeDescendant){o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>me(e.value,f(t)))),-1===o&&(o=null);document.getElementById(e.props.activeDescendant)&&x(e)}if("undefined"==typeof window)return o;const n=t.getBoundingClientRect(),r=document.getElementById(`${e.props.id}`);if(r){const t=r.getBoundingClientRect();t.top+t.height+n.height>window.innerHeight&&t.top+t.height>n.height?e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,top:"auto",bottom:"100%"}:e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,bottom:"auto",top:"100%"}}return o}function y(){}function b(e,t,o){var n,r,i;const s=document.getElementById(`${e.props.id}_dropdown_wrapper`);if(e.props.trackHover){const n=s?s.getBoundingClientRect():{top:0,bottom:0};if(o=null,e.props.mouseY>n.top&&e.props.mouseY<n.bottom){let n=o||0,r=o;const i=(t,n)=>{var r;const i=n[0],{y:s,height:l,x:p,width:a}=i.getBoundingClientRect();if(e.props.mouseX>p&&e.props.mouseX<p+a&&e.props.mouseY>s&&e.props.mouseY<s+l){o=t;const i=n[1];return e.props.activeValue=i&&!(null===(r=i.attrs)||void 0===r?void 0:r.disabled)?f(i):void 0,!0}return!1};do{if(null!==n&&i(n,t[n]))break;if(null!==r&&i(r,t[r]))break;null!==n&&(n++,n>t.length-1&&(n=null)),null!==r&&(r--,r<0&&(r=null))}while(null!==n||null!==r)}null===o&&(e.props.activeValue=void 0)}e.props.trackHover||x(e),e.props.expanded?(s&&e.props.loadOnScroll&&!(null===(n=e.store.loading)||void 0===n?void 0:n.value)&&(null===(r=e.store.hasNextPage)||void 0===r?void 0:r.value)&&s.scrollTop+s.offsetHeight>s.scrollHeight-200&&(null===(i=e.context)||void 0===i||i.handlers.loadMore(!1)),ot.has(e)?requestAnimationFrame(b.bind(null,e,t,o)):g(e,o)):ot.delete(e)}function x(e){const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(e.props.activeDescendant);if(!t||!o)return;const{y:n,height:r}=o.getBoundingClientRect(),{y:i,height:s}=t.getBoundingClientRect();n<i?(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop):n+r>i+s&&(e.props.ignoreScroll=!0,t.scrollTop=o.offsetTop+r-s)}function w(e,t){e.props.page++,nt.set(e,t),e.store.set(ye({key:"hasNextPage",type:"state",value:!0,visible:!1}))}function _(...e){return t=>{t.addProps(["activeDescendant","activeValue","dropdownWrapperStyles","expanded","hasNextPage","isLoadingOption","listboxStyles","loadMoreOption","loadOnScroll","option","optionLoader","options","optionsLoader","page","placeholder","selections"]),t.props.dropdownWrapperStyles={position:"absolute",top:"100%",overflow:"auto",minWidth:"100%"},t.props.page=1,t.props.loadMoreOption={label:"Load more",value:lt},t.props.listboxStyles={},t.props.styleWrapper=y.bind(null,t),t.props.positionListBox=$.bind(null,t),t.props.hasNextPage=w.bind(null,t),t.props.applyLoadedOptions=v,t.props.loadingCounter=0,t.props.disabled=fe(t.props.disabled),t.on("created",(()=>{if(!t.context)return;t.props.trackHover=!0,t.props.loadOnScroll=fe(t.props.loadOnScroll),t.context.touch=()=>{var e;null===(e=t.context)||void 0===e||e._value},t.context.handlers.loadMore=e=>{var o;t.props.didLoadMore=!0,setTimeout((()=>{t.props.didLoadMore=!1}),300),e instanceof MouseEvent&&(t.props.ignoreClickAway=!0,null===(o=document.getElementById(`${t.props.id}`))||void 0===o||o.focus()),m(t)},t.context.handlers.click=e=>{if(t.props.disabled)return;document.getElementById(`${t.props.id}`)&&"mouse"!==e.pointerType?(t.props.mouseX=-1,t.props.mouseY=-1):(t.props.mouseX=e.clientX,t.props.mouseY=e.clientY),t.emit("click",e)};const e=t.context.handlers.blur;t.context.handlers.blur=o=>{t.props.expanded?setTimeout((()=>e(o)),300):e(o),t.emit("blur")},t.context.handlers.keydown=e=>{t.props.disabled||(t.props.trackHover=!1,t.emit("keydown",e))},t.context.handlers.selectOption=e=>()=>{t.emit("optionSelected",e)},t.context.fns.isActive=e=>me(t.props.activeValue,f(e))||void 0,rt&&(s(`${t.props.id}_dropdown_wrapper`,(e=>{"overscroll"!==t.props.behavior&&"none"===getComputedStyle(e).maxHeight&&(t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,maxHeight:"400px"})})),s(`${t.props.id}_dropdown_wrapper`,h.bind(null,t)))})),t.on("prop:expanded",(({payload:e})=>{t.props.dropdownWrapperStyles={...t.props.dropdownWrapperStyles,zIndex:e?"999":"-1",pointerEvents:e?"auto":"none"}}));const o=()=>{t.props.ignoreScroll?t.props.ignoreScroll=!1:t.props.trackHover=!0};if(t.on("prop:trackHover",(({payload:e})=>{var n,r;rt&&(e?null===(r=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===r||r.removeEventListener("scroll",o):null===(n=document.getElementById(`${t.props.id}_dropdown_wrapper`))||void 0===n||n.addEventListener("scroll",o))})),t.on("prop:activeValue",(({payload:e})=>{if(e===lt)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const o=t.props.options.findIndex((t=>me(f(t),e)));t.props.activeDescendant=o>=0?`${t.props.id}_listitem_${o}`:void 0})),"undefined"!=typeof window){const e=e=>{e.target&&e.target instanceof Element&&e.target.closest(`#${t.props.id}_listbox`)||t.props.ignoreClickAway?t.props.ignoreClickAway=!1:(t.props.searchValue="",t.props.expanded=!1)},o=e=>{t.props.mouseX=e.clientX,t.props.mouseY=e.clientY;const o=document.getElementById(`${t.props.id}_dropdown_wrapper`);if(o){const n=o.getBoundingClientRect();e.clientX>n.x&&e.clientX<n.x+n.width&&e.clientY>n.y&&e.clientY<n.y+n.height&&(t.props.trackHover=!0)}};t.on("prop:expanded",(({payload:n})=>{n?(setTimeout((()=>document.addEventListener("click",e)),10),t.props.styleWrapper(),document.addEventListener("mousemove",o),t.props.optionsLoader&&0===t.props.options.length&&m(t)):(document.removeEventListener("click",e),document.removeEventListener("mousemove",o))}))}t.on("prop:loadingCounter",(({payload:e})=>{0===e&&t.store.set(st)})),rt&&window.addEventListener("blur",(e=>{e.target===window&&t.props.expanded&&(t.props.expanded=!1)})),e.map((e=>e(t)))}}function k(e,t,o){const n=e.props.optionLoader(t,o),r=e=>"string"==typeof e?{label:e,value:t}:l(e)?e:ue(e)?Object.assign({label:String(t),value:t},e):{label:String(t),value:t},i=t=>(Array.isArray(e.props.memoOptions)&&e.props.memoOptions.push(t),t);return n instanceof Promise?(e.props.loadingCounter++,e.store.set(it),S(e),n.then((e=>{if("string"==typeof e||l(e))return i(r(e))})).finally((()=>{e.props.loadingCounter--}))):i(r(n))}function T(e){return t=>{t.on("commit",(({payload:o})=>{if(pt&&void 0!==o&&"function"==typeof t.props.optionLoader){const n=e(t,o);if(t.props.multiple&&Array.isArray(o))if(o.forEach((e=>k(t,e,Array.isArray(n)&&n.find((t=>me(t.value,e)))))),t.props.loadingCounter){t.props.isLoadingOption=!0;const n=t.on("prop:loadingCounter",(()=>{t.props.loadingCounter||(t.props.isLoadingOption=!1,S(t,e(t,o)),t.off(n))}))}else S(t,e(t,o));else if(!t.props.multiple&&!Array.isArray(n)&&o){const e=k(t,o,n);e instanceof Promise?(t.props.isLoadingOption=!0,e.then((e=>{S(t,e,o),t.props.isLoadingOption=!1}))):S(t,e,o)}return}const n=e(t,o);if(!pt||n||void 0===o||t.props.options&&t.props.options.length||"function"!=typeof t.props.optionsLoader)S(t,n,o);else{const n=m(t);S(t),n.then((()=>{S(t,e(t,o),o)}))}}))}}function E(e,t){const o=Array.isArray(e.props.options)?e.props.options:[],n=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(o);return!!n.length&&(e.props.multiple?!!Array.isArray(e.value)&&e.value.reduce(((e,t)=>{const o=n.find((e=>me(t,f(e))));return o&&e.push(o),e}),[]):n.find((e=>me(f(e),t)))||!1)}function L(e){if(!e.props.options||!e.props.options.length)return;const t=function(e){return e.props.options.find((t=>me(f(t),e.value)))}(e);if(t)e.props.activeValue=t.value;else{const t=e.props.options.find((e=>{var t;return!(null===(t=null==e?void 0:e.attrs)||void 0===t?void 0:t.disabled)}));e.props.activeValue=null==t?void 0:t.value}}function S(e,t,o){var n;if(e.props.multiple&&Array.isArray(t))return e.props.option={label:t.map((e=>e.label)).join(", "),value:e.value},void(e.props.selections=t);"string"==typeof t?e.props.option={label:t,value:o}:t?e.props.option=t:t||null==o||(null===(n=e.store.loading)||void 0===n?void 0:n.value)?(e.props.option={label:e.props.placeholder||" ",value:void 0,isPlaceholder:!0},e.props.selections=[]):e.props.option={label:o,value:o},e.props.option.isPlaceholder||(e.props.selections=[e.props.option])}function A(e){e.on("keydown",(({payload:t})=>{var o,n;if("Tab"===t.key&&e.props.expanded)t.preventDefault();else if(["ArrowDown","ArrowUp"].includes(t.key)&&e.props.expanded){t.preventDefault(),t.stopPropagation();const n=e.props.options;if(!Array.isArray(n)||!n.length)return;const r=n.reduce(((e,t)=>{var o;return(null===(o=null==t?void 0:t.attrs)||void 0===o?void 0:o.disabled)||e.push(f(t)),e}),[]);(null===(o=e.store.hasNextPage)||void 0===o?void 0:o.value)&&r.push(lt);const i=r.indexOf(e.props.activeValue);-1===i&&r.length?e.props.activeValue=r[0]:"ArrowDown"===t.key&&r.length>i+1?e.props.activeValue=r[i+1]:"ArrowUp"===t.key&&i>0&&(e.props.activeValue=r[i-1])}else if(!e.props.expanded&&["ArrowDown","Up","Down","ArrowUp","Enter"].includes(t.key)&&e.props.id===(null===(n=document.activeElement)||void 0===n?void 0:n.id))t.preventDefault(),!e.props.expanded&&e.isSettled&&(e.props.expanded=!0);else if("Enter"===t.key&&e.props.expanded){if(t.preventDefault(),e.props.activeValue===lt)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>me(f(t),e.props.activeValue)));o&&e.emit("optionSelected",o)}else["Esc","Escape"].includes(t.key)?(t.preventDefault(),e.props.expanded=!1):e.emit("unusedKeyDown",t)}))}function C(e){e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t=>me(e.value,f(t)))})),e.on("prop:expanded",(({payload:t})=>{t&&L(e)})),e.on("optionSelected",(({payload:t})=>{var o,n,r;f(t)!==lt?(null===(n=null==t?void 0:t.attrs)||void 0===n?void 0:n.disabled)||(e.props.skipNextFilter=!0,e.input(f(t)),e.props.expanded=!1,e.props.id&&(null===(r=document.getElementById(e.props.id))||void 0===r||r.focus())):null===(o=e.context)||void 0===o||o.handlers.loadMore()}))}function V(e){const t=e("dropdownWrapper",(()=>({$el:"div",attrs:{id:'$id + "_dropdown_wrapper"',"data-is-wrapper":!0,style:"$dropdownWrapperStyles",onScroll:"$handlers.scroll"}}))),o=e("listbox",(()=>({$el:"ul",if:"$expanded",attrs:{style:"$listboxStyles",id:'$id + "_listbox"',role:"listbox","aria-activedescendant":"$activeDescendant"}}))),n=e("listitem",(()=>({$el:"li",for:["option","index","$options"],bind:"$option.attrs",attrs:{id:'$id + "_listitem_" + $index',"data-disabled":"$option.attrs.disabled","data-value":"$option.value",key:"$option.value",onClick:"$handlers.selectOption($option)",role:"option","aria-selected":"$fns.isSelected($option)","data-is-active":"$fns.isActive($option)"}}))),r=e("loadMore",(()=>({$el:"li",if:"$state.loading || $state.hasNextPage",attrs:{id:'$id + "_load_more"',key:"loadMore",role:"option",onClick:"$handlers.loadMore","aria-selected":"false","data-is-active":"$fns.isActive($loadMoreOption)"}}))),i=e("loadMoreInner","span"),s=e("option","div");return()=>t(o(n(u("$fns.isSelected($option)",tt("selected")),s("$option.label")),r(i(u("$state.loading",tt("loader")),"$state.loading && $ui.isLoading.value || $ui.loadMore.value"))))}function I(e){if("undefined"==typeof window)return;const t=document.getElementById(`${e.props.id}_dropdown_wrapper`),o=document.getElementById(`${e.props.id}`);if(!o||!t)return;const n=t.style.paddingTop,r=t.style.paddingBottom,i=t.style.paddingLeft;t.style.paddingTop="0",t.style.paddingBottom="0",t.style.paddingLeft="0";const s=o.getBoundingClientRect(),l=t.getBoundingClientRect(),p=Math.round(s.top-l.top)+"px",a=Math.round(s.left-l.left-5)+"px",d=Math.max(Math.round(Math.min(l.height-l.top,window.innerHeight)-(s.top+s.height)),0)+"px";t.style.paddingTop=n,t.style.paddingBottom=r,t.style.paddingLeft=i,e.props.dropdownWrapperStyles={...e.props.dropdownWrapperStyles,paddingTop:p,paddingLeft:a,paddingBottom:d},e.props.listboxStyles={...e.props.listboxStyles,minWidth:"overscroll"===e.props.behavior?`min(${s.width+"px"}, calc(100vw - 4em))`:s.width+"px",maxWidth:"calc(100vw - 4em)"}}function M(e,t){let o=null;if(e.props.activeDescendant){const n=document.getElementById(e.props.activeDescendant);if(!n)return o;e.props.ignoreScroll=!0;const r=document.getElementById(`${e.props.id}_listbox`);if(!r)return o;const i=t.getBoundingClientRect(),s=r.getBoundingClientRect(),l=parseInt(getComputedStyle(t).paddingTop),p=parseInt(getComputedStyle(t).paddingBottom),a=n.offsetTop-l,d=Math.max(a-l,0),c=Math.max(t.scrollHeight-p-a-i.height,0),u=s.height-d-c;t.scrollTop=a;const m=()=>{t.scrollTop=c>0?c<l?t.scrollHeight:l:d<p?0:a-p},v=Math.min(150,s.height);d>0&&c>0||0===d&&0===c||u>v?t.scrollTop=a:m();t.clientHeight/2<t.scrollTop&&(o=e.props.options.filter((e=>{var t;return!(null===(t=e.attrs)||void 0===t?void 0:t.disabled)})).findIndex((t=>me(e.value,f(t))))),-1===o&&(o=null)}return o}function O(e){return"radio"===e.props.type&&(e.props.altName=`${e.name}_${bo++}`),!0}function B(e){return!ce(e)||"__key"in e||"__shim"in e||Object.defineProperty(e,"__key",{enumerable:!1,writable:!0,value:he()}),e}function H({payload:e}){if(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(e.props.disabled=fe(e.props.disabled),Array.isArray(e.value))if(e.value.length<e.props.min){const t=r(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(r(e.props.min,(()=>({}))),!1);e.context&&(e.context.fns.createRemover=e=>()=>{var t,o;null===(t=xe(e))||void 0===t||t.each((e=>e.destroy())),null===(o=xe(e))||void 0===o||o.destroy()},e.context.fns.createInsert=t=>()=>{if(Array.isArray(e.value)){const o=e.value.findIndex((e=>e.__key===t)),n=e.value;n.splice(o+1,0,{}),e.input(n,!1)}},e.context.fns.createShift=(e,t)=>()=>{const o=xe(e);if(!o||!o.parent)return;const n=o.index+t;n>=0&&n<o.parent.children.length&&(o.index=o.index+t)},e.context.fns.createAppend=()=>()=>{if(Array.isArray(e.value)){const t=e.value;t.push({}),e.input(t,!1)}})}function D(e,t){const o=e._c.children.find((e=>e.props.id===t));o&&(o.props.preserve=!0,o.destroy())}function W(e,t,o,n){if(Array.isArray(e)){const r=function(e,t){const o=e.map((e=>e.__key));return t.children.reduce(((e,t,n)=>{const r=t.props.id;return r&&!o.includes(r)&&e.set(n,r),e}),new Map)}(e,t);e.forEach(((i,s)=>{B(i);const[l,p]=function(e,t,o,n,r){if(!o.has(e.__key)&&!e.__shim&&!Object.isFrozen(e)){const i=r&&r.get(t);e.__key=he();const s=Object.freeze(Object.defineProperties({},{__key:{value:e.__key},__original:{value:e},__index:{value:t},__prevKey:{value:i}}));return o.add(e.__key),n.value++,[!0,s]}return[!1,e]}(i,s,o,n,r);l&&(e.splice(s,1,p),D(t,p.__prevKey),r.delete(s))})),r.size&&r.forEach((o=>{const n=e.findIndex((e=>e.__key===o));-1!==n&&e.splice(n,1),D(t,o)})),xo.delete(t)}return e}function R(e,t){t.sort(((e,t)=>"__shim"in e||"__shim"in t?"__shim"in t&&!("__shim"in e)?-1:1:"__index"in e&&"__index"in t?e.__index>t.__index?1:-1:0)),e._c.children.sort(((e,o)=>{const n=t.findIndex((t=>t.__key===e.props.id)),r=t.findIndex((e=>e.__key===o.props.id));return-1!==n&&-1!==r?n>r?1:-1:-1===n&&-1==r?0:n>-1?1:-1}))}function N(e,t){return"group"===t.type&&t.hook.input(((o,n)=>(void 0===o?o={__shim:!0}:(B(o),e.has(o.__key)||o.__shim||!t.parent||xo.add(t.parent)),n(o)))),!1}function P(e,t,o){void 0===e.props[t]&&(e.props[t]=o)}function K(e,t){var o;if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){let n;t instanceof MouseEvent?n=t.clientX:(n=t.changedTouches[0].clientX,document.documentElement.style.overflow=e.props.initialBodyOverflow);let r=z(e,n,t.currentTarget)||0;r=r>e.props.min?r:e.props.min,r=r<e.props.max?r:e.props.max,e.input(r),null===(o=document.getElementById(`${e.props.id}`))||void 0===o||o.focus()}}function j(e,t){if(!e.props.disabled&&t.currentTarget instanceof HTMLElement){Y(e,z(e,(window.TouchEvent&&t instanceof TouchEvent||!1)&&t instanceof TouchEvent?t.touches[0].clientX:t instanceof MouseEvent?t.clientX:0,t.currentTarget)||0)}}function X(e){Y(e)}function z(e,t,o){const n=o.getBoundingClientRect();return function(e,t){const o=1/(t||1);return Math.ceil(e*o)/o}((t-n.x)/n.width*e.props.max,e.props.step)}function F(e){setTimeout((()=>{const t=document.getElementById(`${e.props.id}`);t&&(e.props.wrapperWidth=`0 0 ${t.offsetWidth/e.props.max}px`)}))}function Y(e,t){let o=0;o=t?Math.round(t/e.props.max*100):"number"==typeof e._value?Math.round(e._value/e.props.max*100):0;const n=100-o;e.props.onWidth=o,e.props.offWidth=n}function U(e,t,o){const n=zo.get(e);if(n===e.props.searchValue||!n&&!e.props.searchValue)return v(e,t,o);const r=Ee(o);e.props.options=r,L(e),zo.set(e,e.props.searchValue)}function Z(e){var t;e.props.expanded=!e.props.expanded,e.props.expanded&&(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus())}function q(e,t,o=!0){return()=>{e.props.multiple?(e.emit("optionRemoved",t),e.props.searchValue=""):(e.input(void 0),e.props.searchValue=""),o&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)}}function J(e,t=!1){if("function"==typeof e.props.optionsLoader){if(t&&(e.props.options=[]),e.props.search=e.props.searchValue,clearTimeout(jo.get(e)),e.props.skipNextFilter)return void(e.props.skipNextFilter=!1);jo.set(e,setTimeout((()=>{var t;e.props.page=1,null===(t=e.context)||void 0===t||t.handlers.loadMore(!0)}),e.props.debounce||200))}else Array.isArray(e.props.options)&&(Ko.add(e),"string"==typeof e.props.searchValue&&(e.props.options=e.props.initialOptions.filter((t=>e.props.filter(t,e.props.searchValue)))));e.props.skipNextFilter=!1,L(e)}function G(e,t){var o;const n=e.props.highlightedRange,r=n.index,i=n.start+(r?1:0),s=t.length-1>r?t[t.length-1].end-t[r+1].start:0;return[i,(null===(o=e.props.inputText)||void 0===o?void 0:o.length)-s+(t.length-1>n.index?-1:0)]}function Q(e,t){const o=document.getElementById(`${e.props.id}`);if(o instanceof HTMLInputElement){const n=Fo.get(e);if(n){const[e,r]=n,i=t.touches[0].clientX-r;o.scrollLeft=e-i}else Fo.set(e,[o.scrollLeft,t.changedTouches[0].clientX])}}function ee(e){Fo.delete(e)}function te(e,t){const o=t.target;e.props.expanded=!0,e.props.searchValue=o.value,""===e.props.searchValue&&e.input(void 0)}function oe(e,t){const o=t.target.value;e.props.inputText=o,e.props.expanded=!0,"option"!==e.props.selectionAppearance?""===o?(e.props.searchValue=null,e.input([])):!e._value||Array.isArray(e._value)&&!e._value.length?e.props.searchValue=o:Array.isArray(e._value)&&e._value.length&&(e.props.searchValue=function(e){var t;const o=ne(e);if(e.props.highlightedRange){const[t,n]=G(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.searchValue=o}function ne(e){const t=e.props.getSelections(e,e._value);return Array.isArray(t)&&t.length?t.reduce(((e,o,n)=>{var r;const i=(null===(r=e[n-1])||void 0===r?void 0:r.end)||0;let s=0;return t.length-1!==n&&s++,0!==n&&s++,e.push({option:o,index:n,start:i,end:i+o.label.length+s}),e}),[]):[]}function re(e){clearTimeout(Xo.get(e)),Xo.set(e,setTimeout((()=>{var t,o,n;const r=document.getElementById(`${e.props.id}`);if(r instanceof HTMLInputElement){const i=ne(e),s=i.findIndex((e=>null!==r.selectionStart?r.selectionStart>=e.start&&r.selectionStart<=e.end:null!==r.selectionEnd&&(r.selectionEnd>=e.start&&r.selectionEnd<=e.end))),l=null===(t=i[i.length-1])||void 0===t?void 0:t.end;if(0===r.selectionStart&&r.selectionEnd===(null===(o=e.props.inputText)||void 0===o?void 0:o.length))return;if("string"==typeof e.props.searchValue&&e.props.highlightedRange){if(i.length){const t=e.props.highlightedRange,[o,n]=G(e,i);if(null!==r.selectionEnd&&(r.selectionEnd<o||r.selectionEnd>n)){const i=t.end-t.start-(n-o),s=r.selectionEnd;e.props.inputText=e.props.option.label,e.props.highlightedRange=void 0,e.props.searchValue=null,r.value=e.props.inputText,r.selectionStart=r.selectionEnd=s+(s>o?i:0)}}}else if(s>=0&&null!==r.selectionStart&&(l!==(null===(n=e.props.inputText)||void 0===n?void 0:n.length)||r.selectionStart<l)){const t=i[s],o=e.props.inputText.substr(0,l),n=t.start+(t.index>0?1:0),p=t.end+(i.length-1>t.index?-1:0);o!==e.props.inputText&&(e.props.inputText=o,r.value=o),e.props.highlightedRange=t,r.selectionStart=n,r.selectionEnd=p}else e.props.highlightedRange=void 0,e.emit("scrollToEnd");if(null!==r.selectionStart&&r.selectionStart>=l&&", "!==e.props.inputText.substring(l,l+2)&&null===e.props.searchValue){const t=e.props.inputText.substring(0,l);e.props.inputText=`${t}, ${e.props.inputText.substring(l).replace(/^[,\s]{1,2}/,"")}`}}}),5))}function ie(e){"option"===e.props.selectionAppearance?(e.on("prop:option",(()=>{e.props.inputText="",void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("blur",(()=>{e.props.inputText=""})),e.on("optionSelected",(({payload:t})=>{t.value!==lt&&(e.props.expanded=!1)}))):function(e){e.props.searchValue=null;const t=(t,o=!1)=>{var n;const r=document.getElementById(`${e.props.id}`);if(!(r instanceof HTMLInputElement))return!1;const i=ne(e),s=t>=0?t:i.length-1;if(void 0===i[s])return!1;const l=null===(n=i[s])||void 0===n?void 0:n.end;return null!==r.selectionStart&&(!o||r.selectionStart>=l&&r.selectionStart<=l+2)&&(r.selectionStart=i[s].start+(s>0?1:0),r.selectionEnd=i[s].end+(s<i.length-1?-1:0),!0)};let o;e.on("selectRange",(({payload:e})=>t(...e))),e.on("keydown",(({payload:o})=>{var n,r,i,s;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){const t=ne(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["Delete","Backspace"].includes(o.key)?e.props.highlightedRange&&!e.props.searchValue?e.emit("optionRemoved",e.props.highlightedRange.option):o.target instanceof HTMLInputElement&&(e.props.searchValue=null,t(-1,!0)&&o.preventDefault()):o.target instanceof HTMLInputElement&&0===o.target.selectionStart&&o.target.selectionEnd===(null===(i=e.props.inputText)||void 0===i?void 0:i.length)&&(null===(s=e.props.inputText)||void 0===s?void 0:s.length)&&0===e.props.selections.length&&o.preventDefault();"ArrowLeft"===o.key&&t(-1,!0)&&o.preventDefault(),re(e)})),e.on("prop:highlightedRange",(({payload:t})=>{t&&e.props.expanded&&o!==t.option&&(o=t.option,e.props.activeValue=f(t.option))})),e.on("scrollToEnd",(()=>{const t=document.getElementById(`${e.props.id}`);t&&t.scrollTo({left:t.scrollWidth,behavior:"smooth"})})),e.on("prop:option",(({payload:t})=>{if(!t.isPlaceholder){let o="";if(Uo){const t=document.getElementById(`${e.props.id}`);document.activeElement===t&&Array.isArray(e._value)&&e._value.length&&(o=", ")}e.props.inputText=t.label+o}})),e.on("blur",(()=>{if(e._value){const t=e.props.option;ue(t)&&void 0!==t.value?e.props.inputText=t.label:e.props.inputText=""}else e.props.inputText=""}))}(e),e.on("commit",(()=>{void 0!==e.props.searchValue&&(e.props.searchValue=null)})),e.on("created",(()=>{if("option"!==e.props.selectionAppearance&&function(e){s(`${e.props.id}`,(t=>{t instanceof HTMLInputElement&&Yo.set(t,e)})),Uo&&!Zo&&(Zo=!0,document.addEventListener("selectionchange",(()=>{if(document.activeElement instanceof HTMLInputElement&&Yo.has(document.activeElement)){const e=Yo.get(document.activeElement);e&&re(e)}})))}(e),e.props.option&&Array.isArray(e.props.option.value))for(const t of e.props.option.value)e.props.initialOptions.find((o=>{f(o)===t&&e.props.memoOptions.push(o)}));e.context&&(e.context.handlers.input=oe.bind(null,e))})),e.on("optionRemoved",(async({payload:t})=>{if(Array.isArray(e._value)){let o=-1;await e.input(e._value.filter(((e,n)=>e!==f(t)||(o=n,!1)))),e._value.length?setTimeout((()=>e.emit("selectRange",[o])),20):e.props.expanded=!1}})),e.on("prop:expanded",(({payload:t})=>{t||(e.props.searchValue=null)}))}function se(e){return t=>{let o;t.addProps(["inputText","selectionAppearance","searchValue","openOnClick","filteredOptions","search","debounce","showInput","visibilityStyles","selectionStyles","multiple","filter"]),t.props.memoOptions=[],t.props.initialOptions=t.props.options,t.props.applyLoadedOptions=U,t.props.getSelections=e,t.props.nonceKey="searchValue",t.props.multiple=fe(t.props.multiple),"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase())),t.props.selectionStyles={position:"absolute",pointerEvents:"none",width:"100%",left:"0",top:"0",bottom:"0",opacity:"0",overflow:"hidden"},t.props.multiple?(!function(e){function t(t){return!!Array.isArray(e.value)&&e.value.some((e=>me(e,f(t))))}e.on("created",(()=>{e.context&&(e.context.fns.isSelected=t)})),e.on("optionSelected",(({payload:o})=>{var n,r,i;if(f(o)===lt)return void(null===(n=e.context)||void 0===n||n.handlers.loadMore());if(null===(r=null==o?void 0:o.attrs)||void 0===r?void 0:r.disabled)return;const s=Array.isArray(e._value)?e._value:[];t(o)?e.emit("optionRemoved",o):(e.props.memoOptions=[...e.props.memoOptions,o],e.props.highlightedRange?(s.splice(e.props.highlightedRange.index,1,f(o)),e.input(s),e.props.highlightedRange=void 0,e.props.expanded=!1):(e.input(s.concat(f(o))),e.emit("scrollToEnd"))),e.props.id&&(null===(i=document.getElementById(e.props.id))||void 0===i||i.focus())}))}(t),ie(t)):(C(t),function(e){e.props.searchValue="",e.on("created",(()=>{e.context&&(e.context.handlers.input=te.bind(null,e))})),e.on("input",(({payload:t})=>{const o=e.props.getSelections(e,t);e.props.searchValue=o&&(null==o?void 0:o.label)||e.props.searchValue,e.props.selectionStyles={...e.props.selectionStyles,opacity:void 0===t?"0":"1",pointerEvents:void 0===t?"none":"auto"}})),e.on("optionSelected",(({payload:t})=>{t.value!==lt&&setTimeout((()=>{var t;null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus()}),50)})),e.on("prop:option",(({payload:t})=>{ue(t)&&!t.isPlaceholder?e.props.searchValue=t.label:t.isPlaceholder&&(e.props.searchValue="")})),e.on("blur",(()=>{setTimeout((()=>{var t;if(e.props.didLoadMore)return e.props.didLoadMore=!1,void(null===(t=document.getElementById(`${e.props.id}`))||void 0===t||t.focus());if(e._value){const t=e.props.option;ue(t)&&void 0!==t.value?e.props.searchValue=t.label:e.props.searchValue=""}else e.props.searchValue=""}),150)}))}(t)),t.on("prop:options",(({payload:e})=>{"function"!=typeof t.props.optionsLoader&&(Ko.has(t)?Ko.delete(t):(t.props.initialOptions=[...e],setTimeout((()=>J(t)),0)))})),t.on("click",(()=>{t.props.openOnClick&&(t.props.trackHover=!1,t.props.expanded=!0)})),t.on("created",(()=>{t.props.openOnClick=fe(t.props.openOnClick),t.context&&(t.context.handlers.toggleListbox=Z.bind(null,t),t.context.handlers.removeSelection=q.bind(null,t),t.context.handlers.touchmove=Q.bind(null,t),t.context.handlers.touchend=ee.bind(null,t))})),t.on("keydown",(({payload:e})=>{"option"!==t.props.selectionAppearance||!t._value||t.props.isLoadingOption||t.props.multiple||(["Backspace","Delete"].includes(e.key)||"Tab"!==e.key)&&e.preventDefault()})),t.on("prop:expanded",(({payload:e})=>{e&&t.props.searchValue?J(t,!0):e||zo.delete(t)})),t.on("prop:searchValue",(({payload:e})=>{t.props.multiple||(t.props.inputText=e),e!==o&&J(t),null!==o&&null===e&&(t.props.expanded=!1),o=e}))}}function le(e,t=[],o,n){function r(e){if(e.currentTarget&&e.currentTarget instanceof HTMLElement&&e instanceof DragEvent&&e.dataTransfer){e.dataTransfer.dropEffect="move";const t=e.currentTarget.parentNode;if(!t)return;const o=Jo.get(t),r=e.currentTarget;r.id="dropZone";const i=t.children;if(i&&i instanceof HTMLCollection)for(let e=0;e<i.length;e++)if(i[e]instanceof HTMLElement){const t=i[e];if(n&&!n(t))continue;qo.set(t,{value:o[e],index:e})}const s=qo.get(r);p=s.index,a=s.value,setTimeout((function(){const e=document.getElementById("dropZone");e&&e.classList.add("dropZone")}),1)}}function i(t){if(t.preventDefault(),t instanceof DragEvent&&t.relatedTarget!==t.currentTarget&&t.currentTarget&&t.currentTarget instanceof HTMLElement){const o=qo.get(t.currentTarget),n=o.index,r=t.currentTarget;if(a===o.value)return;const i=document.getElementById("dropZone");r&&e&&i&&(n<p?e.insertBefore(i,r):e.insertBefore(i,r.nextSibling),p=n,a=o.value)}}function s(t){t.preventDefault();const r=document.getElementById("dropZone"),i=null==r?void 0:r.parentNode;if(i&&e===i&&(i.removeEventListener("drop",s),r&&r.parentNode)){r.classList.remove("dropZone"),r.removeAttribute("id");const e=[],t=i.children;if(t&&t instanceof HTMLCollection){for(let o=0;o<t.length;o++)if(t[o]instanceof HTMLElement){const r=t[o];if(n&&!n(r))continue;const i=qo.get(r);e.push(i.value)}Jo.set(i,e),o&&o(e)}}}function l(e){e.preventDefault(),s(e)}let p=0,a=null;if(Go.has(e))Jo.set(e,t),e.addEventListener("drop",s);else{const o=new MutationObserver((function(){const o=e,s=[];for(let e=0;e<o.children.length;e++){const t=o.children[e];(n&&n(t)||!n)&&s.push(t)}s.forEach(((e,o)=>{const n=qo.get(e);t&&(n?qo.set(e,{value:n.value,index:o}):qo.set(e,{value:t[o],index:o})),e.setAttribute("draggable","true"),e.setAttribute("tabindex","-1"),e.addEventListener("dragstart",r),e.addEventListener("dragend",l),e.addEventListener("dragenter",i)}))}));o.observe(e,{childList:!0}),e.addEventListener("drop",s),document.addEventListener("drop",s),Go.add(e);const p=[];for(let t=0;t<e.children.length;t++){const o=e.children[t];(n&&n(o)||!n)&&p.push(o)}const a=[];for(let e=0;e<p.length;e++)p[e].setAttribute("draggable","true"),p[e].setAttribute("tabindex","-1"),p[e].addEventListener("dragstart",r),p[e].addEventListener("dragend",l),p[e].addEventListener("dragenter",i),qo.set(p[e],{value:t[e],index:e}),a.push(t[e]?t[e]:e);Jo.set(e,a)}document.addEventListener("dragover",(function(e){e.preventDefault()}))}function pe(e){function t(t){e.input(t)}function o(t){e.props.selectedTagValue=t.value}let n;e.addProps(["disableDragAndDrop","allowNewValues"]),e.props.disableDragAndDrop=fe(e.props.disableDragAndDrop),"taglist"===e.props.type?(e.props.multiple=!0,e.props.selectionAppearance="option",e.props.allowNewValues=fe(e.props.allowNewValues),n=e=>e.classList.contains("formkit-tag-wrapper")):"autocomplete"===e.props.type&&(n=e=>e.classList.contains("formkit-selection")),e.on("created",(()=>{e.context&&(e.context.handlers.selectTag=e=>o.bind(null,e))})),e.on("prop:loadingCounter",(({payload:o})=>{0===o&&Qo&&!e.props.disableDragAndDrop&&setTimeout((()=>{const o=document.getElementById(`${e.props.id}_selections`);o&&le(o,e._value,t,n)}))})),e.on("commit",(({payload:o})=>{if(e.context&&Qo){const r=e.props.id;if(Qo&&r&&!e.props.disableDragAndDrop){const r=document.getElementById(`${e.props.id}_selections`);if(!r)return;le(r,o,t,n)}}})),e.on("keydown",(({payload:t})=>{if(t.currentTarget instanceof HTMLElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)&&t.altKey){t.stopPropagation(),t.preventDefault();const o=document.activeElement,n=e.props.selections.find((t=>t.value===e.props.selectedTagValue)),r=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));"ArrowRight"===t.key?r<e.props.selections.length-1&&(e.props.selections.splice(r,1),e.props.selections.splice(r+1,0,n)):"ArrowLeft"===t.key&&r>0&&(e.props.selections.splice(r,1),e.props.selections.splice(r-1,0,n)),S(e,e.props.selections),e.input(e.props.selections.map((e=>e.value))),setTimeout((()=>{o.focus()}))}else if(t.target instanceof HTMLElement&&document.activeElement&&document.activeElement instanceof HTMLElement&&["ArrowRight","ArrowLeft"].includes(t.key)){if("ArrowRight"===t.key){const o=t.target.nextElementSibling;if(o&&o instanceof HTMLElement&&o.getAttribute("data-value"))e.props.selectedTagValue=o.getAttribute("data-value"),o.focus();else if(o&&o instanceof HTMLElement&&o.id===e.props.id){const t=document.getElementById(e.props.id);t&&t.focus()}}else if("ArrowLeft"===t.key){const o=t.target.previousElementSibling;o&&o instanceof HTMLElement&&o.getAttribute("data-value")&&(e.props.selectedTagValue=o.getAttribute("data-value"),o.focus())}}else if("Enter"===t.key&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&t.currentTarget.id===e.props.id&&e.props.inputText&&"taglist"===e.props.type){if(t.preventDefault(),e.props.activeValue===lt)return void e.emit("optionSelected",e.props.loadMoreOption);const o=e.props.options.find((t=>me(f(t),e.props.activeValue)));o&&e.props.expanded?e.emit("optionSelected",o):e.props.allowNewValues&&e.emit("optionSelected",{value:e.props.inputText,label:e.props.inputText})}else if(t.currentTarget&&t.currentTarget instanceof HTMLElement&&t.currentTarget.id!==e.props.id&&["Backspace"].includes(t.key)&&document.activeElement&&document.activeElement instanceof HTMLElement){const t=e.props.selections.findIndex((t=>t.value===e.props.selectedTagValue));if(-1===t)return;if(0===t&&1===e.props.selections.length)q(e,e.props.selections[t],!0)();else if(t===e.props.selections.length-1){q(e,e.props.selections[t],!0)(),e.props.selectedTagValue=e.props.selections[t-1].value;const o=document.activeElement.previousElementSibling;if(o){const e=o.getAttribute("data-value");o&&o instanceof HTMLElement&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}else{e.props.selectedTagValue=e.props.selections[t+1].value,q(e,e.props.selections[t],!1)();const o=document.activeElement.nextElementSibling;if(o&&o instanceof HTMLElement){const e=o.getAttribute("data-value");e&&setTimeout((()=>{const t=document.querySelector(`[data-value="${e}"]`);t&&t instanceof HTMLElement&&t.focus()}),50)}}}else if(["ArrowLeft"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd){if(t.stopPropagation(),0===e.props.selections.length)return;e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}else if(["Backspace"].includes(t.key)&&t.currentTarget&&t.currentTarget instanceof HTMLInputElement&&0===t.currentTarget.selectionStart&&0===t.currentTarget.selectionEnd&&e.props.selections.length>0){t.stopPropagation(),e.props.selectedTagValue=e.props.selections[e.props.selections.length-1].value;const o=t.currentTarget.previousElementSibling;o&&o instanceof HTMLElement&&o.focus()}}))}function ae(e){const t=Array.isArray(e.props.options)?e.props.options:[],o=(Array.isArray(e.props.memoOptions)?e.props.memoOptions:[]).concat(t);return!!o.length&&(!!Array.isArray(e.value)&&e.value.reduce(((t,n)=>{const r=o.find((e=>me(n,f(e))));return r?t.push(r):e.props.arbitraryValues&&t.push({value:n,label:n}),t}),[]))}function de(e,t={}){const o=e;try{if(!o)throw new Error("FormKitNoKey");function n(t){!function(e,t){Ke[e]?Ke[e].add(t):Ke[e]=new Set([t])}(e,(e=>{t.props.definition&&(t.props.definition.schema=e||[{$el:De(13919),children:De(466954343885)}]),t.emit("schema"),setTimeout((()=>t.destroy()),1e3)}))}return function(e){const t=()=>{throw new Error(`InvalidFormKitKey ${e}`)};if(!/^fk-/i.test(e))return t();const o=e.substring(3);if(!Ie.test(o))return t();const n=parseInt(o,16).toString(),r=Number(n[0])<6?Number(n[0]):6,i=n.substring(r,r+(n.length-6)),s=n.substring(0,r)+n.substring(r+i.length),l=s.slice(0,2),p=`${s[s.length-1]}${s[0]}`;Number(i)!==Math.floor(Number(s)*Number(l)/Number(p))&&t()}(o),n.library=o=>{if(o.props.type in t){const{schema:n,...r}=t[o.props.type];o.define({...r,schema:n(e)})}jn((()=>Pe.has(e)&&o.emit(952679114..toString(32))),4e3)},n}catch(r){throw r instanceof Error&&function(e){if("FormKitNoKey"===e.message)throw new Error("A FormKit API key is required, please visit https://formkit.com/pro")}(r),r}}import{isObject as ce,isRecord as ue,undefine as fe,eq as me,clone as ve,token as he}from"@formkit/utils";import{isDOM as ge,isComponent as $e,createMessage as ye,error as be,getNode as xe}from"@formkit/core";import{icon as we,isSlotCondition as _e,isSchemaObject as ke,extendSchema as Te,normalizeOptions as Ee,options as Le,defaultIcon as Se,localize as Ae}from"@formkit/inputs";const Ce=[988,24029,396,13078,980];let Ve=189024;const Ie=/^[0-9a-f]+$/,Me="undefined"!=typeof window,Oe=r(32,(e=>e)).map((()=>{Ve|=0,Ve=Ve+1831565813|0;let e=Ve^Ve>>>15|Ve;return e=e+e^e>>>427|e^e,((e^e>>>14)>>>0)/4294967296})),Be=setTimeout,He={},De=e=>e.toString(32),We=e=>`${De(Oe[e]).substring(2)}.${De(Ce[e%(Ce.length-1)])}`,Re={},Ne={},Pe=new Set(["",null,void 0]),Ke={},je={position:"fixed",overflow:"hidden",height:"100%",width:"100%"},Xe={overflow:"hidden",height:"100%"},ze={},Fe={};let Ye=0;const Ue=()=>({$el:"div",attrs:{key:"$id","data-type":"$type","data-family":"$family","data-multiple":"$attrs.multiple","data-disabled":"$disabled || undefined","data-complete":"$state.complete || undefined","data-invalid":"$state.valid === false && $state.validationVisible || undefined","data-errors":"$state.errors || undefined","data-submitted":"$state.submitted || undefined","data-loading":"$state.loading || undefined","data-overscroll":'$behavior === "overscroll" && true || undefined',"data-id":"$id"}}),Ze=()=>({$el:"div",attrs:{id:'$id + "_inner"'}}),qe=()=>({if:"$label",$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}),Je=()=>({$el:"ul",if:"$fns.length($messages)"}),Ge=()=>({$el:"li",for:["message","$messages"],attrs:{key:"$message.key",id:"$id + '-' + $message.key","data-message-type":"$message.type"}}),Qe=()=>({$el:"div",if:"$help"}),et=()=>({$el:null}),tt=(e,t)=>()=>we(e,t),ot=new WeakSet,nt=new WeakMap,rt="undefined"!=typeof window,it=ye({key:"loading",type:"state",value:!0,visible:!1}),st=ye({key:"loading",type:"state",value:!1,visible:!1}),lt=Symbol(),pt="undefined"!=typeof window,at=d("dd"),{outer:dt,wrapper:ct,inner:ut,icon:ft,label:mt,prefix:vt,suffix:ht,help:gt,messages:$t,message:yt}=c(at),bt=at("selector",(()=>({$el:"button",attrs:{id:"$id",type:"button",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",tabindex:"0","aria-has-popup":"listbox","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined',"aria-describedBy":"$describedBy"}}))),xt=at("selection","div"),wt=at("placeholder",(()=>({$el:"div",attrs:{key:"placeholder","data-is-placeholder":"true"}}))),_t=at("optionLoading","span"),kt=at("option",(()=>({$el:"div",attrs:{"data-is-placeholder":"$option.isPlaceholder || undefined"}}))),Tt=V(at),Et={position:"fixed",top:0,bottom:0,right:0,left:0,pointerEvents:"none",zIndex:-1,overflowY:"auto","-webkit-overflow-scrolling":"auto"},Lt={schema:dt(ct(mt("$label"),ut(ft("prefix"),vt(),bt(u("$option.isPlaceholder && $state.loading !== true",wt("$option.label"),xt(kt(u("$state.loading",_t("$ui.isLoading.value"),"$option.label")))),u("$state.loading",ft("loader")),ft("select")),Tt(),ht(),ft("suffix"))),gt("$help"),$t(yt("$message.value"))),type:"input",family:"dropdown",props:[],features:[Le,_(C,(function(e){e.on("click",(()=>{e.props.trackHover=!1,e.props.expanded=!0}))}),A,T(E),(function(e){let t,o="";e.on("unusedKeyDown",(({payload:n})=>{if(!n.isComposing&&1===[...n.key].length){clearTimeout(t),o+=n.key;const r=e.props.options.find((e=>e.label.toLowerCase().startsWith(o.toLowerCase())));r&&(e.props.activeValue=f(r)),t=setTimeout((()=>{o=""}),400)}}))})),function(e){e.addProps(["behavior"]),e.on("created",(()=>{"overscroll"===e.props.behavior&&("function"==typeof e.props.optionsLoader&&be(300,[e]),e.props.dropdownWrapperStyles=ve(Et),e.props.listboxStyles={display:"inline-block"},e.props.styleWrapper=I.bind(null,e),e.props.positionListBox=M.bind(null,e))})),e.on("prop:expanded",(({payload:t})=>{"overscroll"===e.props.behavior&&(t?function(){Ye=document.documentElement.scrollTop;for(const e in je)Fe[e]=document.documentElement.style[e],document.documentElement.style[e]=je[e];for(const e in Xe)ze[e]=document.body.style[e],document.body.style[e]=Xe[e];document.body.scrollTop=Ye}():function(){for(const e in je)document.documentElement.style[e]=Fe[e];for(const e in Xe)document.body.style[e]=ze[e];document.body.scrollTop=0,document.documentElement.scrollTop=Ye}())}))},Se("select","select"),Se("selected","check"),Se("loader","spinner"),Ae("isLoading"),Ae("loadMore")]},St=d("tg"),{outer:At,wrapper:Ct,label:Vt,prefix:It,suffix:Mt,help:Ot,messages:Bt,message:Ht,icon:Dt}=c(St),Wt=St("input",(()=>({$el:"input",attrs:{type:"checkbox",id:"$id",value:"$_value",checked:"$checked",onInput:"$handlers.toggles",onBlur:"$handlers.blur",disabled:"$disabled"}}))),Rt=St("label",(()=>({if:"($label && $onValueLabel === undefined && $offValueLabel === undefined) || ($valueLabelDisplay === inner)",$el:"label",attrs:{for:"$id"},children:"$label"}))),Nt=St("altLabel",(()=>({$el:"label",if:"$label && ($onValueLabel || $offValueLabel) && $valueLabelDisplay !== hidden && $valueLabelDisplay !== inner",attrs:{for:"$id","data-label-alt":"true",style:{color:{if:"$checked",then:"$valueLabelColorOn",else:"$valueLabelColorOff"}}},children:"$label"}))),Pt=St("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"}}))),Kt=St("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"}}}))),jt=St("inner",(()=>({$el:"label",attrs:{for:"$id",id:"$id + '_label'"}}))),Xt=St("track",(()=>({$el:"div",attrs:{style:{backgroundColor:{if:"$checked",then:"$trackColorOn",else:"$trackColorOff"}}}}))),zt=St("thumb",(()=>({$el:"div",attrs:{style:{color:{if:"$checked",then:"$iconColorOn",else:"$iconColorOff"},backgroundColor:{if:"$checked",then:"$thumbColorOn",else:"$thumbColorOff"}}}}))),Ft={schema:At(Ct(Nt(),jt(It(),Wt(),Xt(Pt(),zt(u("$slots.default","$slots.default",Dt("thumb")))),Mt()),Kt(),Rt()),Ot("$help"),Bt(Ht("$message.value"))),type:"input",props:["checked","thumbColorOff","thumbColorOn","iconColorOff","iconColorOn","valueLabelColorOff","valueLabelColorOn","offValue","offValueLabel","onValue","onValueLabel","thumbIcon","trackColorOff","trackColorOn","valueLabelDisplay"],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",(()=>{e.props.disabled=fe(e.props.disabled),void 0===e.props.offValue&&(e.props.offValue=!1),void 0===e.props.onValue&&(e.props.onValue=!0),e.props.checked=me(e.value,e.props.onValue),e.context&&(e.context.handlers.toggles=t.bind(null,e))}))}]},Yt=d("rp"),{outer:Ut,inner:Zt,prefix:qt,suffix:Jt,help:Gt,messages:Qt,message:eo,icon:to}=c(Yt),oo=Yt("insertControl",(()=>({$el:"button",attrs:{disabled:"$value.length >= $max",onClick:"$fns.createInsert($item.__key)",type:"button"}}))),no=Yt("addButton",(()=>({$formkit:"button",bind:"$addAttrs",if:"$addButton",disabled:"$value.length >= $max",onClick:"$fns.createAppend()",type:"button"}))),ro=Yt("removeControl",(()=>({$el:"button",attrs:{disabled:"$value.length <= $min",onClick:"$fns.createRemover($item.__key)",type:"button"}}))),io=Yt("items",(()=>({$el:"ul",attrs:{role:"list"}}))),so=Yt("item",(()=>({$el:"li",for:["item","index","$value"],if:"$item.__key",attrs:{role:"listitem",key:"$item.__key","data-index":"$item.__index"}}))),lo=Yt("downControl",(()=>({$el:"button",attrs:{disabled:"$index >= $value.length - 1",onClick:"$fns.createShift($item.__key, 1)",type:"button"}}))),po=Yt("upControl",(()=>({$el:"button",attrs:{disabled:"$index <= 0",onClick:"$fns.createShift($item.__key, -1)",type:"button"}}))),ao=Yt("content","div"),co=Yt("fieldset",(()=>({$el:"fieldset",attrs:{id:"$id",disabled:"$disabled"}}))),uo=Yt("legend",(()=>({$el:"legend",if:"$label"}))),fo=Yt("group",(()=>({$formkit:"group",id:"$item.__key",index:"$item.__index"}))),mo=Yt("controls",(()=>({$el:"ul",if:"$removeControl || $insertControl || $upControl || $downControl"}))),vo=Yt("remove",(()=>({$el:"li",if:"$removeControl"}))),ho=Yt("insert",(()=>({$el:"li",if:"$insertControl"}))),go=Yt("up",(()=>({$el:"li",if:"$upControl"}))),$o=Yt("down",(()=>({$el:"li",if:"$downControl"}))),yo=Yt("controlLabel","span");let bo=0;const xo=new Set,wo={schema:Ut(co(uo("$label"),Gt("$help"),Zt(qt(),u("$slots.default",io(so(ao(fo("$slots.default")),mo(go(po(yo("$ui.moveUp.value"),to("moveUp"))),vo(ro(yo("$ui.remove.value"),to("remove"))),ho(oo(yo("$ui.add.value"),to("add"))),$o(lo(yo("$ui.moveDown.value"),to("moveDown"))))))),Jt()),no('$addLabel || ($ui.add.value + " " + ($label || ""))')),Qt(eo("$message.value"))),type:"list",props:["min","max","total","upControl","downControl","removeControl","insertControl","addLabel","addButton","addAttrs"],features:[function(e){const t=new Set,o={value:0};P(e,"removeControl",!0),P(e,"upControl",!0),P(e,"downControl",!0),P(e,"insertControl",!1),P(e,"addButton",!0),P(e,"addLabel",!1),P(e,"addAttrs",{}),e.plugins.add(O),e.plugins.add(N.bind(null,t)),e.hook.input(((n,r)=>r(W(n,e,t,o)))),e.on("commit",(({payload:t})=>{xo.has(e)&&e.input(t,!1)})),e.hook.commit(((t,n)=>{o.value&&Array.isArray(t)&&t.forEach(((n,r)=>{const s=Object.isFrozen(n)&&e.children.findIndex((e=>e.props.id===n.__key));if(!1!==s&&-1!==s){o.value--;const l=n.__index,p=n.__original;Object.defineProperty(p,"__index",{configurable:!0,value:l});const a=i(t);a.splice(r,1),a.splice(l,0,p);const[d]=e._c.children.splice(s,1);d&&e._c.children.splice(l,0,d),0===o.value&&(R(e,t),t.forEach((e=>delete e.__index)))}})),R(e,t);const r=t[t.length-1];return ce(r)&&"__shim"in r&&function(e){const t=e.findIndex((e=>ce(e)&&"__shim"in e));-1!==t&&e.splice(t)}(t),n(t)})),e.on("created",H)},Ae("remove"),Ae("add"),Ae("moveUp"),Ae("moveDown"),Se("remove","trash"),Se("add","add"),Se("moveUp","arrowUp"),Se("moveDown","arrowDown")]},_o="undefined"!=typeof window,ko=d("rt"),{outer:To,wrapper:Eo,inner:Lo,label:So,prefix:Ao,suffix:Co,help:Vo,messages:Io,message:Mo,icon:Oo}=c(ko),Bo=ko("input",(()=>({$el:"input",attrs:{id:"$id",type:"range",max:"$max",name:"$name",min:"0",disabled:"$disabled",step:"$step",onInput:"$handlers.DOMInput",onBlur:"$handlers.blur",value:"$_value",style:{position:"absolute",zIndex:"0",top:0,right:0,bottom:0,opacity:"0"}}}))),Ho=ko("itemsWrapper",(()=>({$el:"div",attrs:{style:{position:"relative",zIndex:"2"},id:"$id + _items_wrapper",onMousemove:"$hoverHighlight && $handlers.ratingHoverOver",onMouseleave:"$hoverHighlight && $handlers.ratingHoverOut",onTouchstart:"$handlers.ratingHoverOver",onTouchmove:"$handlers.ratingHoverOver",onTouchend:"$handlers.handleClick",onClick:"$handlers.handleClick"}}))),Do=ko("onItems",(()=>({$el:"div",attrs:{id:'$id + "_on_wrapper"',style:{position:"relative",display:"flex",width:'$onWidth + "%"',top:"0",bottom:"0",left:"0",overflow:"hidden",color:"$onColor"}}}))),Wo=ko("offItems",(()=>({$el:"div",attrs:{id:'$id + "_off_wrapper"',style:{position:"absolute",display:"flex",flexDirection:"row-reverse",width:'$offWidth + "%"',top:"0",bottom:"0",right:"0",overflow:"hidden",color:"$offColor"}}}))),Ro=ko("onItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),No=ko("offItemWrapper",(()=>({$el:"div",for:["item","index","$max"],attrs:{style:{flex:"$wrapperWidth"}}}))),Po={schema:To(Eo(So("$label"),Lo(Oo("prefix"),Ao(),Ho(Do(Ro(u("$slots.onItem",(()=>()=>"$slots.onItem"),u("$slots.default",(()=>()=>"$slots.default"),Oo("rating"))))),Wo(No(u("$slots.offItem",(()=>()=>"$slots.offItem"),u("$slots.default",(()=>()=>"$slots.default"),Oo("rating")))))),Bo(),Co(),Oo("suffix"))),Vo("$help"),Io(Mo("$message"))),type:"input",props:[],features:[function(e){e.addProps(["onWidth","offWidth","wrapperWidth","max","min","icon","step","hoverHighlight","ratingIcon","onColor","offColor"]),e.props.max=e.props.max||5,e.props.min=e.props.min||0,e.props.step=e.props.step||1,!1!==e.props.hoverHighlight&&(e.props.hoverHighlight=!0),e.props.disabled=fe(e.props.disabled),e.on("created",(()=>{_o&&(e.props.initialBodyOverflow=document.documentElement.style.overflow),e.context&&(e.context.handlers.ratingHoverOver=j.bind(null,e),e.context.handlers.ratingHoverOut=X.bind(null,e),e.context.handlers.handleClick=K.bind(null,e),_o&&s(`${e.props.id}`,(()=>{F(e),function(e){const t=document.getElementById(`${e.props.id}_items_wrapper`);if(!t)return;new ResizeObserver((()=>{F(e)})).observe(t)}(e),setTimeout((()=>F(e)),100)})))})),e.on("input",(()=>Y(e))),e.hook.input(((t,o)=>{if(null===t||""===t||isNaN(t))return o(t);const n=Number(t),r=Number(e.props.min),i=Number(e.props.max);return n>i?o(i):e.props.min&&n<=r?o(r):o(n)}))},Se("rating","star")]},Ko=new WeakSet,jo=new WeakMap,Xo=new WeakMap,zo=new WeakMap,Fo=new WeakMap,Yo=new WeakMap,Uo="undefined"!=typeof window;let Zo=!1;const qo=new WeakMap,Jo=new WeakMap,Go=new WeakSet,Qo="undefined"!=typeof window,en=d("ac"),{outer:tn,wrapper:on,inner:nn,icon:rn,label:sn,prefix:ln,suffix:pn,help:an,messages:dn,message:cn}=c(en),un=en("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",tabindex:"0",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),fn=en("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),mn=en("selection",(()=>({for:["option","index","$selections"],$el:"div",attrs:{key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),vn=en("selections",(()=>({$el:"div",attrs:{"aria-live":"polite",id:'$id + "_selections"',onKeydown:"$handlers.keydown"}}))),hn=en("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),gn=en("optionLoading","span"),$n=en("option",(()=>({$el:"div",if:"$_value !== undefined"}))),yn=V(en),bn={schema:tn(on(sn("$label"),nn(rn("prefix"),ln(),un(),u("$multiple !== true && $selectionAppearance === option",vn(mn($n(u("$state.loading",gn("$ui.isLoading.value"),"$option.label")),hn(rn("close"))))),u("$state.loading",rn("loader")),fn(rn("select")),yn(),pn(),rn("suffix")),u("$multiple && $selectionAppearance === option",vn(mn($n(u("$state.loading",gn("$ui.isLoading.value"),"$option.label")),hn(rn("close")))))),an("$help"),dn(cn("$message.value"))),type:"input",family:"dropdown",props:[],features:[Le,pe,_(A,T(E)),se(E),Se("select","select"),Se("close","close"),Se("selected","check"),Se("loader","spinner"),Ae("isLoading"),Ae("loadMore")]},xn=d("tl"),{outer:wn,wrapper:_n,inner:kn,icon:Tn,label:En,prefix:Ln,suffix:Sn,help:An,messages:Cn,message:Vn}=c(xn),In=xn("input",(()=>({$el:"input",bind:"$attrs",attrs:{id:"$id",type:"text",onClick:"$handlers.click",onBlur:"$handlers.blur",onKeydown:"$handlers.keydown",onInput:"$handlers.input",value:"$inputText",tabindex:"0",placeholder:"$isLoadingOption && $ui.isLoading.value || $placeholder || undefined",role:"combobox",autocomplete:"off",autocapitalize:"none",readonly:"$attrs.readonly || $isLoadingOption || undefined",disabled:"$disabled || 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"}}))),Mn=xn("listboxButton",(()=>({$el:"button",attrs:{style:"$visibilityStyles",id:'$id + "_listbox_button"',type:"button",onClick:"$handlers.toggleListbox",tabindex:"-1",disabled:"$disabled || undefined","aria-haspopup":"true","aria-expanded":"$expanded","aria-controls":'$expanded && $id + "_listbox" || undefined'}}))),On=xn("tagWrapper",(()=>({$el:"span",for:["option","index","$selections"],attrs:{id:'$id + "_tag-wrapper_" + $index',key:"$option.value","data-value":"$option.value",tabindex:"-1",onClick:"$handlers.selectTag($option)"}}))),Bn=xn("tag",(()=>({$el:"div",attrs:{id:'$id + "_tag_" + $index',role:"button"}}))),Hn=xn("removeSelection",(()=>({$el:"button",if:"$_value !== undefined",attrs:{id:'$id + "_remove_selection_" + $index',tabindex:"-1",type:"button",onClick:"$handlers.removeSelection($option)","aria-controls":"$id"}}))),Dn=xn("tagLabel",(()=>({$el:"span"}))),Wn=xn("tags",(()=>({$el:"div",attrs:{id:'$id + "_selections"',"aria-live":"polite",onKeydown:"$handlers.keydown"}}))),Rn=xn("tagLoading","span"),Nn=V(xn),Pn={schema:wn(_n(En("$label"),kn(Tn("prefix"),Ln(),Wn(On(Bn(u("$state.loading",Rn("$ui.isLoading.value"),Dn("$option.label")),Hn(Tn("close")))),In()),u("$state.loading",Tn("loader")),Mn(Tn("select")),Nn(),Sn(),Tn("suffix"))),An("$help"),Cn(Vn("$message.value"))),type:"input",family:"dropdown",props:[],features:[Le,pe,_(A,T(ae)),se(ae),Se("select","select"),Se("close","close"),Se("selected","check"),Se("loader","spinner"),Ae("isLoading"),Ae("loadMore")]};var Kn=Object.freeze({__proto__:null,dropdown:Lt,toggle:Ft,repeater:wo,rating:Po,autocomplete:bn,taglist:Pn});const jn=setInterval;export{u as $if,bn as autocomplete,c as createBaseSections,de as createProPlugin,d as createSectionFactory,Lt as dropdown,Kn as inputs,Po as rating,wo as repeater,Pn as taglist,Ft as toggle};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formkit/pro",
3
- "version": "1.0.0-alpha.33-06fc9e8",
3
+ "version": "1.0.0-alpha.34",
4
4
  "description": "FormKit Pro — Form inputs and tools for high quality forms.",
5
5
  "main": "index.cjs",
6
6
  "module": "index.mjs",