(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";function showTips(e){var r=(0,_dom.$$)("."+_xtpl.VIDEO_RECORDING_TIPS_TEXT_CLASS_NAME),t=TIPS_AUTO_CLOSED_TIMEOUT,n=!0,o=!1,s=void 0;try{for(var i,a=function(){function r(e,r,n,o,s){setTimeout(function(){"block"===n.style.display&&(s.style.display="none",o.style.display="block"),e.innerHTML="",r.style.display="none"},1e3*t)}var n=i.value;if(_=n.parentNode,d=_.parentNode.id,c=/_(\-?\d+)_/.test(d)?RegExp.$1:"",E=document.getElementById(d).querySelector("div[style*=block]"),y=E.querySelector("div"),T=E.querySelector(".hiddebtn"),!c)throw Error("instance id not found");T.style.display="none",y.style.display="block",n.innerHTML=e.content,_.style.display="block",clearTimeout(_xtpl.wowVideoRecordingName[_xtpl.wowVideoRecordingName.startTimerName+c]),r(n,_,E,T,y)},l=r[Symbol.iterator]();!(n=(i=l.next()).done);n=!0){var _,d,c,E,y,T;a()}}catch(u){o=!0,s=u}finally{try{!n&&l["return"]&&l["return"]()}finally{if(o)throw s}}}var _message=require(7),_dom=require(3),_flashRecord=require(6),_index=require(4),_xtpl=require(5),TIPS_AUTO_CLOSED_TIMEOUT=10;(0,_message.registerMsgHandler)(_flashRecord.MSG_EVENT_FLASH_RECORD_FEATURE_ENABLED,function(e){var r=e.flashId,t=e.instance,n=e.enable;(0,_index.init)(r,t,n)}),(0,_message.registerMsgHandler)(_flashRecord.MSG_EVENT_FLASH_RECORD_STATE_CHANGED,function(e){var r=e.instance,t=e.state,n=1;(0,_index.onRecordStateChange)(r,t,n)}),(0,_message.registerMsgHandler)(_flashRecord.MSG_EVENT_FLASH_RECORD_SHOW_MESSAGE,function(e){var r=e.messages;r.length>0&&showTips(r[0])});


},{"3":3,"4":4,"5":5,"6":6,"7":7}],2:[function(require,module,exports){
"use strict";function defer(){var e=void 0,r=void 0,n=new Promise(function(n,o){e=n,r=o});return{resolve:function(r){e(r)},reject:function(e){r(e)},promise:n}}exports.defer=defer;


},{}],3:[function(require,module,exports){
"use strict";function $(e,o){return e instanceof HTMLElement?e:(o||document).querySelector(e)}function _$(e,o){return(o||document).shadowRoot.querySelector(e)}function _$$(e,o){return slice.call((o||document).shadowRoot.querySelectorAll(e))}function $$(e,o){return slice.call((o||document).querySelectorAll(e))}function toggleClass(e,o,t){var r=2==arguments.length?e.classList.contains(o):!t;e.classList[r?"remove":"add"](o)}function removeNodeFromParent(e){return e&&e.parentNode?(e.parentNode.removeChild(e),!0):!1}exports.$=$,exports._$=_$,exports._$$=_$$,exports.$$=$$,exports.toggleClass=toggleClass,exports.removeNodeFromParent=removeNodeFromParent;var slice=Array.prototype.slice;


},{}],4:[function(require,module,exports){
"use strict";function init(e,t,o){(0,_xtpl.addHtml)(e,t,o)}function onRecordStateChange(e,t,o){var i=parseInt(t),w=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.startName)),n=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.stopName)),d=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.showStartName)),r=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.hideStartName)),l=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.showStopName)),a=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.hideStopName)),c=(0,_xtpl.wowGetEl)((0,_xtpl.wowGetIdStr)(e,_xtpl.wowVideoRecordingName.timerName)),p=_xtpl.wowVideoRecordingName.startTimerName+e,_=_xtpl.wowVideoRecordingName.stopTimerName+e,x=_xtpl.wowVideoRecordingName.curRecorderTimeName+e;switch(_xtpl.wowVideoRecordingName[p]||(_xtpl.wowVideoRecordingName[p]=0),_xtpl.wowVideoRecordingName[_]||(_xtpl.wowVideoRecordingName[_]=0),_xtpl.wowVideoRecordingName[x]||(_xtpl.wowVideoRecordingName[x]=0),o&&(i=Number(!i)),i){case START_VIDEO_RECORDING:w.style.display="none",n.style.display="block",l.style.display="block",a.style.display="none",c.innerText="00:00",_xtpl.wowVideoRecordingName[x]=0,_xtpl.wowVideoRecordingName[_]=setInterval(function(){_xtpl.wowVideoRecordingName[x]++,c.innerText=wowCalRecorderTime(_xtpl.wowVideoRecordingName[x])},1e3);break;case ENABLE_VIDEO_RECORDING:case STOP_VIDEO_RECORDING:default:clearInterval(_xtpl.wowVideoRecordingName[_]),w.style.display="block",n.style.display="none",d.style.display="block",r.style.display="none",_xtpl.wowVideoRecordingName[p]=setTimeout(function(){d.style.display="none",r.style.display="block",clearTimeout(_xtpl.wowVideoRecordingName[p])},7e3)}}function wowExecuteRecordingAction(e,t){runScriptInPage('chrome.wowPrivate.send("executeRecordingAction", \'{"instance":"'+e+'","start":'+t+"}');")}function runScriptInPage(e){var t=document.createElement("script");t.innerHTML=e,document.head.appendChild(t)}function wowCalRecorderTime(e){var t=parseInt(e/60),o=e%60;return t>=120?">2小时":(10>t&&(t="0"+t),10>o&&(o="0"+o),t+":"+o)}exports.init=init,exports.onRecordStateChange=onRecordStateChange,exports.wowExecuteRecordingAction=wowExecuteRecordingAction;var _xtpl=require(5),ENABLE_VIDEO_RECORDING=1,START_VIDEO_RECORDING=0,STOP_VIDEO_RECORDING=1;


},{"5":5}],5:[function(require,module,exports){
"use strict";function wowGetIdStr(e,o){return""+wowVideoRecordingName.prefixName+e+o+wowVideoRecordingName.suffixName}function wowGetEl(e){return document.getElementById(e)}function addHtml(e,o,t){var i=Number(t),r=wowVideoRecordingName.docName,n=""+wowVideoRecordingName.prefixName+wowVideoRecordingName.suffixName;if(document.body.setAttribute(r,n),wowGetEl(wowGetIdStr(o,wowVideoRecordingName.videoName))){if(i===DISABLED_VIDEO_RECORDING){var d=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.startName)),w=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.stopName));return d.style.display="none",void(w.style.display="none")}return void(0,_index.onRecordStateChange)(o,i)}if(i!==DISABLED_VIDEO_RECORDING){var a=calBtnPosition(e),s=a.parentEl,p=a.parentHeight,l=a.startHeight,c=a.stopHeight,m=document.createElement("div"),g='<div id="'+wowGetIdStr(o,wowVideoRecordingName.startName)+'" style="'+wowVideoRecordingStyle.startStyle+'">\n                    <div id="'+wowGetIdStr(o,wowVideoRecordingName.showStartName)+'" style="'+wowVideoRecordingStyle.showStartStyle+'">\n                      <button id="'+wowGetIdStr(o,wowVideoRecordingName.startBtnName)+'" style="'+wowVideoRecordingStyle.showStartBtnStyle+'"></button>\n                      <span style="'+wowVideoRecordingStyle.showStartCopyStyle+'">开始录制</span>\n                    </div>\n                    <span id="'+wowGetIdStr(o,wowVideoRecordingName.hideStartName)+'" class="hiddebtn" style="'+wowVideoRecordingStyle.hideStartBtnStyle+'"></span>\n                  </div>\n                  <div id="'+wowGetIdStr(o,wowVideoRecordingName.stopName)+'" style="'+wowVideoRecordingStyle.stopStyle+'">\n                    <div id="'+wowGetIdStr(o,wowVideoRecordingName.showStopName)+'" style="'+wowVideoRecordingStyle.showStopStyle+'">\n                      <button id="'+wowGetIdStr(o,wowVideoRecordingName.stopBtnName)+'" style="'+wowVideoRecordingStyle.showStopBtnStyle+'"></button>\n                      <span style="'+wowVideoRecordingStyle.showStopCopyStyle+'">停止录制</span>\n                      <span id="'+wowGetIdStr(o,wowVideoRecordingName.circleName)+'" style="'+wowVideoRecordingStyle.showStopCircleStyle+'"></span>\n                      <span id="'+wowGetIdStr(o,wowVideoRecordingName.timerName)+'" class="hiddebtn" style="'+wowVideoRecordingStyle.showStopTimerStyle+'">00:00</span>\n                    </div>\n                    <span id = "'+wowGetIdStr(o,wowVideoRecordingName.hideStopName)+'" style="'+wowVideoRecordingStyle.hideStopBtnStyle+'"></span>\n                  </div>\n                  <div id="'+wowGetIdStr(o,wowVideoRecordingName.tipsName)+'" style="'+wowVideoRecordingStyle.tipsStyle+'">\n                    <span style="'+wowVideoRecordingStyle.tipsTriangleStyle+'"></span>\n                    <span class="'+VIDEO_RECORDING_TIPS_TEXT_CLASS_NAME+'" style="'+wowVideoRecordingStyle.tipsTextStyle+'"></span>\n                  </div>';m.id=""+wowGetIdStr(o,wowVideoRecordingName.videoName),s.appendChild(m),wowGetEl(wowGetIdStr(o,wowVideoRecordingName.videoName)).innerHTML=g,wowGetEl(wowGetIdStr(o,wowVideoRecordingName.startName)).style.top=parseInt(p-l)+"px",wowGetEl(wowGetIdStr(o,wowVideoRecordingName.stopName)).style.top=parseInt(p-c)+"px",wowGetEl(wowGetIdStr(o,wowVideoRecordingName.tipsName)).style.top=parseInt(p-l+DISTANCE_BUTTON_TIPS)+"px",queryTipsMessages(),initEvent(e,o),(0,_index.onRecordStateChange)(o,i)}}function queryTipsMessages(){(0,_message.sendMessageAsync)(_flashRecord.MSG_EVENT_FLASH_RECORD_QUERY_MESSAGE,{},{noReply:!0})}function initEvent(e,o){function t(e,o){e.style.display="none",o.style.display="block"}function i(e){wowVideoRecordingName[e]?clearTimeout(wowVideoRecordingName[e]):wowVideoRecordingName[e]=0}var r=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.startName)),n=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.showStartName)),d=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.hideStartName)),w=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.stopName)),a=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.showStopName)),s=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.hideStopName)),p=wowGetEl(wowGetIdStr(o,wowVideoRecordingName.circleName)),l=wowVideoRecordingName.showStartHoverTimerName+o,c=wowVideoRecordingName.hideStartHoverTimerName+o,m=wowVideoRecordingName.showStopHoverTimerName+o,g=wowVideoRecordingName.hideStopHoverTimerName+o,S=350,N=3e3;n.addEventListener("click",function(){(0,_index.wowExecuteRecordingAction)(o,!0)},!1),n.addEventListener("mouseover",function(){clearTimeout(wowVideoRecordingName[wowVideoRecordingName.startTimerName+o]),i(l),r.style.backgroundColor="#fd9f64"},!1),n.addEventListener("mouseout",function(){i(l),r.style.backgroundColor="#f07151",wowVideoRecordingName[l]=setTimeout(function(){t(n,d)},N)},!1),d.addEventListener("mouseover",function(){i(c),wowVideoRecordingName[c]=setTimeout(function(){t(d,n)},S)},!1),a.addEventListener("click",function(){(0,_index.wowExecuteRecordingAction)(o,!1)},!1),a.addEventListener("mouseover",function(){i(m),w.style.backgroundColor="#fe915d",p.style.backgroundColor="#ee4d5a"},!1),a.addEventListener("mouseout",function(){w.style.backgroundColor="#fd6114",p.style.backgroundColor="#e10012",i(m),wowVideoRecordingName[m]=setTimeout(function(){t(a,s)},N)},!1),s.addEventListener("mouseover",function(){i(g),wowVideoRecordingName[g]=setTimeout(function(){t(s,a)},S)},!1),window.addEventListener("resize",function(){setTimeout(function(){var t=calBtnPosition(e),i=t.parentHeight,r=t.startHeight,n=t.stopHeight;wowGetEl(wowGetIdStr(o,wowVideoRecordingName.startName)).style.top=parseInt(i-r)+"px",wowGetEl(wowGetIdStr(o,wowVideoRecordingName.stopName)).style.top=parseInt(i-n)+"px",wowGetEl(wowGetIdStr(o,wowVideoRecordingName.tipsName)).style.top=parseInt(i-r+DISTANCE_BUTTON_TIPS)+"px"},200)},!1)}function calBtnPosition(e){var o=wowGetEl(e),t=o.parentElement,i="";"OBJECT"===t.tagName&&(t=t.parentElement),i=t.currentStyle?t.currentStyle.position:getComputedStyle(t,!1).position,""!==i&&"static"!==i||(t.setAttribute("wow_recorder_parent_position",i),t.style.position="relative");var r=.618*t.offsetHeight,n=30,d=40;return{parentEl:t,parentHeight:r,startHeight:n,stopHeight:d}}function getBgImage(e){return chrome.extension.getURL(e)}exports.wowVideoRecordingStyle=exports.wowVideoRecordingName=exports.VIDEO_RECORDING_TIPS_TEXT_CLASS_NAME=void 0,exports.wowGetIdStr=wowGetIdStr,exports.wowGetEl=wowGetEl,exports.addHtml=addHtml;var _index=require(4),_message=require(7),_flashRecord=require(6),DISABLED_VIDEO_RECORDING=0,DISTANCE_BUTTON_TIPS=90,VIDEO_RECORDING_TIPS_TEXT_CLASS_NAME=exports.VIDEO_RECORDING_TIPS_TEXT_CLASS_NAME="wow-recorder-tips-text-video-recording-bubble",wowVideoRecordingName=exports.wowVideoRecordingName={docName:"wow_recorder",prefixName:"__wow_recorder_",suffixName:"_recording_bubble__",parentOverflowName:"parent_overflow",videoName:"_video",startName:"_start",stopName:"_stop",showStartName:"_show_start",startBtnName:"_start_btn",hideStartName:"_hide_start",showStopName:"_show_stop",stopBtnName:"_stop_btn",hideStopName:"_hide_stop",circleName:"_circle",timerName:"_timer",startTimerName:"_startKeepTimer",stopTimerName:"_stopKeepTimer",curRecorderTimeName:"_curRecorderTime",showStartHoverTimerName:"_showStartHoverTime",hideStartHoverTimerName:"_hideStartHoverTime",showStopHoverTimerName:"_showStopHoverTime",hideStopHoverTimerName:"_hideStopHoverTime",tipsName:"_tips"},wowVideoRecordingStyle=exports.wowVideoRecordingStyle={startStyle:"position:absolute;display:none;left:0;color:#fff;border:none;width:auto;text-align:left;border-radius:0px 6px 6px 0px;background-color:#f07151;",showStartStyle:"display:block;width:60px;height:60px;line-height:60px;cursor:pointer;",showStartBtnStyle:"display:block;width:60px;height:60px;line-height:60px;color:#fff;cursor:pointer;z-index:10000;border:none;outline:none;background:url("+getBgImage("res/wow_recorder_start_recording_normal.png")+") 50% 10px no-repeat;",showStartCopyStyle:"position:absolute;display:block;top:40px;left:6px;line-height:12px;font-size:12px;",hideStartBtnStyle:"display:none;width:10px;height:60px;line-height:60px;cursor:pointer;z-index:10000;border:none;background:url("+getBgImage("res/wow_recorder_show_recording_btn.png")+") 50% 50% no-repeat",stopStyle:"position:absolute;display:none;left:0px;color:#fff;z-index:10000;border:none;width:auto;text-align:left;border-radius:0px 6px 6px 0px;background:#fd6114;",showStopStyle:"display:block;width:60px;height:80px;line-height:80px;cursor:pointer;",showStopBtnStyle:"display:inline-block;width:60px;height:80px;line-height:80px;color:#fff;cursor:pointer;z-index:10000;border:none;outline:none;background:url("+getBgImage("res/wow_recorder_stop_recording_normal.png")+") 50% 10px no-repeat;",showStopCopyStyle:"position:absolute;display:block;top:40px;left:6px;line-height:12px;font-size:12px;",showStopCircleStyle:"position:absolute;display:inline-block;top:62px;left:8px;width:5px;height:5px;background-color:#e10012;border-radius:5px;",showStopTimerStyle:"position:absolute;display:inline-block;top:60px;left:16px;line-height:12px;font-size:12px;",hideStopBtnStyle:"display:none;width:10px;height:80px;line-height:80px;cursor:pointer;z-index:10000;border:none;background:url("+getBgImage("res/wow_recorder_show_recording_btn.png")+") 50% 50% no-repeat",tipsStyle:"position:absolute;display:none;left:0;color:#fff;border:none;width:auto;border-radius:0px 6px 6px 0px;background-color: #8fc31f;",tipsTriangleStyle:"position:absolute;display:block;z-index:10000;top:-5px;left:15px;width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:5px solid #8fc31f;",tipsTextStyle:"display:block;z-index:10000;padding:5px 10px;max-width:252px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"};


},{"4":4,"6":6,"7":7}],6:[function(require,module,exports){
"use strict";var MSG_EVENT_FLASH_RECORD_FEATURE_ENABLED=exports.MSG_EVENT_FLASH_RECORD_FEATURE_ENABLED="flash-recording-plugin-enabled",MSG_EVENT_FLASH_RECORD_STATE_CHANGED=exports.MSG_EVENT_FLASH_RECORD_STATE_CHANGED="flash-recording-plugin-state-changed",MSG_EVENT_FLASH_RECORD_SHOW_MESSAGE=exports.MSG_EVENT_FLASH_RECORD_SHOW_MESSAGE="flash-recording-show-message",MSG_EVENT_FLASH_RECORD_QUERY_MESSAGE=exports.MSG_EVENT_FLASH_RECORD_QUERY_MESSAGE="flash-recording-query-message",FLASH_RECORD_V2_MEDIA_TYPE_NORMAL=exports.FLASH_RECORD_V2_MEDIA_TYPE_NORMAL="Media",FLASH_RECORD_V2_MEDIA_TYPE_HD=exports.FLASH_RECORD_V2_MEDIA_TYPE_HD="HDMedia";


},{}],7:[function(require,module,exports){
"use strict";function sendMessageAsync(e,r){var t=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],n=t.noReply,o=t.extId,s={type:e,data:r,sync:!1,noReply:n,d:"req"};if(n)return sendMsg(o,s),Promise.resolve();var c=guid(),d=(0,_defer.defer)();return s.guid=c,deferCache[c]=d,sendMsg(o,s),d.promise["catch"](noop)}function initPort(){deferCache=Object.create(null);try{extPort=chrome.runtime.connect({name:"page:connect"}),extPort.onMessage.addListener(onMsg),extPort.onDisconnect.addListener(function(){disposePort(),setTimeout(initPort,0)})}catch(e){console.log(e)}}function disposePort(){for(var e in deferCache){var r=deferCache[e];r&&r.reject&&r.reject("disconnect")}deferCache=Object.create(null),extPort=null}function onMsg(e){var r=e.guid,t=e.d,n=deferCache[r];if("postTab"===t){var o=bkMsgHandlers[e.type];o&&o(e.data)}else n&&"res"===t&&(e.success?n.resolve(e.data):n.reject(e.error),delete deferCache[r])}function registerMsgHandler(e,r){"function"==typeof r&&(bkMsgHandlers[e]=r)}function sendMsg(e,r){if(e&&r)throw Error("not support external");r&&(extPort?extPort.postMessage(r):chrome.runtime.sendMessage(r))}function noop(){}function guid(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+Date.now()}exports.sendMessageAsync=sendMessageAsync,exports.registerMsgHandler=registerMsgHandler;var _defer=require(2),deferCache=void 0,bkMsgHandlers=Object.create(null),extPort=void 0;"object"==typeof chrome&&chrome.runtime&&chrome.runtime.onMessage&&chrome.runtime.onMessage.addListener(onMsg),window.addEventListener("unload",function(){extPort.disconnect(),disposePort()}),initPort();


},{"2":2}]},{},[1]);
