(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[31691],{75485:function(e,t,n){"use strict";n.r(t);var r=n(30266),i=n(809),o=n.n(i),s=n(67294),a=n(5141),u=n(70131),c=n(11163),d=n(27809),l=n(84823),h=n(29171),p=n(98743),f=n(42388),v=n.n(f),b=n(56432),g=n.n(b),y=n(85893),w=a.ZP.div.withConfig({displayName:"video__PlayButtonContainer",componentId:"sc-1mgrsg1-0"})(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);"]),m=a.ZP.div.withConfig({displayName:"video__VideoContainer",componentId:"sc-1mgrsg1-1"})(["position:relative;width:",";padding:10px;"," @media screen and (max-width:767px){width:100%;border:none;","}"],(function(e){return e.width||"73%"}),(function(e){return e.isHigh&&(0,a.iv)(["& > video{border-radius:8px !important;object-fit:contain;}"])}),(function(e){return e.isHigh&&(0,a.iv)(["padding:32px 40px;"])})),k="About Cuemath Plus",V=function(e){var t=e.threshold,n=e.video,i=e.width,a=e.isHigh,f=(0,c.useRouter)().asPath,b=(0,s.useState)(!0),V=b[0],x=b[1],C=(0,s.useState)(),I=C[0],_=C[1],O=(0,s.useRef)(null),P=(0,u.YD)({threshold:t}),j=P.inView,M=P.ref,N=(0,h.j0)(f),S=(0,l.isMobile)(),E=function(){var e=(0,r.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=14;break}return e.prev=1,e.next=4,O.current.play();case 4:_(!0),x(!1),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),_(!1),console.log(e.t0);case 12:e.next=15;break;case 14:j||(O.current.pause(),x(!0));case 15:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}();(0,s.useEffect)((function(){O.current&&E()}),[j]);var R=function(e){var t=document.getElementById("about-cuemath-plus-video"),n=Math.floor(null===t||void 0===t?void 0:t.currentTime);"play"===e&&d.qm.videoPlayed(k,n,N,I),"pause"===e&&d.qm.videoPaused(k,n,N)};return(0,y.jsxs)(m,{width:i,ref:M,isHigh:a,children:[V&&(0,y.jsx)(w,{onClick:function(){O.current.play(),_(!1),x(!V)},children:(0,y.jsx)(p.Z,{url:v(),width:S?87:200,height:S?87:200})}),(0,y.jsxs)("video",{ref:O,width:"100%",height:"auto",controls:!0,muted:!0,disablePictureInPicture:!0,onLoadStart:function(){O.current.volume=.5},id:"about-cuemath-plus-video",onPlay:function(){return R("play")},onPause:function(){return R("pause")},poster:g(),playsInline:!0,autoPlay:!0,children:[(0,y.jsx)("track",{kind:"captions"}),(0,y.jsx)("source",{src:n,type:"video/mp4"}),"Your browser does not support the video"]})]})};V.defaultProps={width:"",isHigh:!1},t.default=V},70131:function(e,t,n){"use strict";n.d(t,{df:function(){return f},YD:function(){return v}});var r=n(67294);function i(){return(i=Object.assign||function(e){for(var t=1;t=e}));e.trackVisibility&&"undefined"===typeof t.isVisible&&(t.isVisible=o),null==(n=i.get(t.target))||n.forEach((function(e){e(o,t)}))}))}),e);r=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:i},s.set(t,n)}return n}(n),a=o.id,u=o.observer,l=o.elements,h=l.get(e)||[];return l.has(e)||l.set(e,h),h.push(t),u.observe(e),function(){h.splice(h.indexOf(t),1),0===h.length&&(l.delete(e),u.unobserve(e)),0===l.size&&(u.disconnect(),s.delete(a))}}var h=["children","as","triggerOnce","threshold","root","rootMargin","onChange","skip","trackVisibility","delay","initialInView","fallbackInView"];function p(e){return"function"!==typeof e.children}var f=function(e){var t,n;function s(t){var n;return(n=e.call(this,t)||this).node=null,n._unobserveCb=null,n.handleNode=function(e){n.node&&(n.unobserve(),e||n.props.triggerOnce||n.props.skip||n.setState({inView:!!n.props.initialInView,entry:void 0})),n.node=e||null,n.observeNode()},n.handleChange=function(e,t){e&&n.props.triggerOnce&&n.unobserve(),p(n.props)||n.setState({inView:e,entry:t}),n.props.onChange&&n.props.onChange(e,t)},n.state={inView:!!t.initialInView,entry:void 0},n}n=e,(t=s).prototype=Object.create(n.prototype),t.prototype.constructor=t,o(t,n);var a=s.prototype;return a.componentDidUpdate=function(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())},a.componentWillUnmount=function(){this.unobserve(),this.node=null},a.observeNode=function(){if(this.node&&!this.props.skip){var e=this.props,t=e.threshold,n=e.root,r=e.rootMargin,i=e.trackVisibility,o=e.delay,s=e.fallbackInView;this._unobserveCb=l(this.node,this.handleChange,{threshold:t,root:n,rootMargin:r,trackVisibility:i,delay:o},s)}},a.unobserve=function(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)},a.render=function(){if(!p(this.props)){var e=this.state,t=e.inView,n=e.entry;return this.props.children({inView:t,entry:n,ref:this.handleNode})}var o=this.props,s=o.children,a=o.as,u=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(o,h);return r.createElement(a||"div",i({ref:this.handleNode},u),s)},s}(r.Component);function v(e){var t=void 0===e?{}:e,n=t.threshold,i=t.delay,o=t.trackVisibility,s=t.rootMargin,a=t.root,u=t.triggerOnce,c=t.skip,d=t.initialInView,h=t.fallbackInView,p=r.useRef(),f=r.useState({inView:!!d}),v=f[0],b=f[1],g=r.useCallback((function(e){void 0!==p.current&&(p.current(),p.current=void 0),c||e&&(p.current=l(e,(function(e,t){b({inView:e,entry:t}),t.isIntersecting&&u&&p.current&&(p.current(),p.current=void 0)}),{root:a,rootMargin:s,threshold:n,trackVisibility:o,delay:i},h))}),[Array.isArray(n)?n.toString():n,a,s,u,c,o,h,i]);(0,r.useEffect)((function(){p.current||!v.entry||u||c||b({inView:!!d})}));var y=[g,v.inView,v.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}f.displayName="InView",f.defaultProps={threshold:0,triggerOnce:!1,initialInView:!1}},56432:function(e){e.exports="https://static.qumath.in/static/next/_next/static/images/cuemath-plus-video-thumbnail-9aea6e3811fabd64206f7cb7954ad093.webp"}}]);