@wistia/vhs 2.74.0 → 2.74.1-beta.7e6b4a65.8314659

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FormGlobalError.d.ts","sourceRoot":"","sources":["../../../src/components/FormGlobalError/FormGlobalError.tsx"],"names":[],"mappings":"AA+EA,eAAO,MAAM,eAAe,0FA0B1B,CAAC"}
1
+ {"version":3,"file":"FormGlobalError.d.ts","sourceRoot":"","sources":["../../../src/components/FormGlobalError/FormGlobalError.tsx"],"names":[],"mappings":"AAkFA,eAAO,MAAM,eAAe,0FA0B1B,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v2.74.0
3
+ * @license @wistia/vhs v2.74.1-beta.7e6b4a65.8314659
4
4
  *
5
5
  * Copyright (c) 2021-2025, Wistia, Inc. and its affiliates.
6
6
  *
@@ -1606,7 +1606,7 @@
1606
1606
  `,JK=(0,mu.default)(LP)`
1607
1607
  cursor: pointer;
1608
1608
  text-decoration: underline;
1609
- `,ZK=e=>{let t="error";return e>1&&(t+="s"),`${e} ${t} found on page`},QK=e=>{document.getElementById(`fieldset-${e}`)?.scrollIntoView({behavior:"smooth"})},eq=({errors:e={},statusError:t})=>(0,mo.jsxs)(YK,{children:[(0,mc.isNonEmptyString)(t)?(0,mo.jsx)(LP,{children:t}):null,Object.keys(e).map(r=>(0,mo.jsx)("li",{children:(0,mo.jsx)(JK,{"data-testid":`form-global-error-${r}`,onClick:()=>QK(r),children:e[r]})},r))]}),hc=(0,VP.forwardRef)((e,t)=>{let r=ui(),{status:n,errors:o}=r,a=Object.keys(o).length;(0,mc.isNotNil)(n)&&n.length>0&&(a+=1);let s=(0,mc.isNotNil)(n)&&!n.success||a;return _n(s)?(0,mo.jsxs)(qK,{ref:t,children:[(0,mo.jsx)(XK,{children:ZK(a)}),(0,mo.jsx)(eq,{errors:o,statusError:n})]}):null});hc.displayName="FormGlobalError_VHS";i();i();var $P=require("react");var hu=()=>(0,$P.useContext)(gd);i();i();var zP=require("react");i();i();var rn=require("react"),p5=(e,t=0)=>{let r=(0,rn.useRef)(!1),n=(0,rn.useRef)(),o=(0,rn.useRef)(e),a=(0,rn.useCallback)(()=>r.current,[]),s=(0,rn.useCallback)(()=>{r.current=!1,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current=!0,o.current()},t)},[t]),u=(0,rn.useCallback)(()=>{r.current=null,n.current&&clearTimeout(n.current)},[]);return(0,rn.useEffect)(()=>{o.current=e},[e]),(0,rn.useEffect)(()=>(s(),u),[t]),[a,u,s]};var d5=(e,t=0,r=[])=>{let[n,o,a]=p5(e,t);return(0,zP.useEffect)(a,r),[n,o]};var gc=require("react/jsx-runtime"),GP=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),tq=(e,t)=>{let r={};return Object.keys(e).forEach(n=>{e[n]===null?(0,Ot.isNotUndefined)(t)&&(0,Ot.isNotUndefined)(t.fields)&&(0,Ot.isNotUndefined)(t.fields[n])&&t.fields[n]._type==="boolean"?r[n]=!1:r[n]=void 0:r[n]=e[n]}),r},m5=({children:e,className:t,formId:r,initialValues:n,onSubmit:o,scrollToFormErrorsOnSubmit:a=!0,shareFormContext:s,style:u,submitOnChange:l=!1,validate:c,validateOnBlur:p=!1,validateOnChange:d=!1,validationSchema:h,globalErrorRef:g,showGlobalError:v=!0,innerRef:m})=>{let[b,y]=(0,di.useState)(),[x,w]=(0,di.useState)(),[S,E]=(0,di.useState)(0),D=hu(),P=(W,N)=>{let V={};Object.keys(W).forEach($=>{let H=W[$],te=(0,Ot.isNotUndefined)(h)&&(0,Ot.isNotUndefined)(h.fields[$])&&h.fields[$]._type==="string";if(H==null){V[$]=null;return}if(typeof H=="number"){V[$]=H;return}H===!1&&(V[$]=!1),te&&!H&&(V[$]=null),H&&(V[$]=te?H.trim():H)}),o(V,N)},R=a&&((0,Ot.isUndefined)(b)||!b)&&((0,Ot.isUndefined)(x)||!x)&&(0,Ot.isNotUndefined)(g.current?.scrollIntoView);(0,di.useEffect)(()=>{if(((0,Ot.isUndefined)(b)||!b)&&(0,Ot.isNotUndefined)(x)&&x&&document.activeElement&&document.activeElement.blur(),R){let W=S>1?`there are ${S} errors`:"there's an error!";D({variant:"error",message:`Uh oh, ${W}`}),g.current.scrollIntoView({behavior:"smooth"})}},[S,g,b,x,R,D]);let B=tq(n,h),I=750;return(0,gc.jsx)(eE,{enableReinitialize:!0,initialValues:B,innerRef:(0,Ot.isNotNil)(m)?m:()=>{},onSubmit:P,validate:(0,Ot.isNotNil)(c)?c:()=>{},validateOnBlur:p,validateOnChange:d,validationSchema:h,children:W=>{let[N,V]=(0,di.useState)(W.values);if((0,di.useEffect)(()=>{(0,Ot.isNotUndefined)(s)&&s(W),y(W.isSubmitting),w(W.isValid),E(Object.keys(W.errors).length),l&&GP(W.values,N)&&V(W.values)},[W,N]),l){let[,]=d5(()=>{GP(n,N)&&W.submitForm()},I,[N])}return(0,gc.jsxs)(I3,{className:t,"data-testid":r,noValidate:!0,style:u,children:[v?(0,gc.jsx)(hc,{ref:g}):null,e]})}})};m5.displayName="Form_VHS";i();i();i();i();var HP=require("react/jsx-runtime"),V1=({type:e="submit",isSubmitting:t=!1,children:r,disabled:n=!1,...o})=>(0,HP.jsx)(et,{disabled:t||n,type:e,...o,children:r});V1.displayName="FormConnectorButton_VHS";var h5=require("react/jsx-runtime"),rq=e=>e.preventDefault(),g5=({buttons:e,align:t="left",...r})=>{let{isSubmitting:n}=ui();return(0,h5.jsx)(uo,{align:t,...r,children:e.map(({name:o,type:a,...s})=>(0,h5.jsx)(V1,{isSubmitting:n,type:a,...s,onMouseDown:rq,children:o},o))})};g5.displayName="FormButtons_VHS";i();i();var GF=require("react"),tv=A(require("styled-components"));i();var jP={checkbox:{component:"FormConnectorCheckboxGroup",inputType:null},custom:{component:"FormConnectorCustomField",inputType:null},email:{component:"FormConnectorInput",inputType:"email"},hidden:{component:"FormConnectorHidden",inputType:"hidden"},multiline:{component:"FormConnectorInput",inputType:null},number:{component:"FormConnectorInput",inputType:"number"},password:{component:"FormConnectorInput",inputType:"password"},phone:{component:"FormConnectorInput",inputType:"tel"},radio:{component:"FormConnectorRadioGroup",inputType:null},search:{component:"FormConnectorInput",inputType:"search"},select:{component:"FormConnectorSelect",inputType:null},text:{component:"FormConnectorInput",inputType:"text"},time:{component:"FormConnectorInput",inputType:"time"},timePosition:{component:"FormConnectorInput",inputType:"text"},url:{component:"FormConnectorInput",inputType:"url"},richTextEditor:{component:"FormConnectorRichTextEditor",inputType:null}};i();i();var L1=A(ee());var WP=require("react/jsx-runtime"),$1=({direction:e="column",disabled:t=!1,field:{name:r,value:n},form:{errors:o,setFieldValue:a},label:s,labelDescription:u,labelProps:l={},onChangeCustom:c,options:p=[]})=>{let d=(m,b)=>{a(b,m.target.checked)},h=(m,b)=>{let y=n;if((0,L1.isArray)(y))if(m.target.checked)y.push(b);else{let x=y.indexOf(b);x>-1&&y.splice(x,1)}a(b,y)},g=Array.isArray(n)&&p.length>1?h:d,v=Array.isArray(p)?p:[p];return(0,WP.jsx)(pc,{direction:e,disabled:t,error:(0,L1.isNotNil)(o)?o[r]:void 0,label:s,labelDescription:u,labelProps:l,name:r,onChange:(m,b)=>{g(m,b),c&&c(m.target.checked)},options:v,value:n})};$1.displayName="FormConnectorCheckboxGroup_VHS";i();i();var _P=A(ee());var v5=require("react/jsx-runtime"),z1=({customComponent:e,field:t,form:r,label:n="",labelDescription:o,labelProps:a={},...s})=>{let{name:u}=t,{errors:l}=r;return(0,v5.jsx)(ir,{error:(0,_P.isNotUndefined)(l)?l[u]:void 0,label:n,labelDescription:o,labelProps:a,name:u,children:(0,v5.jsx)(e,{field:t,form:r,...s})})};z1.displayName="FormConnectorCustomField_VHS";i();i();var JP=A(ee());i();i();var vu=require("react"),YP=A(require("styled-components")),vc=A(ee());i();var Rn=A(require("styled-components"));var UP=Rn.css`
1609
+ `,ZK=e=>{let t="error";return e>1&&(t+="s"),`${e} ${t} found on page`},QK=e=>{document.getElementById(`fieldset-${e}`)?.scrollIntoView({behavior:"smooth"})},eq=({errors:e={},statusError:t})=>(0,mo.jsxs)(YK,{children:[(0,mc.isNonEmptyString)(t)?(0,mo.jsx)(LP,{children:t}):null,Object.keys(e).map(r=>(0,mo.jsx)("li",{children:(0,mo.jsx)(JK,{"data-testid":`form-global-error-${r}`,onClick:n=>{n.preventDefault(),QK(r)},children:e[r]})},r))]}),hc=(0,VP.forwardRef)((e,t)=>{let r=ui(),{status:n,errors:o}=r,a=Object.keys(o).length;(0,mc.isNotNil)(n)&&n.length>0&&(a+=1);let s=(0,mc.isNotNil)(n)&&!n.success||a;return _n(s)?(0,mo.jsxs)(qK,{ref:t,children:[(0,mo.jsx)(XK,{children:ZK(a)}),(0,mo.jsx)(eq,{errors:o,statusError:n})]}):null});hc.displayName="FormGlobalError_VHS";i();i();var $P=require("react");var hu=()=>(0,$P.useContext)(gd);i();i();var zP=require("react");i();i();var rn=require("react"),p5=(e,t=0)=>{let r=(0,rn.useRef)(!1),n=(0,rn.useRef)(),o=(0,rn.useRef)(e),a=(0,rn.useCallback)(()=>r.current,[]),s=(0,rn.useCallback)(()=>{r.current=!1,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current=!0,o.current()},t)},[t]),u=(0,rn.useCallback)(()=>{r.current=null,n.current&&clearTimeout(n.current)},[]);return(0,rn.useEffect)(()=>{o.current=e},[e]),(0,rn.useEffect)(()=>(s(),u),[t]),[a,u,s]};var d5=(e,t=0,r=[])=>{let[n,o,a]=p5(e,t);return(0,zP.useEffect)(a,r),[n,o]};var gc=require("react/jsx-runtime"),GP=(e,t)=>JSON.stringify(e)!==JSON.stringify(t),tq=(e,t)=>{let r={};return Object.keys(e).forEach(n=>{e[n]===null?(0,Ot.isNotUndefined)(t)&&(0,Ot.isNotUndefined)(t.fields)&&(0,Ot.isNotUndefined)(t.fields[n])&&t.fields[n]._type==="boolean"?r[n]=!1:r[n]=void 0:r[n]=e[n]}),r},m5=({children:e,className:t,formId:r,initialValues:n,onSubmit:o,scrollToFormErrorsOnSubmit:a=!0,shareFormContext:s,style:u,submitOnChange:l=!1,validate:c,validateOnBlur:p=!1,validateOnChange:d=!1,validationSchema:h,globalErrorRef:g,showGlobalError:v=!0,innerRef:m})=>{let[b,y]=(0,di.useState)(),[x,w]=(0,di.useState)(),[S,E]=(0,di.useState)(0),D=hu(),P=(W,N)=>{let V={};Object.keys(W).forEach($=>{let H=W[$],te=(0,Ot.isNotUndefined)(h)&&(0,Ot.isNotUndefined)(h.fields[$])&&h.fields[$]._type==="string";if(H==null){V[$]=null;return}if(typeof H=="number"){V[$]=H;return}H===!1&&(V[$]=!1),te&&!H&&(V[$]=null),H&&(V[$]=te?H.trim():H)}),o(V,N)},R=a&&((0,Ot.isUndefined)(b)||!b)&&((0,Ot.isUndefined)(x)||!x)&&(0,Ot.isNotUndefined)(g.current?.scrollIntoView);(0,di.useEffect)(()=>{if(((0,Ot.isUndefined)(b)||!b)&&(0,Ot.isNotUndefined)(x)&&x&&document.activeElement&&document.activeElement.blur(),R){let W=S>1?`there are ${S} errors`:"there's an error!";D({variant:"error",message:`Uh oh, ${W}`}),g.current.scrollIntoView({behavior:"smooth"})}},[S,g,b,x,R,D]);let B=tq(n,h),I=750;return(0,gc.jsx)(eE,{enableReinitialize:!0,initialValues:B,innerRef:(0,Ot.isNotNil)(m)?m:()=>{},onSubmit:P,validate:(0,Ot.isNotNil)(c)?c:()=>{},validateOnBlur:p,validateOnChange:d,validationSchema:h,children:W=>{let[N,V]=(0,di.useState)(W.values);if((0,di.useEffect)(()=>{(0,Ot.isNotUndefined)(s)&&s(W),y(W.isSubmitting),w(W.isValid),E(Object.keys(W.errors).length),l&&GP(W.values,N)&&V(W.values)},[W,N]),l){let[,]=d5(()=>{GP(n,N)&&W.submitForm()},I,[N])}return(0,gc.jsxs)(I3,{className:t,"data-testid":r,noValidate:!0,style:u,children:[v?(0,gc.jsx)(hc,{ref:g}):null,e]})}})};m5.displayName="Form_VHS";i();i();i();i();var HP=require("react/jsx-runtime"),V1=({type:e="submit",isSubmitting:t=!1,children:r,disabled:n=!1,...o})=>(0,HP.jsx)(et,{disabled:t||n,type:e,...o,children:r});V1.displayName="FormConnectorButton_VHS";var h5=require("react/jsx-runtime"),rq=e=>e.preventDefault(),g5=({buttons:e,align:t="left",...r})=>{let{isSubmitting:n}=ui();return(0,h5.jsx)(uo,{align:t,...r,children:e.map(({name:o,type:a,...s})=>(0,h5.jsx)(V1,{isSubmitting:n,type:a,...s,onMouseDown:rq,children:o},o))})};g5.displayName="FormButtons_VHS";i();i();var GF=require("react"),tv=A(require("styled-components"));i();var jP={checkbox:{component:"FormConnectorCheckboxGroup",inputType:null},custom:{component:"FormConnectorCustomField",inputType:null},email:{component:"FormConnectorInput",inputType:"email"},hidden:{component:"FormConnectorHidden",inputType:"hidden"},multiline:{component:"FormConnectorInput",inputType:null},number:{component:"FormConnectorInput",inputType:"number"},password:{component:"FormConnectorInput",inputType:"password"},phone:{component:"FormConnectorInput",inputType:"tel"},radio:{component:"FormConnectorRadioGroup",inputType:null},search:{component:"FormConnectorInput",inputType:"search"},select:{component:"FormConnectorSelect",inputType:null},text:{component:"FormConnectorInput",inputType:"text"},time:{component:"FormConnectorInput",inputType:"time"},timePosition:{component:"FormConnectorInput",inputType:"text"},url:{component:"FormConnectorInput",inputType:"url"},richTextEditor:{component:"FormConnectorRichTextEditor",inputType:null}};i();i();var L1=A(ee());var WP=require("react/jsx-runtime"),$1=({direction:e="column",disabled:t=!1,field:{name:r,value:n},form:{errors:o,setFieldValue:a},label:s,labelDescription:u,labelProps:l={},onChangeCustom:c,options:p=[]})=>{let d=(m,b)=>{a(b,m.target.checked)},h=(m,b)=>{let y=n;if((0,L1.isArray)(y))if(m.target.checked)y.push(b);else{let x=y.indexOf(b);x>-1&&y.splice(x,1)}a(b,y)},g=Array.isArray(n)&&p.length>1?h:d,v=Array.isArray(p)?p:[p];return(0,WP.jsx)(pc,{direction:e,disabled:t,error:(0,L1.isNotNil)(o)?o[r]:void 0,label:s,labelDescription:u,labelProps:l,name:r,onChange:(m,b)=>{g(m,b),c&&c(m.target.checked)},options:v,value:n})};$1.displayName="FormConnectorCheckboxGroup_VHS";i();i();var _P=A(ee());var v5=require("react/jsx-runtime"),z1=({customComponent:e,field:t,form:r,label:n="",labelDescription:o,labelProps:a={},...s})=>{let{name:u}=t,{errors:l}=r;return(0,v5.jsx)(ir,{error:(0,_P.isNotUndefined)(l)?l[u]:void 0,label:n,labelDescription:o,labelProps:a,name:u,children:(0,v5.jsx)(e,{field:t,form:r,...s})})};z1.displayName="FormConnectorCustomField_VHS";i();i();var JP=A(ee());i();i();var vu=require("react"),YP=A(require("styled-components")),vc=A(ee());i();var Rn=A(require("styled-components"));var UP=Rn.css`
1610
1610
  border-color: ${({theme:e})=>e.color.brandBlue500};
1611
1611
  outline: none;
1612
1612
  `,nq=Rn.css`
@@ -2726,7 +2726,7 @@
2726
2726
  visibility: hidden;
2727
2727
  width: calc(100% + 40px);
2728
2728
  }
2729
- `,z6=({align:e="left",buttonVariant:t="secondary",earliestDate:r,latestDate:n,format:o=Boe,fullWidth:a=!1,footerText:s,onChange:u,presets:l=[],range:c={end:new Date,start:new Date},shouldPreventFuture:p=!1,...d})=>{let[h,g]=(0,Ro.useState)(c),[v,m]=(0,Ro.useState)(!1),[b,y]=(0,Ro.useState)(!0),[x,w]=(0,Ro.useState)("end"),[S,E]=(0,Ro.useState)([]),D=bn();return(0,Ro.useEffect)(()=>{g(c)},[c]),(0,Ro.useEffect)(()=>{let R=()=>{m(!1),g(c)};return v&&window.addEventListener("click",R),()=>{window.removeEventListener("click",R)}},[v,c,g]),(0,He.jsxs)(Ioe,{"data-testid":"rangeselector-test-identifer",onClick:R=>R.stopPropagation(),children:[(0,He.jsx)(koe,{...d,"data-testid":"trigger",fullWidth:a,icon:(0,He.jsx)(Pe,{size:"sm",type:"caret-down"}),iconPosition:"end",inputButtonOverride:t==="input",onClick:()=>m(!v),textAlign:"left",variant:t==="input"?"tertiary":t,children:o(c)}),v?(0,He.jsxs)(Loe,{align:e,hasPresets:!!l.length,children:[(0,He.jsxs)($oe,{children:[!!l.length&&(0,He.jsx)(Hc,{"data-testid":"presets",style:{marginBottom:0,borderRight:`1px solid ${D.color.grey400}`,padding:"12px"},variant:"unbulleted",children:l.map(({label:R,value:B,tooltipText:I})=>(0,He.jsx)(Ei,{children:(0,He.jsx)(Noe,{"data-testid":R?.replaceAll(" ","_"),isActive:Ooe(h,B),onClick:()=>{g(B)},children:(0,He.jsxs)(Hoe,{"data-title":`${R}___`,children:[R," ",I!==void 0?(0,He.jsx)(Foe,{tooltipText:I}):null]})})},R))}),(0,He.jsx)(zoe,{children:(0,He.jsxs)(Moe,{children:[(0,He.jsx)(bf,{earliestDate:r,latestDate:n,onChange:R=>{g(R)},onErrorChange:E,onSelectedRangePartChange:w,range:h,shouldPreventFuture:p,width:"100%"}),(0,He.jsx)(df,{earliestDate:r,latestDate:n,onChange:R=>{g(R)},onIsValidChange:y,range:h,rangePartToShow:x,shouldPreventFuture:p})]})})]}),(0,He.jsx)(Voe,{}),(0,He.jsxs)(Goe,{children:[(0,He.jsx)("div",{children:s}),(0,He.jsxs)(uo,{align:"right",children:[(0,He.jsx)(et,{onClick:()=>{g(c),m(!1)},style:{marginLeft:0},variant:"secondary",children:"Cancel"}),(0,He.jsx)(et,{"data-testid":"apply-button",disabled:!!S.length||!b,onMouseUp:()=>{u&&u(h),m(!1)},children:"Apply"})]})]})]}):null]})};z6.displayName="RangeSelector_VHS";i();i();var tl=A(require("styled-components"));i();i();var Ha=A(require("react"),1);function G6(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function H6(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function B0(e){return e!==null&&e.length===1?e[0]:e.slice()}function O0(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function Ga(e,t){return j6(function(r,n){let o=r;return o<=n.min&&(o=n.min),o>=n.max&&(o=n.max),o}(e,t),t)}function j6(e,t){let r=(e-t.min)%t.step,n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}var W6=function(e){function t(n){var o;(o=e.call(this,n)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=u=>{u.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=u=>{o.setState({pending:!0});let l=o.getMousePosition(u),c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onTouchMove=u=>{if(u.touches.length>1)return;o.setState({pending:!0});let l=o.getTouchPosition(u);if(o.isScrolling===void 0){let d=l[0]-o.startPosition[0],h=l[1]-o.startPosition[1];o.isScrolling=Math.abs(h)>Math.abs(d)}if(o.isScrolling)return void o.setState({index:-1});let c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onKeyDown=u=>{if(!(u.ctrlKey||u.shiftKey||u.altKey||u.metaKey))switch(o.setState({pending:!0}),u.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":u.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":u.preventDefault(),o.moveUpByStep();break;case"Home":u.preventDefault(),o.move(o.props.min);break;case"End":u.preventDefault(),o.move(o.props.max);break;case"PageDown":u.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":u.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=u=>{if(!o.props.disabled&&u.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){let l=o.getMousePosition(u);o.forceValueFromPosition(l[0],c=>{o.start(c,l[0]),O0(o.getMouseEventMap())})}G6(u)}},o.onSliderClick=u=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){let l=o.getMousePosition(u),c=Ga(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=u=>l=>{o.props.disabled||(o.start(u),O0(o.getKeyDownEventMap()),G6(l))},o.createOnMouseDown=u=>l=>{if(o.props.disabled||l.button===2)return;o.setState({pending:!0});let c=o.getMousePosition(l);o.start(u,c[0]),O0(o.getMouseEventMap()),G6(l)},o.createOnTouchStart=u=>l=>{if(o.props.disabled||l.touches.length>1)return;o.setState({pending:!0});let c=o.getTouchPosition(l);o.startPosition=c,o.isScrolling=void 0,o.start(u,c[0]),O0(o.getTouchEventMap()),function(p){p.stopPropagation&&p.stopPropagation()}(l)},o.handleResize=()=>{let u=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(u)},o.renderThumb=(u,l)=>{let c=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+l+" "+(o.state.index===l?o.props.thumbActiveClassName:""),p={ref:h=>{o["thumb"+l]=h},key:o.props.thumbClassName+"-"+l,className:c,style:u,onMouseDown:o.createOnMouseDown(l),onTouchStart:o.createOnTouchStart(l),onFocus:o.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[l],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[l]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[l]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},d={index:l,value:B0(o.state.value),valueNow:o.state.value[l]};return o.props.ariaValuetext&&(p["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(d)),o.props.renderThumb(p,d)},o.renderTrack=(u,l,c)=>{let p={key:o.props.trackClassName+"-"+u,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+u,style:o.buildTrackStyle(l,o.state.upperBound-c)},d={index:u,value:B0(o.state.value)};return o.props.renderTrack(p,d)};let a=H6(n.value);a.length||(a=H6(n.defaultValue)),o.pendingResizeTimeouts=[];let s=[];for(let u=0;u<a.length;u+=1)a[u]=Ga(a[u],n),s.push(u);return o.resizeObserver=null,o.resizeElementRef=Ha.default.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:a,zIndices:s},o}Rf(t,e);var r=t.prototype;return r.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(n,o){let a=H6(n.value);return a.length?o.pending?null:{value:a.map(s=>Ga(s,n))}:null},r.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},r.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},r.onEnd=function(n){n&&function(o){Object.keys(o).forEach(a=>{typeof document<"u"&&document.removeEventListener(a,o[a],!1)})}(n),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},r.getValue=function(){return B0(this.state.value)},r.getClosestIndex=function(n){let o=Number.MAX_VALUE,a=-1,{value:s}=this.state,u=s.length;for(let l=0;l<u;l+=1){let c=this.calcOffset(s[l]),p=Math.abs(n-c);p<o&&(o=p,a=l)}return a},r.getMousePosition=function(n){return[n["page"+this.axisKey()],n["page"+this.orthogonalAxisKey()]]},r.getTouchPosition=function(n){let o=n.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},r.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},r.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},r.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},r.getValueFromPosition=function(n){let o=n/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return Ga(this.state.startValue+o,this.props)},r.getDiffPosition=function(n){let o=n-this.state.startPosition;return this.props.invert&&(o*=-1),o},r.resize=function(){let{slider:n,thumb0:o}=this;if(!n||!o)return;let a=this.sizeKey(),s=n.getBoundingClientRect(),u=n[a],l=s[this.posMaxKey()],c=s[this.posMinKey()],p=o.getBoundingClientRect()[a.replace("client","").toLowerCase()],d=u-p,h=Math.abs(l-c);this.state.upperBound===d&&this.state.sliderLength===h&&this.state.thumbSize===p||this.setState({upperBound:d,sliderLength:h,thumbSize:p})},r.calcOffset=function(n){let o=this.props.max-this.props.min;return o===0?0:(n-this.props.min)/o*this.state.upperBound},r.calcValue=function(n){return n/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},r.calcOffsetFromPosition=function(n){let{slider:o}=this,a=o.getBoundingClientRect(),s=a[this.posMaxKey()],u=a[this.posMinKey()],l=n-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?s:u));return this.props.invert&&(l=this.state.sliderLength-l),l-=this.state.thumbSize/2,l},r.forceValueFromPosition=function(n,o){let a=this.calcOffsetFromPosition(n),s=this.getClosestIndex(a),u=Ga(this.calcValue(a),this.props),l=this.state.value.slice();l[s]=u;for(let c=0;c<l.length-1;c+=1)if(l[c+1]-l[c]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:l},()=>{o(s),this.fireChangeEvent("onChange")})},r.clearPendingResizeTimeouts=function(){do{let n=this.pendingResizeTimeouts.shift();clearTimeout(n)}while(this.pendingResizeTimeouts.length)},r.start=function(n,o){let a=this["thumb"+n];a&&a.focus();let{zIndices:s}=this.state;s.splice(s.indexOf(n),1),s.push(n),this.setState(u=>({startValue:u.value[n],startPosition:o!==void 0?o:u.startPosition,index:n,zIndices:s}))},r.moveUpByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=Ga(this.props.invert&&this.props.orientation==="horizontal"?o-n:o+n,this.props);this.move(Math.min(a,this.props.max))},r.moveDownByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=Ga(this.props.invert&&this.props.orientation==="horizontal"?o+n:o-n,this.props);this.move(Math.max(a,this.props.min))},r.move=function(n){let o=this.state.value.slice(),{index:a}=this.state,{length:s}=o,u=o[a];if(n===u)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;let{pearling:l,max:c,min:p,minDistance:d}=this.props;if(!l){if(a>0){let h=o[a-1];n<h+d&&(n=h+d)}if(a<s-1){let h=o[a+1];n>h-d&&(n=h-d)}}o[a]=n,l&&s>1&&(n>u?(this.pushSucceeding(o,d,a),function(h,g,v,m){for(let b=0;b<h;b+=1){let y=m-b*v;g[h-1-b]>y&&(g[h-1-b]=y)}}(s,o,d,c)):n<u&&(this.pushPreceding(o,d,a),function(h,g,v,m){for(let b=0;b<h;b+=1){let y=m+b*v;g[b]<y&&(g[b]=y)}}(s,o,d,p))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},r.pushSucceeding=function(n,o,a){let s,u;for(s=a,u=n[s]+o;n[s+1]!==null&&u>n[s+1];s+=1,u=n[s]+o)n[s+1]=j6(u,this.props)},r.pushPreceding=function(n,o,a){for(let s=a,u=n[s]-o;n[s-1]!==null&&u<n[s-1];s-=1,u=n[s]-o)n[s-1]=j6(u,this.props)},r.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},r.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},r.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},r.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},r.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},r.fireChangeEvent=function(n){this.props[n]&&this.props[n](B0(this.state.value),this.state.index)},r.buildThumbStyle=function(n,o){let a={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return a[this.posMinKey()]=n+"px",a},r.buildTrackStyle=function(n,o){let a={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return a[this.posMinKey()]=n,a[this.posMaxKey()]=o,a},r.buildMarkStyle=function(n){var o;return(o={position:"absolute"})[this.posMinKey()]=n,o},r.renderThumbs=function(n){let{length:o}=n,a=[];for(let u=0;u<o;u+=1)a[u]=this.buildThumbStyle(n[u],u);let s=[];for(let u=0;u<o;u+=1)s[u]=this.renderThumb(a[u],u);return s},r.renderTracks=function(n){let o=[],a=n.length-1;o.push(this.renderTrack(0,0,n[0]));for(let s=0;s<a;s+=1)o.push(this.renderTrack(s+1,n[s],n[s+1]));return o.push(this.renderTrack(a+1,n[a],this.state.upperBound)),o},r.renderMarks=function(){let{marks:n}=this.props,o=this.props.max-this.props.min+1;return typeof n=="boolean"?n=Array.from({length:o}).map((a,s)=>s):typeof n=="number"&&(n=Array.from({length:o}).map((a,s)=>s).filter(a=>a%n==0)),n.map(parseFloat).sort((a,s)=>a-s).map(a=>{let s=this.calcOffset(a),u={key:a,className:this.props.markClassName,style:this.buildMarkStyle(s)};return this.props.renderMark(u)})},r.render=function(){let n=[],{value:o}=this.state,a=o.length;for(let c=0;c<a;c+=1)n[c]=this.calcOffset(o[c],c);let s=this.props.withTracks?this.renderTracks(n):null,u=this.renderThumbs(n),l=this.props.marks?this.renderMarks():null;return Ha.default.createElement("div",{ref:c=>{this.slider=c,this.resizeElementRef.current=c},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},s,u,l)},t}(Ha.default.Component);W6.displayName="ReactSlider",W6.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>Ha.default.createElement("div",e),renderTrack:e=>Ha.default.createElement("div",e),renderMark:e=>Ha.default.createElement("span",e)};var _6=W6;var bt=A(ee()),el=require("react/jsx-runtime"),tk="4px",joe=tl.css`
2729
+ `,z6=({align:e="left",buttonVariant:t="secondary",earliestDate:r,latestDate:n,format:o=Boe,fullWidth:a=!1,footerText:s,onChange:u,presets:l=[],range:c={end:new Date,start:new Date},shouldPreventFuture:p=!1,...d})=>{let[h,g]=(0,Ro.useState)(c),[v,m]=(0,Ro.useState)(!1),[b,y]=(0,Ro.useState)(!0),[x,w]=(0,Ro.useState)("end"),[S,E]=(0,Ro.useState)([]),D=bn();return(0,Ro.useEffect)(()=>{g(c)},[c]),(0,Ro.useEffect)(()=>{let R=()=>{m(!1),g(c)};return v&&window.addEventListener("click",R),()=>{window.removeEventListener("click",R)}},[v,c,g]),(0,He.jsxs)(Ioe,{"data-testid":"rangeselector-test-identifier",onClick:R=>R.stopPropagation(),children:[(0,He.jsx)(koe,{...d,"data-testid":"trigger",fullWidth:a,icon:(0,He.jsx)(Pe,{size:"sm",type:"caret-down"}),iconPosition:"end",inputButtonOverride:t==="input",onClick:()=>m(!v),textAlign:"left",variant:t==="input"?"tertiary":t,children:o(c)}),v?(0,He.jsxs)(Loe,{align:e,hasPresets:!!l.length,children:[(0,He.jsxs)($oe,{children:[!!l.length&&(0,He.jsx)(Hc,{"data-testid":"presets",style:{marginBottom:0,borderRight:`1px solid ${D.color.grey400}`,padding:"12px"},variant:"unbulleted",children:l.map(({label:R,value:B,tooltipText:I})=>(0,He.jsx)(Ei,{children:(0,He.jsx)(Noe,{"data-testid":R?.replaceAll(" ","_"),isActive:Ooe(h,B),onClick:()=>{g(B)},children:(0,He.jsxs)(Hoe,{"data-title":`${R}___`,children:[R," ",I!==void 0?(0,He.jsx)(Foe,{tooltipText:I}):null]})})},R))}),(0,He.jsx)(zoe,{children:(0,He.jsxs)(Moe,{children:[(0,He.jsx)(bf,{earliestDate:r,latestDate:n,onChange:R=>{g(R)},onErrorChange:E,onSelectedRangePartChange:w,range:h,shouldPreventFuture:p,width:"100%"}),(0,He.jsx)(df,{earliestDate:r,latestDate:n,onChange:R=>{g(R)},onIsValidChange:y,range:h,rangePartToShow:x,shouldPreventFuture:p})]})})]}),(0,He.jsx)(Voe,{}),(0,He.jsxs)(Goe,{children:[(0,He.jsx)("div",{children:s}),(0,He.jsxs)(uo,{align:"right",children:[(0,He.jsx)(et,{onClick:()=>{g(c),m(!1)},style:{marginLeft:0},variant:"secondary",children:"Cancel"}),(0,He.jsx)(et,{"data-testid":"apply-button",disabled:!!S.length||!b,onMouseUp:()=>{u&&u(h),m(!1)},children:"Apply"})]})]})]}):null]})};z6.displayName="RangeSelector_VHS";i();i();var tl=A(require("styled-components"));i();i();var Ha=A(require("react"),1);function G6(e){return e&&e.stopPropagation&&e.stopPropagation(),e&&e.preventDefault&&e.preventDefault(),!1}function H6(e){return e==null?[]:Array.isArray(e)?e.slice():[e]}function B0(e){return e!==null&&e.length===1?e[0]:e.slice()}function O0(e){Object.keys(e).forEach(t=>{typeof document<"u"&&document.addEventListener(t,e[t],!1)})}function Ga(e,t){return j6(function(r,n){let o=r;return o<=n.min&&(o=n.min),o>=n.max&&(o=n.max),o}(e,t),t)}function j6(e,t){let r=(e-t.min)%t.step,n=e-r;return 2*Math.abs(r)>=t.step&&(n+=r>0?t.step:-t.step),parseFloat(n.toFixed(5))}var W6=function(e){function t(n){var o;(o=e.call(this,n)||this).onKeyUp=()=>{o.onEnd()},o.onMouseUp=()=>{o.onEnd(o.getMouseEventMap())},o.onTouchEnd=u=>{u.preventDefault(),o.onEnd(o.getTouchEventMap())},o.onBlur=()=>{o.setState({index:-1},o.onEnd(o.getKeyDownEventMap()))},o.onMouseMove=u=>{o.setState({pending:!0});let l=o.getMousePosition(u),c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onTouchMove=u=>{if(u.touches.length>1)return;o.setState({pending:!0});let l=o.getTouchPosition(u);if(o.isScrolling===void 0){let d=l[0]-o.startPosition[0],h=l[1]-o.startPosition[1];o.isScrolling=Math.abs(h)>Math.abs(d)}if(o.isScrolling)return void o.setState({index:-1});let c=o.getDiffPosition(l[0]),p=o.getValueFromPosition(c);o.move(p)},o.onKeyDown=u=>{if(!(u.ctrlKey||u.shiftKey||u.altKey||u.metaKey))switch(o.setState({pending:!0}),u.key){case"ArrowLeft":case"ArrowDown":case"Left":case"Down":u.preventDefault(),o.moveDownByStep();break;case"ArrowRight":case"ArrowUp":case"Right":case"Up":u.preventDefault(),o.moveUpByStep();break;case"Home":u.preventDefault(),o.move(o.props.min);break;case"End":u.preventDefault(),o.move(o.props.max);break;case"PageDown":u.preventDefault(),o.moveDownByStep(o.props.pageFn(o.props.step));break;case"PageUp":u.preventDefault(),o.moveUpByStep(o.props.pageFn(o.props.step))}},o.onSliderMouseDown=u=>{if(!o.props.disabled&&u.button!==2){if(o.setState({pending:!0}),!o.props.snapDragDisabled){let l=o.getMousePosition(u);o.forceValueFromPosition(l[0],c=>{o.start(c,l[0]),O0(o.getMouseEventMap())})}G6(u)}},o.onSliderClick=u=>{if(!o.props.disabled&&o.props.onSliderClick&&!o.hasMoved){let l=o.getMousePosition(u),c=Ga(o.calcValue(o.calcOffsetFromPosition(l[0])),o.props);o.props.onSliderClick(c)}},o.createOnKeyDown=u=>l=>{o.props.disabled||(o.start(u),O0(o.getKeyDownEventMap()),G6(l))},o.createOnMouseDown=u=>l=>{if(o.props.disabled||l.button===2)return;o.setState({pending:!0});let c=o.getMousePosition(l);o.start(u,c[0]),O0(o.getMouseEventMap()),G6(l)},o.createOnTouchStart=u=>l=>{if(o.props.disabled||l.touches.length>1)return;o.setState({pending:!0});let c=o.getTouchPosition(l);o.startPosition=c,o.isScrolling=void 0,o.start(u,c[0]),O0(o.getTouchEventMap()),function(p){p.stopPropagation&&p.stopPropagation()}(l)},o.handleResize=()=>{let u=window.setTimeout(()=>{o.pendingResizeTimeouts.shift(),o.resize()},0);o.pendingResizeTimeouts.push(u)},o.renderThumb=(u,l)=>{let c=o.props.thumbClassName+" "+o.props.thumbClassName+"-"+l+" "+(o.state.index===l?o.props.thumbActiveClassName:""),p={ref:h=>{o["thumb"+l]=h},key:o.props.thumbClassName+"-"+l,className:c,style:u,onMouseDown:o.createOnMouseDown(l),onTouchStart:o.createOnTouchStart(l),onFocus:o.createOnKeyDown(l),tabIndex:0,role:"slider","aria-orientation":o.props.orientation,"aria-valuenow":o.state.value[l],"aria-valuemin":o.props.min,"aria-valuemax":o.props.max,"aria-label":Array.isArray(o.props.ariaLabel)?o.props.ariaLabel[l]:o.props.ariaLabel,"aria-labelledby":Array.isArray(o.props.ariaLabelledby)?o.props.ariaLabelledby[l]:o.props.ariaLabelledby,"aria-disabled":o.props.disabled},d={index:l,value:B0(o.state.value),valueNow:o.state.value[l]};return o.props.ariaValuetext&&(p["aria-valuetext"]=typeof o.props.ariaValuetext=="string"?o.props.ariaValuetext:o.props.ariaValuetext(d)),o.props.renderThumb(p,d)},o.renderTrack=(u,l,c)=>{let p={key:o.props.trackClassName+"-"+u,className:o.props.trackClassName+" "+o.props.trackClassName+"-"+u,style:o.buildTrackStyle(l,o.state.upperBound-c)},d={index:u,value:B0(o.state.value)};return o.props.renderTrack(p,d)};let a=H6(n.value);a.length||(a=H6(n.defaultValue)),o.pendingResizeTimeouts=[];let s=[];for(let u=0;u<a.length;u+=1)a[u]=Ga(a[u],n),s.push(u);return o.resizeObserver=null,o.resizeElementRef=Ha.default.createRef(),o.state={index:-1,upperBound:0,sliderLength:0,value:a,zIndices:s},o}Rf(t,e);var r=t.prototype;return r.componentDidMount=function(){typeof window<"u"&&(this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.resizeElementRef.current),this.resize())},t.getDerivedStateFromProps=function(n,o){let a=H6(n.value);return a.length?o.pending?null:{value:a.map(s=>Ga(s,n))}:null},r.componentDidUpdate=function(){this.state.upperBound===0&&this.resize()},r.componentWillUnmount=function(){this.clearPendingResizeTimeouts(),this.resizeObserver&&this.resizeObserver.disconnect()},r.onEnd=function(n){n&&function(o){Object.keys(o).forEach(a=>{typeof document<"u"&&document.removeEventListener(a,o[a],!1)})}(n),this.hasMoved&&this.fireChangeEvent("onAfterChange"),this.setState({pending:!1}),this.hasMoved=!1},r.getValue=function(){return B0(this.state.value)},r.getClosestIndex=function(n){let o=Number.MAX_VALUE,a=-1,{value:s}=this.state,u=s.length;for(let l=0;l<u;l+=1){let c=this.calcOffset(s[l]),p=Math.abs(n-c);p<o&&(o=p,a=l)}return a},r.getMousePosition=function(n){return[n["page"+this.axisKey()],n["page"+this.orthogonalAxisKey()]]},r.getTouchPosition=function(n){let o=n.touches[0];return[o["page"+this.axisKey()],o["page"+this.orthogonalAxisKey()]]},r.getKeyDownEventMap=function(){return{keydown:this.onKeyDown,keyup:this.onKeyUp,focusout:this.onBlur}},r.getMouseEventMap=function(){return{mousemove:this.onMouseMove,mouseup:this.onMouseUp}},r.getTouchEventMap=function(){return{touchmove:this.onTouchMove,touchend:this.onTouchEnd}},r.getValueFromPosition=function(n){let o=n/(this.state.sliderLength-this.state.thumbSize)*(this.props.max-this.props.min);return Ga(this.state.startValue+o,this.props)},r.getDiffPosition=function(n){let o=n-this.state.startPosition;return this.props.invert&&(o*=-1),o},r.resize=function(){let{slider:n,thumb0:o}=this;if(!n||!o)return;let a=this.sizeKey(),s=n.getBoundingClientRect(),u=n[a],l=s[this.posMaxKey()],c=s[this.posMinKey()],p=o.getBoundingClientRect()[a.replace("client","").toLowerCase()],d=u-p,h=Math.abs(l-c);this.state.upperBound===d&&this.state.sliderLength===h&&this.state.thumbSize===p||this.setState({upperBound:d,sliderLength:h,thumbSize:p})},r.calcOffset=function(n){let o=this.props.max-this.props.min;return o===0?0:(n-this.props.min)/o*this.state.upperBound},r.calcValue=function(n){return n/this.state.upperBound*(this.props.max-this.props.min)+this.props.min},r.calcOffsetFromPosition=function(n){let{slider:o}=this,a=o.getBoundingClientRect(),s=a[this.posMaxKey()],u=a[this.posMinKey()],l=n-(window["page"+this.axisKey()+"Offset"]+(this.props.invert?s:u));return this.props.invert&&(l=this.state.sliderLength-l),l-=this.state.thumbSize/2,l},r.forceValueFromPosition=function(n,o){let a=this.calcOffsetFromPosition(n),s=this.getClosestIndex(a),u=Ga(this.calcValue(a),this.props),l=this.state.value.slice();l[s]=u;for(let c=0;c<l.length-1;c+=1)if(l[c+1]-l[c]<this.props.minDistance)return;this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0,this.setState({value:l},()=>{o(s),this.fireChangeEvent("onChange")})},r.clearPendingResizeTimeouts=function(){do{let n=this.pendingResizeTimeouts.shift();clearTimeout(n)}while(this.pendingResizeTimeouts.length)},r.start=function(n,o){let a=this["thumb"+n];a&&a.focus();let{zIndices:s}=this.state;s.splice(s.indexOf(n),1),s.push(n),this.setState(u=>({startValue:u.value[n],startPosition:o!==void 0?o:u.startPosition,index:n,zIndices:s}))},r.moveUpByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=Ga(this.props.invert&&this.props.orientation==="horizontal"?o-n:o+n,this.props);this.move(Math.min(a,this.props.max))},r.moveDownByStep=function(n){n===void 0&&(n=this.props.step);let o=this.state.value[this.state.index],a=Ga(this.props.invert&&this.props.orientation==="horizontal"?o+n:o-n,this.props);this.move(Math.max(a,this.props.min))},r.move=function(n){let o=this.state.value.slice(),{index:a}=this.state,{length:s}=o,u=o[a];if(n===u)return;this.hasMoved||this.fireChangeEvent("onBeforeChange"),this.hasMoved=!0;let{pearling:l,max:c,min:p,minDistance:d}=this.props;if(!l){if(a>0){let h=o[a-1];n<h+d&&(n=h+d)}if(a<s-1){let h=o[a+1];n>h-d&&(n=h-d)}}o[a]=n,l&&s>1&&(n>u?(this.pushSucceeding(o,d,a),function(h,g,v,m){for(let b=0;b<h;b+=1){let y=m-b*v;g[h-1-b]>y&&(g[h-1-b]=y)}}(s,o,d,c)):n<u&&(this.pushPreceding(o,d,a),function(h,g,v,m){for(let b=0;b<h;b+=1){let y=m+b*v;g[b]<y&&(g[b]=y)}}(s,o,d,p))),this.setState({value:o},this.fireChangeEvent.bind(this,"onChange"))},r.pushSucceeding=function(n,o,a){let s,u;for(s=a,u=n[s]+o;n[s+1]!==null&&u>n[s+1];s+=1,u=n[s]+o)n[s+1]=j6(u,this.props)},r.pushPreceding=function(n,o,a){for(let s=a,u=n[s]-o;n[s-1]!==null&&u<n[s-1];s-=1,u=n[s]-o)n[s-1]=j6(u,this.props)},r.axisKey=function(){return this.props.orientation==="vertical"?"Y":"X"},r.orthogonalAxisKey=function(){return this.props.orientation==="vertical"?"X":"Y"},r.posMinKey=function(){return this.props.orientation==="vertical"?this.props.invert?"bottom":"top":this.props.invert?"right":"left"},r.posMaxKey=function(){return this.props.orientation==="vertical"?this.props.invert?"top":"bottom":this.props.invert?"left":"right"},r.sizeKey=function(){return this.props.orientation==="vertical"?"clientHeight":"clientWidth"},r.fireChangeEvent=function(n){this.props[n]&&this.props[n](B0(this.state.value),this.state.index)},r.buildThumbStyle=function(n,o){let a={position:"absolute",touchAction:"none",willChange:this.state.index>=0?this.posMinKey():void 0,zIndex:this.state.zIndices.indexOf(o)+1};return a[this.posMinKey()]=n+"px",a},r.buildTrackStyle=function(n,o){let a={position:"absolute",willChange:this.state.index>=0?this.posMinKey()+","+this.posMaxKey():void 0};return a[this.posMinKey()]=n,a[this.posMaxKey()]=o,a},r.buildMarkStyle=function(n){var o;return(o={position:"absolute"})[this.posMinKey()]=n,o},r.renderThumbs=function(n){let{length:o}=n,a=[];for(let u=0;u<o;u+=1)a[u]=this.buildThumbStyle(n[u],u);let s=[];for(let u=0;u<o;u+=1)s[u]=this.renderThumb(a[u],u);return s},r.renderTracks=function(n){let o=[],a=n.length-1;o.push(this.renderTrack(0,0,n[0]));for(let s=0;s<a;s+=1)o.push(this.renderTrack(s+1,n[s],n[s+1]));return o.push(this.renderTrack(a+1,n[a],this.state.upperBound)),o},r.renderMarks=function(){let{marks:n}=this.props,o=this.props.max-this.props.min+1;return typeof n=="boolean"?n=Array.from({length:o}).map((a,s)=>s):typeof n=="number"&&(n=Array.from({length:o}).map((a,s)=>s).filter(a=>a%n==0)),n.map(parseFloat).sort((a,s)=>a-s).map(a=>{let s=this.calcOffset(a),u={key:a,className:this.props.markClassName,style:this.buildMarkStyle(s)};return this.props.renderMark(u)})},r.render=function(){let n=[],{value:o}=this.state,a=o.length;for(let c=0;c<a;c+=1)n[c]=this.calcOffset(o[c],c);let s=this.props.withTracks?this.renderTracks(n):null,u=this.renderThumbs(n),l=this.props.marks?this.renderMarks():null;return Ha.default.createElement("div",{ref:c=>{this.slider=c,this.resizeElementRef.current=c},style:{position:"relative"},className:this.props.className+(this.props.disabled?" disabled":""),onMouseDown:this.onSliderMouseDown,onClick:this.onSliderClick},s,u,l)},t}(Ha.default.Component);W6.displayName="ReactSlider",W6.defaultProps={min:0,max:100,step:1,pageFn:e=>10*e,minDistance:0,defaultValue:0,orientation:"horizontal",className:"slider",thumbClassName:"thumb",thumbActiveClassName:"active",trackClassName:"track",markClassName:"mark",withTracks:!0,pearling:!1,disabled:!1,snapDragDisabled:!1,invert:!1,marks:[],renderThumb:e=>Ha.default.createElement("div",e),renderTrack:e=>Ha.default.createElement("div",e),renderMark:e=>Ha.default.createElement("span",e)};var _6=W6;var bt=A(ee()),el=require("react/jsx-runtime"),tk="4px",joe=tl.css`
2730
2730
  opacity: 0.5;
2731
2731
 
2732
2732
  & * {