"use strict";var _luckymoneyService=require("../../../../services/luckymoney-service");Component({properties:{redPacketID:{type:Number,value:0,observer:"onRedPacketIDChange"},sdkInstance:{type:Object,value:null}},data:{count:3},lifetimes:{detached:function(){this.clearTimer()}},methods:{onRedPacketIDChange:function(e){if(!e)return this.clearTimer(),void this.setData({count:3});this.startCountdown()},clearTimer:function(){clearInterval(this.timer),this.timer=null},startCountdown:function(){var e=this;this.clearTimer(),this.setData({count:3}),this.timer=setInterval(function(){var t=e.data.count-1;if(t<=0)return e.clearTimer(),e.setData({count:0}),void e.finishCountdown();e.setData({count:t})},1e3)},finishCountdown:function(){var e,t,i,n,o,r,s=(null===(e=this.properties)||void 0===e||null===(t=e.sdkInstance)||void 0===t?void 0:t.uuid)||(null===(i=this.properties)||void 0===i?void 0:i.sdkInstance),a=null===(n=this.properties)||void 0===n?void 0:n.redPacketID;s&&a&&(null===(o=(0,_luckymoneyService.getLuckymoneyService)(s))||void 0===o||null===(r=o.finishRevealCountdown)||void 0===r||r.call(o,a))}}});