text: "use strict";(self.webpackChunkkoa_practice=self.webpackChunkkoa_practice||[]).push([[577],{1529:(e,t,n)=>{var r=n(3765),o=n(1068),u=n(2424),a=n(3978),l=n(4074);n(1539);var f=n(530);a(t,"__esModule",{value:!0}),t.default=void 0;var i=f(n(6394)),c=f(n(9198)),d=f(n(1379)),s=f(n(214)),v=f(n(6380)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={},u=a&&l;for(var f in e)if("default"!==f&&Object.prototype.hasOwnProperty.call(e,f)){var i=u?l(e,f):null;i&&(i.get||i.set)?a(o,f,i):o[f]=e[f]}o.default=e,n&&n.set(e,o);return o}(n(7294)),m=f(n(5697));function y(e){if("function"!=typeof u)return null;var t=new u,n=new u;return(y=function(e){return e?n:t})(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!o)return!1;if(o.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(o(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,v.default)(e);if(t){var u=(0,v.default)(this).constructor;n=o(r,arguments,u)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}n(7147),n(9872);var w=function(e){(0,d.default)(n,e);var t=h(n);function n(){var e;return(0,i.default)(this,n),(e=t.call(this)).state={},e}return(0,c.default)(n,[{key:"render",value:function(){var e=this.props.children;return p.default.createElement(p.default.Fragment,null,e)}}]),n}(p.Component);w.propTypes={children:m.default.node};var b=w;t.default=b},3126:(e,t,n)=>{var r=n(3765),o=n(1068),u=n(2424),a=n(3978),l=n(4074);n(1539);var f=n(530);a(t,"__esModule",{value:!0}),t.default=void 0;var i=f(n(6394)),c=f(n(9198)),d=f(n(1379)),s=f(n(214)),v=f(n(6380)),p=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=y(t);if(n&&n.has(e))return n.get(e);var o={},u=a&&l;for(var f in e)if("default"!==f&&Object.prototype.hasOwnProperty.call(e,f)){var i=u?l(e,f):null;i&&(i.get||i.set)?a(o,f,i):o[f]=e[f]}o.default=e,n&&n.set(e,o);return o}(n(7294)),m=f(n(5697));function y(e){if("function"!=typeof u)return null;var t=new u,n=new u;return(y=function(e){return e?n:t})(e)}function h(e){var t=function(){if("undefined"==typeof Reflect||!o)return!1;if(o.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(o(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,v.default)(e);if(t){var u=(0,v.default)(this).constructor;n=o(r,arguments,u)}else n=r.apply(this,arguments);return(0,s.default)(this,n)}}n(7147),n(9872);var w=function(e){(0,d.default)(n,e);var t=h(n);function n(){var e;return(0,i.default)(this,n),(e=t.call(this)).state={},e}return(0,c.default)(n,[{key:"render",value:function(){var e=this.props.children;return p.default.createElement(p.default.Fragment,null,e)}}]),n}(p.Component);w.propTypes={children:m.default.node};var b=w;t.default=b},4353:(e,t,n)=>{var r=n(3765),o=n(1068),u=n(2424),a=n(3978),l=n(4074);n(1539);var f=n(530);a(t,"__esModule",{value:!0}),t.default=void 0;var i=f(n(4198)),c=f(n(3032)),d=f(n(6394)),s=f(n(9198)),v=f(n(1222)),p=f(n(1379)),m=f(n(214)),y=f(n(6380)),h=f(n(7672)),w=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=E(t);if(n&&n.has(e))return n.get(e);var o={},u=a&&l;for(var f in e)if("default"!==f&&Object.prototype.hasOwnProperty.call(e,f)){var i=u?l(e,f):null;i&&(i.get||i.set)?a(o,f,i):o[f]=e[f]}o.default=e,n&&n.set(e,o);return o}(n(7294)),b=f(n(3935)),k=f(n(5697));function E(e){if("function"!=typeof u)return null;var t=new u,n=new u;return(E=function(e){return e?n:t})(e)}function C(e){var t=function(){if("undefined"==typeof Reflect||!o)return!1;if(o.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(o(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,y.default)(e);if(t){var u=(0,y.default)(this).constructor;n=o(r,arguments,u)}else n=r.apply(this,arguments);return(0,m.default)(this,n)}}n(4430);var g=0,O=function(e){(0,p.default)(n,e);var t=C(n);function n(e){var r;(0,d.default)(this,n),r=t.call(this,e),(0,h.default)((0,v.default)(r),"componentWillUnmount",(function(){}));var o=r.props.show;return r.state={show:o},r}return(0,s.default)(n,[{key:"shouldComponentUpdate",value:function(e,t){if(!t.show){var n=this.props.node;b.default.unmountComponentAtNode(n),document.body.removeChild(n)}return!1}},{key:"render",value:function(){var e=this.state.show,t=this.props,n=t.content,r=t.height,o=t.layer,u=t.model;return w.default.createElement("div",{className:"model-mini-layer",style:{display:e?null:"none"}},w.default.createElement("div",{className:"layer"},w.default.createElement("div",{className:"content"},n)),o?w.default.createElement("div",{className:u?"layer-back white":"layer-back black",style:{height:"".concat(r,"px")}}):"")}}]),n}(w.Component);(0,h.default)(O,"propTypes",{content:k.default.string,height:k.default.number,layer:k.default.bool,model:k.default.bool,node:k.default.object,show:k.default.bool}),(0,h.default)(O,"defaultProps",{content:"",layer:!0,model:!0,show:!0});function _(){var e;e=document.body.scrollTop+document.documentElement.scrollTop,g=(0,i.default)(e,10);var t=document.querySelector(".toast-model-mini");document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",t&&t.addEventListener("touchmove",(function(e){e.preventDefault()}),!1)}function j(){var e,t=document.querySelector(".toast-model-mini");document.querySelector(".toast-marker")||(document.documentElement.style.overflow="inherit",document.body.style.overflow="inherit",e=g,document.body.scrollTop=e,document.documentElement.scrollTop=e),t&&t.removeEventListener("touchmove",(function(e){e.preventDefault()}),!1)}var x={show:function(e){var t=e.content,n=e.callback,r=e.duration,o=e.layer,u=e.model,a=function(){var e=document.createElement("div");return e.setAttribute("id","toast-".concat(Math.floor(1e7*Math.random()))),e.setAttribute("class","toast-model-mini"),document.body.appendChild(e),e}();r?"number"!=typeof r&&(r=2e3):r=2e3,(0,c.default)((function(){j(),b.default.unmountComponentAtNode(a),document.body.removeChild(a),"function"==typeof n&&n()}),r),b.default.render(w.default.createElement(O,{content:t,height:document.body.clientHeight,layer:o,model:u,node:a}),a),_()}};t.default=x},2727:(e,t,n)=>{var r=n(3765),o=n(1068),u=n(2424),a=n(3978),l=n(4074),f=n(530);n(1539),n(8674);var i=f(n(6394)),c=f(n(9198)),d=f(n(1222)),s=f(n(1379)),v=f(n(214)),p=f(n(6380)),m=f(n(7672)),y=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=g(t);if(n&&n.has(e))return n.get(e);var o={},u=a&&l;for(var f in e)if("default"!==f&&Object.prototype.hasOwnProperty.call(e,f)){var i=u?l(e,f):null;i&&(i.get||i.set)?a(o,f,i):o[f]=e[f]}o.default=e,n&&n.set(e,o);return o}(n(7294)),h=f(n(5697)),w=n(3935),b=f(n(3340)),k=f(n(3126)),E=f(n(1529)),C=f(n(4353));function g(e){if("function"!=typeof u)return null;var t=new u,n=new u;return(g=function(e){return e?n:t})(e)}function O(e){var t=function(){if("undefined"==typeof Reflect||!o)return!1;if(o.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(o(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var u=(0,p.default)(this).constructor;n=o(r,arguments,u)}else n=r.apply(this,arguments);return(0,v.default)(this,n)}}n(3461);var _=function(e){(0,s.default)(n,e);var t=O(n);function n(e){var r;return(0,i.default)(this,n),r=t.call(this,e),(0,m.default)((0,d.default)(r),"handleClick",(function(){var e=r.state.index;C.default.show({content:"I also want to look for a girlfriend..."}),r.setState({index:e+1})})),(0,m.default)((0,d.default)(r),"mainContent",(function(){var e=r.state.index;return y.default.createElement("div",{className:"".concat(b.default?"demo-pc":"demo")},y.default.createElement("h1",{key:"1"},"Hello Demo!"),y.default.createElement("p",{key:"2"},"Welcome to Demo!"),y.default.createElement("div",{key:"3",className:"click"},"You clicked",y.default.createElement("span",{key:"31"},e),"times"),y.default.createElement("button",{key:"32",type:"button",onClick:r.handleClick},"Click me"))})),r.state={index:0},r}return(0,c.default)(n,[{key:"componentDidMount",value:function(){fetch("/json").then((function(e){return e.json()})).then((function(e){console.log(e)}))}},{key:"render",value:function(){var e=this.props.device;return y.default.createElement("div",{className:"wrapper"},e?y.default.createElement(E.default,null,this.mainContent()):y.default.createElement(k.default,null,this.mainContent()))}}]),n}(y.Component);if((0,m.default)(_,"propTypes",{device:h.default.bool}),"undefined"!=typeof window){var j=window.CONFIG||{};(0,w.hydrate)(y.default.createElement(_,j),document.querySelector("#app"))}e.exports=_},3340:(e,t,n)=>{var r=!1;if("undefined"!=typeof window)r=window.CONFIG.device;else if(void 0!==n.g){r=n.g.KoaPractice.device}e.exports=r},4430:(e,t,n)=>{n.r(t)},9872:(e,t,n)=>{n.r(t)},3461:(e,t,n)=>{n.r(t)}},e=>{e.O(0,[216],(()=>{return t=2727,e(e.s=t);var t}));e.O()}]);