mirror of
https://github.com/owncast/owncast.git
synced 2025-01-07 09:07:31 +03:00
1 line
No EOL
25 KiB
JavaScript
Vendored
1 line
No EOL
25 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7042],{86560:function(e,n,t){t.d(n,{default:function(){return O}});var r=t(87462),a=t(4942),o=t(67371),l=t(93967),c=t.n(l),i=t(74902),u=t(15671),s=t(43144),d=t(32531),f=t(29388),v=t(71002),p=t(22610),m=t(67294),h=t(96774),b=t.n(h),y=t(45987),g=t(89046),C=t(97685),x=m.forwardRef(function(e,n){var t,r=e.prefixCls,o=e.forceRender,l=e.className,i=e.style,u=e.children,s=e.isActive,d=e.role,f=m.useState(s||o),v=(0,C.Z)(f,2),p=v[0],h=v[1];return(m.useEffect(function(){(o||s)&&h(!0)},[o,s]),p)?m.createElement("div",{ref:n,className:c()("".concat(r,"-content"),(t={},(0,a.Z)(t,"".concat(r,"-content-active"),s),(0,a.Z)(t,"".concat(r,"-content-inactive"),!s),t),l),style:i,role:d},m.createElement("div",{className:"".concat(r,"-content-box")},u)):null});x.displayName="PanelContent";var Z=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],E=function(e){(0,d.Z)(t,e);var n=(0,f.Z)(t);function t(){var e;(0,u.Z)(this,t);for(var r=arguments.length,a=Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=n.call.apply(n,[this].concat(a))).onItemClick=function(){var n=e.props,t=n.onItemClick,r=n.panelKey;"function"==typeof t&&t(r)},e.handleKeyPress=function(n){("Enter"===n.key||13===n.keyCode||13===n.which)&&e.onItemClick()},e.renderIcon=function(){var n=e.props,t=n.showArrow,r=n.expandIcon,a=n.prefixCls,o=n.collapsible;if(!t)return null;var l="function"==typeof r?r(e.props):m.createElement("i",{className:"arrow"});return l&&m.createElement("div",{className:"".concat(a,"-expand-icon"),onClick:"header"===o||"icon"===o?e.onItemClick:null},l)},e.renderTitle=function(){var n=e.props,t=n.header,r=n.prefixCls,a=n.collapsible;return m.createElement("span",{className:"".concat(r,"-header-text"),onClick:"header"===a?e.onItemClick:null},t)},e}return(0,s.Z)(t,[{key:"shouldComponentUpdate",value:function(e){return!b()(this.props,e)}},{key:"render",value:function(){var e,n,t=this.props,o=t.className,l=t.id,i=t.style,u=t.prefixCls,s=t.headerClass,d=t.children,f=t.isActive,v=t.destroyInactivePanel,p=t.accordion,h=t.forceRender,b=t.openMotion,C=t.extra,E=t.collapsible,k=(0,y.Z)(t,Z),w="disabled"===E,N="header"===E,M="icon"===E,I=c()((e={},(0,a.Z)(e,"".concat(u,"-item"),!0),(0,a.Z)(e,"".concat(u,"-item-active"),f),(0,a.Z)(e,"".concat(u,"-item-disabled"),w),e),o),P={className:c()("".concat(u,"-header"),(n={},(0,a.Z)(n,s,s),(0,a.Z)(n,"".concat(u,"-header-collapsible-only"),N),(0,a.Z)(n,"".concat(u,"-icon-collapsible-only"),M),n)),"aria-expanded":f,"aria-disabled":w,onKeyPress:this.handleKeyPress};return N||M||(P.onClick=this.onItemClick,P.role=p?"tab":"button",P.tabIndex=w?-1:0),delete k.header,delete k.panelKey,delete k.onItemClick,delete k.showArrow,delete k.expandIcon,m.createElement("div",(0,r.Z)({},k,{className:I,style:i,id:l}),m.createElement("div",P,this.renderIcon(),this.renderTitle(),null!=C&&"boolean"!=typeof C&&m.createElement("div",{className:"".concat(u,"-extra")},C)),m.createElement(g.default,(0,r.Z)({visible:f,leavedClassName:"".concat(u,"-content-hidden")},b,{forceRender:h,removeOnLeave:v}),function(e,n){var t=e.className,r=e.style;return m.createElement(x,{ref:n,prefixCls:u,className:t,style:r,isActive:f,forceRender:h,role:p?"tabpanel":null},d)}))}}]),t}(m.Component);function k(e){var n=e;if(!Array.isArray(n)){var t=(0,v.Z)(n);n="number"===t||"string"===t?[n]:[]}return n.map(function(e){return String(e)})}E.defaultProps={showArrow:!0,isActive:!1,onItemClick:function(){},headerClass:"",forceRender:!1};var w=function(e){(0,d.Z)(t,e);var n=(0,f.Z)(t);function t(e){(0,u.Z)(this,t),(r=n.call(this,e)).onClickItem=function(e){var n=r.state.activeKey;if(r.props.accordion)n=n[0]===e?[]:[e];else{var t=(n=(0,i.Z)(n)).indexOf(e);t>-1?n.splice(t,1):n.push(e)}r.setActiveKey(n)},r.getNewChild=function(e,n){if(!e)return null;var t=r.state.activeKey,a=r.props,o=a.prefixCls,l=a.openMotion,c=a.accordion,i=a.destroyInactivePanel,u=a.expandIcon,s=a.collapsible,d=e.key||String(n),f=e.props,v=f.header,p=f.headerClass,h=f.destroyInactivePanel,b=f.collapsible,y=!1;y=c?t[0]===d:t.indexOf(d)>-1;var g=null!=b?b:s,C={key:d,panelKey:d,header:v,headerClass:p,isActive:y,prefixCls:o,destroyInactivePanel:null!=h?h:i,openMotion:l,accordion:c,children:e.props.children,onItemClick:"disabled"===g?null:r.onClickItem,expandIcon:u,collapsible:g};return"string"==typeof e.type?e:(Object.keys(C).forEach(function(e){void 0===C[e]&&delete C[e]}),m.cloneElement(e,C))},r.getItems=function(){var e=r.props.children;return(0,p.Z)(e).map(r.getNewChild)},r.setActiveKey=function(e){"activeKey"in r.props||r.setState({activeKey:e}),r.props.onChange(r.props.accordion?e[0]:e)};var r,a=e.activeKey,o=e.defaultActiveKey;return"activeKey"in e&&(o=a),r.state={activeKey:k(o)},r}return(0,s.Z)(t,[{key:"shouldComponentUpdate",value:function(e,n){return!b()(this.props,e)||!b()(this.state,n)}},{key:"render",value:function(){var e,n=this.props,t=n.prefixCls,r=n.className,o=n.style,l=n.accordion,i=c()((e={},(0,a.Z)(e,t,!0),(0,a.Z)(e,r,!!r),e));return m.createElement("div",{className:i,style:o,role:l?"tablist":null},this.getItems())}}],[{key:"getDerivedStateFromProps",value:function(e){var n={};return"activeKey"in e&&(n.activeKey=k(e.activeKey)),n}}]),t}(m.Component);w.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},w.Panel=E,w.Panel;var N=t(97485),M=t(17399),I=t(99293),P=t(84476),S=function(e){var n,t=m.useContext(M.E_),l=t.getPrefixCls,i=t.direction,u=e.prefixCls,s=e.className,d=e.bordered,f=e.ghost,v=e.expandIconPosition,h=void 0===v?"start":v,b=l("collapse",u),y=m.useMemo(function(){return"left"===h?"start":"right"===h?"end":h},[h]),g=c()("".concat(b,"-icon-position-").concat(y),(0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(b,"-borderless"),!(void 0===d||d)),"".concat(b,"-rtl"),"rtl"===i),"".concat(b,"-ghost"),!!f),void 0===s?"":s),C=(0,r.Z)((0,r.Z)({},I.ZP),{motionAppear:!1,leavedClassName:"".concat(b,"-content-hidden")});return m.createElement(w,(0,r.Z)({openMotion:C},e,{expandIcon:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.expandIcon,r=t?t(n):m.createElement(o.Z,{rotate:n.isActive?90:void 0});return(0,P.Tm)(r,function(){return{className:c()(r.props.className,"".concat(b,"-arrow"))}})},prefixCls:b,className:g}),(n=e.children,(0,p.Z)(n).map(function(e,n){var t;if(null===(t=e.props)||void 0===t?void 0:t.disabled){var a=e.key||String(n),o=e.props,l=o.disabled,c=o.collapsible,i=(0,r.Z)((0,r.Z)({},(0,N.Z)(e.props,["disabled"])),{key:a,collapsible:null!=c?c:l?"disabled":void 0});return(0,P.Tm)(e,i)}return e})))};S.Panel=function(e){var n=m.useContext(M.E_).getPrefixCls,t=e.prefixCls,o=e.className,l=e.showArrow,i=n("collapse",t),u=c()((0,a.Z)({},"".concat(i,"-no-arrow"),!(void 0===l||l)),void 0===o?"":o);return m.createElement(w.Panel,(0,r.Z)({},e,{prefixCls:i,className:u}))};var O=S},72261:function(e,n,t){t.d(n,{Z:function(){return D}});var r=t(71002),a=t(4942),o=t(87462),l=t(97685),c=t(93967),i=t.n(c),u=t(74902),s=t(67294),d=t(96774),f=t.n(d),v=t(22720),p=t(45987),m=t(1413),h=t(77524),b=s.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0});function y(e,n,t,r){var a=(n-t)/(r-t),o={};switch(e){case"rtl":o.right="".concat(100*a,"%"),o.transform="translateX(50%)";break;case"btt":o.bottom="".concat(100*a,"%"),o.transform="translateY(50%)";break;case"ttb":o.top="".concat(100*a,"%"),o.transform="translateY(-50%)";break;default:o.left="".concat(100*a,"%"),o.transform="translateX(-50%)"}return o}function g(e,n){return Array.isArray(e)?e[n]:e}var C=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"],x=s.forwardRef(function(e,n){var t,r,l=e.prefixCls,c=e.value,u=e.valueIndex,d=e.onStartMove,f=e.style,v=e.render,x=e.dragging,Z=e.onOffsetChange,E=(0,p.Z)(e,C),k=s.useContext(b),w=k.min,N=k.max,M=k.direction,I=k.disabled,P=k.range,S=k.tabIndex,O=k.ariaLabelForHandle,R=k.ariaLabelledByForHandle,A=k.ariaValueTextFormatterForHandle,F="".concat(l,"-handle"),K=function(e){I||d(e,u)},L=y(M,c,w,N),T=s.createElement("div",(0,o.Z)({ref:n,className:i()(F,(t={},(0,a.Z)(t,"".concat(F,"-").concat(u+1),P),(0,a.Z)(t,"".concat(F,"-dragging"),x),t)),style:(0,m.Z)((0,m.Z)({},L),f),onMouseDown:K,onTouchStart:K,onKeyDown:function(e){if(!I){var n=null;switch(e.which||e.keyCode){case h.Z.LEFT:n="ltr"===M||"btt"===M?-1:1;break;case h.Z.RIGHT:n="ltr"===M||"btt"===M?1:-1;break;case h.Z.UP:n="ttb"!==M?1:-1;break;case h.Z.DOWN:n="ttb"!==M?-1:1;break;case h.Z.HOME:n="min";break;case h.Z.END:n="max";break;case h.Z.PAGE_UP:n=2;break;case h.Z.PAGE_DOWN:n=-2}null!==n&&(e.preventDefault(),Z(n,u))}},tabIndex:I?null:g(S,u),role:"slider","aria-valuemin":w,"aria-valuemax":N,"aria-valuenow":c,"aria-disabled":I,"aria-label":g(O,u),"aria-labelledby":g(R,u),"aria-valuetext":null===(r=g(A,u))||void 0===r?void 0:r(c)},E));return v&&(T=v(T,{index:u,prefixCls:l,value:c,dragging:x})),T}),Z=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"],E=s.forwardRef(function(e,n){var t=e.prefixCls,r=e.style,a=e.onStartMove,l=e.onOffsetChange,c=e.values,i=e.handleRender,u=e.draggingIndex,d=(0,p.Z)(e,Z),f=s.useRef({});return s.useImperativeHandle(n,function(){return{focus:function(e){var n;null===(n=f.current[e])||void 0===n||n.focus()}}}),s.createElement(s.Fragment,null,c.map(function(e,n){return s.createElement(x,(0,o.Z)({ref:function(e){e?f.current[n]=e:delete f.current[n]},dragging:u===n,prefixCls:t,style:g(r,n),key:n,value:e,valueIndex:n,onStartMove:a,onOffsetChange:l,render:i},d))}))});function k(e){var n="touches"in e?e.touches[0]:e;return{pageX:n.pageX,pageY:n.pageY}}function w(e){var n=e.prefixCls,t=e.style,r=e.start,a=e.end,o=e.index,l=e.onStartMove,c=s.useContext(b),u=c.direction,d=c.min,f=c.max,v=c.disabled,p=c.range,h="".concat(n,"-track"),y=(r-d)/(f-d),g=(a-d)/(f-d),C=function(e){!v&&l&&l(e,-1)},x={};switch(u){case"rtl":x.right="".concat(100*y,"%"),x.width="".concat(100*g-100*y,"%");break;case"btt":x.bottom="".concat(100*y,"%"),x.height="".concat(100*g-100*y,"%");break;case"ttb":x.top="".concat(100*y,"%"),x.height="".concat(100*g-100*y,"%");break;default:x.left="".concat(100*y,"%"),x.width="".concat(100*g-100*y,"%")}return s.createElement("div",{className:i()(h,p&&"".concat(h,"-").concat(o+1)),style:(0,m.Z)((0,m.Z)({},x),t),onMouseDown:C,onTouchStart:C})}function N(e){var n=e.prefixCls,t=e.style,r=e.values,a=e.startPoint,o=e.onStartMove,l=s.useContext(b),c=l.included,i=l.range,u=l.min,d=s.useMemo(function(){if(!i){if(0===r.length)return[];var e=null!=a?a:u,n=r[0];return[{start:Math.min(e,n),end:Math.max(e,n)}]}for(var t=[],o=0;o<r.length-1;o+=1)t.push({start:r[o],end:r[o+1]});return t},[r,i,a,u]);return c?d.map(function(e,r){var a=e.start,l=e.end;return s.createElement(w,{index:r,prefixCls:n,style:g(t,r),start:a,end:l,key:r,onStartMove:o})}):null}function M(e){var n=e.prefixCls,t=e.style,r=e.children,o=e.value,l=e.onClick,c=s.useContext(b),u=c.min,d=c.max,f=c.direction,v=c.includedStart,p=c.includedEnd,h=c.included,g="".concat(n,"-text"),C=y(f,o,u,d);return s.createElement("span",{className:i()(g,(0,a.Z)({},"".concat(g,"-active"),h&&v<=o&&o<=p)),style:(0,m.Z)((0,m.Z)({},C),t),onMouseDown:function(e){e.stopPropagation()},onClick:function(){l(o)}},r)}function I(e){var n=e.prefixCls,t=e.marks,r=e.onClick,a="".concat(n,"-mark");return t.length?s.createElement("div",{className:a},t.map(function(e){var n=e.value,t=e.style,o=e.label;return s.createElement(M,{key:n,prefixCls:a,style:t,value:n,onClick:r},o)})):null}function P(e){var n=e.prefixCls,t=e.value,r=e.style,o=e.activeStyle,l=s.useContext(b),c=l.min,u=l.max,d=l.direction,f=l.included,v=l.includedStart,p=l.includedEnd,h="".concat(n,"-dot"),g=f&&v<=t&&t<=p,C=(0,m.Z)((0,m.Z)({},y(d,t,c,u)),"function"==typeof r?r(t):r);return g&&(C=(0,m.Z)((0,m.Z)({},C),"function"==typeof o?o(t):o)),s.createElement("span",{className:i()(h,(0,a.Z)({},"".concat(h,"-active"),g)),style:C})}function S(e){var n=e.prefixCls,t=e.marks,r=e.dots,a=e.style,o=e.activeStyle,l=s.useContext(b),c=l.min,i=l.max,u=l.step,d=s.useMemo(function(){var e=new Set;if(t.forEach(function(n){e.add(n.value)}),r&&null!==u)for(var n=c;n<=i;)e.add(n),n+=u;return Array.from(e)},[c,i,u,r,t]);return s.createElement("div",{className:"".concat(n,"-step")},d.map(function(e){return s.createElement(P,{prefixCls:n,key:e,value:e,style:a,activeStyle:o})}))}t(92045);var O=s.forwardRef(function(e,n){var t,o,c,d,p,m,h,y,g,C,x,Z,w,M,P,O,R,A,F,K,L,T,D,H,j,_,B,V,X,Y,z=e.prefixCls,G=void 0===z?"rc-slider":z,U=e.className,W=e.style,Q=e.disabled,q=void 0!==Q&&Q,J=e.autoFocus,$=e.onFocus,ee=e.onBlur,en=e.min,et=void 0===en?0:en,er=e.max,ea=void 0===er?100:er,eo=e.step,el=void 0===eo?1:eo,ec=e.value,ei=e.defaultValue,eu=e.range,es=e.count,ed=e.onChange,ef=e.onBeforeChange,ev=e.onAfterChange,ep=e.allowCross,em=e.pushable,eh=void 0!==em&&em,eb=e.draggableTrack,ey=e.reverse,eg=e.vertical,eC=e.included,ex=void 0===eC||eC,eZ=e.startPoint,eE=e.trackStyle,ek=e.handleStyle,ew=e.railStyle,eN=e.dotStyle,eM=e.activeDotStyle,eI=e.marks,eP=e.dots,eS=e.handleRender,eO=e.tabIndex,eR=void 0===eO?0:eO,eA=e.ariaLabelForHandle,eF=e.ariaLabelledByForHandle,eK=e.ariaValueTextFormatterForHandle,eL=s.useRef(),eT=s.useRef(),eD=s.useMemo(function(){return eg?ey?"ttb":"btt":ey?"rtl":"ltr"},[ey,eg]),eH=s.useMemo(function(){return isFinite(et)?et:0},[et]),ej=s.useMemo(function(){return isFinite(ea)?ea:100},[ea]),e_=s.useMemo(function(){return null!==el&&el<=0?1:el},[el]),eB=s.useMemo(function(){return!0===eh?e_:eh>=0&&eh},[eh,e_]),eV=s.useMemo(function(){return Object.keys(eI||{}).map(function(e){var n=eI[e],t={value:Number(e)};return n&&"object"===(0,r.Z)(n)&&!s.isValidElement(n)&&("label"in n||"style"in n)?(t.style=n.style,t.label=n.label):t.label=n,t}).filter(function(e){var n=e.label;return n||"number"==typeof n}).sort(function(e,n){return e.value-n.value})},[eI]),eX=(t=void 0===ep||ep,o=s.useCallback(function(e){return isFinite(e),Math.max(eH,Math.min(ej,e))},[eH,ej]),c=s.useCallback(function(e){if(null!==e_){var n=eH+Math.round((o(e)-eH)/e_)*e_,t=function(e){return(String(e).split(".")[1]||"").length},r=Math.max(t(e_),t(ej),t(eH)),a=Number(n.toFixed(r));return eH<=a&&a<=ej?a:null}return null},[e_,eH,ej,o]),d=s.useCallback(function(e){var n=o(e),t=eV.map(function(e){return e.value});null!==e_&&t.push(c(e)),t.push(eH,ej);var r=t[0],a=ej-eH;return t.forEach(function(e){var t=Math.abs(n-e);t<=a&&(r=e,a=t)}),r},[eH,ej,eV,e_,o,c]),p=function e(n,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit";if("number"==typeof t){var o,l=n[r],i=l+t,s=[];eV.forEach(function(e){s.push(e.value)}),s.push(eH,ej),s.push(c(l));var d=t>0?1:-1;"unit"===a?s.push(c(l+d*e_)):s.push(c(i)),s=s.filter(function(e){return null!==e}).filter(function(e){return t<0?e<=l:e>=l}),"unit"===a&&(s=s.filter(function(e){return e!==l}));var f="unit"===a?l:i,v=Math.abs((o=s[0])-f);if(s.forEach(function(e){var n=Math.abs(e-f);n<v&&(o=e,v=n)}),void 0===o)return t<0?eH:ej;if("dist"===a)return o;if(Math.abs(t)>1){var p=(0,u.Z)(n);return p[r]=o,e(p,t-d,r,a)}return o}return"min"===t?eH:"max"===t?ej:void 0},m=function(e,n,t){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",a=e[t],o=p(e,n,t,r);return{value:o,changed:o!==a}},h=function(e){return null===eB&&0===e||"number"==typeof eB&&e<eB},[d,function(e,n,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unit",o=e.map(d),l=o[r],c=p(o,n,r,a);if(o[r]=c,!1===t){var i=eB||0;r>0&&o[r-1]!==l&&(o[r]=Math.max(o[r],o[r-1]+i)),r<o.length-1&&o[r+1]!==l&&(o[r]=Math.min(o[r],o[r+1]-i))}else if("number"==typeof eB||null===eB){for(var u=r+1;u<o.length;u+=1)for(var s=!0;h(o[u]-o[u-1])&&s;){var f=m(o,1,u);o[u]=f.value,s=f.changed}for(var v=r;v>0;v-=1)for(var b=!0;h(o[v]-o[v-1])&&b;){var y=m(o,-1,v-1);o[v-1]=y.value,b=y.changed}for(var g=o.length-1;g>0;g-=1)for(var C=!0;h(o[g]-o[g-1])&&C;){var x=m(o,-1,g-1);o[g-1]=x.value,C=x.changed}for(var Z=0;Z<o.length-1;Z+=1)for(var E=!0;h(o[Z+1]-o[Z])&&E;){var k=m(o,1,Z+1);o[Z+1]=k.value,E=k.changed}}return{value:o[r],values:o}}]),eY=(0,l.Z)(eX,2),ez=eY[0],eG=eY[1],eU=(0,v.Z)(ei,{value:ec}),eW=(0,l.Z)(eU,2),eQ=eW[0],eq=eW[1],eJ=s.useMemo(function(){var e=null==eQ?[]:Array.isArray(eQ)?eQ:[eQ],n=(0,l.Z)(e,1)[0],t=void 0===n?eH:n,r=null===eQ?[]:[t];if(eu){if(r=(0,u.Z)(e),es||void 0===eQ){var a,o=es>=0?es+1:2;for(r=r.slice(0,o);r.length<o;)r.push(null!==(a=r[r.length-1])&&void 0!==a?a:eH)}r.sort(function(e,n){return e-n})}return r.forEach(function(e,n){r[n]=ez(e)}),r},[eQ,eu,eH,es,ez]),e$=s.useRef(eJ);e$.current=eJ;var e0=function(e){return eu?e:e[0]},e1=function(e){var n=(0,u.Z)(e).sort(function(e,n){return e-n});ed&&!f()(n,e$.current)&&ed(e0(n)),eq(n)},e2=function(e){if(!q){var n=0,t=ej-eH;eJ.forEach(function(r,a){var o=Math.abs(e-r);o<=t&&(t=o,n=a)});var r=(0,u.Z)(eJ);r[n]=e,eu&&!eJ.length&&void 0===es&&r.push(e),null==ef||ef(e0(r)),e1(r),null==ev||ev(e0(r))}},e7=s.useState(null),e9=(0,l.Z)(e7,2),e4=e9[0],e3=e9[1];s.useEffect(function(){if(null!==e4){var e=eJ.indexOf(e4);e>=0&&eL.current.focus(e)}e3(null)},[e4]);var e6=s.useMemo(function(){return(!eb||null!==e_)&&eb},[eb,e_]),e5=(y=function(){null==ev||ev(e0(e$.current))},g=s.useState(null),x=(C=(0,l.Z)(g,2))[0],Z=C[1],w=s.useState(-1),P=(M=(0,l.Z)(w,2))[0],O=M[1],R=s.useState(eJ),F=(A=(0,l.Z)(R,2))[0],K=A[1],L=s.useState(eJ),D=(T=(0,l.Z)(L,2))[0],H=T[1],j=s.useRef(null),_=s.useRef(null),s.useEffect(function(){-1===P&&K(eJ)},[eJ,P]),s.useEffect(function(){return function(){document.removeEventListener("mousemove",j.current),document.removeEventListener("mouseup",_.current),document.removeEventListener("touchmove",j.current),document.removeEventListener("touchend",_.current)}},[]),B=function(e,n){F.some(function(n,t){return n!==e[t]})&&(void 0!==n&&Z(n),K(e),e1(e))},V=function(e,n){if(-1===e){var t=D[0],r=D[D.length-1],a=n*(ej-eH);a=Math.min(a=Math.max(a,eH-t),ej-r),a=ez(t+a)-t,B(D.map(function(e){return e+a}))}else{var o=(0,u.Z)(F);o[e]=D[e];var l=eG(o,(ej-eH)*n,e,"dist");B(l.values,l.value)}},(X=s.useRef(V)).current=V,[P,x,s.useMemo(function(){var e=(0,u.Z)(eJ).sort(function(e,n){return e-n}),n=(0,u.Z)(F).sort(function(e,n){return e-n});return e.every(function(e,t){return e===n[t]})?F:eJ},[eJ,F]),function(e,n){e.stopPropagation();var t=eJ[n];O(n),Z(t),H(eJ);var r=k(e),a=r.pageX,o=r.pageY,l=function(e){e.preventDefault();var t,r=k(e),l=r.pageX,c=r.pageY,i=l-a,u=c-o,s=eT.current.getBoundingClientRect(),d=s.width,f=s.height;switch(eD){case"btt":t=-u/f;break;case"ttb":t=u/f;break;case"rtl":t=-i/d;break;default:t=i/d}X.current(n,t)},c=function e(n){n.preventDefault(),document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",l),document.removeEventListener("touchend",e),document.removeEventListener("touchmove",l),j.current=null,_.current=null,O(-1),y()};document.addEventListener("mouseup",c),document.addEventListener("mousemove",l),document.addEventListener("touchend",c),document.addEventListener("touchmove",l),j.current=l,_.current=c}]),e8=(0,l.Z)(e5,4),ne=e8[0],nn=e8[1],nt=e8[2],nr=e8[3],na=function(e,n){nr(e,n),null==ef||ef(e0(e$.current))},no=-1!==ne;s.useEffect(function(){if(!no){var e=eJ.lastIndexOf(nn);eL.current.focus(e)}},[no]);var nl=s.useMemo(function(){return(0,u.Z)(nt).sort(function(e,n){return e-n})},[nt]),nc=s.useMemo(function(){return eu?[nl[0],nl[nl.length-1]]:[eH,nl[0]]},[nl,eu,eH]),ni=(0,l.Z)(nc,2),nu=ni[0],ns=ni[1];s.useImperativeHandle(n,function(){return{focus:function(){eL.current.focus(0)},blur:function(){var e=document.activeElement;eT.current.contains(e)&&(null==e||e.blur())}}}),s.useEffect(function(){J&&eL.current.focus(0)},[]);var nd=s.useMemo(function(){return{min:eH,max:ej,direction:eD,disabled:q,step:e_,included:ex,includedStart:nu,includedEnd:ns,range:eu,tabIndex:eR,ariaLabelForHandle:eA,ariaLabelledByForHandle:eF,ariaValueTextFormatterForHandle:eK}},[eH,ej,eD,q,e_,ex,nu,ns,eu,eR,eA,eF,eK]);return s.createElement(b.Provider,{value:nd},s.createElement("div",{ref:eT,className:i()(G,U,(Y={},(0,a.Z)(Y,"".concat(G,"-disabled"),q),(0,a.Z)(Y,"".concat(G,"-vertical"),eg),(0,a.Z)(Y,"".concat(G,"-horizontal"),!eg),(0,a.Z)(Y,"".concat(G,"-with-marks"),eV.length),Y)),style:W,onMouseDown:function(e){e.preventDefault();var n,t=eT.current.getBoundingClientRect(),r=t.width,a=t.height,o=t.left,l=t.top,c=t.bottom,i=t.right,u=e.clientX,s=e.clientY;switch(eD){case"btt":n=(c-s)/a;break;case"ttb":n=(s-l)/a;break;case"rtl":n=(i-u)/r;break;default:n=(u-o)/r}e2(ez(eH+n*(ej-eH)))}},s.createElement("div",{className:"".concat(G,"-rail"),style:ew}),s.createElement(N,{prefixCls:G,style:eE,values:nl,startPoint:eZ,onStartMove:e6?na:null}),s.createElement(S,{prefixCls:G,marks:eV,dots:eP,style:eN,activeStyle:eM}),s.createElement(E,{ref:eL,prefixCls:G,style:ek,values:nt,draggingIndex:ne,onStartMove:na,onOffsetChange:function(e,n){if(!q){var t=eG(eJ,e,n);null==ef||ef(e0(eJ)),e1(t.values),null==ev||ev(e0(t.values)),e3(t.value)}},onFocus:$,onBlur:ee,handleRender:eS}),s.createElement(I,{prefixCls:G,marks:eV,onClick:e2})))}),R=t(17399),A=t(15503),F=t(89157),K=t(8968),L=s.forwardRef(function(e,n){var t=e.open,r=(0,s.useRef)(null),a=(0,s.useRef)(null);function l(){A.Z.cancel(a.current),a.current=null}return s.useEffect(function(){return t?a.current=(0,A.Z)(function(){var e;null===(e=r.current)||void 0===e||e.forcePopupAlign(),a.current=null}):l(),l},[t,e.title]),s.createElement(K.Z,(0,o.Z)({ref:(0,F.sQ)(r,n)},e))}),T=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>n.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t},D=s.forwardRef(function(e,n){var t=s.useContext(R.E_),c=t.getPrefixCls,u=t.direction,d=t.getPopupContainer,f=s.useState({}),v=(0,l.Z)(f,2),p=v[0],m=v[1],h=function(e,n){m(function(t){return(0,o.Z)((0,o.Z)({},t),(0,a.Z)({},e,n))})},b=e.prefixCls,y=e.range,g=e.className,C=T(e,["prefixCls","range","className"]),x=c("slider",b),Z=i()(g,(0,a.Z)({},"".concat(x,"-rtl"),"rtl"===u));"rtl"!==u||C.vertical||(C.reverse=!C.reverse);var E=s.useMemo(function(){return y?"object"===(0,r.Z)(y)?[!0,y.draggableTrack]:[!0,!1]:[!1]},[y]),k=(0,l.Z)(E,2),w=k[0],N=k[1];return s.createElement(O,(0,o.Z)({},C,{step:C.step,range:w,draggableTrack:N,className:Z,ref:n,prefixCls:x,handleRender:function(n,t){var r,a=t.index,l=t.dragging,i=c(),f=e.tooltip,v=e.vertical,m=(0,o.Z)({formatter:null!==(r=e.tipFormatter)&&void 0!==r?r:function(e){return"number"==typeof e?e.toString():""},open:e.tooltipVisible,placement:e.tooltipPlacement,getPopupContainer:e.getTooltipPopupContainer},void 0===f?{}:f),b=m.open,y=m.placement,g=m.getPopupContainer,C=m.prefixCls,Z=m.formatter,E=!!Z&&(p[a]||l),k=(0,o.Z)((0,o.Z)({},n.props),{onMouseEnter:function(){return h(a,!0)},onMouseLeave:function(){return h(a,!1)}}),w=c("tooltip",C);return s.createElement(L,{prefixCls:w,title:Z?Z(t.value):"",open:b||void 0===b&&E,placement:y||(v?"rtl"===u?"left":"right":"top"),transitionName:"".concat(i,"-zoom-down"),key:a,overlayClassName:"".concat(x,"-tooltip"),getPopupContainer:g||d},s.cloneElement(n,k))}}))})},59633:function(e,n,t){t.d(n,{Z:function(){return C}});var r=t(87462),a=t(4942),o=t(72034),l=t(93967),c=t.n(l),i=t(97685),u=t(45987),s=t(67294),d=t(22720),f=t(77524),v=s.forwardRef(function(e,n){var t,r=e.prefixCls,o=void 0===r?"rc-switch":r,l=e.className,v=e.checked,p=e.defaultChecked,m=e.disabled,h=e.loadingIcon,b=e.checkedChildren,y=e.unCheckedChildren,g=e.onClick,C=e.onChange,x=e.onKeyDown,Z=(0,u.Z)(e,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),E=(0,d.Z)(!1,{value:v,defaultValue:p}),k=(0,i.Z)(E,2),w=k[0],N=k[1];function M(e,n){var t=w;return m||(N(t=e),null==C||C(t,n)),t}var I=c()(o,l,(t={},(0,a.Z)(t,"".concat(o,"-checked"),w),(0,a.Z)(t,"".concat(o,"-disabled"),m),t));return s.createElement("button",Object.assign({},Z,{type:"button",role:"switch","aria-checked":w,disabled:m,className:I,ref:n,onKeyDown:function(e){e.which===f.Z.LEFT?M(!1,e):e.which===f.Z.RIGHT&&M(!0,e),null==x||x(e)},onClick:function(e){var n=M(!w,e);null==g||g(n,e)}}),h,s.createElement("span",{className:"".concat(o,"-inner")},w?b:y))});v.displayName="Switch";var p=t(17399),m=t(92933),h=t(23173),b=t(51964),y=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>n.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t},g=s.forwardRef(function(e,n){var t=e.prefixCls,l=e.size,i=e.disabled,u=e.loading,d=e.className,f=y(e,["prefixCls","size","disabled","loading","className"]),g=s.useContext(p.E_),C=g.getPrefixCls,x=g.direction,Z=s.useContext(h.Z),E=s.useContext(m.Z),k=(null!=i?i:E)||u,w=C("switch",t),N=s.createElement("div",{className:"".concat(w,"-handle")},u&&s.createElement(o.Z,{className:"".concat(w,"-loading-icon")})),M=c()((0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(w,"-small"),"small"===(l||Z)),"".concat(w,"-loading"),u),"".concat(w,"-rtl"),"rtl"===x),void 0===d?"":d);return s.createElement(b.Z,{insertExtraNode:!0},s.createElement(v,(0,r.Z)({},f,{prefixCls:w,className:M,disabled:k,ref:n,loadingIcon:N})))});g.__ANT_SWITCH=!0;var C=g}}]); |