You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/2974.86248b6b.async.js

12 lines
11 KiB

(self.webpackChunk=self.webpackChunk||[]).push([[2974],{81656:function(se,M,i){"use strict";i.r(M),i.d(M,{ResizableTextArea:function(){return F},default:function(){return oe}});var D=i(22122),T=i(6610),P=i(5991),g=i(10379),N=i(54070),d=i(12924),U=i(28991),I=i(96156),X=i(50344),ee=i(80334),te=i(42550),re=i(34203),K=i(91033),L=new Map;function B(t){t.forEach(function(l){var a,r=l.target;(a=L.get(r))===null||a===void 0||a.forEach(function(e){return e(r)})})}var S=new K.default(B),le=null,ue=null;function G(t,l){L.has(t)||(L.set(t,new Set),S.observe(t)),L.get(t).add(l)}function de(t,l){L.has(t)&&(L.get(t).delete(l),L.get(t).size||(S.unobserve(t),L.delete(t)))}var ce=function(t){(0,g.Z)(a,t);var l=(0,N.Z)(a);function a(){return(0,T.Z)(this,a),l.apply(this,arguments)}return(0,P.Z)(a,[{key:"render",value:function(){return this.props.children}}]),a}(d.Component),Z=d.createContext(null);function j(t){var l=t.children,a=t.onBatchResize,r=d.useRef(0),e=d.useRef([]),o=d.useContext(Z),s=d.useCallback(function(c,E,f){r.current+=1;var z=r.current;e.current.push({size:c,element:E,data:f}),Promise.resolve().then(function(){z===r.current&&(a==null||a(e.current),e.current=[])}),o==null||o(c,E,f)},[a,o]);return d.createElement(Z.Provider,{value:s},l)}function ne(t){var l=t.children,a=t.disabled,r=d.useRef(null),e=d.useRef(null),o=d.useContext(Z),s=d.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),c=d.isValidElement(l)&&(0,te.Yr)(l),E=c?l.ref:null,f=d.useMemo(function(){return(0,te.sQ)(E,r)},[E,r]),z=d.useRef(t);z.current=t;var C=d.useCallback(function(y){var w=z.current,Y=w.onResize,W=w.data,Q=y.getBoundingClientRect(),k=Q.width,ie=Q.height,J=y.offsetWidth,q=y.offsetHeight,he=Math.floor(k),me=Math.floor(ie);if(s.current.width!==he||s.current.height!==me||s.current.offsetWidth!==J||s.current.offsetHeight!==q){var ve={width:he,height:me,offsetWidth:J,offsetHeight:q};s.current=ve;var Ee=J===Math.round(k)?k:J,ge=q===Math.round(ie)?ie:q,pe=(0,U.Z)((0,U.Z)({},ve),{},{offsetWidth:Ee,offsetHeight:ge});o==null||o(pe,y,W),Y&&Promise.resolve().then(function(){Y(pe,y)})}},[]);return d.useEffect(function(){var y=(0,re.Z)(r.current)||(0,re.Z)(e.current);return y&&!a&&G(y,C),function(){return de(y,C)}},[r.current,a]),d.createElement(ce,{ref:e},c?d.cloneElement(l,{ref:f}):l)}var fe="rc-observer-key";function ae(t){var l=t.children,a=(0,X.Z)(l);return a.map(function(r,e){var o=(r==null?void 0:r.key)||"".concat(fe,"-").concat(e);return d.createElement(ne,(0,D.Z)({},t,{key:o}),r)})}ae.Collection=j;var n=ae,u=i(98423),h=i(94184),m=i.n(h),R=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],v={},p;function O(t){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=t.getAttribute("id")||t.getAttribute("data-reactid")||t.getAttribute("name");if(l&&v[a])return v[a];var r=window.getComputedStyle(t),e=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),s=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),c=b.map(function(f){return"".concat(f,":").concat(r.getPropertyValue(f))}).join(";"),E={sizingStyle:c,paddingSize:o,borderSize:s,boxSizing:e};return l&&a&&(v[a]=E),E}function x(t){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;p||(p=document.createElement("textarea"),p.setAttribute("tab-index","-1"),p.setAttribute("aria-hidden","true"),document.body.appendChild(p)),t.getAttribute("wrap")?p.setAttribute("wrap",t.getAttribute("wrap")):p.removeAttribute("wrap");var e=O(t,l),o=e.paddingSize,s=e.borderSize,c=e.boxSizing,E=e.sizingStyle;p.setAttribute("style","".concat(E,";").concat(R)),p.value=t.value||t.placeholder||"";var f=Number.MIN_SAFE_INTEGER,z=Number.MAX_SAFE_INTEGER,C=p.scrollHeight,y;if(c==="border-box"?C+=s:c==="content-box"&&(C-=o),a!==null||r!==null){p.value=" ";var w=p.scrollHeight-o;a!==null&&(f=w*a,c==="border-box"&&(f=f+o+s),C=Math.max(f,C)),r!==null&&(z=w*r,c==="border-box"&&(z=z+o+s),y=C>z?"":"hidden",C=Math.min(z,C))}return{height:C,minHeight:f,maxHeight:z,overflowY:y,resize:"none"}}var _=i(96774),V=i.n(_),A;(function(t){t[t.NONE=0]="NONE",t[t.RESIZING=1]="RESIZING",t[t.RESIZED=2]="RESIZED"})(A||(A={}));var $=function(t){(0,g.Z)(a,t);var l=(0,N.Z)(a);function a(r){var e;return(0,T.Z)(this,a),e=l.call(this,r),e.nextFrameActionId=void 0,e.resizeFrameId=void 0,e.textArea=void 0,e.saveTextArea=function(o){e.textArea=o},e.handleResize=function(o){var s=e.state.resizeStatus,c=e.props,E=c.autoSize,f=c.onResize;if(s!==A.NONE)return;typeof f=="function"&&f(o),E&&e.resizeOnNextFrame()},e.resizeOnNextFrame=function(){cancelAnimationFrame(e.nextFrameActionId),e.nextFrameActionId=requestAnimationFrame(e.resizeTextarea)},e.resizeTextarea=function(){var o=e.props.autoSize;if(!o||!e.textArea)return;var s=o.minRows,c=o.maxRows,E=x(e.textArea,!1,s,c);e.setState({textareaStyles:E,resizeStatus:A.RESIZING},function(){cancelAnimationFrame(e.resizeFrameId),e.resizeFrameId=requestAnimationFrame(function(){e.setState({resizeStatus:A.RESIZED},function(){e.resizeFrameId=requestAnimationFrame(function(){e.setState({resizeStatus:A.NONE}),e.fixFirefoxAutoScroll()})})})})},e.renderTextArea=function(){var o=e.props,s=o.prefixCls,c=s===void 0?"rc-textarea":s,E=o.autoSize,f=o.onResize,z=o.className,C=o.disabled,y=e.state,w=y.textareaStyles,Y=y.resizeStatus,W=(0,u.Z)(e.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Q=m()(c,z,(0,I.Z)({},"".concat(c,"-disabled"),C));"value"in W&&(W.value=W.value||"");var k=(0,U.Z)((0,U.Z)((0,U.Z)({},e.props.style),w),Y===A.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return d.createElement(n,{onResize:e.handleResize,disabled:!(E||f)},d.createElement("textarea",(0,D.Z)({},W,{className:Q,style:k,ref:e.saveTextArea})))},e.state={textareaStyles:{},resizeStatus:A.NONE},e}return(0,P.Z)(a,[{key:"componentDidUpdate",value:function(e){(e.value!==this.props.value||!V()(e.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,o=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,o)}}catch(s){}}},{key:"render",value:function(){return this.renderTextArea()}}]),a}(d.Component),F=$,H=function(t){(0,g.Z)(a,t);var l=(0,N.Z)(a);function a(r){var e;(0,T.Z)(this,a),e=l.call(this,r),e.resizableTextArea=void 0,e.focus=function(){e.resizableTextArea.textArea.focus()},e.saveTextArea=function(s){e.resizableTextArea=s},e.handleChange=function(s){var c=e.props.onChange;e.setValue(s.target.value,function(){e.resizableTextArea.resizeTextarea()}),c&&c(s)},e.handleKeyDown=function(s){var c=e.props,E=c.onPressEnter,f=c.onKeyDown;s.keyCode===13&&E&&E(s),f&&f(s)};var o=typeof r.value=="undefined"||r.value===null?r.defaultValue:r.value;return e.state={value:o},e}return(0,P.Z)(a,[{key:"setValue",value:function(e,o){"value"in this.props||this.setState({value:e},o)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return d.createElement(F,(0,D.Z)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),a}(d.Component),oe=H},98423:function(se,M,i){"use strict";i.d(M,{Z:function(){return T}});var D=i(28991);function T(P,g){var N=(0,D.Z)({},P);return Array.isArray(g)&&g.forEach(function(d){delete N[d]}),N}},73727:function(se,M,i){"use strict";i.d(M,{rU:function(){return G}});var D=i(5977),T=i(41788),P=i(12924),g=i.n(P),N=i(97175),d=i(45697),U=i.n(d),I=i(22122),X=i(19756),ee=i(2177),te=function(n){(0,T.Z)(u,n);function u(){for(var m,R=arguments.length,b=new Array(R),v=0;v<R;v++)b[v]=arguments[v];return m=n.call.apply(n,[this].concat(b))||this,m.history=(0,N.lX)(m.props),m}var h=u.prototype;return h.render=function(){return g().createElement(D.F0,{history:this.history,children:this.props.children})},u}(g().Component),re=function(n){(0,T.Z)(u,n);function u(){for(var m,R=arguments.length,b=new Array(R),v=0;v<R;v++)b[v]=arguments[v];return m=n.call.apply(n,[this].concat(b))||this,m.history=(0,N.q_)(m.props),m}var h=u.prototype;return h.render=function(){return g().createElement(D.F0,{history:this.history,children:this.props.children})},u}(g().Component),K=function(u,h){return typeof u=="function"?u(h):u},L=function(u,h){return typeof u=="string"?(0,N.ob)(u,null,null,h):u},B=function(u){return u},S=g().forwardRef;typeof S=="undefined"&&(S=B);function le(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}var ue=S(function(n,u){var h=n.innerRef,m=n.navigate,R=n.onClick,b=(0,X.Z)(n,["innerRef","navigate","onClick"]),v=b.target,p=(0,I.Z)({},b,{onClick:function(x){try{R&&R(x)}catch(_){throw x.preventDefault(),_}!x.defaultPrevented&&x.button===0&&(!v||v==="_self")&&!le(x)&&(x.preventDefault(),m())}});return B!==S?p.ref=u||h:p.ref=h,g().createElement("a",p)}),G=S(function(n,u){var h=n.component,m=h===void 0?ue:h,R=n.replace,b=n.to,v=n.innerRef,p=(0,X.Z)(n,["component","replace","to","innerRef"]);return g().createElement(D.s6.Consumer,null,function(O){O||(0,ee.Z)(!1);var x=O.history,_=L(K(b,O.location),O.location),V=_?x.createHref(_):"",A=(0,I.Z)({},p,{href:V,navigate:function(){var F=K(b,O.location),H=R?x.replace:x.push;H(F)}});return B!==S?A.ref=u||v:A.innerRef=v,g().createElement(m,A)})});if(!1)var de,ce;var Z=function(u){return u},j=g().forwardRef;typeof j=="undefined"&&(j=Z);function ne(){for(var n=arguments.length,u=new Array(n),h=0;h<n;h++)u[h]=arguments[h];return u.filter(function(m){return m}).join(" ")}var fe=j(function(n,u){var h=n["aria-current"],m=h===void 0?"page":h,R=n.activeClassName,b=R===void 0?"active":R,v=n.activeStyle,p=n.className,O=n.exact,x=n.isActive,_=n.location,V=n.sensitive,A=n.strict,$=n.style,F=n.to,H=n.innerRef,oe=(0,X.Z)(n,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return g().createElement(D.s6.Consumer,null,function(t){t||(0,ee.Z)(!1);var l=_||t.location,a=L(K(F,l),l),r=a.pathname,e=r&&r.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),o=e?(0,D.LX)(l.pathname,{path:e,exact:O,sensitive:V,strict:A}):null,s=!!(x?x(o,l):o),c=s?ne(p,b):p,E=s?(0,I.Z)({},$,{},v):$,f=(0,I.Z)({"aria-current":s&&m||null,className:c,style:E,to:a},oe);return Z!==j?f.ref=u||H:f.innerRef=H,g().createElement(G,f)})});if(!1)var ae}}]);