/*! For license information please see 8b6394965b01a3482fded67e2b94c0e4.js.LICENSE.txt */
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([["sub-common/8b6394965b01a3482fded67e2b94c0e4"],{"./src/components/Dialog/index.tsx":function(e,a,n){var s=n("./node_modules/@babel/runtime/helpers/esm/defineProperty.js");var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js");var t=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js");var l=n("./node_modules/classnames/index.js");var d=n.n(l);var i=n("./node_modules/react/cjs/react.production.min.js");var u=n("./src/components/Dialog/index.module.scss");var r=n("./src/use/useCommon.ts");var c=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");var f=function Dialog(e){var a;var n=e.showOverLay,l=n===void 0?true:n,f=e.zIndex,m=f===void 0?99:f,v=e.show,p=v===void 0?false:v,h=e.onClose,x=e.onChange,j=e.children;var w=(0,r.usePropsValue)({value:p,defaultValue:false,onChange:function onChange(e){x===null||x===void 0?void 0:x(e)}}),_=(0,o["default"])(w,2),g=_[0],b=_[1];var C=(0,i.useState)(false),k=(0,o["default"])(C,2),y=k[0],V=k[1];var z=function handleAnimShow(){b(true);setTimeout((function(){V(true)}),200)};var I=function handleAnimHide(){V(false);setTimeout((function(){b(false)}),200)};var A=function onClose(){I();h===null||h===void 0?void 0:h(g)};(0,i.useEffect)((function(){if(p){z()}}),[p]);return g?(0,c.jsxs)(t.View,{className:u["default"].dialog,style:{zIndex:m},children:[(0,c.jsx)(t.View,{style:{zIndex:m+1},className:d()(u["default"].dialog_mask,(a={},(0,s["default"])(a,u["default"].dialog_mask_active,y),(0,s["default"])(a,u["default"]["drawer_mask--hidden"],!l),a)),onClick:A}),(0,c.jsx)(t.View,{style:{zIndex:m+2},className:d()(u["default"].dialog_content,(0,s["default"])({},u["default"].dialog_content_active,y)),children:j})]}):(0,c.jsx)(t.View,{})};a["default"]=f}}]);