@formkit/pro 0.125.1 → 0.125.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/slider/index.mjs +1 -1
package/index.cjs
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
/* #__PURE__ */o.localize("addAllValues"),
|
|
59
59
|
/* #__PURE__ */o.localize("addSelectedValues"),
|
|
60
60
|
/* #__PURE__ */o.localize("removeSelectedValues"),
|
|
61
|
-
/* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),t.props.loadMoreOption={label:"Load more",value:zi},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=Pe.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map((e=>Ae(e)))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(Ce(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Ji(e)),"function"==typeof e.props.optionLoader?ep(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(t),sp(t),function(t){t.on("prop:options",(()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),Ji(t)})),t.on("prop:memoOptions",(()=>{t.props.skipSetActiveValue=!0,Ji(t)})),t.on("prop:sourceOptions",(()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,Ui.delete(t)})),t.on("prop:targetOptions",(()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1})),t.on("prop:activeValue",(({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===zi)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex((t=>e.eq(Ae(t),o)));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0})),t.on("prop:mouseOnSource",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,Ui.delete(t),ap(t,e)}})),t.on("prop:mouseOnTarget",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,Yi.delete(t),ap(t,e)}})),t.on("prop:optionsLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Te)})),t.on("prop:optionLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Te),t.props.skipSetActiveValue=!0,Ji(t))}))}(t)}]};const pp=/* #__PURE__ */q("sl"),{outer:dp,wrapper:cp,inner:up,icon:fp,label:vp,prefix:hp,suffix:mp,help:gp,messages:$p,message:bp}=/* #__PURE__ */z(pp),yp=pp("chart",(()=>({$el:"div",if:"$chart"}))),xp=pp("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),wp=pp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),_p=pp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),kp=pp("trackWrapper",(()=>({$el:"div"}))),Sp=pp("trackInner",(()=>({$el:"div"}))),Lp=pp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Ap=pp("linkedValues",(()=>({$el:"div"}))),Dp=pp("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Ip=pp("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Cp=pp("marks",(()=>({$el:"div",if:"$marks"}))),Ep=pp("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Op=pp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Tp=pp("handles",(()=>({$el:"ul"}))),Mp=pp("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Vp=pp("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Fp=pp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Bp=pp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Pp=pp("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Hp=pp("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Rp={schema:/* #__PURE__ */dp(/* #__PURE__ */cp(/* #__PURE__ */vp("$label"),/* #__PURE__ */gp("$help"),/* #__PURE__ */wp(/* #__PURE__ */fp("prefix"),/* #__PURE__ */hp(),/* #__PURE__ */_p(/* #__PURE__ */yp(/* #__PURE__ */xp()),/* #__PURE__ */kp(/* #__PURE__ */Sp(/* #__PURE__ */Lp(),/* #__PURE__ */Cp(/* #__PURE__ */Ep(/* #__PURE__ */Op())),/* #__PURE__ */Tp(/* #__PURE__ */Vp(/* #__PURE__ */Hp(),/* #__PURE__ */Fp()),/* #__PURE__ */Mp(/* #__PURE__ */Pp(),/* #__PURE__ */Bp()))))),/* #__PURE__ */mp(),/* #__PURE__ */fp("suffix"),/* #__PURE__ */Y("$showInput && $isMulti === false",/* #__PURE__ */Dp())),/* #__PURE__ */Y("$showInput && $isMulti",/* #__PURE__ */Ap(/* #__PURE__ */Ip(),/* #__PURE__ */Dp())),/* #__PURE__ */$p(/* #__PURE__ */bp("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){$();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=p(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return h(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function i(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){$();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=p(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function p(e,o=t.props.min,n=t.props.max){(e=[...e]).sort(((e,t)=>e.value-t.value)),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map(((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function d(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(c);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${i(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${i(r,e,o)}%`},t.props.fillStyles={left:`${i(r,e,o)}%`,width:i(n,e,o)-i(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${i(n,e,o)}%`}}function c(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function u(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([t.props.min,t.props.max]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(e)}return d(),void f()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1;t._value[n]=e;const[s,a]=[...t._value];if(s>=a){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=m([...t._value].sort(c))}else Array.isArray(e)?r=m(e):(r=m(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=g(r));const s=v(r);n&&t.input(s),d(),f()}function f(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(e),r&&r.input(o)}else r&&r.input(t._value)}function v(e){return t.props.isMulti&&Array.isArray(e)?[v(e[0]),v(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function h(e){return parseFloat(e.toFixed(t.props.decimals))}function m(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map((e=>h(Math.round(e/t.props.step)*t.props.step))):h(Math.round(e/t.props.step)*t.props.step);const o=p(t.props.intervals);if(Array.isArray(e))return e.map((e=>{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return h(n.value+Math.round((e-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return h(n.value+Math.round((e-n.value)/n.step)*n.step)}}function g(e){if(Array.isArray(e))return e[0]=g(e[0]),e[1]=g(e[1]),e;{const o=t.props.marks,n=o.reduce(((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t),o[0]);return n.at}}function $(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",(()=>{var s;$(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=parseFloat(`${t.props.min}`),t.props.max=parseFloat(`${t.props.max}`);const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const f=e.undefine(t.props.marks);t.props.marks=!!f&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):t.props.largestBar;const h={disabled:t.props.disabled,min:t.props.min,max:t.props.max,step:t.props.step};if(t.props.inputAttrs=t.props.inputAttrs&&"object"==typeof t.props.inputAttrs?Object.assign(h,t.props.inputAttrs):h,t.props.computedMaxInputAttrs=t.props.maxInputAttrs&&"object"==typeof t.props.maxInputAttrs?Object.assign({},t.props.inputAttrs,t.props.maxInputAttrs):t.props.inputAttrs,t.props.computedMinInputAttrs=t.props.minInputAttrs&&"object"==typeof t.props.minInputAttrs?Object.assign({},t.props.inputAttrs,t.props.minInputAttrs):t.props.inputAttrs,e.whenAvailable(`track-${t.props.id}`,(()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),u(t.value,!1),d()}),t.props.__root),t.context){let s=0,a="";const d=t.context.handlers.blur;t.context.handlers.blur=e=>{d(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=l(100*s),u(t._value)}else u(l(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,u(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,m,{passive:!1}),document.addEventListener(s,(()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,m),n&&e.target instanceof HTMLElement&&e.target.blur())}))},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout((()=>{"-"!==a?(u(parseFloat(a)*t),a=""):a=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=p(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=g(n),r=t.props.marks.find((e=>e.at===o)),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void u(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?u(t.props.min):u(t.props.max));if("Home"===e.key)return void u(t.props.min);if("End"===e.key)return void u(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){u(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?u(n+10*r):"PageDown"===e.key&&u(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))return r(n);const s=parseFloat(n);return t.props.isMulti&&Array.isArray(t.value)?(t.value[1]=s,u(t.value)):u(s),r(v(s))}))},t.context.handlers.minNode=o=>{n=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))return r(n);const s=parseFloat(n);return t.props.isMulti&&Array.isArray(t.value)?(t.value[0]=s,u(t.value)):u(s),r(v(s))}))},t.context.handlers.inputBlur=()=>{t.props.isMulti&&Array.isArray(t.value)&&(t.value.sort(c),n&&n.input(t.value[0]),r&&r.input(t.value[1]))},t.context.fns.calculateMarkPosition=e=>i(e,t.props.min,t.props.max)}function m(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect();u(l((r-s)/a*100))}u(t.value,!1)})),t.on("input",(({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||u(e,!1):t.value!==e&&u(e,!1)})),t.on("prop:max",(()=>{t.props.max=parseFloat(`${t.props.max}`),u(t.value)})),t.on("prop:min",(()=>{t.props.min=parseFloat(`${t.props.min}`),u(t.value)}))}]},Kp=/* #__PURE__ */q("cp"),{outer:Np,wrapper:Wp,inner:qp,label:zp,prefix:Up,suffix:Yp,help:jp,messages:Zp,message:Gp,icon:Xp}=/* #__PURE__ */z(Kp),Jp=Kp("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Qp=Kp("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),ed=Kp("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),td=Kp("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),od=Kp("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),nd=Kp("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),rd=Kp("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),sd=Kp("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),ad=Kp("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),ld=Kp("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),id=Kp("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),pd=Kp("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),dd=Kp("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),cd=Kp("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),ud=Kp("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),fd=Kp("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),vd=Kp("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),hd=Kp("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),md=Kp("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),gd=Kp("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),$d=Kp("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),bd=Kp("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),yd=Kp("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),xd=Kp("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),wd=Kp("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),_d=Kp("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),kd=Kp("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),Sd=Kp("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Ld=Kp("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Ad=Kp("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Dd=Kp("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Id=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Cd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function Ed(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Od(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Md(t,o,n,r)]}function Td(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Ed(255*t,2),Ed(255*a,2),n]}function Md(e,t,o,n=1){const r=Ed(t/255,4),s=Ed(o/255,4);if(1===s)return[e,0,100,n];const a=Ed(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Ed(l,2),Ed(100*a,2),n]}function Vd(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Fd(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Bd(e,t,o,n=1){const[r,s,a,l]=Vd(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Pd(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Hd(e){if(e){if(Pd(e))return Od(e);if(e.startsWith("rgb")){const t=e.match(Id);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Fd(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Cd);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Md(o,Ed(255*n,2),Ed(255*r,2),s)}}}function Rd(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Kd(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Nd(e){return!1!==e&&"false"!==e}function Wd(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const qd={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const zd={schema:/* #__PURE__ */Np(/* #__PURE__ */Wp(/* #__PURE__ */zp("$label"),/* #__PURE__ */Y("$inline && $help",/* #__PURE__ */jp("$help")),/* #__PURE__ */qp(/* #__PURE__ */Y("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Xp("prefix","label")),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Up()),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Jp(/* #__PURE__ */vd(),/* #__PURE__ */Y("$showValue",/* #__PURE__ */Qp()))),/* #__PURE__ */Y("$inline || $expanded)",/* #__PURE__ */ed(/* #__PURE__ */Y("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */td(/* #__PURE__ */Xp("close"))),/* #__PURE__ */Y("$panelControls",/* #__PURE__ */od(/* #__PURE__ */nd(/* #__PURE__ */rd(),/* #__PURE__ */sd()),/* #__PURE__ */ud(/* #__PURE__ */fd()),/* #__PURE__ */ad(/* #__PURE__ */ld(),/* #__PURE__ */id()),/* #__PURE__ */pd(/* #__PURE__ */dd(),/* #__PURE__ */cd()),/* #__PURE__ */Y("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */hd(/* #__PURE__ */Xp("eyeDropper"))))),/* #__PURE__ */Y("$panelFormat",/* #__PURE__ */md(/* #__PURE__ */gd(/* #__PURE__ */Y('$panelActiveFormat === "hex"',/* #__PURE__ */$d()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */bd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */yd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */xd()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */_d()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */kd()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */Sd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */wd())),/* #__PURE__ */Ld(/* #__PURE__ */Xp("switch")))),/* #__PURE__ */Y("$options",/* #__PURE__ */Ad(/* #__PURE__ */Dd())))),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Yp()),/* #__PURE__ */Y("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Xp("suffix"))),/* #__PURE__ */Y("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */jp("$help"))),/* #__PURE__ */Zp(/* #__PURE__ */Gp("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=Kd((function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)}),2),f=Kd((function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)}),2),v=Kd(D,2),h=Kd(I,2),m=Kd(P,2),g=Kd(F,10,!1);function $(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Pd(o)&&!Id.test(o)&&!Cd.test(o))return;(Pd(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout((()=>{t.props.hexInputFocused=!0}),10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=Hd(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Ed(o,2)===t.props.h&&Ed(r,2)===t.props.s&&Ed(s,2)===t.props.v&&Ed(a,2)===t.props.alpha)||(t.props.alpha=Ed(a,2),P(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find((t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()}));if(n&&n.value){const e=Hd(n.value);if(e){const[o,n,r,s]=e;t.props.alpha=Ed(s,2),P(o,n,r)}else P(t.props.h,t.props.s,t.props.v)}else P(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,(()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",(async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=Od(e.sRGBHex);t.props.alpha=1,P(n,r,s)}))}),t.props.__root))}function _(){k("canvas-ls",(e=>{r=e}),u,O),k("canvas-hue",(e=>{s=e}),A,T),k("canvas-alpha",(e=>{a=e}),f,M),S(`canvas-preview-${t.props.id}`,(e=>{l=e,D()}),v),S(`canvas-swatch-preview-${t.props.id}`,(e=>{i=e,I()}),h),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,(t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,t),t.addEventListener("mousedown",(t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=qd[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),t.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=qd[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),r)}function S(o,n,r){e.whenAvailable(o,(()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))}),t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,(()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach((e=>{x(e,C)})),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()}),t.props.__root)}function A(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function I(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Rd(o),[l,i,p,d]=Td(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function E(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function O(e){E(e,r,((e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;m(t.props.hue,n,s)}))}function T(e){E(e,s,((e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,m(t.props.h,t.props.s,t.props.v)}))}function M(e){E(e,a,((e,o)=>{const n=e/a.width*100/100;t.props.alpha=n,m(t.props.hue,t.props.s,t.props.v)}))}function V(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,alpha:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${Ed(0===o||100===o&&0===t?0:e,0)}-${Ed(r,0)}-${Ed(o,0)}-${Ed(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function B(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function P(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:Ed(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:Ed(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:Ed(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,alpha:p}=t.props,[d,c,u]=Td(a,l,i),[f,v,h]=Vd(a,l,i),m=t.props.hexInputFocused?t.props.hex:Bd(a,l,i,p),$=Ed(p,2);t.props.hsla={h:a,s:c,l:u,a:$},t.props.hslaPercent={h:Ed(a,0),s:100===i&&0===l?0:Ed(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:Ed(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:$},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${$})`,t.props.hslaStringPrecise=`hsla(${a}, ${Ed(0===i?c/255:c/255*100,2)}%, ${Ed(u/255*100,2)}%, ${$})`,t.props.rgba={r:f,g:v,b:h,a:$},t.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,B(m),setTimeout((()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),g(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))}),0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),v(),h()}t.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.alpha=t.props.alpha||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",(()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",$)})),t.on("created",(()=>{t.context&&("undefined"!=typeof window&&document.addEventListener("paste",$),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=Nd(t.props.panelControls),t.props.eyeDropper=Nd(t.props.eyeDropper),t.props.panelFormat=Nd(t.props.panelFormat),t.props.showValue=Nd(t.props.showValue),t.props.allowPaste=Nd(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},P(0,0,0,!0)):b(`${t.value}`),t.on("input",(({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)})),setTimeout((()=>{w()}),5),_(),t.on("prop:expanded",(()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout((()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}})),t.context.fns.anyToHsvaString=(e,t)=>{const o=Hd(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Ed(n,t)}-${Ed(r,t)}-${Ed(s,t)}-${Ed(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Wd),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":P(o,n-s,r);break;case"ArrowRight":P(o,n+s,r);break;case"ArrowUp":P(o,n,r+s);break;case"ArrowDown":P(o,n,r-s);break;case"PageUp":P(o,n,r+10);break;case"PageDown":P(o,n,r-10);break;case"Home":P(o,n-10,r);break;case"End":P(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":P(o-s,n,r);break;case"ArrowRight":case"ArrowUp":P(o+s,n,r);break;case"PageUp":P(o+10,n,r);break;case"PageDown":P(o-10,n,r);break;case"Home":P(0,n,r);break;case"End":P(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,alpha:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.alpha=Ed(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.alpha=Ed(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.alpha=Ed(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.alpha=Ed(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.alpha=0;break;case"End":t.props.alpha=1}P(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,Pd(r)){const[e,o,n,s]=Od(r);t.props.alpha=s,B(r),P(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Pd(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Pd(o)&&B(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=Md(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);P(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Fd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);P(e,o,n)}else"alpha"==e&&(t.props.alpha=i,P())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=Rd(o.dataset.colorPrecise);t.props.alpha=s,P(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(p),c=p.length;let u=0,f=c,v=!1;const h=p[a].dataset.group;if(void 0!==h){const e=p.filter((e=>e.dataset.group===h));u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const m=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=m,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=m,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-m))),v=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter((e=>e.dataset.group===h)),c=p.filter((t=>t.dataset.group===e)),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(v,d),e-1)}else l>f&&(l=g?Math.min(f+Math.max(v,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach((e=>{delete e.parentElement.dataset.focused}));const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Gt,o.options,
|
|
61
|
+
/* #__PURE__ */o.localize("removeAllValues"),o.options,function(t){!function(t){t.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),t.props.loadMoreOption={label:"Load more",value:zi},void 0===t.props.draggable?t.props.draggable=!0:"false"===t.props.draggable&&(t.props.draggable=!1),t.props.optionsLoaderValues=[],t.props.selectedSourceItems=[],t.props.selectedTargetItems=[],t.props.optionsLoaded=void 0,t.props.memoOptions=[],t.props.multiple=!0,t.props.debounce=t.props.debounce?parseInt(t.props.debounce):200,t.props.optionLoaderValues=[],t.props.optionsLoadingCounter=0,t.props.optionLoadingCounter=0,t.props.page=1,t.props.hasNextPage=Pe.bind(null,t),t.props.options?t.props.options=[...t.props.options]:t.props.options=[],t.props.sourceOptions=[],t.props.targetOptions=[],"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.props.searchable=e.undefine(t.props.searchable),t.props.searchable&&(t.props.inputText=""),t.props.clearOnSelect=e.undefine(t.props.clearOnSelect),void 0===t.props.transferOnSelect?t.props.transferOnSelect=!0:"false"===t.props.transferOnSelect&&(t.props.transferOnSelect=!1),t.props.targetOptions.length&&(t.props.targetOptionValues=t.props.targetOptions.map((e=>Ae(e)))),t.props.initialOptions=[...t.props.options],t.props.max&&(t.props.max=parseInt(t.props.max)),t.props.sourceListOrigin=void 0,"function"!=typeof t.props.filter&&(t.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(t),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(Ce(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Ji(e)),"function"==typeof e.props.optionLoader?ep(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(t),sp(t),function(t){t.on("prop:options",(()=>{t.props.appendingOptions&&(t.props.skipSetActiveValue=!0,t.props.appendingOptions=!1),Ji(t)})),t.on("prop:memoOptions",(()=>{t.props.skipSetActiveValue=!0,Ji(t)})),t.on("prop:sourceOptions",(()=>{0===t.props.sourceOptions.length?t.props.showSourceEmptyMessage=!0:t.props.showSourceEmptyMessage=!1,Ui.delete(t)})),t.on("prop:targetOptions",(()=>{0===t.props.targetOptions.length?t.props.showTargetEmptyMessage=!0:t.props.showTargetEmptyMessage=!1})),t.on("prop:activeValue",(({payload:o})=>{if(t.props.isDragging)return void(t.props.activeDescendant=void 0);if(o===zi)return void(t.props.activeDescendant=`${t.props.id}_load_more`);const n=(t.props.sourceListOrigin?t.props.sourceOptions:t.props.targetOptions).findIndex((t=>e.eq(Ae(t),o)));n>=0&&t.props.sourceListOrigin?t.props.activeDescendant=`${t.props.id}_source_list_item_${n}`:t.props.activeDescendant=n>=0?`${t.props.id}_target_list_item_${n}`:void 0})),t.on("prop:mouseOnSource",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(t.props.id+"_source_list_items");if(!e)return;t.props.mouseOnTarget=!1,t.props.sourceListOrigin=!0,Ui.delete(t),ap(t,e)}})),t.on("prop:mouseOnTarget",(({payload:e})=>{var o;if(e&&!0!==t.props.disabled&&!t.props.isDragging){const e=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`${t.props.id}`);if(!e)return;t.props.mouseOnSource=!1,t.props.sourceListOrigin=!1,Yi.delete(t),ap(t,e)}})),t.on("prop:optionsLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionLoadingCounter&&t.store.set(Te)})),t.on("prop:optionLoadingCounter",(({payload:e})=>{0===e&&0===t.props.optionsLoadingCounter&&(t.store.set(Te),t.props.skipSetActiveValue=!0,Ji(t))}))}(t)}]};const pp=/* #__PURE__ */q("sl"),{outer:dp,wrapper:cp,inner:up,icon:fp,label:vp,prefix:hp,suffix:mp,help:gp,messages:$p,message:bp}=/* #__PURE__ */z(pp),yp=pp("chart",(()=>({$el:"div",if:"$chart"}))),xp=pp("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),wp=pp("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),_p=pp("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),kp=pp("trackWrapper",(()=>({$el:"div"}))),Sp=pp("trackInner",(()=>({$el:"div"}))),Lp=pp("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),Ap=pp("linkedValues",(()=>({$el:"div"}))),Dp=pp("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),Ip=pp("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),Cp=pp("marks",(()=>({$el:"div",if:"$marks"}))),Ep=pp("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),Op=pp("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),Tp=pp("handles",(()=>({$el:"ul"}))),Mp=pp("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Vp=pp("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Fp=pp("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Bp=pp("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Pp=pp("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Hp=pp("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Rp={schema:/* #__PURE__ */dp(/* #__PURE__ */cp(/* #__PURE__ */vp("$label"),/* #__PURE__ */gp("$help"),/* #__PURE__ */wp(/* #__PURE__ */fp("prefix"),/* #__PURE__ */hp(),/* #__PURE__ */_p(/* #__PURE__ */yp(/* #__PURE__ */xp()),/* #__PURE__ */kp(/* #__PURE__ */Sp(/* #__PURE__ */Lp(),/* #__PURE__ */Cp(/* #__PURE__ */Ep(/* #__PURE__ */Op())),/* #__PURE__ */Tp(/* #__PURE__ */Vp(/* #__PURE__ */Hp(),/* #__PURE__ */Fp()),/* #__PURE__ */Mp(/* #__PURE__ */Pp(),/* #__PURE__ */Bp()))))),/* #__PURE__ */mp(),/* #__PURE__ */fp("suffix"),/* #__PURE__ */Y("$showInput && $isMulti === false",/* #__PURE__ */Dp())),/* #__PURE__ */Y("$showInput && $isMulti",/* #__PURE__ */Ap(/* #__PURE__ */Ip(),/* #__PURE__ */Dp())),/* #__PURE__ */$p(/* #__PURE__ */bp("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(t){let o,n,r;t.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const s={linear:{forward:e=>e,reverse:e=>e},log:{forward:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1.5),reverse:(e,o=t.props.min,n=t.props.max)=>n*Math.pow(e/n,1/1.5)}};let a=!1;function l(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function i(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function p(e){const{min:o,max:n,intervals:r}=t.props;if(e=Math.min(Math.max(e,0),100),!r||0===r.length){b();const r=o+e/100*(n-o);return t.props.scalingFunction.reverse(r,o,n)}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[t];if(e>=r&&e<=r+a){const t=o+(e-r)/a*l*n,s=t%n;return m(s<n/2?t-s:t+(n-s))}}return e>100?n:e<0?o:void 0}function d(e,o=t.props.min,n=t.props.max){const r=t.props.intervals;if(!r||0===r.length){b();return(t.props.scalingFunction.forward(e,o,n)-o)/(n-o)*100}const s=c(r,o,n);for(let t=0;t<s.length;t++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[t],p=t<s.length-1?s[t+1].value:n;if(e>=o&&e<=p){return 100*((a+(e-o)/r/i*l)/100)}}return 100}function c(e,o=t.props.min,n=t.props.max){(e=[...e]).sort(((e,t)=>e.value-t.value)),e[0].value!==o&&e.unshift({value:o,step:t.props.step});let r=0;for(let t=0;t<e.length;t++){const o=e[t].value,s=((t<e.length-1?e[t+1].value:n)-o)/e[t].step;r+=s}let s=0;return e.map(((t,o)=>{const a=t.value,l=((o<e.length-1?e[o+1].value:n)-a)/t.step,i=s/r*100;return s+=l,{value:t.value,step:t.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function u(){const e=parseFloat(`${t.props.min}`),o=parseFloat(`${t.props.max}`);let n,r=0;if(Array.isArray(t._value)){const e=[...t._value].sort(f);r=parseFloat(`${e[0]}`),n=parseFloat(`${e[1]}`)}else n=parseFloat(`${t._value}`);t.props.maxHandleStyles={left:`${d(n,e,o)}%`},t.props.isMulti&&Array.isArray(t._value)?(t.props.minHandleStyles={left:`${d(r,e,o)}%`},t.props.fillStyles={left:`${d(r,e,o)}%`,width:d(n,e,o)-d(r,e,o)+"%"}):t.props.fillStyles={left:"0%",width:`${d(n,e,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(e,n=!0){if(t.props.disabled)return;let r;if(void 0===e){if(t.props.isMulti)t.input([g(t.props.min),g(t.props.max)]);else{const e=t.props.min+(t.props.max-t.props.min)/2;t.input(g(e))}return void u()}if(t.props.isMulti&&Array.isArray(t._value)&&!Array.isArray(e)){const n="min"===t.props.lastHandleInteraction?0:1;t._value[n]=e;const[s,a]=[...t._value];if(s>=a){const e=null==o?void 0:o.querySelector(`[data-handle="${"min"===t.props.lastHandleInteraction?"max":"min"}"]`);null==e||e.focus()}r=g([...t._value].sort(f))}else Array.isArray(e)?r=g(e):(r=g(e),r=isNaN(r)?t.props.min:r);t.props.snapToMarks&&(r=$(r));const s=g(h(r));n&&t.input(s),u()}function h(e){return t.props.isMulti&&Array.isArray(e)?[h(e[0]),h(e[1])]:(e=isNaN(e)?t.props.min:e,Math.min(Math.max(parseFloat(`${e}`),t.props.min),t.props.max))}function m(e){return parseFloat(e.toFixed(t.props.decimals))}function g(e){if(t.props.snapToMarks)return e;if(!t.props.intervals)return Array.isArray(e)?e.map((e=>m(Math.round(e/t.props.step)*t.props.step))):m(Math.round(e/t.props.step)*t.props.step);const o=c(t.props.intervals);if(Array.isArray(e))return e.map((e=>{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return e>=n.value&&e<((null===(s=o[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!n)return e;return m(n.value+Math.round((e-n.value)/n.step)*n.step)}}function $(e){if(Array.isArray(e))return e[0]=$(e[0]),e[1]=$(e[1]),e;{const o=t.props.marks,n=o.reduce(((t,o)=>Math.abs(o.at-e)<Math.abs(t.at-e)?o:t),o[0]);return n.at}}function b(){if(a)return;e.undefine(t.props.scalingFunction)?"string"==typeof t.props.scalingFunction?t.props.scalingFunction=s[t.props.scalingFunction]||s.linear:"object"==typeof t.props.scalingFunction&&(t.props.scalingFunction={...s.linear,...t.props.scalingFunction}):t.props.scalingFunction=s.linear,a=!0}t.props.maxHandleStyles={left:"0%"},t.props.fillStyles={left:"0%",width:"0%"},t.props.isMulti=!1,t.props.step=1,t.props.min=0,t.props.max=100,t.props.tooltipFormat="function"==typeof t.props.tooltipFormat?t.props.tooltipFormat:(e,t)=>{if(t)return e},t.props.largestBar=0,"disabled"in t.props&&(t.props.disabled=e.undefine(t.props.disabled)),t.on("created",(()=>{var s;b(),t.props.isMulti=Array.isArray(t.value),t.props.step=parseFloat(`${t.props.step}`),t.props.decimals=(null===(s=t.props.step.toString().split(".")[1])||void 0===s?void 0:s.length)||0,t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,t.props.max=t.props.max?parseFloat(`${t.props.max}`):100;const a=e.undefine(t.props.tooltip);t.props.tooltip=void 0===t.props.tooltip?"auto":a;const m=e.undefine(t.props.marks);if(t.props.marks=!!m&&(Array.isArray(t.props.marks)?t.props.marks:function(){const{min:e,max:o,step:n}=t.props,r=[];for(let t=e;t<=o;t+=n)r.push({at:t,label:t});return r}()),t.props.markLabels=e.undefine(t.props.markLabels),t.props.snapToMarks=e.undefine(t.props.snapToMarks),t.props.showInput=e.undefine(t.props.showInput),t.props.largestBar=t.props.chart?t.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):t.props.largestBar,i(t),e.whenAvailable(`track-${t.props.id}`,(()=>{var e;o=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`track-${t.props.id}`),v(t.value,!1),u()}),t.props.__root),t.context){let s=0,a="";const i=t.context.handlers.blur;t.context.handlers.blur=e=>{i(e),t.emit("blur")},t.context.handlers.clickTrack=e=>{if(!o)return;t.props.dragging=!1;const{left:n,width:r}=o.getBoundingClientRect(),s=(e.clientX-n)/r;if(t.props.isMulti&&Array.isArray(t.value)){const[e,o]=t.value,n=Math.abs(e-s*t.props.max)<Math.abs(o-s*t.props.max)?"min":"max",r="min"===n?0:1;t.props.lastHandleInteraction=n,t.value[r]=p(100*s),v(t._value)}else v(p(100*s))},t.context.handlers.focus=e=>{if(!o)return;const n=e.target.dataset.handle;n&&(t.props.lastHandleInteraction=n)},t.context.handlers.clickHandle=e=>{e.stopPropagation(),t.props.attrs.onClick&&t.props.attrs.onClick(e),t.props.dragging=!1,v(t._value)},t.context.handlers.startDrag=e=>{if(!o)return;t.props.dragging=!0;const n="touchstart"===e.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";t.props.lastHandleInteraction=e.target.dataset.handle||t.props.lastHandleInteraction,document.addEventListener(r,x,{passive:!1}),document.addEventListener(s,(()=>{t.context&&(t.props.dragging=!1,document.removeEventListener(r,x),n&&e.target instanceof HTMLElement&&e.target.blur())}))},t.context.handlers.keydown=e=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(e.key)){e.preventDefault(),clearTimeout(s),a+=e.key;const t="-"===a?-1:1;s=window.setTimeout((()=>{"-"!==a?(v(parseFloat(a)*t),a=""):a=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const o="min"===t.props.lastHandleInteraction?0:1,n=Array.isArray(t._value)?t._value[o]:t._value,r=function(e,o){if(!t.props.intervals)return t.props.step;const n=c(t.props.intervals);if(e>=t.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return e>=o.value&&e<((null===(s=n[r+1])||void 0===s?void 0:s.value)||t.props.max)}));if(!r)return t.props.step;if(-1===o){e-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(e.key)?-1:1);if(t.props.marks&&t.props.snapToMarks){const o=$(n),r=t.props.marks.find((e=>e.at===o)),s=t.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(e.key)?-1:1,l=Math.min(Math.max(0,s+a),t.props.marks.length-1);return void v(t.props.marks[l].at)}if(e.metaKey)return void("ArrowLeft"===e.key||"ArrowDown"===e.key?v(t.props.min):v(t.props.max));if("Home"===e.key)return void v(t.props.min);if("End"===e.key)return void v(t.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key)){v(n+(e.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(e.key)?-1:1))}"PageUp"===e.key?v(n+10*r):"PageDown"===e.key&&v(n-10*r)}},t.context.handlers.maxNode=o=>{r=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([t.value[0],n])}else v(n);return r(h(n))}))},t.context.handlers.minNode=o=>{n=o,o.hook.commit(((n,r)=>{if(e.eq(o.value,n))return r(n);if(`${o.value}`.includes(".")&&!`${n}`.includes(".")&&l(),t.props.isMulti&&Array.isArray(t.value)){v([n,t.value[1]])}else v(n);return r(h(n))}))},t.context.handlers.inputBlur=()=>{if(t.props.isMulti&&Array.isArray(t._value)){v([...t._value].sort(f))}},t.context.fns.calculateMarkPosition=e=>d(e,t.props.min,t.props.max)}let y;function x(e){var n;if(!o||!t.props.dragging)return;e.preventDefault();const r=e.clientX||(null===(n=e.touches)||void 0===n?void 0:n.length)&&e.touches[0].clientX,{left:s,width:a}=o.getBoundingClientRect(),l=g(p((r-s)/a*100));y!==l&&(y=l,v(l))}v(t.value)})),t.on("input",(({payload:e})=>{Array.isArray(t.value)&&Array.isArray(e)?t.value[0]===e[0]&&t.value[1]===e[1]||v(e,!1):t.value!==e&&v(e,!1),function(){if(t.props.isMulti&&Array.isArray(t._value)){const[e,o]=[...t._value];n&&n.input(m(e)),r&&r.input(m(o))}else r&&r.input(t._value)}()})),t.on("prop:max",(()=>{t.props.max=t.props.max?parseFloat(`${t.props.max}`):100,v(t.value),i(t)})),t.on("prop:min",(()=>{t.props.min=t.props.min?parseFloat(`${t.props.min}`):0,v(t.value),i(t)}))}]},Kp=/* #__PURE__ */q("cp"),{outer:Np,wrapper:Wp,inner:qp,label:zp,prefix:Up,suffix:Yp,help:jp,messages:Zp,message:Gp,icon:Xp}=/* #__PURE__ */z(Kp),Jp=Kp("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Qp=Kp("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),ed=Kp("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),td=Kp("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),od=Kp("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),nd=Kp("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),rd=Kp("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),sd=Kp("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),ad=Kp("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),ld=Kp("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),id=Kp("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),pd=Kp("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),dd=Kp("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),cd=Kp("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),ud=Kp("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),fd=Kp("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),vd=Kp("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),hd=Kp("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),md=Kp("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),gd=Kp("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),$d=Kp("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),bd=Kp("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),yd=Kp("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),xd=Kp("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),wd=Kp("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),_d=Kp("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),kd=Kp("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),Sd=Kp("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),Ld=Kp("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),Ad=Kp("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),Dd=Kp("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),Id=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,Cd=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function Ed(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function Od(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Md(t,o,n,r)]}function Td(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,Ed(255*t,2),Ed(255*a,2),n]}function Md(e,t,o,n=1){const r=Ed(t/255,4),s=Ed(o/255,4);if(1===s)return[e,0,100,n];const a=Ed(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,Ed(l,2),Ed(100*a,2),n]}function Vd(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Fd(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Bd(e,t,o,n=1){const[r,s,a,l]=Vd(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Pd(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Hd(e){if(e){if(Pd(e))return Od(e);if(e.startsWith("rgb")){const t=e.match(Id);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Fd(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(Cd);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Md(o,Ed(255*n,2),Ed(255*r,2),s)}}}function Rd(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Kd(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Nd(e){return!1!==e&&"false"!==e}function Wd(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const qd={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const zd={schema:/* #__PURE__ */Np(/* #__PURE__ */Wp(/* #__PURE__ */zp("$label"),/* #__PURE__ */Y("$inline && $help",/* #__PURE__ */jp("$help")),/* #__PURE__ */qp(/* #__PURE__ */Y("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Xp("prefix","label")),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Up()),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Jp(/* #__PURE__ */vd(),/* #__PURE__ */Y("$showValue",/* #__PURE__ */Qp()))),/* #__PURE__ */Y("$inline || $expanded)",/* #__PURE__ */ed(/* #__PURE__ */Y("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */td(/* #__PURE__ */Xp("close"))),/* #__PURE__ */Y("$panelControls",/* #__PURE__ */od(/* #__PURE__ */nd(/* #__PURE__ */rd(),/* #__PURE__ */sd()),/* #__PURE__ */ud(/* #__PURE__ */fd()),/* #__PURE__ */ad(/* #__PURE__ */ld(),/* #__PURE__ */id()),/* #__PURE__ */pd(/* #__PURE__ */dd(),/* #__PURE__ */cd()),/* #__PURE__ */Y("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */hd(/* #__PURE__ */Xp("eyeDropper"))))),/* #__PURE__ */Y("$panelFormat",/* #__PURE__ */md(/* #__PURE__ */gd(/* #__PURE__ */Y('$panelActiveFormat === "hex"',/* #__PURE__ */$d()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */bd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */yd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba"',/* #__PURE__ */xd()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */_d()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */kd()),/* #__PURE__ */Y('$panelActiveFormat === "hsla"',/* #__PURE__ */Sd()),/* #__PURE__ */Y('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */wd())),/* #__PURE__ */Ld(/* #__PURE__ */Xp("switch")))),/* #__PURE__ */Y("$options",/* #__PURE__ */Ad(/* #__PURE__ */Dd())))),/* #__PURE__ */Y("$inline === undefined || $inline === false",/* #__PURE__ */Yp()),/* #__PURE__ */Y("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Xp("suffix"))),/* #__PURE__ */Y("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */jp("$help"))),/* #__PURE__ */Zp(/* #__PURE__ */Gp("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(t){let o,n=null,r=null,s=null,a=null,l=null,i=null,p=null,d=0;const c=["hex","rgba","hsla"],u=Kd((function(){if(!r)return;const e=r.getContext("2d");if(!e)return;const{width:o,height:n}=r,s=t.props.h||0;e.fillStyle=`hsl(${s}, 100%, 50%)`,e.fillRect(0,0,o,n);const a=e.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),e.fillStyle=a,e.fillRect(0,0,o,n);const l=e.createLinearGradient(0,0,0,n);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=l,e.fillRect(0,0,o,n)}),2),f=Kd((function(){if(!a)return;const e=a.getContext("2d");if(!e)return;const o=Math.round(a.width),n=Math.round(a.height);e.clearRect(0,0,o,n),V(a,n/2);const r=t.props.rgba.r||0,s=t.props.rgba.g||0,l=t.props.rgba.b||0,i=e.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${l}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${l}, 1)`),e.fillStyle=i,e.fillRect(0,0,o,n)}),2),v=Kd(D,2),h=Kd(I,2),m=Kd(P,2),g=Kd(F,10,!1);function $(e){var o,r;if(!t.context||!t.props.allowPaste||t.props.disabled)return;const s=null===(o=t.props.__root)||void 0===o?void 0:o.activeElement;if(n&&n.contains(s)){const o=null===(r=e.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Pd(o)&&!Id.test(o)&&!Cd.test(o))return;(Pd(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(t.props.hexInputFocused&&(t.props.hexInputFocused=!1,setTimeout((()=>{t.props.hexInputFocused=!0}),10)),e.preventDefault(),b(o))}}function b(e){var o;if(!e)return;const n=Hd(e);if(n){const[o,r,s,a]=n;"undefined"!==e&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||Ed(o,2)===t.props.h&&Ed(r,2)===t.props.s&&Ed(s,2)===t.props.v&&Ed(a,2)===t.props.alpha)||(t.props.alpha=Ed(a,2),P(o,r,s))}else{const n=null===(o=t.props.options)||void 0===o?void 0:o.find((t=>{var o;return(null===(o=t.label)||void 0===o?void 0:o.toLowerCase())===e.toLowerCase()}));if(n&&n.value){const e=Hd(n.value);if(e){const[o,n,r,s]=e;t.props.alpha=Ed(s,2),P(o,n,r)}else P(t.props.h,t.props.s,t.props.v)}else P(t.props.h,t.props.s,t.props.v)}}function y(e){if(!t.context||!p)return;const o=p[e];o&&(t.props.focusedSwatch=o.dataset.color)}function x(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function w(){t.context&&t.props.eyeDropper&&(t.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),e.whenAvailable(`eye-dropper-${t.props.id}`,(()=>{var e;const o=new window.EyeDropper,n=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(`eye-dropper-${t.props.id}`);null==n||n.addEventListener("click",(async()=>{const e=await o.open();if(!e.sRGBHex)return;const[n,r,s]=Od(e.sRGBHex);t.props.alpha=1,P(n,r,s)}))}),t.props.__root))}function _(){k("canvas-ls",(e=>{r=e}),u,O),k("canvas-hue",(e=>{s=e}),A,T),k("canvas-alpha",(e=>{a=e}),f,M),S(`canvas-preview-${t.props.id}`,(e=>{l=e,D()}),v),S(`canvas-swatch-preview-${t.props.id}`,(e=>{i=e,I()}),h),L()}function k(e,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&o&&s(e)},p=e=>{o&&s(e)},d=()=>{o=void 0,l()},c=()=>{o=void 0,l()};S(`${e}-${t.props.id}`,(t=>{const l=t.nextElementSibling;n(t),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(t,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,t),t.addEventListener("mousedown",(t=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),o=qd[e],s(t),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),t.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),o=qd[e],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),r)}function S(o,n,r){e.whenAvailable(o,(()=>{var e;const s=null===(e=t.props.__root)||void 0===e?void 0:e.getElementById(o);s&&(n(s),r&&x(s,r))}),t.props.__root)}function L(){e.whenAvailable(`swatches-${t.props.id}`,(()=>{var e,o,n;p=Array.from((null===(e=t.props.__root)||void 0===e?void 0:e.querySelectorAll(`#swatches-${t.props.id} canvas`))||[]),p.forEach((e=>{x(e,C)})),t.props.focusedSwatch=null===(n=null===(o=p[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,F()}),t.props.__root)}function A(){if(!s)return;const e=s.getContext("2d");if(!e)return;const t=s.width,o=s.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!l)return;const e=l.getContext("2d");if(!e)return;V(l,l.width/3);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,l.width,l.height)}function I(){if(!i)return;const e=i.getContext("2d");if(!e)return;V(i,i.height/2);const{r:o,g:n,b:r,a:s}=t.props.rgba;e.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,e.fillRect(0,0,i.width,i.height)}function C(e){if(!e)return;const t=e.getContext("2d");if(!t)return;V(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Rd(o),[l,i,p,d]=Td(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function E(e,t,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!t)return;const o=t.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-o.left,s=e.touches[0].clientY-o.top):(r=e.clientX-o.left,s=e.clientY-o.top),r=Math.min(Math.max(r,0),o.width),s=Math.min(Math.max(s,0),o.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{o=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{o=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function O(e){E(e,r,((e,o)=>{const n=e/r.width*100,s=100-o/r.height*100;m(t.props.hue,n,s)}))}function T(e){E(e,s,((e,o)=>{if(!s)return;const n=s.width,r=Math.floor(e/n*360);t.props.h=r,m(t.props.h,t.props.s,t.props.v)}))}function M(e){E(e,a,((e,o)=>{const n=e/a.width*100/100;t.props.alpha=n,m(t.props.hue,t.props.s,t.props.v)}))}function V(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function F(){var e,o;if(!t.context||!t.props.options||!p)return;const{h:n,s:r,v:s,alpha:a}=t.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${Ed(0===o||100===o&&0===t?0:e,0)}-${Ed(r,0)}-${Ed(o,0)}-${Ed(n,2)}`}(n,r,s,a);let i=!1,d=!1;p.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(d=!0);const u=e.parentElement;d||t===l?(u.dataset.active="true",e.ariaSelected="true",d=!1,!i&&p&&(y(p.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(t.props.focusedSwatch=null===(o=null===(e=p[0])||void 0===e?void 0:e.dataset)||void 0===o?void 0:o.color)}function B(e){e=e.replace("#",""),t.props.hexInputFocused||3!==e.length||(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e=`#${e=e.toUpperCase()}`,t.props.hex=e.slice(0,9)}function P(e,o,r,s=!1){t.props.h=void 0===e||isNaN(e)?t.props.h:Ed(Math.max(Math.min(e,360),0),2),t.props.s=void 0===o||isNaN(o)?t.props.s:Ed(Math.max(Math.min(o,100),0),2),t.props.v=void 0===r||isNaN(r)?t.props.v:Ed(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,alpha:p}=t.props,[d,c,u]=Td(a,l,i),[f,v,h]=Vd(a,l,i),m=t.props.hexInputFocused?t.props.hex:Bd(a,l,i,p),$=Ed(p,2);t.props.hsla={h:a,s:c,l:u,a:$},t.props.hslaPercent={h:Ed(a,0),s:100===i&&0===l?0:Ed(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:Ed(Math.max(Math.min(t.props.hsla.l/255*100,100),0),0),a:$},t.props.hslaString=`hsla(${t.props.hslaPercent.h}, ${t.props.hslaPercent.s}%, ${t.props.hslaPercent.l}%, ${$})`,t.props.hslaStringPrecise=`hsla(${a}, ${Ed(0===i?c/255:c/255*100,2)}%, ${Ed(u/255*100,2)}%, ${$})`,t.props.rgba={r:f,g:v,b:h,a:$},t.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,B(m),setTimeout((()=>{var e;H(),function(){const e=t.props.s,o=100-t.props.v;t.props.controlLSPosition={x:e,y:o}}(),g(),n||"undefined"==typeof window||(n=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"]`))}),0);const b=t.props.valueFormat?t.props.valueFormat:t.props.format;s||("hex"===b?t.input(t.props.hex):"rgba"===b?t.input(t.props.rgbaString):"hsla"===b&&t.input(t.props.hslaStringPrecise))}function H(){u(),f(),v(),h()}t.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),t.props.h=t.props.h||void 0,t.props.s=t.props.s||void 0,t.props.v=t.props.v||void 0,t.props.alpha=t.props.alpha||1,t.props.controlLSPosition=t.props.controlLSPosition||{x:0,y:0},t.props.switchIcon=t.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',t.props.hexInputFocused=!1,t.props.swatchIsUsingKeyboardNav=!1,t.on("destroying",(()=>{t.context&&"undefined"!=typeof document&&document.removeEventListener("paste",$)})),t.on("created",(()=>{t.context&&("undefined"!=typeof window&&document.addEventListener("paste",$),t.props.expanded=!1,t.props.panelActiveFormat=t.props.format||c[0],t.props.panelControls=Nd(t.props.panelControls),t.props.eyeDropper=Nd(t.props.eyeDropper),t.props.panelFormat=Nd(t.props.panelFormat),t.props.showValue=Nd(t.props.showValue),t.props.allowPaste=Nd(t.props.allowPaste),t.props.inline=e.undefine(t.props.inline),t.props.disabled=e.undefine(t.props.disabled),t.props.format=t.props.format||"hex",t.props.valueFormat=t.props.valueFormat||t.props.format,t.props.closeOnSelect=e.undefine(t.props.closeOnSelect),t.props.focusedSwatch=void 0,void 0===t.value||""===t.value||null===t.value?(t.props.rgba={r:0,g:0,b:0},P(0,0,0,!0)):b(`${t.value}`),t.on("input",(({payload:e})=>{n&&void 0!==t.props.__root&&!n.contains(t.props.__root.activeElement)&&b(e)})),setTimeout((()=>{w()}),5),_(),t.on("prop:expanded",(()=>{var e;if(t.props.expanded)w(),_(),L(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?t.props.showPanelClose=!0:t.props.showPanelClose=!1,setTimeout((()=>{var e;const o=null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(e=t.props.__root)||void 0===e?void 0:e.querySelector(`[data-id="${t.props.id}"] *[tabindex="0"]`)).focus()}function o(e){"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1)}})),t.context.fns.anyToHsvaString=(e,t)=>{const o=Hd(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${Ed(n,t)}-${Ed(r,t)}-${Ed(s,t)}-${Ed(a,2)}`},t.context.handlers.inputPreviewClick=e=>{t.props.expanded=!t.props.expanded},t.context.handlers.inputPreviewFocusout=e=>{var o,n,r;const s=null===(o=t.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${t.props.id}"] .formkit-inner`),a=e.relatedTarget;if(s.contains(a)){function l(e){var o,n;s.contains(e.target)||(t.props.expanded=!1,null===(o=t.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=t.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=t.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=t.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else t.props.expanded=!1},t.context.handlers.inputPreviewKeydown=e=>{"Escape"===e.key&&(e.preventDefault(),t.props.expanded=!1),"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!t.props.expanded)},t.context.handlers.closePanel=()=>{t.props.expanded=!1},t.context.handlers.panelCloseKeydown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t.props.expanded=!1)},t.context.handlers.toggleFormat=(e=1)=>{e="number"==typeof e?e:1;const o=(c.indexOf(t.props.panelActiveFormat)+e+c.length)%c.length;t.props.panelActiveFormat=c[o]},t.context.handlers.panelKeydown=e=>{var o,n,r;if("Tab"===e.key&&t.props.expanded){e.preventDefault();const s=Array.from((null===(o=t.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${t.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Wd),a=s.indexOf((null===(n=t.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=t.props.__root)||void 0===r?void 0:r.activeElement:t.props.__root);let l;l=e.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},t.context.handlers.lsKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":P(o,n-s,r);break;case"ArrowRight":P(o,n+s,r);break;case"ArrowUp":P(o,n,r+s);break;case"ArrowDown":P(o,n,r-s);break;case"PageUp":P(o,n,r+10);break;case"PageDown":P(o,n,r-10);break;case"Home":P(o,n-10,r);break;case"End":P(o,n+10,r)}H()}},t.context.handlers.hueControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r}=t.props,s=e.shiftKey?10:1;switch(e.key){case"ArrowLeft":case"ArrowDown":P(o-s,n,r);break;case"ArrowRight":case"ArrowUp":P(o+s,n,r);break;case"PageUp":P(o+10,n,r);break;case"PageDown":P(o-10,n,r);break;case"Home":P(0,n,r);break;case"End":P(360,n,r)}H()}},t.context.handlers.alphaControlKeydown=e=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key)){e.preventDefault();const{h:o,s:n,v:r,alpha:s}=t.props,a=e.shiftKey?.1:.01;switch(e.key){case"ArrowLeft":case"ArrowDown":t.props.alpha=Ed(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":t.props.alpha=Ed(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":t.props.alpha=Ed(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":t.props.alpha=Ed(Math.min(Math.max(s-.1,0),1),2);break;case"Home":t.props.alpha=0;break;case"End":t.props.alpha=1}P(o,n,r)}},t.context.handlers.eyeDropperKeydown=e=>{var o;if("Enter"===e.key||" "===e.key){e.preventDefault();const n=null===(o=t.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${t.props.id}`);null==n||n.click()}},t.context.handlers.formatSwitcherKeydown=e=>{t.context&&("Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),t.context.handlers.toggleFormat()),"ArrowUp"===e.key&&(e.preventDefault(),t.context.handlers.toggleFormat(-1)))},t.context.handlers.hexInput=e=>{const o=e.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,Pd(r)){const[e,o,n,s]=Od(r);t.props.alpha=s,B(r),P(e,o,n)}},t.context.handlers.hexKeydown=e=>{const o=e.target,n=o.value;let r="";if(!Pd(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=e.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(e.key))switch(e.preventDefault(),e.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),t.context&&t.context.handlers.hexInput(e)},t.context.handlers.hexFocus=()=>{t.context&&(t.props.hexInputFocused=!0)},t.context.handlers.hexBlur=e=>{if(!t.context)return;t.props.hexInputFocused=!1;const o=e.target.value;Pd(o)&&B(o)},t.context.handlers.rangeLimitInput=(e,o,n,r)=>s=>{const a=r||s;if(!a||!t.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===e){switch(p){case`h-${t.props.id}`:t.props.h=i;break;case`s-${t.props.id}`:t.props.hslaPercent.s=i;break;case`l-${t.props.id}`:t.props.hslaPercent.l=i}const[e,o,n]=Md(t.props.h,2.55*t.props.hslaPercent.s,2.55*t.props.hslaPercent.l);P(e,o,n)}else if("rgba"===e){switch(p){case`r-${t.props.id}`:t.props.rgba.r=i;break;case`g-${t.props.id}`:t.props.rgba.g=i;break;case`b-${t.props.id}`:t.props.rgba.b=i}const[e,o,n]=Fd(t.props.rgba.r,t.props.rgba.g,t.props.rgba.b);P(e,o,n)}else"alpha"==e&&(t.props.alpha=i,P())},t.context.handlers.rangeLimitKeydown=(e,o,n,r)=>s=>{if(!t.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}t.context.handlers.rangeLimitInput(e,o,n,s)()}}else s.preventDefault()},t.context.handlers.swatchClick=e=>{const o=e.target;if(o.dataset.colorPrecise){const[e,n,r,s]=Rd(o.dataset.colorPrecise);t.props.alpha=s,P(e,n,r),t.props.closeOnSelect&&(t.props.expanded=!1)}t.context&&"keydown"!==e.type&&t.context.handlers.swatchKeydown(e)},t.context.handlers.swatchKeydown=e=>{var o,n,r,s;if(!t.context||!p||!p.length)return;const a=p.indexOf(e.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(p),c=p.length;let u=0,f=c,v=!1;const h=p[a].dataset.group;if(void 0!==h){const e=p.filter((e=>e.dataset.group===h));u=p.indexOf(e[0]),f=p.indexOf(e[e.length-1])}const m=(a-u)%i;if(!e.key||"Tab"===e.key)return e.key||(t.props.swatchIsUsingKeyboardNav=!1,d=m,y(a)),"Tab"===e.key&&(t.props.swatchIsUsingKeyboardNav=!1),void p.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===e.key||" "===e.key)return e.preventDefault(),d=m,t.context.handlers.swatchClick(e),void y(a);switch("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(t.props.swatchIsUsingKeyboardNav=!0,e.preventDefault()),e.key){case"ArrowUp":l=Math.max(a-i,a-(i-(d-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(d-m))),v=!0;break;case"ArrowLeft":l=a-1,d=(l-u)%i;break;case"ArrowRight":l=a+1,d=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=p[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=p[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=p.filter((e=>e.dataset.group===h)),c=p.filter((t=>t.dataset.group===e)),v=(a-u)%i,m=t.length%i||i,g=a>=u+t.length-m;if(l<u){const e=c.length%i||i;l=u-e+Math.min(Math.max(v,d),e-1)}else l>f&&(l=g?Math.min(f+Math.max(v,d)+1,p.indexOf(c[c.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<c){y(l),p.forEach((e=>{delete e.parentElement.dataset.focused}));const e=p[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Gt,o.options,
|
|
62
62
|
/* #__PURE__ */o.defaultIcon("eyeDropper","color"),
|
|
63
63
|
/* #__PURE__ */o.defaultIcon("close","close"),
|
|
64
64
|
/* #__PURE__ */o.localize("close"),
|
package/index.mjs
CHANGED
|
@@ -58,7 +58,7 @@ import{isRecord as e,isObject as t,isPojo as o,eq as n,undefine as r,whenAvailab
|
|
|
58
58
|
/* #__PURE__ */g("addAllValues"),
|
|
59
59
|
/* #__PURE__ */g("addSelectedValues"),
|
|
60
60
|
/* #__PURE__ */g("removeSelectedValues"),
|
|
61
|
-
/* #__PURE__ */g("removeAllValues"),b,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),e.props.loadMoreOption={label:"Load more",value:Fp},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=Ct.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.searchable=r(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=r(e.props.clearOnSelect),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>$t(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(yt(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Wp(e)),"function"==typeof e.props.optionLoader?Yp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Gp(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Wp(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Wp(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,Bp.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===Fp)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>n($t(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,Bp.delete(e),Xp(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Pp.delete(e),Xp(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(_t)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(_t),e.props.skipSetActiveValue=!0,Wp(e))}))}(e)}]};const ed=/* #__PURE__ */Me("sl"),{outer:td,wrapper:od,inner:nd,icon:rd,label:sd,prefix:ad,suffix:ld,help:id,messages:pd,message:dd}=/* #__PURE__ */Ve(ed),cd=ed("chart",(()=>({$el:"div",if:"$chart"}))),ud=ed("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),fd=ed("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),vd=ed("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),hd=ed("trackWrapper",(()=>({$el:"div"}))),md=ed("trackInner",(()=>({$el:"div"}))),$d=ed("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),gd=ed("linkedValues",(()=>({$el:"div"}))),bd=ed("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),yd=ed("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),xd=ed("marks",(()=>({$el:"div",if:"$marks"}))),wd=ed("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),_d=ed("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),kd=ed("handles",(()=>({$el:"ul"}))),Sd=ed("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Ld=ed("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Ad=ed("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Cd=ed("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Dd=ed("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Id=ed("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Ed={schema:/* #__PURE__ */td(/* #__PURE__ */od(/* #__PURE__ */sd("$label"),/* #__PURE__ */id("$help"),/* #__PURE__ */fd(/* #__PURE__ */rd("prefix"),/* #__PURE__ */ad(),/* #__PURE__ */vd(/* #__PURE__ */cd(/* #__PURE__ */ud()),/* #__PURE__ */hd(/* #__PURE__ */md(/* #__PURE__ */$d(),/* #__PURE__ */xd(/* #__PURE__ */wd(/* #__PURE__ */_d())),/* #__PURE__ */kd(/* #__PURE__ */Ld(/* #__PURE__ */Id(),/* #__PURE__ */Ad()),/* #__PURE__ */Sd(/* #__PURE__ */Dd(),/* #__PURE__ */Cd()))))),/* #__PURE__ */ld(),/* #__PURE__ */rd("suffix"),/* #__PURE__ */Be("$showInput && $isMulti === false",/* #__PURE__ */bd())),/* #__PURE__ */Be("$showInput && $isMulti",/* #__PURE__ */gd(/* #__PURE__ */yd(),/* #__PURE__ */bd())),/* #__PURE__ */pd(/* #__PURE__ */dd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){let t,o,a;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const l={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let i=!1;function p(t){const{min:o,max:n,intervals:r}=e.props;if(t=Math.min(Math.max(t,0),100),!r||0===r.length){y();const r=o+t/100*(n-o);return e.props.scalingFunction.reverse(r,o,n)}const s=c(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[e];if(t>=r&&t<=r+a){const e=o+(t-r)/a*l*n,s=e%n;return $(s<n/2?e-s:e+(n-s))}}return t>100?n:t<0?o:void 0}function d(t,o=e.props.min,n=e.props.max){const r=e.props.intervals;if(!r||0===r.length){y();return(e.props.scalingFunction.forward(t,o,n)-o)/(n-o)*100}const s=c(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[e],p=e<s.length-1?s[e+1].value:n;if(t>=o&&t<=p){return 100*((a+(t-o)/r/i*l)/100)}}return 100}function c(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function u(){const t=parseFloat(`${e.props.min}`),o=parseFloat(`${e.props.max}`);let n,r=0;if(Array.isArray(e._value)){const t=[...e._value].sort(f);r=parseFloat(`${t[0]}`),n=parseFloat(`${t[1]}`)}else n=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${d(n,t,o)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${d(r,t,o)}%`},e.props.fillStyles={left:`${d(r,t,o)}%`,width:d(n,t,o)-d(r,t,o)+"%"}):e.props.fillStyles={left:"0%",width:`${d(n,t,o)}%`}}function f(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function v(o,n=!0){if(e.props.disabled)return;let r;if(void 0===o){if(e.props.isMulti)e.input([e.props.min,e.props.max]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(t)}return u(),void h()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(o)){const n="min"===e.props.lastHandleInteraction?0:1;e._value[n]=o;const[s,a]=[...e._value];if(s>=a){const o=null==t?void 0:t.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==o||o.focus()}r=g([...e._value].sort(f))}else Array.isArray(o)?r=g(o):(r=g(o),r=isNaN(r)?e.props.min:r);e.props.snapToMarks&&(r=b(r));const s=m(r);n&&e.input(s),u(),h()}function h(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,n]=[...e._value];o&&o.input(t),a&&a.input(n)}else a&&a.input(e._value)}function m(t){return e.props.isMulti&&Array.isArray(t)?[m(t[0]),m(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function $(t){return parseFloat(t.toFixed(e.props.decimals))}function g(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>$(Math.round(t/e.props.step)*e.props.step))):$(Math.round(t/e.props.step)*e.props.step);const o=c(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return $(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return $(n.value+Math.round((t-n.value)/n.step)*n.step)}}function b(t){if(Array.isArray(t))return t[0]=b(t[0]),t[1]=b(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function y(){if(i)return;r(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=l[e.props.scalingFunction]||l.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...l.linear,...e.props.scalingFunction}):e.props.scalingFunction=l.linear,i=!0}e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.on("created",(()=>{var l;y(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=parseFloat(`${e.props.min}`),e.props.max=parseFloat(`${e.props.max}`);const i=r(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":i;const h=r(e.props.marks);e.props.marks=!!h&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=r(e.props.markLabels),e.props.snapToMarks=r(e.props.snapToMarks),e.props.showInput=r(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar;const $={disabled:e.props.disabled,min:e.props.min,max:e.props.max,step:e.props.step};if(e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign($,e.props.inputAttrs):$,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs,s(`track-${e.props.id}`,(()=>{var o;t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),v(e.value,!1),u()}),e.props.__root),e.context){let r=0,s="";const l=e.context.handlers.blur;e.context.handlers.blur=t=>{l(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!t)return;e.props.dragging=!1;const{left:n,width:r}=t.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,n=Math.abs(t-s*e.props.max)<Math.abs(o-s*e.props.max)?"min":"max",r="min"===n?0:1;e.props.lastHandleInteraction=n,e.value[r]=p(100*s),v(e._value)}else v(p(100*s))},e.context.handlers.focus=o=>{if(!t)return;const n=o.target.dataset.handle;n&&(e.props.lastHandleInteraction=n)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,v(e._value)},e.context.handlers.startDrag=o=>{if(!t)return;e.props.dragging=!0;const n="touchstart"===o.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";e.props.lastHandleInteraction=o.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(r,g,{passive:!1}),document.addEventListener(s,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(r,g),n&&o.target instanceof HTMLElement&&o.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),s+=t.key;const e="-"===s?-1:1;r=window.setTimeout((()=>{"-"!==s?(v(parseFloat(s)*e),s=""):s=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,n=Array.isArray(e._value)?e._value[o]:e._value,r=function(t,o){if(!e.props.intervals)return e.props.step;const n=c(e.props.intervals);if(t>=e.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return t>=o.value&&t<((null===(s=n[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!r)return e.props.step;if(-1===o){t-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=b(n),r=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,l=Math.min(Math.max(0,s+a),e.props.marks.length-1);return void v(e.props.marks[l].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?v(e.props.min):v(e.props.max));if("Home"===t.key)return void v(e.props.min);if("End"===t.key)return void v(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){v(n+(t.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?v(n+10*r):"PageDown"===t.key&&v(n-10*r)}},e.context.handlers.maxNode=t=>{a=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);const s=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[1]=s,v(e.value)):v(s),r(m(s))}))},e.context.handlers.minNode=t=>{o=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);const s=parseFloat(o);return e.props.isMulti&&Array.isArray(e.value)?(e.value[0]=s,v(e.value)):v(s),r(m(s))}))},e.context.handlers.inputBlur=()=>{e.props.isMulti&&Array.isArray(e.value)&&(e.value.sort(f),o&&o.input(e.value[0]),a&&a.input(e.value[1]))},e.context.fns.calculateMarkPosition=t=>d(t,e.props.min,e.props.max)}function g(o){var n;if(!t||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:a}=t.getBoundingClientRect();v(p((r-s)/a*100))}v(e.value,!1)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||v(t,!1):e.value!==t&&v(t,!1)})),e.on("prop:max",(()=>{e.props.max=parseFloat(`${e.props.max}`),v(e.value)})),e.on("prop:min",(()=>{e.props.min=parseFloat(`${e.props.min}`),v(e.value)}))}]},Td=/* #__PURE__ */Me("cp"),{outer:Od,wrapper:Md,inner:Vd,label:Fd,prefix:Bd,suffix:Pd,help:Hd,messages:Rd,message:Kd,icon:Nd}=/* #__PURE__ */Ve(Td),Wd=Td("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Ud=Td("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),Yd=Td("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),jd=Td("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),zd=Td("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Zd=Td("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),qd=Td("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),Gd=Td("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),Xd=Td("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Jd=Td("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),Qd=Td("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),ec=Td("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),tc=Td("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),oc=Td("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),nc=Td("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),rc=Td("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),sc=Td("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),ac=Td("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),lc=Td("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),ic=Td("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),pc=Td("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),dc=Td("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),cc=Td("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),uc=Td("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),fc=Td("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),vc=Td("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),hc=Td("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),mc=Td("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),$c=Td("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),gc=Td("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),bc=Td("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),yc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,xc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function wc(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function _c(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Sc(t,o,n,r)]}function kc(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,wc(255*t,2),wc(255*a,2),n]}function Sc(e,t,o,n=1){const r=wc(t/255,4),s=wc(o/255,4);if(1===s)return[e,0,100,n];const a=wc(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,wc(l,2),wc(100*a,2),n]}function Lc(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Ac(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Cc(e,t,o,n=1){const[r,s,a,l]=Lc(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Dc(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Ic(e){if(e){if(Dc(e))return _c(e);if(e.startsWith("rgb")){const t=e.match(yc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Ac(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(xc);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Sc(o,wc(255*n,2),wc(255*r,2),s)}}}function Ec(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Tc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Oc(e){return!1!==e&&"false"!==e}function Mc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const Vc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const Fc={schema:/* #__PURE__ */Od(/* #__PURE__ */Md(/* #__PURE__ */Fd("$label"),/* #__PURE__ */Be("$inline && $help",/* #__PURE__ */Hd("$help")),/* #__PURE__ */Vd(/* #__PURE__ */Be("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Nd("prefix","label")),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Bd()),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Wd(/* #__PURE__ */sc(),/* #__PURE__ */Be("$showValue",/* #__PURE__ */Ud()))),/* #__PURE__ */Be("$inline || $expanded)",/* #__PURE__ */Yd(/* #__PURE__ */Be("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */jd(/* #__PURE__ */Nd("close"))),/* #__PURE__ */Be("$panelControls",/* #__PURE__ */zd(/* #__PURE__ */Zd(/* #__PURE__ */qd(),/* #__PURE__ */Gd()),/* #__PURE__ */nc(/* #__PURE__ */rc()),/* #__PURE__ */Xd(/* #__PURE__ */Jd(),/* #__PURE__ */Qd()),/* #__PURE__ */ec(/* #__PURE__ */tc(),/* #__PURE__ */oc()),/* #__PURE__ */Be("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */ac(/* #__PURE__ */Nd("eyeDropper"))))),/* #__PURE__ */Be("$panelFormat",/* #__PURE__ */lc(/* #__PURE__ */ic(/* #__PURE__ */Be('$panelActiveFormat === "hex"',/* #__PURE__ */pc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */dc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */cc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */uc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */vc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */hc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */mc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */fc())),/* #__PURE__ */$c(/* #__PURE__ */Nd("switch")))),/* #__PURE__ */Be("$options",/* #__PURE__ */gc(/* #__PURE__ */bc())))),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Pd()),/* #__PURE__ */Be("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Nd("suffix"))),/* #__PURE__ */Be("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */Hd("$help"))),/* #__PURE__ */Rd(/* #__PURE__ */Kd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){let t,o=null,n=null,a=null,l=null,i=null,p=null,d=null,c=0;const u=["hex","rgba","hsla"],f=Tc((function(){if(!n)return;const t=n.getContext("2d");if(!t)return;const{width:o,height:r}=n,s=e.props.h||0;t.fillStyle=`hsl(${s}, 100%, 50%)`,t.fillRect(0,0,o,r);const a=t.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=a,t.fillRect(0,0,o,r);const l=t.createLinearGradient(0,0,0,r);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=l,t.fillRect(0,0,o,r)}),2),v=Tc((function(){if(!l)return;const t=l.getContext("2d");if(!t)return;const o=Math.round(l.width),n=Math.round(l.height);t.clearRect(0,0,o,n),F(l,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,i=t.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=i,t.fillRect(0,0,o,n)}),2),h=Tc(D,2),m=Tc(I,2),$=Tc(H,2),g=Tc(B,10,!1);function b(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(o&&o.contains(s)){const o=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Dc(o)&&!yc.test(o)&&!xc.test(o))return;(Dc(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),y(o))}}function y(t){var o;if(!t)return;const n=Ic(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||wc(o,2)===e.props.h&&wc(r,2)===e.props.s&&wc(s,2)===e.props.v&&wc(a,2)===e.props.alpha)||(e.props.alpha=wc(a,2),H(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=Ic(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=wc(s,2),H(o,n,r)}else H(e.props.h,e.props.s,e.props.v)}else H(e.props.h,e.props.s,e.props.v)}}function x(t){if(!e.context||!d)return;const o=d[t];o&&(e.props.focusedSwatch=o.dataset.color)}function w(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function _(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),s(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=_c(t.sRGBHex);e.props.alpha=1,H(n,r,s)}))}),e.props.__root))}function k(){S("canvas-ls",(e=>{n=e}),f,O),S("canvas-hue",(e=>{a=e}),C,M),S("canvas-alpha",(e=>{l=e}),v,V),L(`canvas-preview-${e.props.id}`,(e=>{i=e,D()}),h),L(`canvas-swatch-preview-${e.props.id}`,(e=>{p=e,I()}),m),A()}function S(o,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&t&&s(e)},p=e=>{t&&s(e)},d=()=>{t=void 0,l()},c=()=>{t=void 0,l()};L(`${o}-${e.props.id}`,(e=>{const l=e.nextElementSibling;n(e),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,e),e.addEventListener("mousedown",(e=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),t=Vc[o],s(e),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),t=Vc[o],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),r)}function L(t,o,n){s(t,(()=>{var r;const s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(t);s&&(o(s),n&&w(s,n))}),e.props.__root)}function A(){s(`swatches-${e.props.id}`,(()=>{var t,o,n;d=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),d.forEach((e=>{w(e,E)})),e.props.focusedSwatch=null===(n=null===(o=d[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,B()}),e.props.__root)}function C(){if(!a)return;const e=a.getContext("2d");if(!e)return;const t=a.width,o=a.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!i)return;const t=i.getContext("2d");if(!t)return;F(i,i.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,i.width,i.height)}function I(){if(!p)return;const t=p.getContext("2d");if(!t)return;F(p,p.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,p.width,p.height)}function E(e){if(!e)return;const t=e.getContext("2d");if(!t)return;F(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Ec(o),[l,i,p,d]=kc(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function T(e,o,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!o)return;const t=o.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-t.left,s=e.touches[0].clientY-t.top):(r=e.clientX-t.left,s=e.clientY-t.top),r=Math.min(Math.max(r,0),t.width),s=Math.min(Math.max(s,0),t.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{t=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{t=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function O(t){T(t,n,((t,o)=>{const r=t/n.width*100,s=100-o/n.height*100;$(e.props.hue,r,s)}))}function M(t){T(t,a,((t,o)=>{if(!a)return;const n=a.width,r=Math.floor(t/n*360);e.props.h=r,$(e.props.h,e.props.s,e.props.v)}))}function V(t){T(t,l,((t,o)=>{const n=t/l.width*100/100;e.props.alpha=n,$(e.props.hue,e.props.s,e.props.v)}))}function F(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function B(){var t,o;if(!e.context||!e.props.options||!d)return;const{h:n,s:r,v:s,alpha:a}=e.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${wc(0===o||100===o&&0===t?0:e,0)}-${wc(r,0)}-${wc(o,0)}-${wc(n,2)}`}(n,r,s,a);let i=!1,p=!1;d.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(p=!0);const u=e.parentElement;p||t===l?(u.dataset.active="true",e.ariaSelected="true",p=!1,!i&&d&&(x(d.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(e.props.focusedSwatch=null===(o=null===(t=d[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function P(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function H(t,n,r,s=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:wc(Math.max(Math.min(t,360),0),2),e.props.s=void 0===n||isNaN(n)?e.props.s:wc(Math.max(Math.min(n,100),0),2),e.props.v=void 0===r||isNaN(r)?e.props.v:wc(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,alpha:p}=e.props,[d,c,u]=kc(a,l,i),[f,v,h]=Lc(a,l,i),m=e.props.hexInputFocused?e.props.hex:Cc(a,l,i,p),$=wc(p,2);e.props.hsla={h:a,s:c,l:u,a:$},e.props.hslaPercent={h:wc(a,0),s:100===i&&0===l?0:wc(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:wc(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:$},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${$})`,e.props.hslaStringPrecise=`hsla(${a}, ${wc(0===i?c/255:c/255*100,2)}%, ${wc(u/255*100,2)}%, ${$})`,e.props.rgba={r:f,g:v,b:h,a:$},e.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout((()=>{var t;R(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),g(),o||"undefined"==typeof window||(o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const b=e.props.valueFormat?e.props.valueFormat:e.props.format;s||("hex"===b?e.input(e.props.hex):"rgba"===b?e.input(e.props.rgbaString):"hsla"===b&&e.input(e.props.hslaStringPrecise))}function R(){f(),v(),h(),m()}e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",b)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",b),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||u[0],e.props.panelControls=Oc(e.props.panelControls),e.props.eyeDropper=Oc(e.props.eyeDropper),e.props.panelFormat=Oc(e.props.panelFormat),e.props.showValue=Oc(e.props.showValue),e.props.allowPaste=Oc(e.props.allowPaste),e.props.inline=r(e.props.inline),e.props.disabled=r(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=r(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},H(0,0,0,!0)):y(`${e.value}`),e.on("input",(({payload:t})=>{o&&void 0!==e.props.__root&&!o.contains(e.props.__root.activeElement)&&y(t)})),setTimeout((()=>{_()}),5),k(),e.on("prop:expanded",(()=>{var t;if(e.props.expanded)_(),k(),A(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}function o(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=Ic(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${wc(n,t)}-${wc(r,t)}-${wc(s,t)}-${wc(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(u.indexOf(e.props.panelActiveFormat)+t+u.length)%u.length;e.props.panelActiveFormat=u[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Mc),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":H(o,n-s,r);break;case"ArrowRight":H(o,n+s,r);break;case"ArrowUp":H(o,n,r+s);break;case"ArrowDown":H(o,n,r-s);break;case"PageUp":H(o,n,r+10);break;case"PageDown":H(o,n,r-10);break;case"Home":H(o,n-10,r);break;case"End":H(o,n+10,r)}R()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":H(o-s,n,r);break;case"ArrowRight":case"ArrowUp":H(o+s,n,r);break;case"PageUp":H(o+10,n,r);break;case"PageDown":H(o-10,n,r);break;case"Home":H(0,n,r);break;case"End":H(360,n,r)}R()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=wc(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=wc(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=wc(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=wc(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}H(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,Dc(r)){const[t,o,n,s]=_c(r);e.props.alpha=s,P(r),H(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!Dc(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;Dc(o)&&P(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Sc(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);H(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=Ac(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);H(t,o,n)}else"alpha"==t&&(e.props.alpha=i,H())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Ec(o.dataset.colorPrecise);e.props.alpha=s,H(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,n,r,s;if(!e.context||!d||!d.length)return;const a=d.indexOf(t.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(d),p=d.length;let u=0,f=p,v=!1;const h=d[a].dataset.group;if(void 0!==h){const e=d.filter((e=>e.dataset.group===h));u=d.indexOf(e[0]),f=d.indexOf(e[e.length-1])}const m=(a-u)%i;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,c=m,x(a)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void d.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),c=m,e.context.handlers.swatchClick(t),void x(a);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":l=Math.max(a-i,a-(i-(c-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(c-m))),v=!0;break;case"ArrowLeft":l=a-1,c=(l-u)%i;break;case"ArrowRight":l=a+1,c=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=d[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=d[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=d.filter((e=>e.dataset.group===h)),p=d.filter((t=>t.dataset.group===e)),v=(a-u)%i,m=t.length%i||i,$=a>=u+t.length-m;if(l<u){const e=p.length%i||i;l=u-e+Math.min(Math.max(v,c),e-1)}else l>f&&(l=$?Math.min(f+Math.max(v,c)+1,d.indexOf(p[p.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<p){x(l),d.forEach((e=>{delete e.parentElement.dataset.focused}));const e=d[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Ko,b,
|
|
61
|
+
/* #__PURE__ */g("removeAllValues"),b,function(e){!function(e){e.addProps(["search","options","selectedItems","activeValue","activeIndex","activeDescendant","targetOptions","sourceOptions","optionLoader","isLoadingOptions","filterOptions","inputText","hasNextPage","page","targetLoading","searchable","sourceLabel","targetLabel","transferOnSelect","disabled","placeholder","filter","showSourceEmptyMessage","showTargetEmptyMessage","sourceEmptyMessage","targetEmptyMessage","clearOnSelect","max","maxReached","debounce","sourceListActive","optionLoaderValues","optionLoadingCounter","optionsLoadingCounter","memoOptions","optionsLoaded","selectedSourceItems","selectedTargetItems","draggable","loadMore","loadMoreOption"]),e.props.loadMoreOption={label:"Load more",value:Fp},void 0===e.props.draggable?e.props.draggable=!0:"false"===e.props.draggable&&(e.props.draggable=!1),e.props.optionsLoaderValues=[],e.props.selectedSourceItems=[],e.props.selectedTargetItems=[],e.props.optionsLoaded=void 0,e.props.memoOptions=[],e.props.multiple=!0,e.props.debounce=e.props.debounce?parseInt(e.props.debounce):200,e.props.optionLoaderValues=[],e.props.optionsLoadingCounter=0,e.props.optionLoadingCounter=0,e.props.page=1,e.props.hasNextPage=Ct.bind(null,e),e.props.options?e.props.options=[...e.props.options]:e.props.options=[],e.props.sourceOptions=[],e.props.targetOptions=[],"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.props.searchable=r(e.props.searchable),e.props.searchable&&(e.props.inputText=""),e.props.clearOnSelect=r(e.props.clearOnSelect),void 0===e.props.transferOnSelect?e.props.transferOnSelect=!0:"false"===e.props.transferOnSelect&&(e.props.transferOnSelect=!1),e.props.targetOptions.length&&(e.props.targetOptionValues=e.props.targetOptions.map((e=>$t(e)))),e.props.initialOptions=[...e.props.options],e.props.max&&(e.props.max=parseInt(e.props.max)),e.props.sourceListOrigin=void 0,"function"!=typeof e.props.filter&&(e.props.filter=(e,t)=>e.label.toLowerCase().includes(t.toLowerCase()))}(e),function(e){e.on("commit",(async({payload:t})=>{e.props.activeValue=void 0,e.props.max&&(e.props.maxReached=t.length>=e.props.max),e.props.clearOnSelect&&e.props.inputText&&(e.props.reFilter=!0,e.props.inputText=""),e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])],e.props.searchable&&e.props.reFilter&&!e.props.initialLoad?(yt(e,e.props.inputText),e.props.reFilter=!1):e.props.initialLoad||(e.isCreated||(e.props.skipSetActiveValue=!0),Wp(e)),"function"==typeof e.props.optionLoader?Yp(e):e.props.initialLoad||(e.props.memoOptions=[...new Set([...e.props.targetOptions,...e.props.memoOptions])])}))}(e),Gp(e),function(e){e.on("prop:options",(()=>{e.props.appendingOptions&&(e.props.skipSetActiveValue=!0,e.props.appendingOptions=!1),Wp(e)})),e.on("prop:memoOptions",(()=>{e.props.skipSetActiveValue=!0,Wp(e)})),e.on("prop:sourceOptions",(()=>{0===e.props.sourceOptions.length?e.props.showSourceEmptyMessage=!0:e.props.showSourceEmptyMessage=!1,Bp.delete(e)})),e.on("prop:targetOptions",(()=>{0===e.props.targetOptions.length?e.props.showTargetEmptyMessage=!0:e.props.showTargetEmptyMessage=!1})),e.on("prop:activeValue",(({payload:t})=>{if(e.props.isDragging)return void(e.props.activeDescendant=void 0);if(t===Fp)return void(e.props.activeDescendant=`${e.props.id}_load_more`);const o=(e.props.sourceListOrigin?e.props.sourceOptions:e.props.targetOptions).findIndex((e=>n($t(e),t)));o>=0&&e.props.sourceListOrigin?e.props.activeDescendant=`${e.props.id}_source_list_item_${o}`:e.props.activeDescendant=o>=0?`${e.props.id}_target_list_item_${o}`:void 0})),e.on("prop:mouseOnSource",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(e.props.id+"_source_list_items");if(!t)return;e.props.mouseOnTarget=!1,e.props.sourceListOrigin=!0,Bp.delete(e),Xp(e,t)}})),e.on("prop:mouseOnTarget",(({payload:t})=>{var o;if(t&&!0!==e.props.disabled&&!e.props.isDragging){const t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`${e.props.id}`);if(!t)return;e.props.mouseOnSource=!1,e.props.sourceListOrigin=!1,Pp.delete(e),Xp(e,t)}})),e.on("prop:optionsLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionLoadingCounter&&e.store.set(_t)})),e.on("prop:optionLoadingCounter",(({payload:t})=>{0===t&&0===e.props.optionsLoadingCounter&&(e.store.set(_t),e.props.skipSetActiveValue=!0,Wp(e))}))}(e)}]};const ed=/* #__PURE__ */Me("sl"),{outer:td,wrapper:od,inner:nd,icon:rd,label:sd,prefix:ad,suffix:ld,help:id,messages:pd,message:dd}=/* #__PURE__ */Ve(ed),cd=ed("chart",(()=>({$el:"div",if:"$chart"}))),ud=ed("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),fd=ed("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),vd=ed("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),hd=ed("trackWrapper",(()=>({$el:"div"}))),md=ed("trackInner",(()=>({$el:"div"}))),$d=ed("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),gd=ed("linkedValues",(()=>({$el:"div"}))),bd=ed("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),yd=ed("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),xd=ed("marks",(()=>({$el:"div",if:"$marks"}))),wd=ed("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),_d=ed("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),kd=ed("handles",(()=>({$el:"ul"}))),Sd=ed("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Ld=ed("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),Ad=ed("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),Cd=ed("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),Dd=ed("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),Id=ed("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}}))),Ed={schema:/* #__PURE__ */td(/* #__PURE__ */od(/* #__PURE__ */sd("$label"),/* #__PURE__ */id("$help"),/* #__PURE__ */fd(/* #__PURE__ */rd("prefix"),/* #__PURE__ */ad(),/* #__PURE__ */vd(/* #__PURE__ */cd(/* #__PURE__ */ud()),/* #__PURE__ */hd(/* #__PURE__ */md(/* #__PURE__ */$d(),/* #__PURE__ */xd(/* #__PURE__ */wd(/* #__PURE__ */_d())),/* #__PURE__ */kd(/* #__PURE__ */Ld(/* #__PURE__ */Id(),/* #__PURE__ */Ad()),/* #__PURE__ */Sd(/* #__PURE__ */Dd(),/* #__PURE__ */Cd()))))),/* #__PURE__ */ld(),/* #__PURE__ */rd("suffix"),/* #__PURE__ */Be("$showInput && $isMulti === false",/* #__PURE__ */bd())),/* #__PURE__ */Be("$showInput && $isMulti",/* #__PURE__ */gd(/* #__PURE__ */yd(),/* #__PURE__ */bd())),/* #__PURE__ */pd(/* #__PURE__ */dd("$message.value")))),type:"input",family:"",props:["min","max","step","showInput","tooltip","tooltipFormat","inputAttrs","maxInputAttrs","minInputAttrs","marks","markLabels","snapToMarks","chart","scalingFunction","intervals"],features:[function(e){let t,o,a;e.addProps(["isMulti","maxHandleStyles","minHandleStyles","fillStyles","decimals","dragging","lastHandleInteraction","largestBar","computedMaxInputAttrs","computedMinInputAttrs"]);const l={linear:{forward:e=>e,reverse:e=>e},log:{forward:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1.5),reverse:(t,o=e.props.min,n=e.props.max)=>n*Math.pow(t/n,1/1.5)}};let i=!1;function p(){const e=document.activeElement;if(e instanceof HTMLInputElement){const t=e.value;e.value="",e.value=t}}function d(e){if(!e)return;const t={disabled:e.props.disabled,min:"number"==typeof e.props.min?e.props.min:0,max:"number"==typeof e.props.max?e.props.max:void 0,step:e.props.step||1};e.props.minInputAttrs=Object.assign(e.props.minInputAttrs||{},t),e.props.maxInputAttrs=Object.assign(e.props.maxInputAttrs||{},t),e.props.inputAttrs=e.props.inputAttrs&&"object"==typeof e.props.inputAttrs?Object.assign(e.props.inputAttrs,t):t,e.props.computedMaxInputAttrs=e.props.maxInputAttrs&&"object"==typeof e.props.maxInputAttrs?Object.assign({},e.props.inputAttrs,e.props.maxInputAttrs):e.props.inputAttrs,e.props.computedMinInputAttrs=e.props.minInputAttrs&&"object"==typeof e.props.minInputAttrs?Object.assign({},e.props.inputAttrs,e.props.minInputAttrs):e.props.inputAttrs}function c(t){const{min:o,max:n,intervals:r}=e.props;if(t=Math.min(Math.max(t,0),100),!r||0===r.length){x();const r=o+t/100*(n-o);return e.props.scalingFunction.reverse(r,o,n)}const s=f(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:n,left:r,width:a,stepsInInterval:l}=s[e];if(t>=r&&t<=r+a){const e=o+(t-r)/a*l*n,s=e%n;return g(s<n/2?e-s:e+(n-s))}}return t>100?n:t<0?o:void 0}function u(t,o=e.props.min,n=e.props.max){const r=e.props.intervals;if(!r||0===r.length){x();return(e.props.scalingFunction.forward(t,o,n)-o)/(n-o)*100}const s=f(r,o,n);for(let e=0;e<s.length;e++){const{value:o,step:r,left:a,width:l,stepsInInterval:i}=s[e],p=e<s.length-1?s[e+1].value:n;if(t>=o&&t<=p){return 100*((a+(t-o)/r/i*l)/100)}}return 100}function f(t,o=e.props.min,n=e.props.max){(t=[...t]).sort(((e,t)=>e.value-t.value)),t[0].value!==o&&t.unshift({value:o,step:e.props.step});let r=0;for(let e=0;e<t.length;e++){const o=t[e].value,s=((e<t.length-1?t[e+1].value:n)-o)/t[e].step;r+=s}let s=0;return t.map(((e,o)=>{const a=e.value,l=((o<t.length-1?t[o+1].value:n)-a)/e.step,i=s/r*100;return s+=l,{value:e.value,step:e.step,left:i,width:l/r*100,stepsInInterval:l,totalSteps:r}}))}function v(){const t=parseFloat(`${e.props.min}`),o=parseFloat(`${e.props.max}`);let n,r=0;if(Array.isArray(e._value)){const t=[...e._value].sort(h);r=parseFloat(`${t[0]}`),n=parseFloat(`${t[1]}`)}else n=parseFloat(`${e._value}`);e.props.maxHandleStyles={left:`${u(n,t,o)}%`},e.props.isMulti&&Array.isArray(e._value)?(e.props.minHandleStyles={left:`${u(r,t,o)}%`},e.props.fillStyles={left:`${u(r,t,o)}%`,width:u(n,t,o)-u(r,t,o)+"%"}):e.props.fillStyles={left:"0%",width:`${u(n,t,o)}%`}}function h(e,t){return parseFloat(`${e}`)-parseFloat(`${t}`)}function m(o,n=!0){if(e.props.disabled)return;let r;if(void 0===o){if(e.props.isMulti)e.input([b(e.props.min),b(e.props.max)]);else{const t=e.props.min+(e.props.max-e.props.min)/2;e.input(b(t))}return void v()}if(e.props.isMulti&&Array.isArray(e._value)&&!Array.isArray(o)){const n="min"===e.props.lastHandleInteraction?0:1;e._value[n]=o;const[s,a]=[...e._value];if(s>=a){const o=null==t?void 0:t.querySelector(`[data-handle="${"min"===e.props.lastHandleInteraction?"max":"min"}"]`);null==o||o.focus()}r=b([...e._value].sort(h))}else Array.isArray(o)?r=b(o):(r=b(o),r=isNaN(r)?e.props.min:r);e.props.snapToMarks&&(r=y(r));const s=b($(r));n&&e.input(s),v()}function $(t){return e.props.isMulti&&Array.isArray(t)?[$(t[0]),$(t[1])]:(t=isNaN(t)?e.props.min:t,Math.min(Math.max(parseFloat(`${t}`),e.props.min),e.props.max))}function g(t){return parseFloat(t.toFixed(e.props.decimals))}function b(t){if(e.props.snapToMarks)return t;if(!e.props.intervals)return Array.isArray(t)?t.map((t=>g(Math.round(t/e.props.step)*e.props.step))):g(Math.round(t/e.props.step)*e.props.step);const o=f(e.props.intervals);if(Array.isArray(t))return t.map((t=>{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return g(n.value+Math.round((t-n.value)/n.step)*n.step)}));{const n=o.find(((n,r)=>{var s;return t>=n.value&&t<((null===(s=o[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!n)return t;return g(n.value+Math.round((t-n.value)/n.step)*n.step)}}function y(t){if(Array.isArray(t))return t[0]=y(t[0]),t[1]=y(t[1]),t;{const o=e.props.marks,n=o.reduce(((e,o)=>Math.abs(o.at-t)<Math.abs(e.at-t)?o:e),o[0]);return n.at}}function x(){if(i)return;r(e.props.scalingFunction)?"string"==typeof e.props.scalingFunction?e.props.scalingFunction=l[e.props.scalingFunction]||l.linear:"object"==typeof e.props.scalingFunction&&(e.props.scalingFunction={...l.linear,...e.props.scalingFunction}):e.props.scalingFunction=l.linear,i=!0}e.props.maxHandleStyles={left:"0%"},e.props.fillStyles={left:"0%",width:"0%"},e.props.isMulti=!1,e.props.step=1,e.props.min=0,e.props.max=100,e.props.tooltipFormat="function"==typeof e.props.tooltipFormat?e.props.tooltipFormat:(e,t)=>{if(t)return e},e.props.largestBar=0,"disabled"in e.props&&(e.props.disabled=r(e.props.disabled)),e.on("created",(()=>{var l;x(),e.props.isMulti=Array.isArray(e.value),e.props.step=parseFloat(`${e.props.step}`),e.props.decimals=(null===(l=e.props.step.toString().split(".")[1])||void 0===l?void 0:l.length)||0,e.props.min=e.props.min?parseFloat(`${e.props.min}`):0,e.props.max=e.props.max?parseFloat(`${e.props.max}`):100;const i=r(e.props.tooltip);e.props.tooltip=void 0===e.props.tooltip?"auto":i;const g=r(e.props.marks);if(e.props.marks=!!g&&(Array.isArray(e.props.marks)?e.props.marks:function(){const{min:t,max:o,step:n}=e.props,r=[];for(let e=t;e<=o;e+=n)r.push({at:e,label:e});return r}()),e.props.markLabels=r(e.props.markLabels),e.props.snapToMarks=r(e.props.snapToMarks),e.props.showInput=r(e.props.showInput),e.props.largestBar=e.props.chart?e.props.chart.reduce(((e,t)=>t.value>e?t.value:e),0):e.props.largestBar,d(e),s(`track-${e.props.id}`,(()=>{var o;t=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`track-${e.props.id}`),m(e.value,!1),v()}),e.props.__root),e.context){let r=0,s="";const l=e.context.handlers.blur;e.context.handlers.blur=t=>{l(t),e.emit("blur")},e.context.handlers.clickTrack=o=>{if(!t)return;e.props.dragging=!1;const{left:n,width:r}=t.getBoundingClientRect(),s=(o.clientX-n)/r;if(e.props.isMulti&&Array.isArray(e.value)){const[t,o]=e.value,n=Math.abs(t-s*e.props.max)<Math.abs(o-s*e.props.max)?"min":"max",r="min"===n?0:1;e.props.lastHandleInteraction=n,e.value[r]=c(100*s),m(e._value)}else m(c(100*s))},e.context.handlers.focus=o=>{if(!t)return;const n=o.target.dataset.handle;n&&(e.props.lastHandleInteraction=n)},e.context.handlers.clickHandle=t=>{t.stopPropagation(),e.props.attrs.onClick&&e.props.attrs.onClick(t),e.props.dragging=!1,m(e._value)},e.context.handlers.startDrag=o=>{if(!t)return;e.props.dragging=!0;const n="touchstart"===o.type,r=n?"touchmove":"mousemove",s=n?"touchend":"mouseup";e.props.lastHandleInteraction=o.target.dataset.handle||e.props.lastHandleInteraction,document.addEventListener(r,_,{passive:!1}),document.addEventListener(s,(()=>{e.context&&(e.props.dragging=!1,document.removeEventListener(r,_),n&&o.target instanceof HTMLElement&&o.target.blur())}))},e.context.handlers.keydown=t=>{if(["1","2","3","4","5","6","7","8","9","0",".","-"].includes(t.key)){t.preventDefault(),clearTimeout(r),s+=t.key;const e="-"===s?-1:1;r=window.setTimeout((()=>{"-"!==s?(m(parseFloat(s)*e),s=""):s=""}),350)}if(["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const o="min"===e.props.lastHandleInteraction?0:1,n=Array.isArray(e._value)?e._value[o]:e._value,r=function(t,o){if(!e.props.intervals)return e.props.step;const n=f(e.props.intervals);if(t>=e.props.max)return n[n.length-1].step;let r=n.find(((o,r)=>{var s;return t>=o.value&&t<((null===(s=n[r+1])||void 0===s?void 0:s.value)||e.props.max)}));if(!r)return e.props.step;if(-1===o){t-r.step<r.value&&(r=n[n.indexOf(r)-1]||r)}return r.step}(n,["ArrowLeft","ArrowDown","PageDown"].includes(t.key)?-1:1);if(e.props.marks&&e.props.snapToMarks){const o=y(n),r=e.props.marks.find((e=>e.at===o)),s=e.props.marks.indexOf(r),a=["ArrowLeft","ArrowDown"].includes(t.key)?-1:1,l=Math.min(Math.max(0,s+a),e.props.marks.length-1);return void m(e.props.marks[l].at)}if(t.metaKey)return void("ArrowLeft"===t.key||"ArrowDown"===t.key?m(e.props.min):m(e.props.max));if("Home"===t.key)return void m(e.props.min);if("End"===t.key)return void m(e.props.max);if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)){m(n+(t.shiftKey?10*r:r)*(["ArrowLeft","ArrowDown"].includes(t.key)?-1:1))}"PageUp"===t.key?m(n+10*r):"PageDown"===t.key&&m(n-10*r)}},e.context.handlers.maxNode=t=>{a=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);if(`${t.value}`.includes(".")&&!`${o}`.includes(".")&&p(),e.props.isMulti&&Array.isArray(e.value)){m([e.value[0],o])}else m(o);return r($(o))}))},e.context.handlers.minNode=t=>{o=t,t.hook.commit(((o,r)=>{if(n(t.value,o))return r(o);if(`${t.value}`.includes(".")&&!`${o}`.includes(".")&&p(),e.props.isMulti&&Array.isArray(e.value)){m([o,e.value[1]])}else m(o);return r($(o))}))},e.context.handlers.inputBlur=()=>{if(e.props.isMulti&&Array.isArray(e._value)){m([...e._value].sort(h))}},e.context.fns.calculateMarkPosition=t=>u(t,e.props.min,e.props.max)}let w;function _(o){var n;if(!t||!e.props.dragging)return;o.preventDefault();const r=o.clientX||(null===(n=o.touches)||void 0===n?void 0:n.length)&&o.touches[0].clientX,{left:s,width:a}=t.getBoundingClientRect(),l=b(c((r-s)/a*100));w!==l&&(w=l,m(l))}m(e.value)})),e.on("input",(({payload:t})=>{Array.isArray(e.value)&&Array.isArray(t)?e.value[0]===t[0]&&e.value[1]===t[1]||m(t,!1):e.value!==t&&m(t,!1),function(){if(e.props.isMulti&&Array.isArray(e._value)){const[t,n]=[...e._value];o&&o.input(g(t)),a&&a.input(g(n))}else a&&a.input(e._value)}()})),e.on("prop:max",(()=>{e.props.max=e.props.max?parseFloat(`${e.props.max}`):100,m(e.value),d(e)})),e.on("prop:min",(()=>{e.props.min=e.props.min?parseFloat(`${e.props.min}`):0,m(e.value),d(e)}))}]},Td=/* #__PURE__ */Me("cp"),{outer:Od,wrapper:Md,inner:Vd,label:Fd,prefix:Bd,suffix:Pd,help:Hd,messages:Rd,message:Kd,icon:Nd}=/* #__PURE__ */Ve(Td),Wd=Td("swatchPreview",(()=>({$el:"div",attrs:{id:"$id",class:"$classes.swatchPreview",tabindex:{if:"$disabled",then:-1,else:0},onClick:"$handlers.inputPreviewClick",onFocusout:"$handlers.inputPreviewFocusout",onKeydown:"$handlers.inputPreviewKeydown",role:"button","aria-valuetext":'$: "Current color: " + $value'}}))),Ud=Td("valueString",(()=>({$el:"span",attrs:{class:"$classes.valueString"},children:{if:'$format === "hex"',then:"$hex",else:{if:'$format === "rgba"',then:"$rgbaString",else:{if:'$format === "hsla"',then:"$hslaString",else:""}}}}))),Yd=Td("panel",(()=>({$el:"div",attrs:{id:'$: $id + "_popover"',class:"$classes.panel",onKeydown:"$handlers.panelKeydown","aria-role":{if:"$layout === popover",then:"dialog"},"aria-modal":{if:"$layout === popover",then:"true"},"aria-label":"$label",popover:"$popover",style:{if:"$usePopover",then:{margin:0,top:'$popoverCoordinates.y + "px"',left:'$popoverCoordinates.x + "px"'},else:{position:{if:"$inline === undefined || $inline === false",then:"absolute"}}}}}))),jd=Td("panelClose",(()=>({$el:"button",attrs:{type:"button",class:"$classes.panelClose",onClick:"$handlers.closePanel",tabindex:{if:"$showPanelClose",then:-1,else:0},onKeydown:"$handlers.panelCloseKeydown","aria-label":"$ui.close.value"}}))),zd=Td("controlGroup",(()=>({$el:"div",attrs:{class:"$classes.controlGroup","data-eye-dropper":"$hasNativeEyeDropper && $eyeDropper",role:"group"}}))),Zd=Td("LS",(()=>({$el:"div",attrs:{class:"$classes.LS"}}))),qd=Td("canvasLS",(()=>({$el:"canvas",attrs:{id:'$: "canvas-ls-" + $id',class:'$classes.canvas + " " + $classes.canvasLS',width:256,height:256,"aria-hidden":"true"}}))),Gd=Td("controlLS",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},class:'$classes.control + " " + $classes.controlLS',onKeydown:"$handlers.lsKeydown",style:{left:'$controlLSPosition.x + "%"',top:'$controlLSPosition.y + "%"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuetext":'$: "Lightness: " + $hslaPercent.l + "%, Saturation: " + $hslaPercent.s + "%"'}}))),Xd=Td("hue",(()=>({$el:"div",attrs:{class:"$classes.hue"}}))),Jd=Td("canvasHue",(()=>({$el:"canvas",attrs:{id:'$: "canvas-hue-" + $id',class:'$classes.canvas + " " + $classes.canvasHue',width:256,height:10,"aria-hidden":"true"}}))),Qd=Td("controlHue",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.hueControlKeydown",class:'$classes.control + " " + $classes.controlHue',style:{left:'$: "min(max(" + (($hsla.h / 360) * 100) + "%, 3px), calc(100% - 3px))"',backgroundColor:'$: "hsl(" + $hsla.h + "deg, 100%, 50%)"'},role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$h"}}))),ec=Td("alpha",(()=>({$el:"div",attrs:{class:"$classes.alpha"}}))),tc=Td("canvasAlpha",(()=>({$el:"canvas",attrs:{id:'$: "canvas-alpha-" + $id',class:'$classes.canvas + " " + $classes.canvasAlpha',width:256,height:10,"aria-hidden":"true"}}))),oc=Td("controlAlpha",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.alphaControlKeydown",class:'$classes.control + " " + $classes.controlAlpha',style:{left:'$: "min(max(" + ($hsla.a * 100) + "%, 3px), calc(100% - 3px))"',backgroundImage:'$: "linear-gradient(to right, hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + "), hsla(" + $hsla.h + "deg, " + ($hsla.s / 255) * 100 + "%, " + ($hsla.l / 255) * 100 + "%, " + $hsla.a + ")), linear-gradient(to right, white, white)"'},role:"slider","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$hsla.a"}}))),nc=Td("preview",(()=>({$el:"div",attrs:{class:"$classes.preview"}}))),rc=Td("canvasPreview",(()=>({$el:"canvas",attrs:{id:'$: "canvas-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasPreview',width:33,height:33,"aria-hidden":"true"}}))),sc=Td("canvasSwatchPreview",(()=>({$el:"div",attrs:{class:"$classes.canvasSwatchPreviewWrapper"},children:[{$el:"canvas",attrs:{id:'$: "canvas-swatch-preview-" + $id',class:'$classes.canvas + " " + $classes.canvasSwatchPreview',width:33,height:33,"aria-hidden":"true"}}]}))),ac=Td("eyeDropper",(()=>({$el:"div",attrs:{tabindex:{if:"$disabled",then:-1,else:0},role:"button",onKeydown:"$handlers.eyeDropperKeydown",id:'$: "eye-dropper-" + $id',class:"$classes.eyeDropper"}}))),lc=Td("formatField",(()=>({$el:"div",attrs:{class:"$classes.formatField"}}))),ic=Td("colorInputGroup",(()=>({$el:"div",attrs:{class:"$classes.colorInputGroup","aria-role":"group"}}))),pc=Td("hexField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hexFieldGroup'},children:[{$el:"input",attrs:{onInput:"$handlers.hexInput",onKeydown:"$handlers.hexKeydown",onFocus:"$handlers.hexFocus",onBlur:"$handlers.hexBlur",id:'$: "hex-" + $id',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",class:'$classes.colorField + " " + $classes.hexField',value:"$hex",autocomplete:"off"}},{$el:"label",children:"HEX",attrs:{for:'$: "hex-" + $id',class:"$classes.fieldLabel"}}]}))),dc=Td("rField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.rFieldGroup'},children:[{$el:"input",attrs:{id:'$: "r-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.rField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.r",autocomplete:"off"}},{$el:"label",children:"R",attrs:{for:'$: "r-" + $id',class:"$classes.fieldLabel"}}]}))),cc=Td("gField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.gFieldGroup'},children:[{$el:"input",attrs:{id:'$: "g-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.gField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.g",autocomplete:"off"}},{$el:"label",children:"G",attrs:{for:'$: "g-" + $id',class:"$classes.fieldLabel"}}]}))),uc=Td("bField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.bFieldGroup'},children:[{$el:"input",attrs:{id:'$: "b-" + $id',onInput:'$handlers.rangeLimitInput("rgba", 0, 255)',onKeydown:'$handlers.rangeLimitKeydown("rgba", 0, 255, 1)',type:"number",class:'$classes.colorField + " " + $classes.bField',min:0,max:255,step:1,tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$rgba.b",autocomplete:"off"}},{$el:"label",children:"B",attrs:{for:'$: "b-" + $id',class:"$classes.fieldLabel"}}]}))),fc=Td("aField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.aFieldGroup'},children:[{$el:"input",attrs:{id:'$: "a-" + $id',onInput:'$handlers.rangeLimitInput("alpha", 0, 1)',onKeydown:'$handlers.rangeLimitKeydown("alpha", 0, 1, 0.01)',type:"text",class:'$classes.colorField + " " + $classes.aField',value:"$rgba.a",tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",autocomplete:"off"},"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":"$rgba.a"},{$el:"label",children:"A",attrs:{for:'$: "a-" + $id',class:"$classes.fieldLabel"}}]}))),vc=Td("hField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.hFieldGroup'},children:[{$el:"input",attrs:{id:'$: "h-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 360)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 360, 1)',type:"text",class:'$classes.colorField + " " + $classes.hField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.h",autocomplete:"off","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":"$hsla.h"}},{$el:"label",children:"H",attrs:{for:'$: "h-" + $id',class:"$classes.fieldLabel"}}]}))),hc=Td("sField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.sFieldGroup'},children:[{$el:"input",attrs:{id:'$: "s-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.sField',tabindex:{if:"$disabled",then:-1,else:0},value:"$hslaPercent.s",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.s"}},{$el:"label",children:"S",attrs:{for:'$: "s-" + $id',class:"$classes.fieldLabel"}}]}))),mc=Td("lField",(()=>({$el:"div",attrs:{class:'$classes.fieldGroup + " " + $classes.lFieldGroup'},children:[{$el:"input",attrs:{id:'$: "l-" + $id',onInput:'$handlers.rangeLimitInput("hsla", 0, 100)',onKeydown:'$handlers.rangeLimitKeydown("hsla", 0, 100, 1)',type:"text",class:'$classes.colorField + " " + $classes.lField',tabindex:{if:"$disabled",then:-1,else:0},disabled:"$disabled",value:"$hslaPercent.l",autocomplete:"off","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":"$hsla.l"}},{$el:"label",children:"L",attrs:{for:'$: "l-" + $id',class:"$classes.fieldLabel"}}]}))),$c=Td("formatSwitcher",(()=>({$el:"div",attrs:{class:"$classes.formatSwitcher",onClick:"$handlers.toggleFormat",tabindex:{if:"$disabled",then:-1,else:0},onKeydown:"$handlers.formatSwitcherKeydown",role:"button","aria-label":"$ui.next.value"}}))),gc=Td("swatches",(()=>({$el:"div",attrs:{id:'$: "swatches-" + $id',class:"$classes.swatches","data-keyboard-nav":"$swatchIsUsingKeyboardNav"}}))),bc=Td("swatch",(()=>({$el:"div",for:["swatch","index","$options"],if:"$swatch",attrs:{if:"$swatch.group",then:{class:"$classes.swatchGroup"},else:{class:"$classes.swatch",title:"$swatch.label"}},children:{if:"$swatch.group",then:[{$el:"span",attrs:{class:"$classes.swatchGroupLabel"},children:"$swatch.group"},{$el:"div",for:["groupSwatch","swatchIndex","$swatch.options"],attrs:{class:"$classes.swatch",title:"$groupSwatch.label"},children:[{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($groupSwatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$groupSwatch.label + "-" + $groupSwatch.value',"data-color":"$fns.anyToHsvaString($groupSwatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($groupSwatch.value, 2)","data-group":"$index","data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}]}],else:{$el:"canvas",attrs:{class:"$classes.swatchCanvas",width:21,height:21,onClick:"$handlers.swatchClick",onKeydown:"$handlers.swatchKeydown",tabindex:{if:"$: ($focusedSwatch === $fns.anyToHsvaString($swatch.value, 0))",then:{if:"$disabled",then:-1,else:0},else:-1},key:'$swatch.label + "-" + $swatch.value',"data-color":"$fns.anyToHsvaString($swatch.value, 0)","data-color-precise":"$fns.anyToHsvaString($swatch.value, 2)","data-group":0,"data-label":"$swatch.label",role:"button","aria-label":"$swatch.label"}}}}))),yc=/rgba?\((\d+%?)\s*(?:,?\s*|\s+)(\d+%?)\s*(?:,?\s*|\s+)(\d+%?)(?:\s*(?:,?\s*|\s+|\/\s*)(\d*(?:\.\d+)?%?))?\)/i,xc=/^hsla?\((\d{1,3}deg|[\d.]+)\s*,?\s*([\d.]+%)\s*,?\s*([\d.]+%)(?:\s*,?\s*([\d.]+%?))?\)$/i;function wc(e,t){const o=Math.pow(10,t);return Math.round(e*o)/o}function _c(e){const[t,o,n,r]=function(e){e=e.replace("#",""),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);const t=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),r=e.length>=8?parseInt(e.slice(6,8),16)/255:1;return function(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p,d=0;const c=(l+i)/2;if(l===i)d=p=0;else{const e=l-i;switch(p=c>.5?e/(2-l-i):e/(l+i),l){case r:d=(s-a)/e+(s<a?6:0);break;case s:d=(a-r)/e+2;break;case a:d=(r-s)/e+4}d*=60}return[d,255*p,255*c,n]}(t,o,n,r)}(e);return[...Sc(t,o,n,r)]}function kc(e,t,o,n=1){const r=t/100,s=o/100,a=(2-r)*s/2;return 0!==a&&(1===a||(t=a<.5?r*s/(2*a):r*s/(2-2*a))),[e,wc(255*t,2),wc(255*a,2),n]}function Sc(e,t,o,n=1){const r=wc(t/255,4),s=wc(o/255,4);if(1===s)return[e,0,100,n];const a=wc(s+r*Math.min(s,1-s),4);let l=t/2.55;return 0!==a&&(l=1!==s&&0!==s?2*(a-s)/a*100:t/2.55),[e,wc(l,2),wc(100*a,2),n]}function Lc(e,t,o,n=1){const r=o/100,s=r*(t/100),a=s*(1-Math.abs(e/60%2-1)),l=r-s;let i=0,p=0,d=0;return[i,p,d]=e<60?[s,a,0]:e<120?[a,s,0]:e<180?[0,s,a]:e<240?[0,a,s]:e<300?[a,0,s]:[s,0,a],i=Math.round(255*(i+l)),p=Math.round(255*(p+l)),d=Math.round(255*(d+l)),[Math.min(Math.max(i,0),255),Math.min(Math.max(p,0),255),Math.min(Math.max(d,0),255),n]}function Ac(e,t,o,n=1){const r=e/255,s=t/255,a=o/255,l=Math.max(r,s,a),i=Math.min(r,s,a);let p=0;const d=l,c=l-i,u=0===l?0:c/l;if(l!==i){switch(l){case r:p=(s-a)/c+(s<a?6:0);break;case s:p=(a-r)/c+2;break;case a:p=(r-s)/c+4}p/=6}return[360*p,100*u,100*d,n]}function Cc(e,t,o,n=1){const[r,s,a,l]=Lc(e,t,o,n);return function(e,t,o,n=1){const r=e=>Math.round(e).toString(16).padStart(2,"0").toUpperCase(),s=function(e){return Math.round(255*e).toString(16).padStart(2,"0").toUpperCase()}(n);return"#"+r(e)+r(t)+r(o)+`${"FF"===s?"":s}`}(r,s,a,l)}function Dc(e){return/^(#?)([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/.test(e)}function Ic(e){if(e){if(Dc(e))return _c(e);if(e.startsWith("rgb")){const t=e.match(yc);if(!t)return[0,0,0,1];const o=e=>e.endsWith("%")?Math.round(2.55*Number(e.slice(0,-1))):Number(e);return Ac(o(t[1]),o(t[2]),o(t[3]),t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1)}if(e.startsWith("hsl")){const t=e.match(xc);if(!t)return[0,0,0,1];const o=Number(t[1].replace("deg","").trim()),n=Number(t[2].slice(0,-1))/100,r=Number(t[3].slice(0,-1))/100,s=t[4]?t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]):1;return Sc(o,wc(255*n,2),wc(255*r,2),s)}}}function Ec(e){const[t,o,n,r]=e.split("-").map((e=>Number(e)));return[t,o,n,r]}function Tc(e,t=150,o=!0){let n=null,r=!0;return(...s)=>{const a=()=>{e(...s),n=null};o&&r&&(r=!1,a()),n||(n=setTimeout(a,t))}}function Oc(e){return!1!==e&&"false"!==e}function Mc(e){return e.tabIndex>=0&&!e.disabled&&null!==e.offsetParent}const Vc={"canvas-ls":"LS","canvas-hue":"Hue","canvas-alpha":"Alpha"};const Fc={schema:/* #__PURE__ */Od(/* #__PURE__ */Md(/* #__PURE__ */Fd("$label"),/* #__PURE__ */Be("$inline && $help",/* #__PURE__ */Hd("$help")),/* #__PURE__ */Vd(/* #__PURE__ */Be("($inline === undefined || $inline === false) && $prefixIcon !== undefined",/* #__PURE__ */Nd("prefix","label")),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Bd()),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Wd(/* #__PURE__ */sc(),/* #__PURE__ */Be("$showValue",/* #__PURE__ */Ud()))),/* #__PURE__ */Be("$inline || $expanded)",/* #__PURE__ */Yd(/* #__PURE__ */Be("$showPanelClose && ($inline === undefined || $inline === false)",/* #__PURE__ */jd(/* #__PURE__ */Nd("close"))),/* #__PURE__ */Be("$panelControls",/* #__PURE__ */zd(/* #__PURE__ */Zd(/* #__PURE__ */qd(),/* #__PURE__ */Gd()),/* #__PURE__ */nc(/* #__PURE__ */rc()),/* #__PURE__ */Xd(/* #__PURE__ */Jd(),/* #__PURE__ */Qd()),/* #__PURE__ */ec(/* #__PURE__ */tc(),/* #__PURE__ */oc()),/* #__PURE__ */Be("$eyeDropper && $hasNativeEyeDropper",/* #__PURE__ */ac(/* #__PURE__ */Nd("eyeDropper"))))),/* #__PURE__ */Be("$panelFormat",/* #__PURE__ */lc(/* #__PURE__ */ic(/* #__PURE__ */Be('$panelActiveFormat === "hex"',/* #__PURE__ */pc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */dc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */cc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba"',/* #__PURE__ */uc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */vc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */hc()),/* #__PURE__ */Be('$panelActiveFormat === "hsla"',/* #__PURE__ */mc()),/* #__PURE__ */Be('$panelActiveFormat === "rgba" || $panelActiveFormat === "hsla"',/* #__PURE__ */fc())),/* #__PURE__ */$c(/* #__PURE__ */Nd("switch")))),/* #__PURE__ */Be("$options",/* #__PURE__ */gc(/* #__PURE__ */bc())))),/* #__PURE__ */Be("$inline === undefined || $inline === false",/* #__PURE__ */Pd()),/* #__PURE__ */Be("($inline === undefined || $inline === false) && $suffixIcon !== undefined",/* #__PURE__ */Nd("suffix"))),/* #__PURE__ */Be("$: ($inline === undefined || $inline === false) && $help",/* #__PURE__ */Hd("$help"))),/* #__PURE__ */Rd(/* #__PURE__ */Kd("$message.value"))),type:"input",family:"text",props:["disbaled","format","valueFormat","panelControls","panelFormat","eyeDropper","inline","options","showValue","closeOnSelect","allowPaste"],features:[function(e){let t,o=null,n=null,a=null,l=null,i=null,p=null,d=null,c=0;const u=["hex","rgba","hsla"],f=Tc((function(){if(!n)return;const t=n.getContext("2d");if(!t)return;const{width:o,height:r}=n,s=e.props.h||0;t.fillStyle=`hsl(${s}, 100%, 50%)`,t.fillRect(0,0,o,r);const a=t.createLinearGradient(0,0,o,0);a.addColorStop(0,"rgba(255, 255, 255, 1)"),a.addColorStop(1,"rgba(255, 255, 255, 0)"),t.fillStyle=a,t.fillRect(0,0,o,r);const l=t.createLinearGradient(0,0,0,r);l.addColorStop(0,"rgba(0,0,0,0)"),l.addColorStop(1,"rgba(0,0,0,1)"),t.fillStyle=l,t.fillRect(0,0,o,r)}),2),v=Tc((function(){if(!l)return;const t=l.getContext("2d");if(!t)return;const o=Math.round(l.width),n=Math.round(l.height);t.clearRect(0,0,o,n),F(l,n/2);const r=e.props.rgba.r||0,s=e.props.rgba.g||0,a=e.props.rgba.b||0,i=t.createLinearGradient(0,0,o,0);i.addColorStop(0,`rgba(${r}, ${s}, ${a}, 0)`),i.addColorStop(1,`rgba(${r}, ${s}, ${a}, 1)`),t.fillStyle=i,t.fillRect(0,0,o,n)}),2),h=Tc(D,2),m=Tc(I,2),$=Tc(H,2),g=Tc(B,10,!1);function b(t){var n,r;if(!e.context||!e.props.allowPaste||e.props.disabled)return;const s=null===(n=e.props.__root)||void 0===n?void 0:n.activeElement;if(o&&o.contains(s)){const o=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text");if(!o)return;if("INPUT"===s.tagName&&!Dc(o)&&!yc.test(o)&&!xc.test(o))return;(Dc(o)||o.startsWith("hsl")||o.startsWith("rgb"))&&(e.props.hexInputFocused&&(e.props.hexInputFocused=!1,setTimeout((()=>{e.props.hexInputFocused=!0}),10)),t.preventDefault(),y(o))}}function y(t){var o;if(!t)return;const n=Ic(t);if(n){const[o,r,s,a]=n;"undefined"!==t&&("number"!=typeof o||isNaN(o)||"number"!=typeof r||isNaN(r)||"number"!=typeof s||isNaN(s)||"number"!=typeof a||isNaN(a)||wc(o,2)===e.props.h&&wc(r,2)===e.props.s&&wc(s,2)===e.props.v&&wc(a,2)===e.props.alpha)||(e.props.alpha=wc(a,2),H(o,r,s))}else{const n=null===(o=e.props.options)||void 0===o?void 0:o.find((e=>{var o;return(null===(o=e.label)||void 0===o?void 0:o.toLowerCase())===t.toLowerCase()}));if(n&&n.value){const t=Ic(n.value);if(t){const[o,n,r,s]=t;e.props.alpha=wc(s,2),H(o,n,r)}else H(e.props.h,e.props.s,e.props.v)}else H(e.props.h,e.props.s,e.props.v)}}function x(t){if(!e.context||!d)return;const o=d[t];o&&(e.props.focusedSwatch=o.dataset.color)}function w(e,t){new ResizeObserver((()=>{const o=e.getBoundingClientRect();e.width=Math.round(o.width),e.height=Math.round(o.height),t(e)})).observe(e)}function _(){e.context&&e.props.eyeDropper&&(e.context.hasNativeEyeDropper=!("undefined"==typeof window||!window.EyeDropper),s(`eye-dropper-${e.props.id}`,(()=>{var t;const o=new window.EyeDropper,n=null===(t=e.props.__root)||void 0===t?void 0:t.getElementById(`eye-dropper-${e.props.id}`);null==n||n.addEventListener("click",(async()=>{const t=await o.open();if(!t.sRGBHex)return;const[n,r,s]=_c(t.sRGBHex);e.props.alpha=1,H(n,r,s)}))}),e.props.__root))}function k(){S("canvas-ls",(e=>{n=e}),f,O),S("canvas-hue",(e=>{a=e}),C,M),S("canvas-alpha",(e=>{l=e}),v,V),L(`canvas-preview-${e.props.id}`,(e=>{i=e,D()}),h),L(`canvas-swatch-preview-${e.props.id}`,(e=>{p=e,I()}),m),A()}function S(o,n,r,s){let a=!1;const l=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",c)},i=e=>{1===e.buttons&&t&&s(e)},p=e=>{t&&s(e)},d=()=>{t=void 0,l()},c=()=>{t=void 0,l()};L(`${o}-${e.props.id}`,(e=>{const l=e.nextElementSibling;n(e),r(),function(e,t){const o=o=>{e&&(o.preventDefault(),t(o))};null==e||e.addEventListener("mousedown",o),null==e||e.addEventListener("touchstart",o)}(e,s),a||function(e,t){a=!0,e.addEventListener("blur",(()=>{e.removeAttribute("data-prevent-focus-style")})),t.addEventListener("touchend",(()=>{e.removeAttribute("data-prevent-focus-style"),e.blur()})),e.addEventListener("keydown",(t=>{["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&e.removeAttribute("data-prevent-focus-style")}))}(l,e),e.addEventListener("mousedown",(e=>{l.focus(),l.setAttribute("data-prevent-focus-style","true"),t=Vc[o],s(e),document.addEventListener("mousemove",i),document.addEventListener("mouseup",d)})),e.addEventListener("touchstart",(()=>{l.setAttribute("data-prevent-focus-style","true"),l.focus(),t=Vc[o],document.addEventListener("touchmove",p),document.addEventListener("touchend",c)}))}),r)}function L(t,o,n){s(t,(()=>{var r;const s=null===(r=e.props.__root)||void 0===r?void 0:r.getElementById(t);s&&(o(s),n&&w(s,n))}),e.props.__root)}function A(){s(`swatches-${e.props.id}`,(()=>{var t,o,n;d=Array.from((null===(t=e.props.__root)||void 0===t?void 0:t.querySelectorAll(`#swatches-${e.props.id} canvas`))||[]),d.forEach((e=>{w(e,E)})),e.props.focusedSwatch=null===(n=null===(o=d[0])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.color,B()}),e.props.__root)}function C(){if(!a)return;const e=a.getContext("2d");if(!e)return;const t=a.width,o=a.height;for(let n=0;n<t;n++){const r=Math.floor(n/t*360);e.fillStyle=`hsl(${r}, 100%, 50%)`,e.fillRect(n,0,1,o)}}function D(){if(!i)return;const t=i.getContext("2d");if(!t)return;F(i,i.width/3);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,i.width,i.height)}function I(){if(!p)return;const t=p.getContext("2d");if(!t)return;F(p,p.height/2);const{r:o,g:n,b:r,a:s}=e.props.rgba;t.fillStyle=`rgba(${o}, ${n}, ${r}, ${s})`,t.fillRect(0,0,p.width,p.height)}function E(e){if(!e)return;const t=e.getContext("2d");if(!t)return;F(e,e.width/2);const o=e.dataset.colorPrecise;if(!o)return;const[n,r,s,a]=Ec(o),[l,i,p,d]=kc(n,r,s,a);t.fillStyle=`hsla(${l}, ${i/255*100}%, ${p/255*100}%, ${d})`,t.fillRect(0,0,Math.round(e.width),Math.round(e.height))}function T(e,o,n){let r=null;const s=e=>{null!==r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{if(!o)return;const t=o.getBoundingClientRect();let r,s;"touches"in e?(r=e.touches[0].clientX-t.left,s=e.touches[0].clientY-t.top):(r=e.clientX-t.left,s=e.clientY-t.top),r=Math.min(Math.max(r,0),t.width),s=Math.min(Math.max(s,0),t.height),n(r,s)}))};s(e);const a=e=>{e.preventDefault(),s(e)},l=e=>{e.preventDefault(),s(e)},i=()=>{t=void 0,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},p=()=>{t=void 0,document.removeEventListener("touchmove",l),document.removeEventListener("touchend",p)};"touches"in e?(document.addEventListener("touchmove",l),document.addEventListener("touchend",p)):(document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))}function O(t){T(t,n,((t,o)=>{const r=t/n.width*100,s=100-o/n.height*100;$(e.props.hue,r,s)}))}function M(t){T(t,a,((t,o)=>{if(!a)return;const n=a.width,r=Math.floor(t/n*360);e.props.h=r,$(e.props.h,e.props.s,e.props.v)}))}function V(t){T(t,l,((t,o)=>{const n=t/l.width*100/100;e.props.alpha=n,$(e.props.hue,e.props.s,e.props.v)}))}function F(e,t){const o=e.getContext("2d");if(!o)return;const n=Math.ceil(e.height/t),r=Math.ceil(e.width/t);for(let e=0;e<n;e++)for(let n=0;n<r;n++)o.fillStyle=(e+n)%2==1?"#FFFFFF":"#CCCCCC",o.fillRect(n*t,e*t,t,t)}function B(){var t,o;if(!e.context||!e.props.options||!d)return;const{h:n,s:r,v:s,alpha:a}=e.props,l=function(e,t,o,n=1){const r=0===o?0:t;return`${wc(0===o||100===o&&0===t?0:e,0)}-${wc(r,0)}-${wc(o,0)}-${wc(n,2)}`}(n,r,s,a);let i=!1,p=!1;d.forEach((e=>{const t=e.dataset.color;if(!t)return;const[o,n,r,c]=t.split("-");"0"===r&&0===s&&c===`${a}`&&(p=!0);const u=e.parentElement;p||t===l?(u.dataset.active="true",e.ariaSelected="true",p=!1,!i&&d&&(x(d.indexOf(e)),i=!0)):(delete u.dataset.active,e.ariaSelected="false")})),i||(e.props.focusedSwatch=null===(o=null===(t=d[0])||void 0===t?void 0:t.dataset)||void 0===o?void 0:o.color)}function P(t){t=t.replace("#",""),e.props.hexInputFocused||3!==t.length||(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),t=`#${t=t.toUpperCase()}`,e.props.hex=t.slice(0,9)}function H(t,n,r,s=!1){e.props.h=void 0===t||isNaN(t)?e.props.h:wc(Math.max(Math.min(t,360),0),2),e.props.s=void 0===n||isNaN(n)?e.props.s:wc(Math.max(Math.min(n,100),0),2),e.props.v=void 0===r||isNaN(r)?e.props.v:wc(Math.max(Math.min(r,100),0),2);const{h:a,s:l,v:i,alpha:p}=e.props,[d,c,u]=kc(a,l,i),[f,v,h]=Lc(a,l,i),m=e.props.hexInputFocused?e.props.hex:Cc(a,l,i,p),$=wc(p,2);e.props.hsla={h:a,s:c,l:u,a:$},e.props.hslaPercent={h:wc(a,0),s:100===i&&0===l?0:wc(0===i?c/255:Math.max(Math.min(c/255*100,100),0),0),l:wc(Math.max(Math.min(e.props.hsla.l/255*100,100),0),0),a:$},e.props.hslaString=`hsla(${e.props.hslaPercent.h}, ${e.props.hslaPercent.s}%, ${e.props.hslaPercent.l}%, ${$})`,e.props.hslaStringPrecise=`hsla(${a}, ${wc(0===i?c/255:c/255*100,2)}%, ${wc(u/255*100,2)}%, ${$})`,e.props.rgba={r:f,g:v,b:h,a:$},e.props.rgbaString=`rgba(${f}, ${v}, ${h}, ${$})`,P(m),setTimeout((()=>{var t;R(),function(){const t=e.props.s,o=100-e.props.v;e.props.controlLSPosition={x:t,y:o}}(),g(),o||"undefined"==typeof window||(o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"]`))}),0);const b=e.props.valueFormat?e.props.valueFormat:e.props.format;s||("hex"===b?e.input(e.props.hex):"rgba"===b?e.input(e.props.rgbaString):"hsla"===b&&e.input(e.props.hslaStringPrecise))}function R(){f(),v(),h(),m()}e.addProps(["expanded","h","s","v","alpha","hsla","hslaPercent","hslaString","hslaStringPrecise","rgba","rgbaString","hex","controlLSPosition","panelActiveFormat","hexInputFocused","hasNativeEyeDropper","focusedSwatch","swatchIsUsingKeyboardNav","showPanelClose"]),e.props.h=e.props.h||void 0,e.props.s=e.props.s||void 0,e.props.v=e.props.v||void 0,e.props.alpha=e.props.alpha||1,e.props.controlLSPosition=e.props.controlLSPosition||{x:0,y:0},e.props.switchIcon=e.props.switchIcon||'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M34.2 179.7L154.4 66.2c1.4-1.3 3.5-2.2 5.6-2.2s4.2 .8 5.6 2.2L285.8 179.7c1.4 1.3 2.2 3.2 2.2 5.2c0 3.9-3.2 7.1-7.1 7.1H39.1c-3.9 0-7.1-3.2-7.1-7.1c0-2 .8-3.8 2.2-5.2zm-22-23.3C4.4 163.8 0 174.1 0 184.9C0 206.5 17.5 224 39.1 224H280.9c21.6 0 39.1-17.5 39.1-39.1c0-10.8-4.4-21.1-12.3-28.4L187.6 42.9C180.1 35.9 170.2 32 160 32s-20.1 3.9-27.6 10.9L12.3 156.4zm22 175.9c-1.4-1.3-2.2-3.2-2.2-5.2c0-3.9 3.2-7.1 7.1-7.1H280.9c3.9 0 7.1 3.2 7.1 7.1c0 2-.8 3.8-2.2 5.2L165.6 445.8c-1.4 1.3-3.5 2.2-5.6 2.2s-4.2-.8-5.6-2.2L34.2 332.3zm-22 23.3L132.4 469.1c7.4 7 17.4 10.9 27.6 10.9s20.1-3.9 27.6-10.9L307.7 355.6c7.8-7.4 12.3-17.7 12.3-28.5c0-21.6-17.5-39.1-39.1-39.1H39.1C17.5 288 0 305.5 0 327.1c0 10.8 4.4 21.1 12.3 28.5z"/></svg>',e.props.hexInputFocused=!1,e.props.swatchIsUsingKeyboardNav=!1,e.on("destroying",(()=>{e.context&&"undefined"!=typeof document&&document.removeEventListener("paste",b)})),e.on("created",(()=>{e.context&&("undefined"!=typeof window&&document.addEventListener("paste",b),e.props.expanded=!1,e.props.panelActiveFormat=e.props.format||u[0],e.props.panelControls=Oc(e.props.panelControls),e.props.eyeDropper=Oc(e.props.eyeDropper),e.props.panelFormat=Oc(e.props.panelFormat),e.props.showValue=Oc(e.props.showValue),e.props.allowPaste=Oc(e.props.allowPaste),e.props.inline=r(e.props.inline),e.props.disabled=r(e.props.disabled),e.props.format=e.props.format||"hex",e.props.valueFormat=e.props.valueFormat||e.props.format,e.props.closeOnSelect=r(e.props.closeOnSelect),e.props.focusedSwatch=void 0,void 0===e.value||""===e.value||null===e.value?(e.props.rgba={r:0,g:0,b:0},H(0,0,0,!0)):y(`${e.value}`),e.on("input",(({payload:t})=>{o&&void 0!==e.props.__root&&!o.contains(e.props.__root.activeElement)&&y(t)})),setTimeout((()=>{_()}),5),k(),e.on("prop:expanded",(()=>{var t;if(e.props.expanded)_(),k(),A(),document.addEventListener("keydown",o),window.innerWidth<=430&&!window.matchMedia("(hover: hover)").matches?e.props.showPanelClose=!0:e.props.showPanelClose=!1,setTimeout((()=>{var t;const o=null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`);o&&o.focus()}),0);else{document.removeEventListener("keydown",o);(null===(t=e.props.__root)||void 0===t?void 0:t.querySelector(`[data-id="${e.props.id}"] *[tabindex="0"]`)).focus()}function o(t){"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1)}})),e.context.fns.anyToHsvaString=(e,t)=>{const o=Ic(e);if(!o)return"0-0-0-1";let[n,r,s,a]=o;return 0===t&&(n=0===s||100===s&&0===r?0:n),`${wc(n,t)}-${wc(r,t)}-${wc(s,t)}-${wc(a,2)}`},e.context.handlers.inputPreviewClick=t=>{e.props.expanded=!e.props.expanded},e.context.handlers.inputPreviewFocusout=t=>{var o,n,r;const s=null===(o=e.props.__root)||void 0===o?void 0:o.querySelector(`[data-id="${e.props.id}"] .formkit-inner`),a=t.relatedTarget;if(s.contains(a)){function l(t){var o,n;s.contains(t.target)||(e.props.expanded=!1,null===(o=e.props.__root)||void 0===o||o.removeEventListener("mousedown",l),null===(n=e.props.__root)||void 0===n||n.removeEventListener("touchstart",l))}null===(n=e.props.__root)||void 0===n||n.addEventListener("mousedown",l),null===(r=e.props.__root)||void 0===r||r.addEventListener("touchstart",l)}else e.props.expanded=!1},e.context.handlers.inputPreviewKeydown=t=>{"Escape"===t.key&&(t.preventDefault(),e.props.expanded=!1),"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!e.props.expanded)},e.context.handlers.closePanel=()=>{e.props.expanded=!1},e.context.handlers.panelCloseKeydown=t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e.props.expanded=!1)},e.context.handlers.toggleFormat=(t=1)=>{t="number"==typeof t?t:1;const o=(u.indexOf(e.props.panelActiveFormat)+t+u.length)%u.length;e.props.panelActiveFormat=u[o]},e.context.handlers.panelKeydown=t=>{var o,n,r;if("Tab"===t.key&&e.props.expanded){t.preventDefault();const s=Array.from((null===(o=e.props.__root)||void 0===o?void 0:o.querySelectorAll(`[data-id="${e.props.id}"] *:not(.formkit-swatch-preview)[tabindex="0"]`))||[]).filter(Mc),a=s.indexOf((null===(n=e.props.__root)||void 0===n?void 0:n.activeElement)?null===(r=e.props.__root)||void 0===r?void 0:r.activeElement:e.props.__root);let l;l=t.shiftKey?(a-1+s.length)%s.length:(a+1)%s.length,s[l].focus()}},e.context.handlers.lsKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":H(o,n-s,r);break;case"ArrowRight":H(o,n+s,r);break;case"ArrowUp":H(o,n,r+s);break;case"ArrowDown":H(o,n,r-s);break;case"PageUp":H(o,n,r+10);break;case"PageDown":H(o,n,r-10);break;case"Home":H(o,n-10,r);break;case"End":H(o,n+10,r)}R()}},e.context.handlers.hueControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r}=e.props,s=t.shiftKey?10:1;switch(t.key){case"ArrowLeft":case"ArrowDown":H(o-s,n,r);break;case"ArrowRight":case"ArrowUp":H(o+s,n,r);break;case"PageUp":H(o+10,n,r);break;case"PageDown":H(o-10,n,r);break;case"Home":H(0,n,r);break;case"End":H(360,n,r)}R()}},e.context.handlers.alphaControlKeydown=t=>{if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const{h:o,s:n,v:r,alpha:s}=e.props,a=t.shiftKey?.1:.01;switch(t.key){case"ArrowLeft":case"ArrowDown":e.props.alpha=wc(Math.min(Math.max(s-a,0),1),2);break;case"ArrowRight":case"ArrowUp":e.props.alpha=wc(Math.min(Math.max(s+a,0),1),2);break;case"PageUp":e.props.alpha=wc(Math.min(Math.max(s+.1,0),1),2);break;case"PageDown":e.props.alpha=wc(Math.min(Math.max(s-.1,0),1),2);break;case"Home":e.props.alpha=0;break;case"End":e.props.alpha=1}H(o,n,r)}},e.context.handlers.eyeDropperKeydown=t=>{var o;if("Enter"===t.key||" "===t.key){t.preventDefault();const n=null===(o=e.props.__root)||void 0===o?void 0:o.getElementById(`eye-dropper-${e.props.id}`);null==n||n.click()}},e.context.handlers.formatSwitcherKeydown=t=>{e.context&&("Enter"!==t.key&&" "!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),e.context.handlers.toggleFormat()),"ArrowUp"===t.key&&(t.preventDefault(),e.context.handlers.toggleFormat(-1)))},e.context.handlers.hexInput=t=>{const o=t.target,n=o.value.startsWith("#")?9:8,r=o.value.slice(0,n);if(o.value=r,Dc(r)){const[t,o,n,s]=_c(r);e.props.alpha=s,P(r),H(t,o,n)}},e.context.handlers.hexKeydown=t=>{const o=t.target,n=o.value;let r="";if(!Dc(n))return;const s=n.startsWith("#")?n.slice(1):n,a=8===s.length,l=a?s.substring(0,6):s,i=a?s.substring(6,8):"",p=t.shiftKey?10:1,d=16777215;let c;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(t.key))switch(t.preventDefault(),t.key){case"ArrowUp":c=(parseInt(l,16)+p)%16777216;break;case"ArrowDown":c=(parseInt(l,16)-p+d+1)%16777216;break;case"PageUp":c=(parseInt(l,16)+10)%16777216;break;case"PageDown":c=(parseInt(l,16)-10+d+1)%16777216;break;case"Home":c=0;break;case"End":c=d}void 0!==c&&(r=c.toString(16).padStart(6,"0").toUpperCase()),r&&(o.value=a?`#${r}${i}`:`#${r}`),e.context&&e.context.handlers.hexInput(t)},e.context.handlers.hexFocus=()=>{e.context&&(e.props.hexInputFocused=!0)},e.context.handlers.hexBlur=t=>{if(!e.context)return;e.props.hexInputFocused=!1;const o=t.target.value;Dc(o)&&P(o)},e.context.handlers.rangeLimitInput=(t,o,n,r)=>s=>{const a=r||s;if(!a||!e.context)return;const l=a.target;if(l.value.endsWith("."))return;const i=Math.max(Math.min(Number(l.value),n),o);l.value=`${i}`;const p=l.id;if("hsla"===t){switch(p){case`h-${e.props.id}`:e.props.h=i;break;case`s-${e.props.id}`:e.props.hslaPercent.s=i;break;case`l-${e.props.id}`:e.props.hslaPercent.l=i}const[t,o,n]=Sc(e.props.h,2.55*e.props.hslaPercent.s,2.55*e.props.hslaPercent.l);H(t,o,n)}else if("rgba"===t){switch(p){case`r-${e.props.id}`:e.props.rgba.r=i;break;case`g-${e.props.id}`:e.props.rgba.g=i;break;case`b-${e.props.id}`:e.props.rgba.b=i}const[t,o,n]=Ac(e.props.rgba.r,e.props.rgba.g,e.props.rgba.b);H(t,o,n)}else"alpha"==t&&(e.props.alpha=i,H())},e.context.handlers.rangeLimitKeydown=(t,o,n,r)=>s=>{if(!e.context)return;if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End","Backspace","Tab","Enter"].includes(s.key)||s.metaKey||!/[a-zA-Z!@#$%^&*()_+={}\[\]:;"'<,>?\/|\\`~]/g.test(s.key)){if(["ArrowUp","ArrowDown","PageUp","PageDown","Home","End"].includes(s.key)){const a=s.target,l=Number(a.value),i=s.shiftKey?10*r:r;switch(s.key){case"ArrowUp":s.preventDefault(),a.value=`${Math.min(l+i,n)}`;break;case"ArrowDown":s.preventDefault(),a.value=`${Math.max(l-i,o)}`;break;case"PageUp":s.preventDefault(),a.value=`${Math.min(l+10*r,n)}`;break;case"PageDown":s.preventDefault(),a.value=`${Math.max(l-10*r,o)}`;break;case"Home":s.preventDefault(),a.value=`${o}`;break;case"End":s.preventDefault(),a.value=`${n}`}e.context.handlers.rangeLimitInput(t,o,n,s)()}}else s.preventDefault()},e.context.handlers.swatchClick=t=>{const o=t.target;if(o.dataset.colorPrecise){const[t,n,r,s]=Ec(o.dataset.colorPrecise);e.props.alpha=s,H(t,n,r),e.props.closeOnSelect&&(e.props.expanded=!1)}e.context&&"keydown"!==t.type&&e.context.handlers.swatchKeydown(t)},e.context.handlers.swatchKeydown=t=>{var o,n,r,s;if(!e.context||!d||!d.length)return;const a=d.indexOf(t.currentTarget);let l=null;const i=function(e){var t;if(!e.length)return 0;const o=null===(t=e[0].parentElement)||void 0===t?void 0:t.parentElement;if(!o)return 0;const n=o.getBoundingClientRect().width,r=e[0].parentElement;if(!r)return 0;const s=r.getBoundingClientRect(),a=window.getComputedStyle(r),l=parseFloat(a.marginLeft)+parseFloat(a.marginRight),i=s.width+l;return Math.floor(n/i)}(d),p=d.length;let u=0,f=p,v=!1;const h=d[a].dataset.group;if(void 0!==h){const e=d.filter((e=>e.dataset.group===h));u=d.indexOf(e[0]),f=d.indexOf(e[e.length-1])}const m=(a-u)%i;if(!t.key||"Tab"===t.key)return t.key||(e.props.swatchIsUsingKeyboardNav=!1,c=m,x(a)),"Tab"===t.key&&(e.props.swatchIsUsingKeyboardNav=!1),void d.forEach((e=>{delete e.parentElement.dataset.focused}));if("Enter"===t.key||" "===t.key)return t.preventDefault(),c=m,e.context.handlers.swatchClick(t),void x(a);switch("ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||(e.props.swatchIsUsingKeyboardNav=!0,t.preventDefault()),t.key){case"ArrowUp":l=Math.max(a-i,a-(i-(c-m))),v=!0;break;case"ArrowDown":l=Math.max(a+i,a+(i+(c-m))),v=!0;break;case"ArrowLeft":l=a-1,c=(l-u)%i;break;case"ArrowRight":l=a+1,c=(l-u)%i}if(v&&null!==l&&(l<u||l>f)){let e;e=l<u?null===(n=null===(o=d[u-1])||void 0===o?void 0:o.dataset)||void 0===n?void 0:n.group:null===(s=null===(r=d[f+1])||void 0===r?void 0:r.dataset)||void 0===s?void 0:s.group;const t=d.filter((e=>e.dataset.group===h)),p=d.filter((t=>t.dataset.group===e)),v=(a-u)%i,m=t.length%i||i,$=a>=u+t.length-m;if(l<u){const e=p.length%i||i;l=u-e+Math.min(Math.max(v,c),e-1)}else l>f&&(l=$?Math.min(f+Math.max(v,c)+1,d.indexOf(p[p.length-1])):Math.min(l,f))}if(null!==l&&l>=0&&l<p){x(l),d.forEach((e=>{delete e.parentElement.dataset.focused}));const e=d[l],t=e.parentElement;e.focus(),t.dataset.focused="true"}})}))},Ko,b,
|
|
62
62
|
/* #__PURE__ */$("eyeDropper","color"),
|
|
63
63
|
/* #__PURE__ */$("close","close"),
|
|
64
64
|
/* #__PURE__ */g("close"),
|
package/package.json
CHANGED
package/slider/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSectionFactory as a,createBaseSections as e}from"../index.mjs";const l=/* #__PURE__ */a("sl"),{outer:t,wrapper:s,inner:$,icon:n,label:i,prefix:r,suffix:d,help:o,messages:u,message:c}=/* #__PURE__ */e(l),h=l("chart",(()=>({$el:"div",if:"$chart"}))),p=l("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),
|
|
1
|
+
import{createSectionFactory as a,createBaseSections as e}from"../index.mjs";const l=/* #__PURE__ */a("sl"),{outer:t,wrapper:s,inner:$,icon:n,label:i,prefix:r,suffix:d,help:o,messages:u,message:c}=/* #__PURE__ */e(l),h=l("chart",(()=>({$el:"div",if:"$chart"}))),p=l("chartBar",(()=>({$el:"div",for:["bar","index","$chart"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$bar.at >= $_value.0 && $bar.at <= $_value.1",else:"$bar.at >= $_value.1 && $bar.at <= $_value.0"},else:"$bar.at <= $_value"},style:{left:'$bar.at / ($max - $min) * 100 + "%"',width:'$: "calc(" + (100 / $chart.length) + "% - 2px)"',height:{if:"$largestBar",then:'$bar.value / $largestBar * 100 + "%"'}}}}))),m=l("sliderInner",(()=>({$el:"div",attrs:{"data-has-mark-labels":"$markLabels && $marks.length > 0"}}))),v=l("track",(()=>({$el:"div",attrs:{id:"$: 'track-' + $id",onClick:"$handlers.clickTrack"}}))),f=l("trackWrapper",(()=>({$el:"div"}))),b=l("trackInner",(()=>({$el:"div"}))),k=l("fill",(()=>({$el:"div",attrs:{style:"$fillStyles"}}))),_=l("linkedValues",(()=>({$el:"div"}))),x=l("maxValue",(()=>({$formkit:"number",bind:"$computedMaxInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.1",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.maxNode",onBlur:"$handlers.inputBlur"}))),M=l("minValue",(()=>({$formkit:"number",if:"$isMulti",bind:"$computedMinInputAttrs",ignore:!0,number:!0,value:{if:"$isMulti",then:"$_value.0",else:"$_value"},tabindex:{if:"$disabled",then:-1},onNode:"$handlers.minNode",onBlur:"$handlers.inputBlur"}))),g=l("marks",(()=>({$el:"div",if:"$marks"}))),y=l("mark",(()=>({$el:"span",for:["step","index","$marks"],attrs:{"data-active":{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:"$step.at >= $_value.0 && $step.at <= $_value.1",else:"$step.at >= $_value.1 && $step.at <= $_value.0"},else:"$step.at <= $_value"},class:{if:"$step.class",then:'$: $classes.mark + " " + $step.class',else:"$classes.mark"},style:{left:'$: $fns.calculateMarkPosition($step.at) + "%"'}}}))),I=l("markLabel",(()=>({$el:"span",if:"$markLabels",children:{if:"$step.label !== undefined",then:"$step.label",else:""},attrs:{class:'$: $classes.markLabel + " " + $step.labelClass'}}))),w=l("handles",(()=>({$el:"ul"}))),B=l("handleMax",(()=>({$el:"li",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "max"',"data-handle":"max","data-show-tooltip":"$tooltip",class:"$: 'formkit-handle ' + $classes.handle + ' ' + $classes.handleMax",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$maxHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),F=l("handleMin",(()=>({$el:"li",if:"$isMulti",attrs:{"data-active":"$dragging","data-is-target":'$lastHandleInteraction === "min"',"data-handle":"min","data-show-tooltip":"$tooltip",class:"$: $classes.handle + ' ' + $classes.handleMin",onFocus:"$handlers.focus",onClick:"$handlers.clickHandle",onMousedown:"$handlers.startDrag",onTouchstart:"$handlers.startDrag",style:"$minHandleStyles",tabindex:{if:"$disabled",then:-1,else:0},onBlur:"$handlers.blur",onKeydown:"$handlers.keydown"}}))),H=l("handleMinInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMinInner'}}))),C=l("handleMaxInner",(()=>({$el:"div",attrs:{class:'$: $classes.handleInner + " " + $classes.handleMaxInner'}}))),D=l("tooltipMax",(()=>({$el:"div",if:'$tooltip === true || $tooltip === "auto"',children:{if:"$isMulti",then:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.1, "max")',else:'$tooltipFormat($_value.0, "max")'},else:'$tooltipFormat($_value, "max")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMax"}}))),L=l("tooltipMin",(()=>({$el:"div",if:'$isMulti && ($tooltip === true || $tooltip === "auto")',children:{if:"$_value.0 < $_value.1",then:'$tooltipFormat($_value.0, "min")',else:'$tooltipFormat($_value.1, "min")'},attrs:{class:"$classes.tooltip + ' ' + $classes.tooltipMin"}})));export{h as chart,p as chartBar,l as createSection,k as fill,B as handleMax,C as handleMaxInner,F as handleMin,H as handleMinInner,w as handles,o as help,n as icon,$ as inner,i as label,_ as linkedValues,y as mark,I as markLabel,g as marks,x as maxValue,c as message,u as messages,M as minValue,t as outer,r as prefix,m as sliderInner,d as suffix,D as tooltipMax,L as tooltipMin,v as track,b as trackInner,f as trackWrapper,s as wrapper};
|