tcic-electron-sdk 1.8.13 → 1.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +1 -1
- package/dist/config.json +3 -3
- package/dist/main.bundle.js +1 -1
- package/dist/mainRenderer.bundle.js +1 -1
- package/dist/resource.zip +0 -0
- package/locales/ko.json +5 -5
- package/package.json +1 -1
package/.env
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
TCIC_VERSION=1.8.
|
|
1
|
+
TCIC_VERSION=1.8.14
|
|
2
2
|
TCIC_CACHE_VERSION=1.8.0
|
package/dist/config.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"resources": [
|
|
3
3
|
{
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7a221f9f71207700e5498d0aedec142f20cc9076",
|
|
5
5
|
"sdkAppId": "0",
|
|
6
6
|
"schoolId": "0",
|
|
7
|
-
"url": "https://class.qcloudclass.com/1.8.0/cache/
|
|
7
|
+
"url": "https://class.qcloudclass.com/1.8.0/cache/offline_7a221f9f71207700e5498d0aedec142f20cc9076.zip",
|
|
8
8
|
"files": {
|
|
9
9
|
},
|
|
10
10
|
"regexes": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"supportFomats": "mp4|rmvb|avi|mov|flv|wmv|m3u8|mpeg|mp3|wav|pcm|aac|ogg"
|
|
26
26
|
},
|
|
27
27
|
"expired": 200,
|
|
28
|
-
"devBuildTime":
|
|
28
|
+
"devBuildTime": 1691056670,
|
|
29
29
|
"domains": {
|
|
30
30
|
"www.xxx.com": [
|
|
31
31
|
"www.aaa.com"
|
package/dist/main.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TCIC=t():e.TCIC=t()}(global,(function(){return(()=>{"use strict";var __webpack_modules__={231:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TencentCloudClass=t.TClassSubType=t.TClassType=void 0;const c=r(i(933)),d=a(i(765)),l=a(i(747)),h=a(i(622)),u=r(i(293)),w=r(i(893)),f=i(412),p=i(817),S=r(i(593)),g=r(i(60)),m=a(i(528)),y=a(i(239)),W=i(439),C=i(311),b=i(95),M=i(914),v=i(867),_=i(364),D=i(804),I=new d.default;var T,V;(V=t.TClassType||(t.TClassType={}))[V.Interactive=0]="Interactive",V[V.Live=1]="Live",function(e){e.UnKnow="",e.Interactive="interactive",e.Live="live",e.College="college",e.CoTeaching="coteaching",e.OneOnOne="oneonone",e.RTC="rtc"}(T=t.TClassSubType||(t.TClassSubType={}));class B extends C.TLoggerElectronModule{constructor(){super(),this.initializeOption=null,this.classUrl="",this.boardUrl="",this.windowTitle="",this.tcicMainView=null,this.tcicBoardView=null,this.isBoardViewLoaded=!1,this.tcicScreenShareVideoWindow=null,this.tcicDefaultEntryMainWindow=null,this.tcicScreenShareMainWindow=null,this.tcicScreenShareBoardWindow=null,this.tcicScreenShareCameraWindow=null,this.watchMouseEventEnabled=!1,this.watchMouseMoveTimer=null,this.touchScreenOptimizeEnabled=!1,this.touchScreenOptimizePerformed=!1,this.screenShareMainWindowMouseEventIgnored=!1,this.screenShareBoardWindowMouseEventIgnored=!1,this.mainViewDevTools=null,this.boardViewDevTools=null,this.videoWindowDevTools=null,this.cameraWindowDevTools=null,this.shouldFullscreen=!1,this.closeAllWindowInvoking=!1,this.callBoardMethodCache=[],this.needToShowTaskbarFix=!1,this.isTaskbarAutoHiddenInDesktopEnabled=!1,this.isTaskbarAutoHiddenInTabletEnabled=!1,this.isShowTaskbarOnMultipleDisplays=!1,this.onAllWindowClosedCallback=null,this.lastSelectedScreenBoardToolType=0,this.ipcListeners=[],this.ipcHandlers=[],this.seriousErrorTimes=0,this.isScreenSharing=!1,this.shareParams=null,this.isMainWindowMaximized=!1,this.mainWindowBoundsBeforeMaximize={},this.gpuInfoWatcher=null,this.checkShareWindowBoundsTimer=null,this.shareWindowBounds={x:0,y:0,width:0,height:0,isMinimized:!1},this.shareMainWindowDisplay=null,this.shareBoardWindowDisplay=null,this.wss=null,this.userId="",this.clickableRects=[],this.clickableAreaDetectMode="domRect",console.log("constructor"),this.detectScreenShareMainWindowMouseEventIgnored=(0,D.debounce)(this.detectScreenShareMainWindowMouseEventIgnored.bind(this),150,{trailing:!0,leading:!0})}sendUpdateMessage(e="",t){this.tcicMainView&&this.tcicMainView.webContents.send("message",e,t)}get wins(){const{tcicMainView:e,tcicBoardView:t,tcicScreenShareVideoWindow:i,tcicDefaultEntryMainWindow:n,tcicScreenShareMainWindow:o,tcicScreenShareBoardWindow:r,tcicScreenShareCameraWindow:s}=this,{mainViewDevTools:a,boardViewDevTools:c,videoWindowDevTools:d,cameraWindowDevTools:l}=this,{screenShareMainWindowMouseEventIgnored:h,isScreenSharing:u,shareParams:w,checkShareWindowBoundsTimer:f,shareWindowBounds:p,shareMainWindowDisplay:S,shareBoardWindowDisplay:g}=this,{isBoardViewLoaded:m,callBoardMethodCache:y,lastSelectedScreenBoardToolType:W}=this;return{tcicMainView:e,tcicBoardView:t,tcicScreenShareVideoWindow:i,tcicDefaultEntryMainWindow:n,tcicScreenShareMainWindow:o,tcicScreenShareBoardWindow:r,tcicScreenShareCameraWindow:s,devtools:{mainViewDevTools:a,boardViewDevTools:c,videoWindowDevTools:d,cameraWindowDevTools:l},share:{screenShareMainWindowMouseEventIgnored:h,isScreenSharing:u,shareParams:w,checkShareWindowBoundsTimer:f,shareWindowBounds:p,shareMainWindowDisplay:S,shareBoardWindowDisplay:g},board:{isBoardViewLoaded:m,callBoardMethodCache:y,lastSelectedScreenBoardToolType:W}}}initialize(e){return s(this,void 0,void 0,(function*(){if(process.on("uncaughtException",(e=>{this._info("process-uncaughtException",String(e))})),this.checkHasInitialize())return this.tcicScreenShareBoardWindow?this.tcicScreenShareBoardWindow.show():this.tcicDefaultEntryMainWindow.show(),!1;if("function"==typeof e.onClose&&(this.onAllWindowClosedCallback=e.onClose),e.url)try{const t=e.url.split("?")[1].split("&");for(const i of t){const t=i.split("=");"schoolid"===t[0]?e.schoolId=parseInt(t[1],10):"userid"===t[0]?e.userId=t[1]:"classid"===t[0]?e.classId=parseInt(t[1],10):"classtype"===t[0]?e.classType=parseInt(t[1],10):"classsubtype"===t[0]?e.classSubType=t[1]:"lng"===t[0]&&(e.lng=t[1])}}catch(t){return console.error("parse url error",e.url),!1}if(e.sign){const t=new Buffer(e.sign.split(".")[1],"base64"),i=JSON.parse(t.toString("utf-8"));e.schoolId=i.school_id,e.classId=i.class_id,e.userId=i.user_id,e.cid=i.cid,e.uid=i.uid,e.scene=i.scene,e.token=e.sign,i.hasOwnProperty("class_type")&&(e.classType=i.class_type),i.hasOwnProperty("class_sub_type")&&(e.classSubType=i.class_sub_type)}this.initializeOption=e,this.userId=e.userId,v.sentry.setUserId(e.userId);const t=new C.TLoggerConfig;t.sdkAppId=e.schoolId,t.userId=e.userId,t.roomId=e.classId,t.nativeSdkVersion=f.tcicSdkVersion,this._setConfig(t),this._info("Initialize",JSON.stringify(e));const i=e.lng||c.default.app.getLocaleCountryCode();let n="en";["ja","en","ko","zh-tw","zh"].find((e=>{if(i.toLocaleLowerCase().match(e))return n=e,!0})),console.log(`language.toLocaleLowerCase 000000>>>>> ${n}`),yield((e="zh")=>(m.default.use((0,y.default)(((e,t,i)=>{const n=h.default.resolve(__dirname,"..","locales",`${e}.json`);l.default.promises.readFile(n,"utf8").then((e=>{i(null,JSON.parse(e))})).catch((e=>{i(e,null)}))}))),m.default.init({lng:e,load:"languageOnly",fallbackLng:!1,keySeparator:!1,nsSeparator:!1})))(n);let o=`schoolid=${e.schoolId}&userid=${e.userId}&classid=${e.classId}&token=${e.token}&webloadstamp=${(new Date).getTime()}&classtype=${e.classType}&watermark=${e.waterMark?JSON.stringify(e.waterMark):""}`;e.lng&&(o+=`&lng=${e.lng}`,m.default.changeLanguage(e.lng)),e.scene&&(o+=`&scene=${e.scene}`),e.classSubType&&(o+=`&classsubtype=${e.classSubType}`),e.debugCss&&(o+=`&debugcss=${e.debugCss}`),e.debugJs&&(o+=`&debugjs=${e.debugJs}`),e.customParams&&(o+=`&${e.customParams}`);let r=e.url;if(!r){let t=f.tcicSdkVersion.split(".");e.version&&(t=e.version.split("."));let i=`${t[0]}.${t[1]}.${t[2]}`;if(f.tcicSdkBranch){const e=f.tcicSdkBranch.match(/^(\d+).(\d+).(\d+).([\w-]+)$/);e&&e[1]===t[0]&&e[2]===t[1]&&e[3]===t[2]&&(i=f.tcicSdkBranch)}let n="";e.env&&"prod"!==e.env&&(n=`${e.env}-`),e.versionStr&&(i=`/${e.versionStr}`),r=`https://${n}class.qcloudclass.com${i}/class.html?${e.env?`env=${e.env}&`:""}${o}`,process.defaultApp&&(process.argv.includes("--local")?r=`http://localhost:8080/class.html?${e.env?`env=${e.env}&`:""}${o}`:process.argv.includes("--vm")&&(r=`http://10.211.55.2:8080/class.html?${e.env?`env=${e.env}&`:""}${o}`))}if(this.classUrl=r,!process.argv.includes("--local")){const e=e=>e?-1===e.indexOf(".html")?"":e.replace(/\/[^/]*\.html/,"/board.html").replace(/\?.*$/,"").replace(/\/+$/,""):"";this.boardUrl=e(this.classUrl)}return this.createAndInitDefaultEntryMainWindow(),c.default.app.whenReady().then((()=>{this.createAndInitWindow()})),c.default.globalShortcut.unregister("CmdOrCtrl+F11"),c.default.globalShortcut.register("CmdOrCtrl+F11",(()=>{this.tcicDefaultEntryMainWindow.webContents.reload(),this.openDevTools()})),c.default.globalShortcut.unregister("CmdOrCtrl+Shift+Q"),c.default.globalShortcut.register("CmdOrCtrl+Shift+Q",(()=>{this._info("CmdOrCtrl+Shift+Q"),this.closeAllWindow().then()})),c.default.globalShortcut.unregister("CmdOrCtrl+Shift+F11"),c.default.globalShortcut.register("CmdOrCtrl+Shift+F11",(()=>{const e={watch_mouse_event:this.watchMouseEventEnabled,touch_optimize_enabled:this.touchScreenOptimizeEnabled,touch_optimize_performed:this.touchScreenOptimizePerformed,gpu_compositing_enabled:c.default.app.getGPUFeatureStatus().gpu_compositing.includes("enabled"),max_touches:g.getMaxTouches(),primary_screen:g.getPrimaryDisplaySize()||c.default.screen.getPrimaryDisplay().size};"win32"===process.platform&&(e.aero_glass_enabled=c.default.systemPreferences.isAeroGlassEnabled());const t={type:"info",title:m.default.t("系统信息"),message:JSON.stringify(e,null,2),buttons:[m.default.t("关闭"),m.default.t("打开GPU排障页面"),I.get("autoOpenDevTools")?m.default.t("启动时不打开调试工具"):m.default.t("启动时打开调试工具"),I.get("screenShareNotOnTop")?m.default.t("屏幕分享时窗口置顶"):m.default.t("屏幕分享时窗口不置顶"),I.get("screenShareNotSetParent")?m.default.t("屏幕分享时设置父子窗口"):m.default.t("屏幕分享时窗口不设置父子窗口"),I.get("disableCache")?m.default.t("打开本地缓存"):m.default.t("关闭本地缓存"),m.default.t("清除本地记录信息")]};c.default.dialog.showMessageBox(t).then((e=>{switch(e.response){case 1:{const e=new c.default.BrowserWindow({title:m.default.t("GPU排障")});e.setMenu(null),e.loadURL("chrome://gpu"),e.show()}break;case 2:I.set("autoOpenDevTools",!I.get("autoOpenDevTools"));break;case 3:I.set("screenShareNotOnTop",!I.get("screenShareNotOnTop"));break;case 4:I.set("screenShareNotSetParent",!I.get("screenShareNotSetParent"));break;case 5:I.set("disableCache",!I.get("disableCache"));break;case 6:I.clear()}}))})),!0}))}closeAllWindow(e){if(this.closeAllWindowInvoking)return;this._info("CloseAllWindowStart"),this.closeAllWindowInvoking=!0;let t=Promise.resolve();this.tcicMainView&&(this.initializeOption.classSubType===T.College&&this.unInitWSService(),this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.getBrowserViews().length>0&&this.tcicDefaultEntryMainWindow.removeBrowserView(this.tcicMainView),t=new Promise((e=>{const t=this.tcicMainView?this.tcicMainView.webContents:null;t?(t.once("destroyed",(()=>{this._info("MainViewDestroyed"),this.tcicMainView=null,this.mainViewDevTools&&this.mainViewDevTools.close(),e()})),t.destroy&&t.destroy()):e()})));let i=Promise.resolve(),n=Promise.resolve();this.tcicBoardView&&(n=new Promise((e=>{const t=this.tcicBoardView.webContents;t.once("destroyed",(()=>{this._info("BoardViewDestroyed"),this.tcicBoardView=null,this.boardViewDevTools&&this.boardViewDevTools.close(),e()})),t.destroy&&t.destroy()})));let o=Promise.resolve();this.tcicScreenShareBoardWindow&&(o=new Promise((e=>{this.tcicScreenShareBoardWindow.once("closed",(()=>{this._info("ShareBoardWindowClosed"),e()})),this.tcicScreenShareBoardWindow.close()})));let r=Promise.resolve();this.tcicScreenShareMainWindow&&(r=new Promise((e=>{this.tcicScreenShareMainWindow.once("closed",(()=>{this._info("ShareMainWindowClosed"),e()})),this.tcicScreenShareMainWindow.close()})));let s=Promise.resolve();if(this.tcicScreenShareCameraWindow&&(s=new Promise((e=>{this.tcicScreenShareCameraWindow.once("closed",(()=>{this._info("CameraMainWindowClosed"),e()})),this.tcicScreenShareCameraWindow.close()}))),this.ipcListeners&&(this.ipcListeners.forEach((e=>{e.channel&&e.listener&&c.default.ipcMain.off(e.channel,e.listener)})),this.ipcListeners=[]),this.ipcHandlers&&(this.ipcHandlers.forEach((e=>{e.channel&&c.default.ipcMain.removeHandler(e.channel)})),this.ipcHandlers=[]),this.gpuInfoWatcher&&c.default.app.off("gpu-info-update",this.gpuInfoWatcher),!e){this.tcicDefaultEntryMainWindow&&(i=new Promise((e=>{this.tcicDefaultEntryMainWindow.once("closed",(()=>{this._info("EntryMainWindowClosed"),this.tcicDefaultEntryMainWindow=null,e()})),this.tcicDefaultEntryMainWindow.close()})));try{this.onAllWindowClosedCallback&&this.onAllWindowClosedCallback()}catch(e){console.error("业务侧传入的onClose回调内发生了异常:",e)}}let a=Promise.resolve();return this.tcicScreenShareVideoWindow&&(a=new Promise((e=>{this.tcicScreenShareVideoWindow.once("closed",(()=>{this._info("ShareVideoWindowClosed"),e()})),this.tcicScreenShareVideoWindow.close()}))),Promise.all([t,i,n,o,r,a,s]).then((()=>{this.closeAllWindowInvoking=!1,this._info("CloseAllWindowFinish")}))}focus(){this.tcicScreenShareBoardWindow?this.tcicScreenShareBoardWindow.focus():this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.focus()}show(){this.tcicScreenShareBoardWindow?this.tcicScreenShareBoardWindow.show():this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.show()}sendCustomData(e){this.tcicMainView&&this.tcicMainView.webContents.send("sendCustomMessage",e)}_getClassName(){return"TencentCloudClass"}closeScreenShareBoardWindow(){this.tcicScreenShareBoardWindow&&(this.tcicScreenShareBoardWindow.getChildWindows().forEach((e=>{e.setParentWindow(null)})),this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.getBrowserViews().length>0&&this.tcicScreenShareBoardWindow.removeBrowserView(this.tcicBoardView),this.tcicScreenShareBoardWindow.close())}seriousErrorHandler(e,t=""){this.seriousErrorTimes+=1;const i=JSON.stringify({times:this.seriousErrorTimes,reason:e,detail:t});this._info("SeriouseError",i),c.crashReporter.addExtraParameter("seriousError",i),console.error("TCIC seriousErrorHandler",this.seriousErrorTimes,e);let n=!this.closeAllWindowInvoking&&this.seriousErrorTimes<=3,o=m.default.t("客户端遇到多次异常即将关闭,可从课堂列表再次进入,如果问题持续出现,请联系客服人员\n\n异常原因:{{reason}} - {{detail}}\n\n用户ID:{{arg_2}}",{reason:e,detail:t,arg_2:this.userId});switch(e){case"clean-exit":case"abnormal-exit":case"killed":n=!1;break;case"oom":o=m.default.t("客户端由于内存不足无法正常工作,请退出其它应用后从课堂列表再次进入\n\n用户ID:{{arg_0}}",{arg_0:this.userId}),n=!1}this.closeAllWindow(n).then((()=>{if(n)this.createAndInitWindow();else{const e={type:"info",title:m.default.t("客户端异常"),message:o,buttons:[m.default.t("退出课堂")]};c.default.dialog.showMessageBox(e).then((()=>{}))}}))}isPointInsideRect(e,t){return e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}isPointInsideClickableRects(e){if(!this.clickableRects.length)return!1;for(const t of this.clickableRects)if(this.isPointInsideRect(e,t))return!0;return!1}isPointInTransparentArea(e){return s(this,void 0,void 0,(function*(){if(!this.tcicScreenShareMainWindow||!this.tcicMainView)return!1;try{const t=this.tcicScreenShareMainWindow.getPosition(),i=e.x-t[0],n=e.y-t[1];return 0===(yield this.tcicMainView.webContents.capturePage({x:i,y:n,width:1,height:1})).getBitmap()[3]}catch(e){return this._info("capturePage","error"),!1}}))}detectScreenShareMainWindowMouseEventIgnored(e,t){return s(this,void 0,void 0,(function*(){if(!(this.watchMouseEventEnabled&&this.tcicScreenShareMainWindow&&this.tcicScreenShareBoardWindow&&this.tcicMainView))return;let i=!1;if("domRect"===this.clickableAreaDetectMode?i=!this.isPointInsideClickableRects({x:e,y:t}):"screenCapture"===this.clickableAreaDetectMode&&(i=yield this.isPointInTransparentArea({x:e,y:t})),i!==this.screenShareMainWindowMouseEventIgnored&&(this.tcicScreenShareMainWindow.setIgnoreMouseEvents(i,{forward:this.touchScreenOptimizeEnabled}),this.screenShareMainWindowMouseEventIgnored=i),0===this.shareParams.type){const i=this.isPointInsideRect({x:e,y:t},this.shareWindowBounds);let n=!1;n=0===this.lastSelectedScreenBoardToolType||!i,this.screenShareBoardWindowMouseEventIgnored!==n&&(this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(n),this.screenShareBoardWindowMouseEventIgnored=n)}"darwin"===process.platform&&(0===this.lastSelectedScreenBoardToolType||this.tcicScreenShareBoardWindow.isFocused()||this.tcicScreenShareBoardWindow.focus()),process.platform}))}enableScreenShareMainWindowTouchScreenOptimize(){!this.touchScreenOptimizePerformed&&this.watchMouseEventEnabled&&this.touchScreenOptimizeEnabled&&(this.touchScreenOptimizePerformed=!0,this.tcicMainView&&this.tcicMainView.webContents.postMessage("enableWatchMouseMoveEvent",!0),this.tcicBoardView&&(this.tcicBoardView.webContents.isLoading()?this.tcicBoardView.webContents.on("did-finish-load",(()=>{this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!0)})):this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!0)))}disableScreenShareMainWindowTouchScreenOptimize(){this.touchScreenOptimizePerformed&&(this.touchScreenOptimizePerformed=!1,console.log("disableScreenShareMainWindowTouchScreenOptimize"),this.tcicMainView&&this.tcicMainView.webContents.postMessage("enableWatchMouseMoveEvent",!1),this.tcicScreenShareBoardWindow&&(this.tcicBoardView.webContents.isLoading()?this.tcicBoardView.webContents.on("did-finish-load",(()=>{this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!1)})):this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!1)))}enableScreenShareMainWindowWatchMouseMove(){if(this.watchMouseEventEnabled)return;this.watchMouseEventEnabled=!0,console.log("enableWatchMouseMove");let e=0,t=0;this.watchMouseMoveTimer=setInterval((()=>{const i=c.default.screen.getCursorScreenPoint();i.x===e&&i.y===t||(e=i.x,t=i.y,this.detectScreenShareMainWindowMouseEventIgnored(e,t))}),300),this.enableScreenShareMainWindowTouchScreenOptimize(),this.tcicScreenShareMainWindow.on("closed",(()=>{this.disableScreenShareMainWindowWatchMouseMove()}))}disableScreenShareMainWindowWatchMouseMove(){var e;this.watchMouseEventEnabled&&(this.watchMouseEventEnabled=!1,this.watchMouseMoveTimer&&(clearInterval(this.watchMouseMoveTimer),this.watchMouseMoveTimer=null),this.disableScreenShareMainWindowTouchScreenOptimize(),null===(e=this.tcicScreenShareMainWindow)||void 0===e||e.setIgnoreMouseEvents(!1),this.screenShareMainWindowMouseEventIgnored=!1)}patchScreenShareMainWindowClickThrough(){"darwin"===process.platform?this.enableScreenShareMainWindowWatchMouseMove():"win32"===process.platform&&(g.isWin7()||c.default.app.getGPUFeatureStatus().gpu_compositing.includes("enabled")&&(this.enableScreenShareMainWindowWatchMouseMove(),this.gpuInfoWatcher||(this.gpuInfoWatcher=()=>{c.default.app.getGPUFeatureStatus().gpu_compositing.includes("enabled")||this.disableScreenShareMainWindowWatchMouseMove()},c.default.app.on("gpu-info-update",this.gpuInfoWatcher))))}createAndInitMainView(){if(this.tcicMainView)return;this.tcicMainView=new c.default.BrowserView({webPreferences:{preload:h.default.join(__dirname,"mainRenderer.bundle.js"),nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1,webSecurity:!1}}),this.tcicMainView.webContents.__sentryName="tcicMainView";const{spans:e}=v.sentry.startTransWithSpans([{name:"tcicMainView",op:"tcicMainView",description:"tcicMainView loadUrl到domReady",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"domReady",description:"domReady耗时"}),[t,i,n]=e;this.tcicMainView.webContents.once("dom-ready",(()=>{this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.show(),n.finish()})),p.TIWCacheManager.EnableWebContentsCache(this.tcicMainView.webContents,!0),this.tcicMainView.setAutoResize({width:!0,height:!0,horizontal:!0,vertical:!0}),this.tcicMainView.webContents.on("page-title-updated",((e,t,i)=>{i&&(this.windowTitle=t,this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.setTitle(t),this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.setTitle(t))}));const o=`${this.classUrl}&seriousError=${this.seriousErrorTimes}`,r=this.tcicMainView.webContents.loadURL(o).finally((()=>{t.finish()})),s=new Promise(((e,t)=>{this.tcicMainView.webContents.on("did-finish-load",(()=>{this._info("MainViewDidFinishLoad"),e()})),this.tcicMainView.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("MainViewDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).then((()=>{i.finish()}),(()=>{i.finish()}));Promise.all([r,s]).then((()=>{this.initializeOption.classSubType===T.College&&this.initWSService(),this._info("MainViewInitFinish"),this.tcicMainView.webContents.focus(),this.tcicMainView.webContents.send("init",JSON.parse(JSON.stringify(this.initializeOption)))})).catch((e=>{this._info("MainViewInitFail",JSON.stringify({error:JSON.stringify(e)}))})),this.tcicMainView.webContents.on("render-process-gone",((e,t)=>{this._info("MainViewRenderProcessGone",JSON.stringify({from:"tcicMainView.webContents",detail:t})),this.seriousErrorHandler(t.reason)})),this.tcicMainView.webContents.on("unresponsive",(()=>{this._info("MainViewUnresponsive"),this.seriousErrorHandler("unresponsive")})),this._info("MainViewInit",JSON.stringify({url:o}))}getMainWindowMinSize(e){e||(e="top");const t=c.default.screen.getPrimaryDisplay().workAreaSize;let i=718,n=110+i+45;n>t.height&&(i=Math.ceil(538.5),n=110+i+45,n>t.height&&(i=Math.ceil(359),n=110+i+45));const o=Math.ceil(i/9*16);return{width:Math.max(o,890),height:n}}createAndInitDefaultEntryMainWindow(){if(this.tcicDefaultEntryMainWindow)return;this._info("EntryMainWindowInit");const e=this.getMainWindowMinSize();let t=e;if(I.has("MainWindowBounds")&&(t=I.get("MainWindowBounds")),this.initializeOption.classSubType===T.College){console.log("大教学模式");const e=c.default.screen.getPrimaryDisplay().workAreaSize,t="win32"===process.platform;this.tcicDefaultEntryMainWindow=new c.default.BrowserWindow({width:e.width,height:e.height,fullscreen:t,resizable:!1,show:!1,frame:!1,maximizable:!1,skipTaskbar:!0,transparent:!0,title:"",webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}})}else console.log("其他模式"),this.tcicDefaultEntryMainWindow=new c.default.BrowserWindow({width:t.width<e.width?e.width:t.width,height:t.height<e.height?e.height:t.height,minWidth:e.width,minHeight:e.height,show:!1,frame:!1,maximizable:!1,fullscreen:!1,skipTaskbar:!1,title:this.windowTitle,backgroundColor:"#14181D",webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}});this.tcicDefaultEntryMainWindow.setMenu(null);let i=null;this.tcicDefaultEntryMainWindow.on("resize",(()=>{if(i&&clearTimeout(i),i=setTimeout((()=>{if(i=null,!this.tcicDefaultEntryMainWindow.isMinimized()&&!this.isMainWindowMaximized){const e=this.tcicDefaultEntryMainWindow.getBounds();I.set("MainWindowBounds",e)}}),100),this.tcicScreenShareVideoWindow){const e=this.tcicScreenShareVideoWindow.getBounds();this.resizeScreenShareVideoWindow({width:e.width,height:e.height})}if(this.tcicScreenShareCameraWindow){const e=this.tcicScreenShareCameraWindow.getBounds();this.resizeScreenShareCameraWindow({width:e.width,height:e.height})}})),this.tcicDefaultEntryMainWindow.on("move",(()=>{if(this.tcicScreenShareVideoWindow){const e=this.tcicDefaultEntryMainWindow.getPosition();this.tcicScreenShareVideoWindow.setPosition(e[0],e[1])}if(this.tcicScreenShareCameraWindow){const e=this.tcicDefaultEntryMainWindow.getPosition();this.tcicScreenShareCameraWindow.setPosition(e[0],e[1])}})),this.tcicDefaultEntryMainWindow.on("close",(e=>{this._info("CloseDefaultEntryMainWindow",JSON.stringify({invoke:this.closeAllWindowInvoking,sharing:this.isScreenSharing})),console.log("getUpdateStatus() CloseDefaultEntryMainWindow",(0,M.getUpdateStatus)()),(0,M.getUpdateStatus)()||this.closeAllWindowInvoking||(e.preventDefault(),this.isScreenSharing||this.tcicMainView&&this.tcicMainView.webContents.send("leaveClass"))}))}createAndInitBoardView(e,t){if(this.tcicBoardView)return;this._info("BoardViewInit",JSON.stringify({x:e.bounds.x,y:e.bounds.y,width:e.bounds.width,height:e.bounds.height,params:JSON.stringify(t)})),this.tcicBoardView=new c.default.BrowserView({webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,webSecurity:!1,session:c.default.session.fromPartition("board")}}),this.tcicBoardView.webContents.__sentryName="tcicBoardView";const{spans:i}=v.sentry.startTransWithSpans([{name:"tcicBoardView",op:"tcicBoardView",description:"tcicBoardView loadUrl到domReady",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"domReady",description:"domReady耗时"}),[n,o,r]=i;if(this.tcicBoardView.webContents.once("dom-ready",(()=>{this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.show(),r.finish()})),p.TIWCacheManager.EnableWebContentsCache(this.tcicBoardView.webContents,!0),this.tcicBoardView.setAutoResize({width:!0,height:!0,horizontal:!0,vertical:!0}),t){const i=this.boardUrl?this.tcicBoardView.webContents.loadURL(this.boardUrl).finally((()=>{n.finish()})):this.tcicBoardView.webContents.loadFile("board.html").finally((()=>{n.finish()})),o=new Promise(((e,t)=>{this.tcicBoardView.webContents.on("did-finish-load",(()=>{this._info("BoardViewDidFinishLoad"),e()})),this.tcicBoardView.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("BoardViewDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).finally((()=>{n.finish()}));Promise.all([i,o]).then((()=>{this._info("BoardViewInitFinish",JSON.stringify({boardMethodCache:JSON.stringify(this.callBoardMethodCache)})),t.shareWindowBounds={x:this.shareWindowBounds.x-e.bounds.x,y:this.shareWindowBounds.y-e.bounds.y,width:this.shareWindowBounds.width,height:this.shareWindowBounds.height},this.isBoardViewLoaded=!0,this.tcicBoardView.webContents.send("initBoard",t),this.callBoardMethodCache.forEach((e=>{this.callBoardMethod(e)})),this.callBoardMethodCache=[]})).catch((e=>{this._info("BoardViewInitFail",JSON.stringify({error:JSON.stringify(e)}))}))}this.tcicBoardView.webContents.on("render-process-gone",((e,t)=>{this._info("BoardViewRenderProcessGone",JSON.stringify({from:"tcicBoardView.webContents",details:t})),this.seriousErrorHandler(t.reason)})),this.tcicBoardView.webContents.on("unresponsive",(()=>{this._info("BoardViewUnResponsive"),this.seriousErrorHandler("unresponsive")}))}recreateScreenShareBoardWindow(e,t){console.log("recreateScreenShareBoardWindow"),this.closeScreenShareBoardWindow(),this.createAndInitScreenShareBoardWindow(e,t),this.attachBoardViewToScreenShareBoardWindow(),this.updateZOrderAccordingShareWindow(this.shareMainWindowDisplay,this.shareBoardWindowDisplay),this.tcicScreenShareBoardWindow.flashFrame(!1),this.screenShareMainWindowMouseEventIgnored=null,this.tcicMainView&&this.tcicMainView.webContents.send("rpc-no-ret",{method:"addIncludedShareWindows",args:[[this.tcicScreenShareBoardWindow.getMediaSourceId().split(":")[1]]]})}createAndInitScreenShareBoardWindow(e,t){this._info("BoardWindowInit",JSON.stringify({x:e.bounds.x,y:e.bounds.y,width:e.bounds.width,height:e.bounds.height,params:JSON.stringify(t)})),this.tcicScreenShareBoardWindow=new c.default.BrowserWindow({x:e.bounds.x,y:e.bounds.y,enableLargerThanScreen:!0,width:e.bounds.width,height:e.bounds.height,fullscreen:this.shouldFullscreen,frame:!1,transparent:!0,hasShadow:!1,skipTaskbar:!1,title:this.windowTitle,minimizable:!1,maximizable:!1,resizable:!1,acceptFirstMouse:!0,webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareBoardWindow.setMenu(null),this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(!0),this.screenShareBoardWindowMouseEventIgnored=!0,"darwin"===process.platform&&this.tcicScreenShareBoardWindow.setVisibleOnAllWorkspaces(!0),this.tcicScreenShareBoardWindow.on("restore",(()=>{var e;console.log("tcicScreenShareBoardWindow restore"),null===(e=this.tcicScreenShareBoardWindow)||void 0===e||e.setOpacity(1)})),this.tcicScreenShareBoardWindow.on("closed",(()=>{this.tcicScreenShareBoardWindow=null}))}createAndInitScreenShareCameraWindow(e){this.tcicScreenShareCameraWindow&&(this.tcicScreenShareCameraWindow.close(),this.tcicScreenShareCameraWindow=null);const t=this.tcicDefaultEntryMainWindow.getBounds();this._info("CameraWindowInit",JSON.stringify({bounds:JSON.stringify(t),params:JSON.stringify(e)})),this.tcicScreenShareCameraWindow=new c.default.BrowserWindow({x:t.x,y:t.y,width:t.width,height:t.height,frame:!1,hasShadow:!1,minimizable:!1,maximizable:!1,skipTaskbar:!0,focusable:!1,opacity:0,title:"",webPreferences:{preload:h.default.join(__dirname,"cameraRenderer.bundle.js"),nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareCameraWindow.webContents.__sentryName="tcicScreenShareCameraWindow";const{spans:i}=v.sentry.startTransWithSpans([{name:"tcicScreenShareCameraWindow",op:"tcicScreenShareCameraWindow",description:"tcicScreenShareCameraWindow loadUrl到show",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"show",description:"show耗时"}),[n,o,r]=i;this.resizeScreenShareCameraWindow({width:960,height:540}),this.tcicScreenShareCameraWindow.setIgnoreMouseEvents(!0),this.tcicScreenShareCameraWindow.setMenu(null),this.tcicScreenShareCameraWindow.once("show",(()=>{this.tcicDefaultEntryMainWindow.moveAbove(this.tcicScreenShareCameraWindow.getMediaSourceId()),this.tcicDefaultEntryMainWindow.show();const e="win32"===process.platform?0:1;this.tcicScreenShareCameraWindow.setOpacity(e),r.finish()}));const s=this.tcicScreenShareCameraWindow.webContents.loadFile(h.default.join(__dirname,"camera.html")).finally((()=>{n.finish()})),a=new Promise(((e,t)=>{this.tcicScreenShareCameraWindow.webContents.on("did-finish-load",(()=>{this._info("CameraWindowDidFinishLoad"),e()})),this.tcicScreenShareCameraWindow.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("CameraWindowDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).finally((()=>{o.finish()}));return new Promise(((e,t)=>{Promise.all([s,a]).then((()=>{const t=this.tcicScreenShareCameraWindow.getMediaSourceId().split(":")[1];this._info("CameraWindowInitFinish",JSON.stringify({sourceId:t})),e({sourceId:t})})).catch((e=>{this._info("CameraWindowInitFail",JSON.stringify({error:JSON.stringify(e)})),t(e)}))}))}resizeScreenShareCameraWindow(e){const t=this.tcicDefaultEntryMainWindow.getBounds();e.width>t.width&&(e.height=Math.floor(e.height/e.width*t.width),e.width=t.width),e.height>t.height&&(e.width=Math.floor(e.width/e.height*t.height),e.height=t.height),t.width=e.width,t.height=e.height,this.tcicScreenShareCameraWindow.setBounds(t)}closeScreenShareCameraWindow(){this.tcicScreenShareCameraWindow&&(this.tcicScreenShareCameraWindow.close(),this.tcicScreenShareCameraWindow=null)}createAndInitScreenShareMainWindow(e){this.tcicScreenShareMainWindow||(this._info("ShareMainWindowInit",JSON.stringify({x:e.bounds.x,y:e.bounds.y,width:e.bounds.width,height:e.bounds.height})),this.tcicScreenShareMainWindow=new c.default.BrowserWindow({x:e.bounds.x,y:e.bounds.y,enableLargerThanScreen:!0,width:e.bounds.width,height:e.bounds.height,fullscreen:this.shouldFullscreen,transparent:!0,frame:!1,hasShadow:!1,minimizable:!1,maximizable:!1,resizable:!1,skipTaskbar:!0,acceptFirstMouse:!0,webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareMainWindow.setMenu(null),this.tcicScreenShareMainWindow.on("close",(e=>{console.log("getUpdateStatus() tcicScreenShareMainWindow",(0,M.getUpdateStatus)()),(0,M.getUpdateStatus)()||!this.closeAllWindowInvoking&&this.isScreenSharing&&e.preventDefault()})),this.tcicScreenShareMainWindow.on("closed",(()=>{this.tcicScreenShareMainWindow=null})),this.patchScreenShareMainWindowClickThrough())}createAndInitScreenShareVideoWindow(e){this.tcicScreenShareVideoWindow&&(this.tcicScreenShareVideoWindow.close(),this.tcicScreenShareVideoWindow=null);const t=this.tcicDefaultEntryMainWindow.getBounds();this._info("VideoWindowInit",JSON.stringify({x:t.x,y:t.y,width:e.bounds.width,height:e.bounds.height,params:JSON.stringify(e)})),this.tcicScreenShareVideoWindow=new c.default.BrowserWindow({x:t.x,y:t.y,width:e.bounds.width,height:e.bounds.height,frame:!1,hasShadow:!1,minimizable:!1,maximizable:!1,skipTaskbar:!0,focusable:!1,opacity:0,title:"",webPreferences:{preload:h.default.join(__dirname,"videoRenderer.bundle.js"),nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareVideoWindow.webContents.__sentryName="tcicScreenShareVideoWindow";const{spans:i}=v.sentry.startTransWithSpans([{name:"tcicScreenShareVideoWindow",op:"tcicScreenShareVideoWindow",description:"tcicScreenShareVideoWindow loadUrl到domReady",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"domReady",description:"domReady耗时"}),[n,o,r]=i;this.tcicScreenShareVideoWindow.setIgnoreMouseEvents(!0),this.tcicScreenShareVideoWindow.setMenu(null),this.tcicScreenShareVideoWindow.once("show",(()=>{this.tcicDefaultEntryMainWindow.moveAbove(this.tcicScreenShareVideoWindow.getMediaSourceId()),this.tcicDefaultEntryMainWindow.show();const e="win32"===process.platform?0:1;this.tcicScreenShareVideoWindow.setOpacity(e),r.finish()}));const s=this.tcicScreenShareVideoWindow.webContents.loadFile(h.default.join(__dirname,"video.html")).finally((()=>{n.finish()})),a=new Promise(((e,t)=>{this.tcicScreenShareVideoWindow.webContents.on("did-finish-load",(()=>{this._info("VideoWindowDidFinishLoad"),e()})),this.tcicScreenShareVideoWindow.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("VideoWindowDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).finally((()=>{o.finish()}));return new Promise(((e,t)=>{Promise.all([s,a]).then((()=>{const t=this.tcicScreenShareVideoWindow.getMediaSourceId().split(":")[1];this._info("VideoWindowInitFinish",JSON.stringify({sourceId:t})),e({sourceId:t})})).catch((e=>{this._info("VideoWindowInitFail",JSON.stringify({error:JSON.stringify(e)})),t(e)}))}))}resizeScreenShareVideoWindow(e){const t=this.tcicDefaultEntryMainWindow.getBounds();e.width>t.width&&(e.height=Math.floor(e.height/e.width*t.width),e.width=t.width),e.height>t.height&&(e.width=Math.floor(e.width/e.height*t.height),e.height=t.height),t.width=e.width,t.height=e.height,this.tcicScreenShareVideoWindow.setBounds(t)}closeScreenShareVideoWindow(){this.tcicScreenShareVideoWindow&&(this.tcicScreenShareVideoWindow.close(),this.tcicScreenShareVideoWindow=null)}attachMainViewToDefaultEntryMainWindow(){if(this.tcicDefaultEntryMainWindow&&this.tcicMainView){this.tcicScreenShareMainWindow&&this.tcicScreenShareMainWindow.getBrowserViews().length>0&&this.tcicScreenShareMainWindow.removeBrowserView(this.tcicMainView),0===this.tcicDefaultEntryMainWindow.getBrowserViews().length&&this.tcicDefaultEntryMainWindow.addBrowserView(this.tcicMainView);const e=this.tcicDefaultEntryMainWindow.getContentBounds();this.tcicMainView.setBounds({x:0,y:0,width:e.width,height:e.height})}}attachMainViewToScreenShareMainWindow(){if(this.tcicScreenShareMainWindow&&this.tcicMainView){this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.getBrowserViews().length>0&&this.tcicDefaultEntryMainWindow.removeBrowserView(this.tcicMainView),0===this.tcicScreenShareMainWindow.getBrowserViews().length&&this.tcicScreenShareMainWindow.addBrowserView(this.tcicMainView);const e=this.tcicScreenShareMainWindow.getContentBounds();this.tcicMainView.setBounds({x:0,y:0,width:e.width,height:e.height})}}attachBoardViewToScreenShareBoardWindow(){if(this.tcicScreenShareBoardWindow&&this.tcicBoardView){this.tcicScreenShareBoardWindow.addBrowserView(this.tcicBoardView);const e=this.tcicScreenShareBoardWindow.getContentBounds();this.tcicBoardView.setBounds({x:0,y:0,width:e.width,height:e.height})}}openDevTools(){const e=c.default.screen.getPrimaryDisplay().size,t=e.width/2,i=600;this.tcicMainView&&(this.mainViewDevTools||(this.mainViewDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2+t,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 主视图"),webPreferences:{backgroundThrottling:!1}}),this.mainViewDevTools.on("close",(e=>{this.tcicMainView?(e.preventDefault(),this.mainViewDevTools.hide()):this.mainViewDevTools=null})),this.tcicMainView.webContents.setDevToolsWebContents(this.mainViewDevTools.webContents)),this.tcicMainView.webContents.openDevTools({mode:"detach"}),this.mainViewDevTools.show()),this.tcicBoardView&&(this.boardViewDevTools||(this.boardViewDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 白板"),webPreferences:{backgroundThrottling:!1}}),this.boardViewDevTools.on("close",(e=>{this.tcicScreenShareBoardWindow?(e.preventDefault(),this.boardViewDevTools.hide()):this.boardViewDevTools=null})),this.tcicBoardView.webContents.setDevToolsWebContents(this.boardViewDevTools.webContents)),this.tcicBoardView.webContents.openDevTools({mode:"detach"}),this.boardViewDevTools.show()),this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.webContents.openDevTools({mode:"detach"}),this.tcicScreenShareVideoWindow&&(this.videoWindowDevTools||(this.videoWindowDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 视频"),webPreferences:{backgroundThrottling:!1}}),this.videoWindowDevTools.on("close",(e=>{this.tcicScreenShareBoardWindow?(e.preventDefault(),this.videoWindowDevTools.hide()):this.videoWindowDevTools=null})),this.tcicScreenShareVideoWindow.webContents.setDevToolsWebContents(this.videoWindowDevTools.webContents)),this.tcicScreenShareVideoWindow.webContents.openDevTools({mode:"detach"}),this.videoWindowDevTools.show()),this.tcicScreenShareCameraWindow&&(this.cameraWindowDevTools||(this.cameraWindowDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 辅助摄像头"),webPreferences:{backgroundThrottling:!1}}),this.cameraWindowDevTools.on("close",(e=>{this.tcicScreenShareBoardWindow?(e.preventDefault(),this.cameraWindowDevTools.hide()):this.cameraWindowDevTools=null})),this.tcicScreenShareCameraWindow.webContents.setDevToolsWebContents(this.cameraWindowDevTools.webContents)),this.tcicScreenShareCameraWindow.webContents.openDevTools({mode:"detach"}),this.cameraWindowDevTools.show())}callBoardMethod(e){var t;if(this.isBoardViewLoaded){if(this._info("CallBoardMethod",JSON.stringify({params:JSON.stringify(e)})),"board"===e.module){if(this.tcicScreenShareBoardWindow&&"setToolType"===e.method){const t=e.params[0];0===t?(this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(!0),this.screenShareBoardWindowMouseEventIgnored=!0,"darwin"===process.platform&&this.tcicScreenShareBoardWindow.blur()):(this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(!1),this.screenShareBoardWindowMouseEventIgnored=!1),this.lastSelectedScreenBoardToolType=t}null===(t=this.tcicBoardView)||void 0===t||t.webContents.send("callMethod",e)}}else this.callBoardMethodCache.push(e)}addLifecycleIPCListener(e,t){console.debug("addLifecycleIPCListener:",e);const i=(i,...n)=>(console.debug("chan:",e,"name:",i.sender.__sentryName,"id:",i.sender.id,"frameId:",i.frameId,"processId:",i.processId,"args:",...n),t(i,...n));c.default.ipcMain.on(e,i),this.ipcListeners.push({channel:e,listener:i})}addLifecycleIPCHandler(e,t){console.debug("addLifecycleIPCHandler:",e);const i=(i,...n)=>(console.debug("hand:",e,"name:",i.sender.__sentryName,"id:",i.sender.id,"frameId:",i.frameId,"processId:",i.processId,"args:",...n),t(i,...n));c.default.ipcMain.handle(e,i),this.ipcHandlers.push({channel:e,handler:i})}registerIPCEvent(){this.addLifecycleIPCHandler("getAppInfo",(()=>({appVersion:c.app.getVersion(),appName:c.app.getName()}))),this.addLifecycleIPCHandler("getUserInfo",(()=>({id:this.userId,mac_address:(0,_.getMAC)()}))),this.addLifecycleIPCHandler("getSystemInfo",((e,t)=>s(this,void 0,void 0,(function*(){return yield u.get(t)})))),this.addLifecycleIPCListener("callMethod",((e,t)=>{this.callBoardMethod(t)})),this.addLifecycleIPCListener("setClickableAreaDetectMode",((e,t)=>{this.clickableAreaDetectMode=t.mode})),this.addLifecycleIPCListener("updateClickableRects",((e,t)=>{this.clickableRects=t.rects})),this.addLifecycleIPCListener("enableTouchScreenOptimize",(e=>{this.touchScreenOptimizeEnabled=!0,this.enableScreenShareMainWindowTouchScreenOptimize()})),this.addLifecycleIPCListener("onMouseEvent",((e,t)=>{this.detectScreenShareMainWindowMouseEventIgnored(t.x,t.y)})),this.addLifecycleIPCListener("onReloadWindow",((e,t,i)=>{this._info("onReloadWindow",`reason: ${t}, detail: ${i}`)})),this.addLifecycleIPCListener("onPageFinished",((e,t)=>{})),this.addLifecycleIPCListener("onCloseWindow",(()=>{this._info("onCloseWindow"),this.closeAllWindow().then()})),this.addLifecycleIPCListener("onMinimizeWindow",(()=>{this.tcicDefaultEntryMainWindow.isMinimized()?(this.tcicDefaultEntryMainWindow.restore(),console.log("TCIC unminimized")):(this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.setOpacity(0),this.tcicDefaultEntryMainWindow.minimize(),console.log("TCIC minimized"))})),this.tcicDefaultEntryMainWindow.on("restore",(()=>{if(this.tcicScreenShareVideoWindow){const e="win32"===process.platform?0:1;this.tcicScreenShareVideoWindow.setOpacity(e)}})),this.addLifecycleIPCListener("onMaximizeWindow",(()=>{this.isMainWindowMaximized?(console.log("TCIC unmaximized"),this.isMainWindowMaximized=!1,this.tcicDefaultEntryMainWindow.setResizable(!0),this.tcicDefaultEntryMainWindow.unmaximize(),g.setThickFrame(this.tcicDefaultEntryMainWindow,!0).then((()=>{this.tcicDefaultEntryMainWindow.setBounds(this.mainWindowBoundsBeforeMaximize)}))):(this.mainWindowBoundsBeforeMaximize=this.tcicDefaultEntryMainWindow.getBounds(),g.setThickFrame(this.tcicDefaultEntryMainWindow,!1).then((()=>{console.log("TCIC maximized"),this.isMainWindowMaximized=!0,this.tcicDefaultEntryMainWindow.maximize(),this.tcicDefaultEntryMainWindow.setResizable(!1)})))})),this.addLifecycleIPCListener("onClassLayoutChanged",((e,t)=>{if(!this.isMainWindowMaximized){const e=this.getMainWindowMinSize(t);this.tcicDefaultEntryMainWindow.setMinimumSize(e.width,e.height);const i=this.tcicDefaultEntryMainWindow.getBounds();if(i.width<e.width||i.height<e.height){this.tcicDefaultEntryMainWindow.setBounds({width:i.width<e.width?e.width:i.width,height:i.height<e.height?e.height:i.height},!0);const t=this.tcicDefaultEntryMainWindow.getBounds();I.set("MainWindowBounds",t),console.log("TCIC resize after layout",t)}}})),this.addLifecycleIPCListener("onScreenShareSnapshot",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onScreenShareSnapshot",t)})),this.addLifecycleIPCListener("onBoardCanRedoChange",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onBoardCanRedoChange",t)})),this.addLifecycleIPCListener("onBoardCanUndoChange",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onBoardCanUndoChange",t)})),this.addLifecycleIPCHandler("saveImage",((e,t)=>new Promise(((e,i)=>{const n=i=>{const n=t.base64Data.replace(/^data:image\/\w+;base64,/,""),o=Buffer.from(n,"base64");i?l.default.writeFile(i,o,(i=>{e(i?{snapId:t.snapId,module:"electron",errcode:-5,errmsg:i.message}:{snapId:t.snapId,snapName:t.snapName,totalSlices:1,totalSize:n.length,sliceIndex:0,sliceSize:n.length})})):e({snapId:t.snapId,module:"electron",errcode:0,errmsg:""})};t.dialog?c.default.dialog.showSaveDialog(this.tcicDefaultEntryMainWindow,{defaultPath:t.snapName,title:m.default.t("保存图片"),filters:[{name:"Custom File Type",extensions:["png","jpg"]}]}).then((e=>{n(e.filePath)})):g.getDesktopPath().then((e=>{const i=h.default.join(e,t.snapName);n(i)}))})))),this.addLifecycleIPCHandler("downloadMusic",((e,t)=>new Promise(((e,i)=>{let n;n="win32"===process.platform?h.default.join(process.env.USERPROFILE,"TencentCloudClass"):h.default.join(process.env.HOME,"TencentCloudClass"),n=h.default.join(n,"document"),l.default.existsSync(n)||l.default.mkdirSync(n,{recursive:!0});const o=h.default.join(n,`${t.documentId}_${t.url.substring(t.url.lastIndexOf("/")+1)}`);l.default.existsSync(o)?e(o):S.httpRequest(t.url,null,null,o).then((()=>{e(o)})).catch((e=>{i(e)}))})))),this.addLifecycleIPCHandler("loadVideo",((e,t)=>new Promise(((e,i)=>{this.createAndInitScreenShareVideoWindow(t).then((i=>{c.default.ipcMain.once("canplay",((t,n)=>{this.resizeScreenShareVideoWindow(n),e(i)})),this.tcicScreenShareVideoWindow.webContents.send("loadVideo",t.url)}))})))),this.addLifecycleIPCHandler("playVideo",(e=>{this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("playVideo")})),this.addLifecycleIPCHandler("seekVideo",((e,t)=>{this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("seekVideo",t)})),this.addLifecycleIPCHandler("pauseVideo",(e=>{this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("pauseVideo")})),this.addLifecycleIPCHandler("stopVideo",(e=>{this.tcicScreenShareVideoWindow&&(this.tcicScreenShareVideoWindow.webContents.send("stopVideo"),this.closeScreenShareVideoWindow())})),this.addLifecycleIPCHandler("setVideoVolume",((e,t)=>(this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("setVideoVolume",t),Promise.resolve()))),this.addLifecycleIPCListener("onVideoTimeSeeked",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onVideoTimeSeeked",t)})),this.addLifecycleIPCListener("onVideoTimeUpdate",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onVideoTimeUpdate",t)})),this.addLifecycleIPCHandler("startSubCamera",((e,t)=>new Promise(((e,i)=>{this.createAndInitScreenShareCameraWindow(t).then((i=>{c.default.ipcMain.once("playing",((t,n)=>{this.resizeScreenShareCameraWindow(n),e(i)})),this.tcicScreenShareCameraWindow&&this.tcicScreenShareCameraWindow.webContents.send("start",t)}))})))),this.addLifecycleIPCHandler("stopSubCamera",((e,t)=>new Promise(((e,t)=>{this.tcicScreenShareCameraWindow&&(this.tcicScreenShareCameraWindow&&this.tcicScreenShareCameraWindow.webContents.send("stop"),this.closeScreenShareCameraWindow()),e()})))),this.addLifecycleIPCHandler("getDeskTopWindows",((e,t)=>new Promise(((e,i)=>{let n=null;"win32"===process.platform?n=g:"darwin"===process.platform&&(n=w),null===n&&i(-2);let o=0;for(const e of t.pptArrName)if(""!==e&&(o=n.getDesktopWindow(e),o>0))break;if(t.bToShare)if(o>0)i(-1);else{for(const e of t.pptArrShareName)if(""!==e&&(o=n.getDesktopWindow(e),o>0))break;o>0?e(o):i(-1)}else o>0?e(o):i(-1)})))),this.addLifecycleIPCHandler("startScreenShare",((e,t,i)=>s(this,void 0,void 0,(function*(){this._info("StartScreenShare",JSON.stringify(t)),this.checkShareWindowBoundsTimer&&(clearInterval(this.checkShareWindowBoundsTimer),this.checkShareWindowBoundsTimer=null),this.shareParams=t,this.isScreenSharing=!0,this.tcicDefaultEntryMainWindow.hide();const e=this.getDisplay(t);return this.needToShowTaskbarFix="win32"===process.platform&&e.size.width===e.workAreaSize.width&&e.size.height===e.workAreaSize.height,this.needToShowTaskbarFix&&(this.isTaskbarAutoHiddenInDesktopEnabled=yield g.isTaskbarAutoHiddenInDesktopEnabled(),this.isTaskbarAutoHiddenInDesktopEnabled&&(yield g.setTaskbarAutoHiddenInDesktopEnabled(!1)),this.isTaskbarAutoHiddenInTabletEnabled=yield g.isTaskbarAutoHiddenInTabletEnabled(),this.isTaskbarAutoHiddenInTabletEnabled&&(yield g.setTaskbarAutoHiddenInTabletEnabled(!1)),c.default.screen.getAllDisplays().length>1&&(this.isShowTaskbarOnMultipleDisplays=yield g.isShowTaskbarOnMultipleDisplays(),this.isShowTaskbarOnMultipleDisplays||(yield g.setShowTaskbarOnMultipleDisplays(!0)))),new Promise((e=>{const n=()=>{t.followTarget?(this.shareMainWindowDisplay=this.getDisplay(t),this.shareBoardWindowDisplay=this.shareMainWindowDisplay):(this.shareMainWindowDisplay=this.getCurrentDisplay(),this.shareBoardWindowDisplay=this.getDisplay(t)),i||(this.createAndInitBoardView(this.shareBoardWindowDisplay,t),this.createAndInitScreenShareBoardWindow(this.shareBoardWindowDisplay,t),this.attachBoardViewToScreenShareBoardWindow(),this.createAndInitScreenShareMainWindow(this.shareMainWindowDisplay),this.attachMainViewToScreenShareMainWindow(),this.tcicScreenShareBoardWindow.hide(),this.tcicScreenShareMainWindow.hide(),setTimeout((()=>{this.tcicScreenShareBoardWindow.show(),this.tcicScreenShareMainWindow.show()}),600)),this.updateZOrderAccordingShareWindow(this.shareMainWindowDisplay,this.shareBoardWindowDisplay);const n=(0,D.debounce)(((e,t)=>{this.tcicBoardView&&this.tcicBoardView.webContents.send("onShareWindowBoundsChanged",{x:e.x-t.bounds.x,y:e.y-t.bounds.y,width:e.width,height:e.height})}),150,{trailing:!0,leading:!0});this.checkShareWindowBoundsTimer=setInterval((()=>{const e=this.getShareWindowBounds(t);if(void 0!==e.isMinimized&&this.shareWindowBounds.isMinimized!==e.isMinimized)return this.shareWindowBounds=e,void(e.isMinimized?this.tcicMainView&&this.tcicMainView.webContents.send("onElectronScreenSharePause"):this.tcicMainView&&this.tcicMainView.webContents.send("onElectronScreenShareResume"));if(this.shareWindowBounds.x!==e.x||this.shareWindowBounds.y!==e.y||this.shareWindowBounds.width!==e.width||this.shareWindowBounds.height!==e.height){this.shareWindowBounds=e;const i=this.getDisplay(t);this.shareBoardWindowDisplay.id!==i.id&&(this._info("ShareBoardWindowDisplayChanged",JSON.stringify({from:JSON.stringify(this.shareBoardWindowDisplay.bounds),to:JSON.stringify(i.bounds)})),console.log("ShareBoardWindowDisplayChanged",JSON.stringify({shareBoardWindowDisplayId:this.shareBoardWindowDisplay.id,from:JSON.stringify(this.shareBoardWindowDisplay.bounds),to:JSON.stringify(i.bounds)})),this.shareBoardWindowDisplay=i,this.recreateScreenShareBoardWindow(i,t)),n(e,i)}}),300);const o=this.tcicScreenShareMainWindow.getMediaSourceId().split(":")[1],r=this.tcicScreenShareBoardWindow.getMediaSourceId().split(":")[1];0===t.type?e({excludeShareWindowSourceIds:[o],includeShareWindowSourceIds:[r]}):e({excludeShareWindowSourceIds:[o],includeShareWindowSourceIds:[]})};if("win32"===process.platform){let e=0;const i=setInterval((()=>{const o=this.getDisplay(t);e+=1,(o.size.width!==o.workAreaSize.width||o.size.height!==o.workAreaSize.height||e>50)&&(clearInterval(i),n())}),100)}else n()}))})))),this.addLifecycleIPCHandler("hasScreenCapturePermission",(e=>s(this,void 0,void 0,(function*(){return w.hasScreenCapturePermission()})))),this.addLifecycleIPCHandler("openSystemPreferences",(e=>s(this,void 0,void 0,(function*(){return w.requestScreenCaptureAccess()})))),this.addLifecycleIPCHandler("getExcludeSelectWindows",(e=>s(this,void 0,void 0,(function*(){const e=[];if(this.tcicDefaultEntryMainWindow){const t=this.tcicDefaultEntryMainWindow.getMediaSourceId().split(":")[1];e.push(t)}return Promise.resolve(e)})))),this.addLifecycleIPCHandler("stopScreenShare",((e,t)=>s(this,void 0,void 0,(function*(){return this._info("StopScreenShare",JSON.stringify(t)),this.isScreenSharing=!1,this.attachMainViewToDefaultEntryMainWindow(),setTimeout((()=>{this.tcicDefaultEntryMainWindow.show(),setTimeout((()=>{this.tcicDefaultEntryMainWindow.focus();const e=this.tcicDefaultEntryMainWindow.getPosition();this.tcicDefaultEntryMainWindow.setPosition(e[0]+1,e[1]+1)}),300)}),600),this.tcicScreenShareMainWindow&&this.tcicScreenShareMainWindow.close(),this.tcicBoardView&&this.tcicBoardView.webContents.destroy&&this.tcicBoardView.webContents.destroy(),this.tcicBoardView=null,this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.close(),this.screenShareMainWindowMouseEventIgnored=!1,this.checkShareWindowBoundsTimer&&(clearInterval(this.checkShareWindowBoundsTimer),this.checkShareWindowBoundsTimer=null),this.needToShowTaskbarFix&&(this.isTaskbarAutoHiddenInDesktopEnabled&&(yield g.setTaskbarAutoHiddenInDesktopEnabled(!0)),this.isTaskbarAutoHiddenInTabletEnabled&&(yield g.setTaskbarAutoHiddenInTabletEnabled(!0)),c.default.screen.getAllDisplays().length>1&&(this.isShowTaskbarOnMultipleDisplays||(yield g.setShowTaskbarOnMultipleDisplays(!1)))),Promise.resolve()}))))}getCurrentDisplay(){return c.default.screen.getDisplayMatching(this.tcicDefaultEntryMainWindow.getBounds())}updateZOrderAccordingShareWindow(e,t){I.get("screenShareNotOnTop")||this.tcicScreenShareMainWindow&&this.tcicScreenShareBoardWindow&&(e.id===t.id?I.get("screenShareNotSetParent")?this.tcicScreenShareMainWindow.setAlwaysOnTop(!0,"screen-saver"):(this.tcicScreenShareMainWindow.setAlwaysOnTop(!1),this.tcicScreenShareMainWindow.setParentWindow(this.tcicScreenShareBoardWindow),this.tcicScreenShareBoardWindow.setAlwaysOnTop(!0,"screen-saver")):(this.tcicScreenShareMainWindow.setParentWindow(null),this.tcicScreenShareMainWindow.setAlwaysOnTop(!0,"screen-saver"),this.tcicScreenShareBoardWindow.setAlwaysOnTop(!0,"screen-saver")))}getShareWindowBounds(e){if(0===e.type){if("win32"===process.platform){const t=g.getWindowBounds(parseInt(e.displayId,10)),i=c.default.screen.screenToDipRect(null,t);return i.isMinimized=t.isMinimized,i}if("darwin"===process.platform)return w.getWindowBounds(parseInt(e.displayId,10))}return this.getDisplay(e).bounds}getDisplay(e){if(e.displayId){const t=c.default.screen.getAllDisplays();if(t.length>0){if("win32"===process.platform)return 0===e.type?c.default.screen.getDisplayMatching(g.getWindowBounds(parseInt(e.displayId,10))):c.default.screen.getDisplayMatching(g.getDesktopBounds(parseInt(e.displayId,10)));if("darwin"===process.platform&&0===e.type)return c.default.screen.getDisplayMatching(w.getWindowBounds(parseInt(e.displayId,10)))}for(const i of t)if(i.id.toString()===e.displayId)return i}return this.getCurrentDisplay()}initCacheModule(){return new Promise(((e,t)=>{let i=this.classUrl,n=null,o=null;try{n=new URL(this.classUrl),o=n.protocol,n.protocol="http:",n.search="",i=n.pathname}catch(e){return console.error("initCacheModule parse classUrl error:",e),c.default.dialog.showErrorBox(m.default.t("出错"),m.default.t("传入非法URL,课堂无法正常初始化: {{arg_0}}",{arg_0:this.classUrl})),void t(e)}let r=i.indexOf(".html");-1!==r&&(r=i.length);const s=i.lastIndexOf("/",r);if(-1===s)return c.default.dialog.showErrorBox(m.default.t("出错"),m.default.t("传入非法URL,课堂无法正常初始化: {{arg_0}}",{arg_0:this.classUrl})),void t("no / in url");n.pathname=i.substring(0,s),n.protocol=o,i=n.toString(),p.TIWCacheManager.SetCallback((e=>{this.tcicMainView&&this.tcicMainView.webContents.send("onVersionUpdate",{force:e})})),p.TIWCacheManager.SetConfig({configUrl:`${i}/cache/tiwcache.json`,configPath:h.default.join(__dirname,"config.json"),resourcePath:h.default.join(__dirname,"resource.zip"),resourceDir:b.tcicResourceDir}).then((()=>{this._info("initCacheModule",JSON.stringify({code:0,error:""})),e()})).catch((t=>{this._info("initCacheModule",JSON.stringify({code:-1,error:JSON.stringify(t)})),e()}))}))}createAndInitWindow(){this.shouldFullscreen=!1,"win32"===process.platform&&(c.default.systemPreferences.isAeroGlassEnabled()?this.shouldFullscreen=!0:c.default.dialog.showErrorBox(m.default.t("出错"),m.default.t("DWM未开启,不支持窗口透明特性"))),this.initCacheModule().then((()=>{p.TIWCacheManager.EnableCache(!I.get("disableCache")),this.createAndInitMainView(),I.get("autoOpenDevTools")&&this.openDevTools(),this.attachMainViewToDefaultEntryMainWindow(),this.registerIPCEvent()}))}checkHasInitialize(){return!!this.tcicDefaultEntryMainWindow}initWSService(){this.wss=new W.WebSocketServer({port:18081}),this.wss.on("connection",(e=>{e.on("message",(e=>{try{const t=JSON.parse(e.toString());this.tcicMainView&&this.tcicMainView.webContents.send("onReceiveMessage",t)}catch(e){console.error("message format error")}}))})),this.addLifecycleIPCHandler("onReceiveMessage",((e,t)=>new Promise(((e,i)=>{this.wss.clients.forEach((e=>{e.readyState===W.WebSocket.OPEN&&e.send(JSON.stringify(t))})),e()}))))}unInitWSService(){this.wss&&(this.wss.close(),this.wss=null)}}t.TencentCloudClass=B},61:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commonOption=void 0,t.commonOption={dsn:"https://9497a4f3e4e64dddb4dd2b2f12b39a7a@sentry.qcloudtiw.com/2",environment:"production"}},893:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hasScreenCapturePermission=t.requestScreenCaptureAccess=t.macOSVersion=t.getWindowBounds=t.getDesktopWindow=void 0;const a=r(i(124)),c=s(i(420)),d=r(i(728)),l=s(i(451)),h=s(i(747)),u=i(933),w=i(327),f=d.types.void,p=d.types.int,S=d.types.int,g=process.arch.includes("64")?d.types.uint64:d.types.uint32,m=g,y=m,W=m,C=m,b=g,M=d.types.uint32,v=d.types.uint32,_=d.types.int,D=d.types.CString,I=d.types.double,T=(0,l.default)({x:I,y:I}),V=(0,l.default)({width:I,height:I}),B=(0,l.default)({origin:T,size:V}),P=d.refType(B),k=(0,c.default)(g),x=134217984;let E=null,O=null;if("darwin"===process.platform)try{const e=a.DynamicLibrary("/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics");E=a.Library(e,{CGWindowListCopyWindowInfo:[W,[b,M]],CGWindowListCreateDescriptionFromArray:[W,[W]],CGRectMakeWithDictionaryRepresentation:[p,[C,P]],CGWindowListCreateImage:[m,[B,S,S,S]]});const t=a.DynamicLibrary("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation");O=a.Library(t,{CFArrayCreate:[W,[S,k,S,S]],CFStringCreateWithCString:[y,[S,D,v]],CFArrayGetCount:[_,[W]],CFArrayGetValueAtIndex:[m,[W,_]],CFDictionaryGetValue:[m,[C,y]],CFStringGetCString:[p,[y,D,_,v]],CFStringGetCStringPtr:[D,[y,v]],CFStringGetLength:[_,[y]],CFStringGetMaximumSizeForEncoding:[_,[_,v]],CFRelease:[f,[m]]})}catch(e){console.error(e)}t.getDesktopWindow=function(e){let t=0;if(E&&O){const i=O.CFStringCreateWithCString(0,"kCGWindowName",x),n=E.CGWindowListCopyWindowInfo(1,0),o=O.CFArrayGetCount(n);for(let r=0;r<o;++r){const o=O.CFArrayGetValueAtIndex(n,r),s=O.CFDictionaryGetValue(o,i);let a=O.CFStringGetCStringPtr(s,x);if(null===a&&s>0){const i=O.CFStringGetLength(s),n=O.CFStringGetMaximumSizeForEncoding(i,x)+1,o=new Buffer(n);if(o.type=d.types.CString,O.CFStringGetCString(s,o,n,x)&&(a=o.toString("utf8").replace(/\0/g,"")),a===e){t=1,console.log(`+++++=====${e}++++${a}`);break}}}O.CFRelease(n)}return t},t.getWindowBounds=function(e){const t={x:0,y:0,width:0,height:0,isMinimized:!1};if(E&&O)try{const i=new k(1);i[0]=e;const n=O.CFArrayCreate(0,i,i.length,0),o=E.CGWindowListCreateDescriptionFromArray(n);if(0===o)return t;if(O.CFArrayGetCount(o)>0){const e=O.CFArrayGetValueAtIndex(o,0),i=O.CFStringCreateWithCString(0,"kCGWindowBounds",x),n=O.CFDictionaryGetValue(e,i),r=new B;E.CGRectMakeWithDictionaryRepresentation(n,r.ref()),t.x=r.origin.x,t.y=r.origin.y,t.width=r.size.width,t.height=r.size.height;const s=O.CFStringCreateWithCString(0,"kCGWindowIsOnscreen",x),a=O.CFDictionaryGetValue(e,s);t.isMinimized=0===a,O.CFRelease(i),O.CFRelease(s)}O.CFRelease(o),O.CFRelease(n)}catch(e){console.error(e)}return t};let U;function A(){if(!U){const e=(e=>{const t=/<key>ProductVersion<\/key>\s*<string>([\d.]+)<\/string>/.exec(e);if(t)return t[1].replace("10.16","11")})(h.default.readFileSync("/System/Library/CoreServices/SystemVersion.plist","utf8"));if(!e)return;U=(e=>{const{length:t}=e.split(".");return 1===t?`${e}.0.0`:2===t?`${e}.0`:e})(e)}return U}t.macOSVersion=A;let R=!1;t.requestScreenCaptureAccess=function(){if(E&&O)try{const e=A().split(".").map((e=>parseInt(e,10)));if(e[0]<10||10===e[0]&&e[1]<15)return;const t=new B;t.origin.x=0,t.origin.y=0,t.size.width=1,t.size.height=1;const i=E.CGWindowListCreateImage(t,1,0,0);if(O.CFRelease(i),R){const e="security",t="Privacy_ScreenCapture";u.shell.openExternal(`x-apple.systempreferences:com.apple.preference.${e}${t?`?${t}`:""}`)}else R=!0}catch(e){console.error(e)}},t.hasScreenCapturePermission=function(){return(0,w.hasScreenCapturePermission)()}},519:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TCIC=t.classInstance=void 0;const r=i(209),s=i(867),a=i(231),c=i(412),d=o(i(933)),l=i(914),h=i(95);t.classInstance=null;let u="";t.TCIC={bootstrap:r.bootstrap,sentry:s.sentry,ResourceDir:h.tcicResourceDir,initialize(e){return n(this,void 0,void 0,(function*(){const i=e.onClose;e.onClose=()=>{i&&i(),t.classInstance=null},t.classInstance?this.show():(t.classInstance=new a.TencentCloudClass,globalThis.dbg||(globalThis.dbg={}),globalThis.dbg.cl=t.classInstance,yield t.classInstance.initialize(e))}))},closeAllWindow(){t.classInstance&&t.classInstance.closeAllWindow()},focus(){t.classInstance&&t.classInstance.focus()},show(){t.classInstance&&t.classInstance.show()},getVersion:()=>c.tcicSdkVersion,configUpdateUrl(e){console.log("configUpdateUrl:---------\x3e",e),u=e},setUpdateView(e){console.log("setUpdateView ----------\x3e> ",u),(0,l.setUpdateUrl)({url:u,notifiView:e.notifiView})},setUpdateUrl(e){console.log("--\x3echecking-for-update: setUpdateUrl",e.url),e.notifiView.send("gotUrl",e.url),(0,l.setUpdateUrl)(e)},checkUpdate(){console.log("--\x3echecking-for-update checkUpdate::in main"),(0,l.checkUpdate)()}};const w={downloading:!1,quitAndInstall:!1};[{name:"setUpdateUrl",handler:(e,i)=>{t.TCIC.setUpdateUrl(i)}},{name:"checkUpdate",handler:e=>{t.TCIC.checkUpdate()}},{name:"downloadUpdate",handler:e=>{w.downloading||(w.downloading=!0,(0,l.downloadUpdate)())}},{name:"quitAndInstall",handler:e=>{w.quitAndInstall||(w.quitAndInstall=!0,(0,l.quitAndInstall)())}}].forEach((e=>{d.default.ipcMain.handle(e.name,e.handler)})),e.exports=t.TCIC},209:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.bootstrap=void 0,i(867);const s=i(817),a=i(953),c=r(i(60)),d=i(933);let l=!1;t.bootstrap=()=>{if(!l){if(process.on("uncaughtException",(e=>{console.error("uncaughtException:",e)})),(0,a.startCrashReporter)(),s.TIWCacheManager.RegisterAsPrivileged(),"win32"===process.platform){const e=c.getPrimaryDisplaySize();e.width*e.height<=2073600&&(c.getMaxTouches()>1||c.isWin7())&&d.app.commandLine.appendSwitch("disable-gpu-compositing"),c.isWin7()&&d.app.commandLine.appendSwitch("disable-site-isolation-trials")}l=!0}},(0,t.bootstrap)()},953:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.startCrashReporter=void 0,i(699);const a=r(i(933)),c=s(i(747)),d=s(i(622)),l=i(95);t.startCrashReporter=()=>{if(a.app.isReady())throw new Error("startCrashReporter should be called before app.ready");a.app.setPath("crashDumps",d.default.join(l.tcicResourceDir,"crash"));const e=a.app.getPath("crashDumps");c.default.existsSync(e)||c.default.mkdirSync(e,{recursive:!0});const t={last:a.crashReporter.getLastCrashReport(),uploaded:a.crashReporter.getUploadedReports()};globalThis.dbg||(globalThis.dbg={});const{dbg:i}=globalThis;i.crashReports=t,i.electron=a.default}},364:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isMAC=t.getMAC=void 0;const n=i(87),o=/(?:[a-z0-9]{1,2}[:-]){5}[a-z0-9]{1,2}/i,r=/(?:[0]{1,2}[:-]){5}[0]{1,2}/;t.getMAC=function(e){const t=(0,n.networkInterfaces)();if(e){const i=t[e];if(!i)return"notfound";for(const e of i)if(!1===r.test(e.mac))return e.mac;return"notvalid"}for(const[e,i]of Object.entries(t))if(i)for(const e of i)if(!1===r.test(e.mac))return e.mac;return"unknown"},t.isMAC=function(e){return o.test(e)}},867:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sentry=void 0;const a=r(i(317)),c=i(615),d=i(412),l=i(61),h=i(933),u=i(364),w=i(519),f=i(317),p=i(785),S=i(409),g=[new p.SentryMinidump,new p.ElectronBreadcrumbs,new p.MainContext,new p.ChildProcess,new p.OnUncaughtException,new p.PreloadInjection,new p.AdditionalContext,new p.Screenshots,...S.defaultIntegrations.filter((e=>"OnUncaughtException"!==e.name&&"Context"!==e.name))];g.push(new p.MainProcessSession);class m{constructor(){this.inited=!1,this.appStartUpTrans=null,this.appStartUpSpans=[],this.captureMsg=a.captureMessage,this.captureError=function(e,t){return this.inited?a.captureException(e,t):""},this.closeAndFlush=()=>s(this,void 0,void 0,(function*(){return!this.inited||(yield a.close(2e3),this.inited=!1,!0)}))}static get instance(){return m.inst||(m.inst=new m,m.inst.init()),m.inst}init(){if(this.inited)return;a.init(Object.assign(Object.assign({},l.commonOption),{initialScope:{tags:{sdk:d.tcicSdkVersion,"extra.sdk":d.tcicSdkVersion,appName:h.app.getName(),appVersion:h.app.getVersion()},user:{mac_address:(0,u.getMAC)()}},getRendererName(e){if(e.__sentryName)return e.__sentryName;if(w.classInstance){const t=h.BrowserWindow.fromWebContents(e),{tcicMainView:i,tcicBoardView:n,tcicScreenShareVideoWindow:o,tcicDefaultEntryMainWindow:r,tcicScreenShareMainWindow:s,tcicScreenShareBoardWindow:a,tcicScreenShareCameraWindow:c}=w.classInstance.wins;switch(t){case i:return"tcicMainView";case n:return"tcicBoardView";case o:return"tcicScreenShareVideoWindow";case r:return"tcicDefaultEntryMainWindow";case s:return"tcicScreenShareMainWindow";case a:return"tcicScreenShareBoardWindow";case c:return"tcicScreenShareCameraWindow"}}return e.getTitle()},getSessions:()=>[h.session.defaultSession],IPCMode:f.IPCMode.Protocol,autoSessionTracking:!1,defaultIntegrations:!1,integrations:[...g,new c.CaptureConsole({levels:["error","warn","assert"]})],tracesSampleRate:1}));const e=a.startTransaction({op:"app-start",name:"appStartUp",description:"app启动时序",trimEnd:!0});this.appStartUpTrans=e;const t=e.startChild({op:"app.ready",description:"从第一行代码到app.ready耗时"});h.app.whenReady().then((()=>{t.finish()})),a.captureMessage("Sentry-inited.","info"),this.inited=!0}startUpAppChildSpan(e){const t=this.appStartUpTrans.startChild(e),i=t.finish.bind(t);return t.finish=(...e)=>{i(...e),this.finishAppStartUpTrans()},t}finishAppStartUpTrans(e){if(this.appStartUpTrans){for(const e of this.appStartUpSpans)if(!e.endTimestamp)return;this.appStartUpTrans.finish(e)}}startTransWithSpans(e,...t){const i=a.startTransaction(...e),n=[];for(const e of t){const t=i.startChild(e),o=t.finish.bind(t);t.finish=(...e)=>{o(...e);for(const e of n)if(!e.endTimestamp)return;i.finish()},n.push(t)}return{trans:i,spans:n}}setUserId(e){a.setUser({id:e}),a.captureMessage("UserId-updated.","info")}addClue(e){a.addBreadcrumb(e)}startTransaction(...e){return a.startTransaction(...e)}}t.sentry=m.instance},95:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tcicResourceDir=void 0;const o=n(i(747)),r=n(i(622));let s;s="win32"===process.platform?r.default.join(process.env.USERPROFILE,"TencentCloudClass"):r.default.join(process.env.HOME,"TencentCloudClass"),o.default.existsSync(s)||o.default.mkdirSync(s,{recursive:!0}),t.tcicResourceDir=s},817:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TIWCacheManager=void 0;const r=o(i(528)),s=i(933),a=o(i(747)),c=o(i(622)),d=o(i(605)),l=o(i(211)),h=o(i(138)),u=i(867);var w;!function(e){e[e.None=0]="None",e[e.Downloading=1]="Downloading",e[e.DownloadFailed=2]="DownloadFailed",e[e.DownloadSucc=3]="DownloadSucc"}(w||(w={}));class f{constructor(){this.retentionTime=2592e5,this.url="",this.path="",this.reg="",this.status=w.None,this.createTime=Date.parse((new Date).toString())}}class p{static EnableCache(e){if(p._enabled=e,p._timer&&(clearTimeout(p._timer),p._timer=null),p._enabled&&p._config&&p._serverConfig){const e=(t="")=>n(this,void 0,void 0,(function*(){console.log("refreshwork ",t,this._serverConfig.interval),yield p.RefreshServerConfig().catch((e=>{console.error(e)})),console.log("refreshwork done. set timer"),p._timer&&clearTimeout(p._timer),p._timer=setTimeout((()=>e("timer")),1e3*this._serverConfig.interval)}));e("1st")}}static SetCallback(e){p._cacheCallback=e}static SetConfig(e){return new Promise(((t,i)=>n(this,void 0,void 0,(function*(){const n=u.sentry.startTransaction({name:"TIWCacheManager::SetConfig",op:"TIWCacheManager::SetConfig",description:"TIWCacheManager::SetConfig 耗时"});try{p._config=e;const n=p.GetConfigDir(),o=p.GetZipDir(),r=p.GetResourceDir(),s=p.GetDocumentDir(),c=p.GetCourseCacheDir();a.default.existsSync(n)||a.default.mkdirSync(n,{recursive:!0}),a.default.existsSync(o)||a.default.mkdirSync(o,{recursive:!0}),a.default.existsSync(r)||a.default.mkdirSync(r,{recursive:!0}),a.default.existsSync(s)||a.default.mkdirSync(s,{recursive:!0}),c.length>0&&!a.default.existsSync(c)&&a.default.mkdirSync(c,{recursive:!0}),c.length>0&&!p._hadLoadCourseConfig&&(p._hadLoadCourseConfig=!0,p._coursewares.clear(),p.LoadCoursewareConfig());const d=p.GetConfigPath(),l=p.GetZipPath();let u=null;if(a.default.existsSync(d)&&(u=p.LoadServerConfigFromLocalFile(d),p.IsBundleResourceNew(e.configPath,u))){p.RemoveDirSync(r);const e=[];a.default.existsSync(d)&&e.push(a.default.promises.unlink(d)),a.default.existsSync(l)&&e.push(a.default.promises.unlink(l)),yield Promise.all(e),u=null}u?(console.warn("TIWCacheManager use cache files"),p._serverConfig=u,t()):a.default.existsSync(e.configPath)?a.default.existsSync(e.resourcePath)?a.default.promises.copyFile(e.configPath,d).then((()=>{console.info("TIWCacheManager update config file");const n=p.LoadServerConfigFromLocalFile(d);a.default.promises.copyFile(e.resourcePath,l).then((()=>{console.info("TIWCacheManager update resource file");try{p.RemoveDirSync(r),new h.default(l).extractAllTo(r,!0),p._serverConfig=n,t()}catch(e){a.default.existsSync(l)&&a.default.promises.unlink(l),a.default.existsSync(d)&&a.default.promises.unlink(d),console.error("TIWCacheManager resource unzip failed",e),i(e)}})).catch((()=>{i(`TIWCacheManager copyFile file error: ${e.resourcePath}`)}))})).catch((()=>{i(`TIWCacheManager resource file not found: ${e.configPath}`)})):i(`TIWCacheManager resource file not found: ${e.resourcePath}`):i(`TIWCacheManager config file not found: ${e.configPath}`)}catch(e){u.sentry.captureError(e,{tags:{ctx:"TIWCacheManager::SetConfig"}}),i(e)}finally{n.finish()}}))))}static PreloadCourseware(e,t=""){if(0===p.GetCourseConfigPath().length)return void Promise.reject("not set courseCacheDir by Call SetConfig");const i=p.GetCoursewarwId(e);if(0===i.length)return void Promise.reject("the zipUrl is not right courseware zip");const n=new f;n.url=e,n.reg=t,n.path=i;let o=!1;if(p._coursewares.hasOwnProperty(i)){const t=p._coursewares.get(i);t.status===w.Downloading&&t.url===e||(p._coursewares.set(i,n),o=!0)}else p._coursewares.set(i,n),o=!0;if(!o)return void Promise.reject("the zipUrl is donwloading");const r=p._coursewares.get(i);r.status=w.Downloading,p.SaveCoursewareConfig();const s=c.default.join(p.GetCourseCacheDir(),i,"/");p.RemoveDirSync(s),a.default.mkdirSync(s);const d=c.default.join(p.GetCourseCacheDir(),n.path,`${Date.parse((new Date).toString())}_tiwcourseware.zip`);return p.HttpRequest(e,null,null,d).then((()=>(new h.default(d).extractAllTo(s,!0),a.default.existsSync(d)&&a.default.unlinkSync(d),r.status=w.DownloadSucc,p.SaveCoursewareConfig(),Promise.resolve()))).catch((e=>(a.default.existsSync(d)&&a.default.unlinkSync(d),r.status=w.DownloadFailed,p.SaveCoursewareConfig(),Promise.reject("coursezip fetch failed"))))}static RefreshServerConfig(){return n(this,void 0,void 0,(function*(){if(console.warn("RefreshServerConfig:",p._isRefreshing,p._config.configUrl),!p._config.configUrl)return Promise.reject(r.default.t("缺少配置文件URL"));if(p._isRefreshing)return Promise.reject(r.default.t("上次刷新未完成"));const e=p.GetConfigPath(!0);p._isRefreshing=!0;try{const t=p._config.configUrl;yield p.HttpRequest(t,null,null,e);const i=p.LoadServerConfigFromLocalFile(e),n=p.GetResourceInfo(i);if(!n)return Promise.reject(r.default.t("新配置缺少可用资源信息"));const o=p.GetResourceInfo(p._serverConfig);if(o&&n&&o.version===n.version&&n.devBuildTime<=o.devBuildTime)return Promise.reject(r.default.t("新配置版本低于老配置版本: {{arg_0}} < {{arg_1}}",{arg_0:n.version,arg_1:o.version}));console.log("TIWCacheManager new config fetched",i);const s=p.GetZipPath(!0);yield p.HttpRequest(n.url,null,null,s).then((()=>{const t=`${s}.uncompressed`;a.default.existsSync(t)||a.default.mkdirSync(t,{recursive:!0}),new h.default(s).extractAllTo(t,!0);const n=p.GetResourceDir(),o=`${t}.bak`;a.default.renameSync(n,o),a.default.renameSync(t,n),p.RemoveDirSync(o);const r=p.GetConfigPath();a.default.existsSync(r)&&a.default.unlinkSync(r),a.default.existsSync(e)&&a.default.renameSync(e,r);const c=p.GetZipPath();if(a.default.existsSync(c)&&a.default.unlinkSync(c),a.default.renameSync(s,c),p._serverConfig=i,console.log("TIWCacheManager resource prepare done"),p._cacheCallback){const e=p._serverConfig.forceUpdate;p._cacheCallback(e)}return Promise.resolve()})).catch((e=>{a.default.existsSync(s)&&a.default.unlinkSync(s),console.error("TIWCacheManager resource fetch failed",e)}))}catch(t){a.default.existsSync(e)&&a.default.unlinkSync(e),console.error("TIWCacheManager config fetch failed",t)}finally{p._isRefreshing=!1,console.warn("RefreshServerConfig finished")}}))}static RegisterAsPrivileged(){return s.app.isReady()?(console.error("RegisterAsPrivileged can only be used before the ready event of the app module gets emitted!!!"),!1):(s.protocol.registerSchemesAsPrivileged([{scheme:p.TIWCacheSchemeHttp,privileges:p.TIWCacheSchemePrivileges},{scheme:p.TIWCacheSchemeHttps,privileges:p.TIWCacheSchemePrivileges}]),!0)}static GetResourcePath(e){if(!(p._enabled&&p._config&&p._config.resourceDir))return"";const t=p.GetResourceInfo(p._serverConfig);if(!t)return"";let i="";try{const n=new URL(e);if(t.hostnames&&!t.hostnames[n.hostname])return"";do{const o=`${n.origin}${n.pathname}`;if(t.files&&t.files.hasOwnProperty(o)){const e=t.files[o];if(e.toLowerCase().startsWith("http"))return e;i=c.default.join(p.GetResourceDir(),e);break}if(!i&&t.regexes)for(const e in t.regexes){let n=t.regexes[e];const r=o.match(e);if(r&&r.length>0){for(let e=1;e<=r.length;++e){const t=new RegExp(`\\$${e}`,"g");n=n.replace(t,r[e])}i=c.default.join(p.GetResourceDir(),n);break}}if(!i&&t.documents)for(const e in t.documents){const n=t.documents[e],r=o.match(e);if(r&&r.length>=3){const e=r[1],t=r[2],s=p.GetDocumentDir();i=o.replace(e,s),a.default.existsSync(i)||p.DownloadDocumentCategory(c.default.join(s,t,n),`${e}/${t}/${n}`);break}}if(!i){const t=p.GetCourseCacheDir();if(t.length>0)for(const[n,o]of p._coursewares)if(0===o.reg.length){const o=e.indexOf(n);if(-1!==o){const r=e.substring(o+n.length+1);i=c.default.join(t,n,r);break}}}}while(0)}catch(e){return console.error("GetResourcePath error:",e),""}return a.default.existsSync(i)?(console.debug("TIWCacheManager GetResourcePath : ==>> Hit :",e,i),i):(console.debug("TIWCacheManager GetResourcePath not hit :::::: url:",e," local:",i),"")}static EnableWebContentsCache(e,t){if(t){const t=e.session,i=t.protocol;if(i.isProtocolRegistered(p.TIWCacheSchemeHttp)||i.isProtocolRegistered(p.TIWCacheSchemeHttps))return;const n=(e,t)=>{if(p.TIWCacheFileMap.has(e.url)){const i=p.TIWCacheFileMap.get(e.url);console.debug("schemeHandler hit:",e.url,"path:",i),t({path:i}),p.TIWCacheFileMap.delete(e.url)}else console.warn("schemeHandler 404:",e.url),t({statusCode:404})};console.assert(!i.isProtocolRegistered(p.TIWCacheSchemeHttp),"tiw-cache duplicate registered!!!"),console.assert(!i.isProtocolRegistered(p.TIWCacheSchemeHttps),"tiw-caches duplicate registered!!!");let o=i.registerFileProtocol(p.TIWCacheSchemeHttp,n);console.assert(!0===o,`${p.TIWCacheSchemeHttp} register failed`),o=i.registerFileProtocol(p.TIWCacheSchemeHttps,n),console.assert(!0===o,`${p.TIWCacheSchemeHttps} register failed`),t.webRequest.onBeforeRequest(((e,t)=>{let i=e.url;const n=i.indexOf("://"),o=i.substring(0,n).toLowerCase(),r=i.substring(n);if(o===p.TIWCacheSchemeHttp||o===p.TIWCacheSchemeHttps){if(p.TIWCacheFileMap.has(i))return console.warn("onBeforeRequest hit:",i),void t({});i=o===p.TIWCacheSchemeHttp?`http${r}`:`https${r}`}else if("http"!==o&&"https"!==o)return void t({});console.assert("http"===o||"https"===o,"unexpected URL scheme: %s, %s",o,r);const s=p.GetResourcePath(i);if(""!==s){if(s.startsWith("http"))return console.warn(i," use redirect http(s):",s),void t({cancel:!1,redirectURL:s});if(i="https"===o||o===p.TIWCacheSchemeHttps?p.TIWCacheSchemeHttps+r:p.TIWCacheSchemeHttp+r,p.TIWCacheFileMap.set(i,s),i===e.url)return console.warn(i," already equals tiw-cache."),void t({});console.warn(e.url," redirect tiw-cache:",i),t({cancel:!1,redirectURL:i})}else t({})}))}else e.session.protocol.unregisterProtocol(p.TIWCacheSchemeHttp),e.session.protocol.unregisterProtocol(p.TIWCacheSchemeHttps),e.session.webRequest.onBeforeRequest(null)}static HttpRequest(e,t,i,n){const o=e.toLowerCase().startsWith("https://")?l.default:d.default;return new Promise(((r,s)=>{const c=n?a.default.createWriteStream(n):null,d=i?JSON.stringify(i):null,l=d?"POST":"GET";t||(t={}),d&&(t.hasOwnProperty("Content-Type")||(t["Content-Type"]="application/json"),t.hasOwnProperty("Content-Length")||(t["Content-Length"]=d.length.toString()));const h={method:l,headers:t},u=o.request(e,h,(t=>{if(200!==t.statusCode){const i=new Error(`Failed to get '${e}' (${t.statusCode})`);return console.error(i),void s(i)}if(c)t.pipe(c);else{let e="";t.on("data",(t=>{e+=t.toString()})),t.on("end",(()=>{r(e)}))}}));i&&u.write(d),c&&(c.on("finish",(()=>r(null))),c.on("error",(e=>{console.error(e),a.default.unlink(n,(()=>s(e)))}))),u.on("error",(e=>{console.error(e),n?a.default.unlink(n,(()=>s(e))):s(e)})),u.end()}))}static GetCoursewarwId(e){const t=new URL(e).pathname;let i=t.lastIndexOf("/");if(-1!==i){const e=t.substring(0,i);if(i=e.lastIndexOf("/"),-1!==i)return e.substring(i+1)}return""}static GetCourseConfigPath(){return void 0!==p._config.courseCacheDir&&p._config.courseCacheDir.length>0?c.default.join(p._config.courseCacheDir,"tiwcache_course_config.json"):""}static LoadServerConfigFromLocalFile(e){const t=a.default.readFileSync(e,"utf8");return JSON.parse(t)}static GetResourceInfo(e){if(!e)return;const t=`${p._config.sdkAppId}`,i=`${p._config.schoolId}`;let n=e.resources.find((e=>-1!==t.search(e.sdkAppId)&&-1!==i.search(e.schoolId)));return n||(n=e.resources.find((e=>"0"===e.sdkAppId&&"0"===e.schoolId))),n}static LoadCoursewareConfig(){const e=p.GetCourseConfigPath();if(a.default.existsSync(e)){p._coursewares.clear();const t=a.default.readFileSync(e,"utf8"),i=JSON.parse(t);for(const e in i)p._coursewares.set(e,i[e]);let n=!1;const o=p.GetCourseCacheDir(),r=Date.parse((new Date).toString());for(const[e,t]of p._coursewares)if(r.valueOf()-t.createTime.valueOf()>t.retentionTime.valueOf()){const i=o+t.path;p.RemoveDirSync(i),p._coursewares.delete(e),n=!0}else t.status!==w.DownloadSucc&&(t.createTime=Date.parse((new Date).toString()),t.status=w.None,n=!0);n&&p.SaveCoursewareConfig()}}static SaveCoursewareConfig(){const e=p.GetCourseConfigPath();a.default.existsSync(e)&&a.default.unlinkSync(e);const t={};for(const[e,i]of p._coursewares)t[e]=i;a.default.writeFileSync(e,JSON.stringify(t))}static GetConfigPath(e){return c.default.join(p.GetConfigDir(),`${e?(+new Date).toString():""}tiwcache.json`)}static GetZipPath(e){return c.default.join(p.GetZipDir(),`${e?(+new Date).toString():""}tiwresource.zip`)}static GetConfigDir(){return c.default.join(p._config.resourceDir,"tiwcache")}static GetLogDir(){return c.default.join(p._config.resourceDir,"tiwcache")}static GetZipDir(){return c.default.join(p._config.resourceDir,"tiwcache")}static GetResourceDir(){return c.default.join(p._config.resourceDir,"tiwcache","resource")}static GetDocumentDir(){return c.default.join(p._config.resourceDir,"tiwcache","document")}static GetCourseCacheDir(){return void 0===p._config.courseCacheDir?"":c.default.join(p._config.courseCacheDir,"tiwcache_courseware")}static IsBundleResourceNew(e,t){const i=p.LoadServerConfigFromLocalFile(e),n=p.GetResourceInfo(i),o=p.GetResourceInfo(t);return n&&o&&n.devBuildTime>o.devBuildTime}static DownloadDocumentCategory(e,t){if(a.default.existsSync(e))return p.DownloadDocumentFiles(e,t);if(p._documentState.get(t))return Promise.reject(r.default.t("下载中"));p._documentState.set(t,!0),console.log("TIWCacheManager document downloading",t);const i=c.default.normalize(e.substring(0,e.lastIndexOf(c.default.sep)+1));return a.default.mkdirSync(i),p.HttpRequest(t,null,null,e).then((()=>(console.log("TIWCacheManager document downloaded",t,e),p.ClearExpiredDocuments(),p.DownloadDocumentFiles(e,t)))).finally((()=>{p._documentState.set(t,!1)}))}static DownloadDocumentFiles(e,t,i=0){let n=p._documentInfo.get(e);if(!n){if(n=p.LoadDocumentInfoFromLocalFile(e,t),!n)return Promise.reject(r.default.t("课件文件列表解析失败"));n.files.sort(((e,t)=>e.priority-t.priority)),console.log("TIWCacheManager document info",t,n),p._documentInfo.set(e,n)}if(i>=n.files.length)return Promise.resolve();const o=n.files[i];if(!a.default.existsSync(o.path)){const n=o.path.substring(0,o.path.lastIndexOf(c.default.sep)+1);return a.default.mkdirSync(n,{recursive:!0}),console.log("TIWCacheManager document file downloading",t,i),p.HttpRequest(o.url,null,null,o.path).then((()=>(console.log("TIWCacheManager document file downloaded",t,i,o),p.DownloadDocumentFiles(e,t,i+1))))}return p.DownloadDocumentFiles(e,t,i+1)}static LoadDocumentInfoFromLocalFile(e,t){const i=a.default.readFileSync(e,"utf-8"),n=JSON.parse(i);n.path=e,n.url=t;const o=e.substring(0,e.lastIndexOf(c.default.sep)+1),r=t.substring(0,t.lastIndexOf("/")+1);return n.files.forEach((e=>{e.path=c.default.join(o,e.name),e.url=`${r}/${e.name}`})),n}static RemoveDirSync(e,t){if(!a.default.existsSync(e))return!0;let i=!0;return a.default.readdirSync(e).forEach((n=>{const o=c.default.join(e,n),r=a.default.statSync(o);!t||t(r)?r.isDirectory()?p.RemoveDirSync(o)||(i=!1):a.default.unlinkSync(o):r.isDirectory()&&p.RemoveDirSync(o,t)||(i=!1)})),!!i&&(a.default.rmdirSync(e),!0)}static ClearExpiredDocuments(){const e=new Date;p.RemoveDirSync(p.GetDocumentDir(),(t=>!t.isDirectory()||new Date(t.atime.getTime()+2592e5)<e))}}p.TIWCacheSchemeHttp="tiw-cache",p.TIWCacheSchemeHttps="tiw-caches",p.TIWCacheSchemePrivileges={standard:!0,secure:!0,bypassCSP:!0,allowServiceWorkers:!0,supportFetchAPI:!0,corsEnabled:!0},p.TIWCacheFileMap=new Map,p._enabled=!1,p._timer=null,p._isRefreshing=!1,p._documentState=new Map,p._documentInfo=new Map,p._cacheCallback=null,p._hadLoadCourseConfig=!1,p._coursewares=new Map,t.TIWCacheManager=p},699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},914:function(__unused_webpack_module,exports,__webpack_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t},__awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.quitAndInstall=exports.getUpdateStatus=exports.downloadUpdate=exports.checkUpdate=exports.setUpdateUrl=exports.getWebjs=exports.insertUpdateDom=void 0;const electron_updater_1=__webpack_require__(346),path=__importStar(__webpack_require__(622)),fs=__importStar(__webpack_require__(747));let FEED_URL=null;function loadView(e){return fs.readFileSync(path.resolve(__dirname,"view",e)).toString()}const tplStr=JSON.stringify({tpl:loadView("update.html")}),updatingConfig={isUpdating:!1};function insertUpdateDom(){const wraper=document.createElement("DIV"),loadTextObj="#replace#",loadText=loadTextObj.tpl,getJs=/<script>([^\^]+)<\/script>/gi.exec(loadText);wraper.innerHTML=loadText,document.body.appendChild(wraper),getJs&&eval(getJs[1])}function getWebjs(e,t){return`${e.toString().replace('"#replace#"',t)};${e.name}()`}function setUpdateUrl(e){const t=function(){let t=!1;return i=>!t&&(t=!0,e.notifiView)?e.notifiView.executeJavaScript(getWebjs(i,tplStr)):new Promise((e=>{e(!1)}))}(),i=function(t,i){e.notifiView&&e.notifiView.send("message",t,i)};FEED_URL=e.url,electron_updater_1.autoUpdater.setFeedURL(FEED_URL),electron_updater_1.autoUpdater.autoDownload=!1,electron_updater_1.autoUpdater.autoInstallOnAppQuit=!1,[{name:"error",handler(n){console.log("--\x3echecking-for-update =>",n),t(insertUpdateDom).then((()=>{i("error",n)})),console.log("will call cb",e.cb),e.cb&&e.cb("error",n)}},{name:"checking-for-update",handler(n){t(insertUpdateDom).then((()=>{console.log("--\x3echecking-for-update checking-for-updatingConfig.isUpdating",updatingConfig.isUpdating),i("checking-for-update",n)})).catch((e=>{console.log("checking-for-update:",e)})),e.cb&&e.cb("checking-for-update",n)}},{name:"update-available",handler(n){t(insertUpdateDom).then((()=>__awaiter(this,void 0,void 0,(function*(){if(i("update-available",n),console.log("--\x3echecking-for-update ::update-available=>",n,e.cb),e.cb){const t=yield e.cb("update-available",n);console.log("--\x3echecking-for-update ::confirmResult=>",t),t&&(console.log("--\x3echecking-for-update ::confirmResult=> isUpdating",updatingConfig.isUpdating),electron_updater_1.autoUpdater.downloadUpdate())}})))).catch((e=>{console.log("--\x3echecking-for-update -------\x3enotifiViewAction err ",e),console.error(e)}))}},{name:"update-not-available",handler(n){t(insertUpdateDom).then((()=>__awaiter(this,void 0,void 0,(function*(){i("update-not-available",n),console.log("--\x3echecking-for-update update-not-available ----\x3e>> ",n),e.cb&&e.cb("update-not-available",n)}))))}},{name:"download-progress",handler(t){console.log("download-progress::----",t),i("download-progress",t),e.cb&&e.cb("download-progress",t)}},{name:"update-downloaded",handler(t,n,o,r,s,a){return __awaiter(this,void 0,void 0,(function*(){const t={releaseNotes:n,releaseName:o,releaseDate:r,updateUrl:s,quitAndUpdate:a};e.cb&&(yield e.cb("update-downloaded",t))&&quitAndInstall(),updatingConfig.isUpdating=!0,i("update-downloaded",t)}))}}].forEach((e=>{electron_updater_1.autoUpdater.on(e.name,e.handler)}))}function checkUpdate(){console.log("checkUpdate fn:-----------\x3e",FEED_URL),FEED_URL?electron_updater_1.autoUpdater.checkForUpdates():console.error("Need setUpdateUrl")}exports.insertUpdateDom=insertUpdateDom,exports.getWebjs=getWebjs,exports.setUpdateUrl=setUpdateUrl,exports.checkUpdate=checkUpdate;const USER_HOME=process.env.HOME||process.env.USERPROFILE;function clearUpdateCache(){try{let e;"win32"===process.platform?e=path.join(process.env.LOCALAPPDATA||path.join(USER_HOME,"AppData","Local"),"TuritoWhiteboard-updater"):"darwin"===process.platform&&(e=path.join(__webpack_require__(87).homedir(),"Library","Application Support","Caches","TuritoWhiteboard-updater")),e&&fs.existsSync(e)&&(console.info("MAIN::clearUpdateCache do...",e),fs.rmdir(e,{recursive:!0},(()=>{})))}catch(e){console.error("MAIN::clearUpdateCache error",e)}}function downloadUpdate(){console.log("downloadUpdate----\x3e call"),electron_updater_1.autoUpdater.downloadUpdate()}function getUpdateStatus(){return updatingConfig.isUpdating}function quitAndInstall(){console.log("quitAndInstall----\x3e call"),electron_updater_1.autoUpdater.quitAndInstall()}exports.downloadUpdate=downloadUpdate,exports.getUpdateStatus=getUpdateStatus,exports.quitAndInstall=quitAndInstall},593:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.httpRequest=void 0;const o=n(i(211)),r=n(i(605)),s=n(i(747));t.httpRequest=function(e,t,i,n){const a=e.toLowerCase().startsWith("https://")?o.default:r.default;return new Promise(((o,r)=>{const c=n?s.default.createWriteStream(n):null,d=i?JSON.stringify(i):null,l=d?"POST":"GET";t||(t={}),d&&(t.hasOwnProperty("Content-Type")||(t["Content-Type"]="application/json"),t.hasOwnProperty("Content-Length")||(t["Content-Length"]=d.length.toString()));const h={method:l,headers:t},u=a.request(e,h,(t=>{if(200!==t.statusCode){const i=new Error(`Failed to get '${e}' (${t.statusCode})`);return console.error(i),void r(i)}if(c)t.pipe(c);else{let e="";t.on("data",(t=>{e+=t.toString()})),t.on("end",(()=>{o(e)}))}}));i&&u.write(d),c&&(c.on("finish",(()=>o(null))),c.on("error",(e=>{console.error(e),s.default.unlink(n,(()=>r(e)))}))),u.on("error",(e=>{console.error(e),n?s.default.unlink(n,(()=>r(e))):r(e)})),u.end()}))}},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tcicSdkBranch=t.tcicSdkVersion=void 0,t.tcicSdkVersion="1.8.13",t.tcicSdkBranch=""},60:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getDesktopWindow=t.isWin7=t.getDesktopBounds=t.getWindowBounds=t.setThickFrame=t.setShowTaskbarOnMultipleDisplays=t.isShowTaskbarOnMultipleDisplays=t.setTaskbarAutoHiddenInTabletEnabled=t.isTaskbarAutoHiddenInTabletEnabled=t.setTaskbarAutoHiddenInDesktopEnabled=t.isTaskbarAutoHiddenInDesktopEnabled=t.getPrimaryDisplaySize=t.getMaxTouches=t.getDesktopPath=void 0;const c=a(i(124)),d=a(i(747)),l=r(i(87)),h=a(i(622)),u=a(i(728)),w=a(i(451)),f=a(i(26)),p=u.default.types.bool,S=u.default.types.int,g=u.default.types.uint,m=process.arch.includes("64")?u.default.types.uint64:u.default.types.uint32,y=u.default.types.long,W=u.default.types.ulong,C=W,b=process.arch.includes("64")?u.default.types.int64:u.default.types.int32,M=process.arch.includes("64")?u.default.types.ulonglong:W,v=M,_=M,D=M,I=(0,w.default)({left:y,top:y,right:y,bottom:y}),T=u.default.refType(I),V=(0,w.default)({cbSize:C,hWnd:D,uCallbackMessage:g,uEdge:g,rc:I,lParam:b}),B=u.default.refType(V),P=536870912;let k=null,x=null;if("win32"===process.platform)try{k=c.default.Library("user32",{SendNotifyMessageA:[p,[D,g,m,"string"]],GetSystemMetrics:[S,[S]],FindWindowA:[D,["string",y]],GetWindowLongA:[y,[D,S]],SetWindowLongA:[y,[D,S,y]],GetWindowRect:[p,[D,T]],EnumDisplayMonitors:[p,[_,y,"pointer",b]],FindWindowW:[D,[y,"string"]],FindWindowExW:[D,[y,y,"string","string"]]}),x=c.default.Library("shell32",{SHAppBarMessage:[g,[g,B]]})}catch(e){console.error(e)}const E=function(e){return new Promise(((t,i)=>{const n={};f.default.list(e).on("data",(e=>{n[e.key]=e.data})).on("finish",(()=>{t(n)})).on("error",(e=>{i(e)}))}))},O=function(e){return new Promise(((t,i)=>{f.default.putValue(e,(e=>{e&&i(e),t()}))}))},U=function(){k&&k.SendNotifyMessageA(65535,26,0,"TraySettings")};t.getDesktopPath=function(){return s(this,void 0,void 0,(function*(){let e=h.default.join(l.homedir(),"Desktop"),t=d.default.existsSync(e);if("win32"===process.platform&&!t){const i="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",[n,o]=yield E(i).then((e=>[null,e])).catch((e=>[e,null]));if(!n&&o)try{t=!0,e=o[i].values.Desktop.value}catch(e){}}return t?e:""}))},t.getMaxTouches=function(){if(k){const e=95;return k.GetSystemMetrics(e)}return 0},t.getPrimaryDisplaySize=function(){if(k){const e=0,t=1;return{width:k.GetSystemMetrics(e),height:k.GetSystemMetrics(t)}}return null},t.isTaskbarAutoHiddenInDesktopEnabled=function(){return s(this,void 0,void 0,(function*(){if(x){const e=new V;return e.cbSize=V.size,1===x.SHAppBarMessage(4,e.ref())}return!1}))},t.setTaskbarAutoHiddenInDesktopEnabled=function(e){return s(this,void 0,void 0,(function*(){if(k&&x){const t=new V;return t.cbSize=V.size,t.hWnd=k.FindWindowA("Shell_TrayWnd",0),t.lParam=e?1:0,x.SHAppBarMessage(10,t.ref()),!0}return!1}))},t.isTaskbarAutoHiddenInTabletEnabled=function(){return s(this,void 0,void 0,(function*(){if("win32"===process.platform){const e="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",[t,i]=yield E(e).then((e=>[null,e])).catch((e=>[e,null]));if(!t&&i)try{return!!i[e].values.TaskbarAutoHideInTabletMode.value}catch(e){}}return!1}))},t.setTaskbarAutoHiddenInTabletEnabled=function(e){return s(this,void 0,void 0,(function*(){if("win32"===process.platform)try{const t={"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced":{TaskbarAutoHideInTabletMode:{value:e?1:0,type:"REG_DWORD"}}};return yield O(t),U(),!0}catch(e){}return!1}))},t.isShowTaskbarOnMultipleDisplays=function(){return s(this,void 0,void 0,(function*(){if("win32"===process.platform){const e="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",[t,i]=yield E(e).then((e=>[null,e])).catch((e=>[e,null]));if(!t&&i)try{return!!i[e].values.MMTaskbarEnabled.value}catch(e){}}return!1}))},t.setShowTaskbarOnMultipleDisplays=function(e){return s(this,void 0,void 0,(function*(){if("win32"===process.platform)try{const t={"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced":{MMTaskbarEnabled:{value:e?1:0,type:"REG_DWORD"}}};return yield O(t),U(),!0}catch(e){}return!1}))},t.setThickFrame=function(e,t){return s(this,void 0,void 0,(function*(){if(k){const i=parseInt(e.getMediaSourceId().split(":")[1],10),n=k.GetWindowLongA(i,-16),o=t?262144|n:-262145&n;return k.SetWindowLongA(i,-16,o),!0}return!1}))},t.getWindowBounds=function(e){const t={x:0,y:0,width:0,height:0,isMinimized:!1};if(k){const i=new I;k.GetWindowRect(e,i.ref())&&(t.x=i.left,t.y=i.top,t.width=i.right-i.left,t.height=i.bottom-i.top);const n=k.GetWindowLongA(e,-16);t.isMinimized=(n&P)===P}return t};const A=new Map;t.getDesktopBounds=function(e){let t=A.get(e);if(t)return t;if(t={x:0,y:0,width:0,height:0},k){let i=0;const n=e,o=c.default.Callback(p,[v,_,T,b],((e,o,r,s)=>{if(i+=1,i===n){const e=r.deref();return t.x=e.left,t.y=e.top,t.width=e.right-e.left,t.height=e.bottom-e.top,!1}return!0}));k.EnumDisplayMonitors(0,0,o,0)}return A.set(e,t),t},t.isWin7=function(){const e=l.release().split(".");if(e.length>=3){const t=parseInt(e[0],10),i=parseInt(e[1],10);return!(t>=10||6===t&&i>=2)}return!1},t.getDesktopWindow=function(e){const t=Buffer.from(e,"ucs2"),i=k.FindWindowW(0,t);return console.log(`+++++++++++++++++++++${i}`),i}},317:e=>{e.exports=require("@sentry/electron/main")},785:e=>{e.exports=require("@sentry/electron/main/integrations")},615:e=>{e.exports=require("@sentry/integrations")},409:e=>{e.exports=require("@sentry/node")},138:e=>{e.exports=require("adm-zip")},933:e=>{e.exports=require("electron")},765:e=>{e.exports=require("electron-store")},346:e=>{e.exports=require("electron-updater")},124:e=>{e.exports=require("ffi-napi")},747:e=>{e.exports=require("fs")},605:e=>{e.exports=require("http")},211:e=>{e.exports=require("https")},528:e=>{e.exports=require("i18next")},239:e=>{e.exports=require("i18next-resources-to-backend")},804:e=>{e.exports=require("lodash")},327:e=>{e.exports=require("mac-screen-capture-permissions")},87:e=>{e.exports=require("os")},622:e=>{e.exports=require("path")},420:e=>{e.exports=require("ref-array-napi")},728:e=>{e.exports=require("ref-napi")},451:e=>{e.exports=require("ref-struct-napi")},26:e=>{e.exports=require("regedit")},293:e=>{e.exports=require("systeminformation")},311:e=>{e.exports=require("tiw-log")},439:e=>{e.exports=require("ws")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.exports}var __webpack_exports__=__webpack_require__(519);return __webpack_exports__})()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TCIC=t():e.TCIC=t()}(global,(function(){return(()=>{"use strict";var __webpack_modules__={231:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TencentCloudClass=t.TClassSubType=t.TClassType=void 0;const c=r(i(933)),d=a(i(765)),l=a(i(747)),h=a(i(622)),u=r(i(293)),w=r(i(893)),f=i(412),p=i(817),S=r(i(593)),g=r(i(60)),m=a(i(528)),y=a(i(239)),W=i(439),C=i(311),b=i(95),M=i(914),v=i(867),_=i(364),D=i(804),I=new d.default;var T,V;(V=t.TClassType||(t.TClassType={}))[V.Interactive=0]="Interactive",V[V.Live=1]="Live",function(e){e.UnKnow="",e.Interactive="interactive",e.Live="live",e.College="college",e.CoTeaching="coteaching",e.OneOnOne="oneonone",e.RTC="rtc"}(T=t.TClassSubType||(t.TClassSubType={}));class B extends C.TLoggerElectronModule{constructor(){super(),this.initializeOption=null,this.classUrl="",this.boardUrl="",this.windowTitle="",this.tcicMainView=null,this.tcicBoardView=null,this.isBoardViewLoaded=!1,this.tcicScreenShareVideoWindow=null,this.tcicDefaultEntryMainWindow=null,this.tcicScreenShareMainWindow=null,this.tcicScreenShareBoardWindow=null,this.tcicScreenShareCameraWindow=null,this.watchMouseEventEnabled=!1,this.watchMouseMoveTimer=null,this.touchScreenOptimizeEnabled=!1,this.touchScreenOptimizePerformed=!1,this.screenShareMainWindowMouseEventIgnored=!1,this.screenShareBoardWindowMouseEventIgnored=!1,this.mainViewDevTools=null,this.boardViewDevTools=null,this.videoWindowDevTools=null,this.cameraWindowDevTools=null,this.shouldFullscreen=!1,this.closeAllWindowInvoking=!1,this.callBoardMethodCache=[],this.needToShowTaskbarFix=!1,this.isTaskbarAutoHiddenInDesktopEnabled=!1,this.isTaskbarAutoHiddenInTabletEnabled=!1,this.isShowTaskbarOnMultipleDisplays=!1,this.onAllWindowClosedCallback=null,this.lastSelectedScreenBoardToolType=0,this.ipcListeners=[],this.ipcHandlers=[],this.seriousErrorTimes=0,this.isScreenSharing=!1,this.shareParams=null,this.isMainWindowMaximized=!1,this.mainWindowBoundsBeforeMaximize={},this.gpuInfoWatcher=null,this.checkShareWindowBoundsTimer=null,this.shareWindowBounds={x:0,y:0,width:0,height:0,isMinimized:!1},this.shareMainWindowDisplay=null,this.shareBoardWindowDisplay=null,this.wss=null,this.userId="",this.clickableRects=[],this.clickableAreaDetectMode="domRect",console.log("constructor"),this.detectScreenShareMainWindowMouseEventIgnored=(0,D.debounce)(this.detectScreenShareMainWindowMouseEventIgnored.bind(this),150,{trailing:!0,leading:!0})}sendUpdateMessage(e="",t){this.tcicMainView&&this.tcicMainView.webContents.send("message",e,t)}get wins(){const{tcicMainView:e,tcicBoardView:t,tcicScreenShareVideoWindow:i,tcicDefaultEntryMainWindow:n,tcicScreenShareMainWindow:o,tcicScreenShareBoardWindow:r,tcicScreenShareCameraWindow:s}=this,{mainViewDevTools:a,boardViewDevTools:c,videoWindowDevTools:d,cameraWindowDevTools:l}=this,{screenShareMainWindowMouseEventIgnored:h,isScreenSharing:u,shareParams:w,checkShareWindowBoundsTimer:f,shareWindowBounds:p,shareMainWindowDisplay:S,shareBoardWindowDisplay:g}=this,{isBoardViewLoaded:m,callBoardMethodCache:y,lastSelectedScreenBoardToolType:W}=this;return{tcicMainView:e,tcicBoardView:t,tcicScreenShareVideoWindow:i,tcicDefaultEntryMainWindow:n,tcicScreenShareMainWindow:o,tcicScreenShareBoardWindow:r,tcicScreenShareCameraWindow:s,devtools:{mainViewDevTools:a,boardViewDevTools:c,videoWindowDevTools:d,cameraWindowDevTools:l},share:{screenShareMainWindowMouseEventIgnored:h,isScreenSharing:u,shareParams:w,checkShareWindowBoundsTimer:f,shareWindowBounds:p,shareMainWindowDisplay:S,shareBoardWindowDisplay:g},board:{isBoardViewLoaded:m,callBoardMethodCache:y,lastSelectedScreenBoardToolType:W}}}initialize(e){return s(this,void 0,void 0,(function*(){if(process.on("uncaughtException",(e=>{this._info("process-uncaughtException",String(e))})),this.checkHasInitialize())return this.tcicScreenShareBoardWindow?this.tcicScreenShareBoardWindow.show():this.tcicDefaultEntryMainWindow.show(),!1;if("function"==typeof e.onClose&&(this.onAllWindowClosedCallback=e.onClose),e.url)try{const t=e.url.split("?")[1].split("&");for(const i of t){const t=i.split("=");"schoolid"===t[0]?e.schoolId=parseInt(t[1],10):"userid"===t[0]?e.userId=t[1]:"classid"===t[0]?e.classId=parseInt(t[1],10):"classtype"===t[0]?e.classType=parseInt(t[1],10):"classsubtype"===t[0]?e.classSubType=t[1]:"lng"===t[0]&&(e.lng=t[1])}}catch(t){return console.error("parse url error",e.url),!1}if(e.sign){const t=new Buffer(e.sign.split(".")[1],"base64"),i=JSON.parse(t.toString("utf-8"));e.schoolId=i.school_id,e.classId=i.class_id,e.userId=i.user_id,e.cid=i.cid,e.uid=i.uid,e.scene=i.scene,e.token=e.sign,i.hasOwnProperty("class_type")&&(e.classType=i.class_type),i.hasOwnProperty("class_sub_type")&&(e.classSubType=i.class_sub_type)}this.initializeOption=e,this.userId=e.userId,v.sentry.setUserId(e.userId);const t=new C.TLoggerConfig;t.sdkAppId=e.schoolId,t.userId=e.userId,t.roomId=e.classId,t.nativeSdkVersion=f.tcicSdkVersion,this._setConfig(t),this._info("Initialize",JSON.stringify(e));const i=e.lng||c.default.app.getLocaleCountryCode();let n="en";["ja","en","ko","zh-tw","zh"].find((e=>{if(i.toLocaleLowerCase().match(e))return n=e,!0})),console.log(`language.toLocaleLowerCase 000000>>>>> ${n}`),yield((e="zh")=>(m.default.use((0,y.default)(((e,t,i)=>{const n=h.default.resolve(__dirname,"..","locales",`${e}.json`);l.default.promises.readFile(n,"utf8").then((e=>{i(null,JSON.parse(e))})).catch((e=>{i(e,null)}))}))),m.default.init({lng:e,load:"languageOnly",fallbackLng:!1,keySeparator:!1,nsSeparator:!1})))(n);let o=`schoolid=${e.schoolId}&userid=${e.userId}&classid=${e.classId}&token=${e.token}&webloadstamp=${(new Date).getTime()}&classtype=${e.classType}&watermark=${e.waterMark?JSON.stringify(e.waterMark):""}`;e.lng&&(o+=`&lng=${e.lng}`,m.default.changeLanguage(e.lng)),e.scene&&(o+=`&scene=${e.scene}`),e.classSubType&&(o+=`&classsubtype=${e.classSubType}`),e.debugCss&&(o+=`&debugcss=${e.debugCss}`),e.debugJs&&(o+=`&debugjs=${e.debugJs}`),e.customParams&&(o+=`&${e.customParams}`);let r=e.url;if(!r){let t=f.tcicSdkVersion.split(".");e.version&&(t=e.version.split("."));let i=`${t[0]}.${t[1]}.${t[2]}`;if(f.tcicSdkBranch){const e=f.tcicSdkBranch.match(/^(\d+).(\d+).(\d+).([\w-]+)$/);e&&e[1]===t[0]&&e[2]===t[1]&&e[3]===t[2]&&(i=f.tcicSdkBranch)}let n="";e.env&&"prod"!==e.env&&(n=`${e.env}-`),e.versionStr&&(i=`${e.versionStr}`),r=`https://${n}class.qcloudclass.com/${i}/class.html?${e.env?`env=${e.env}&`:""}${o}`,process.defaultApp&&(process.argv.includes("--local")?r=`http://localhost:8080/class.html?${e.env?`env=${e.env}&`:""}${o}`:process.argv.includes("--vm")&&(r=`http://10.211.55.2:8080/class.html?${e.env?`env=${e.env}&`:""}${o}`))}if(this.classUrl=r,!process.argv.includes("--local")){const e=e=>e?-1===e.indexOf(".html")?"":e.replace(/\/[^/]*\.html/,"/board.html").replace(/\?.*$/,"").replace(/\/+$/,""):"";this.boardUrl=e(this.classUrl)}return this.createAndInitDefaultEntryMainWindow(),c.default.app.whenReady().then((()=>{this.createAndInitWindow()})),c.default.globalShortcut.unregister("CmdOrCtrl+F11"),c.default.globalShortcut.register("CmdOrCtrl+F11",(()=>{this.tcicDefaultEntryMainWindow.webContents.reload(),this.openDevTools()})),c.default.globalShortcut.unregister("CmdOrCtrl+Shift+Q"),c.default.globalShortcut.register("CmdOrCtrl+Shift+Q",(()=>{this._info("CmdOrCtrl+Shift+Q"),this.closeAllWindow().then()})),c.default.globalShortcut.unregister("CmdOrCtrl+Shift+F11"),c.default.globalShortcut.register("CmdOrCtrl+Shift+F11",(()=>{const e={watch_mouse_event:this.watchMouseEventEnabled,touch_optimize_enabled:this.touchScreenOptimizeEnabled,touch_optimize_performed:this.touchScreenOptimizePerformed,gpu_compositing_enabled:c.default.app.getGPUFeatureStatus().gpu_compositing.includes("enabled"),max_touches:g.getMaxTouches(),primary_screen:g.getPrimaryDisplaySize()||c.default.screen.getPrimaryDisplay().size};"win32"===process.platform&&(e.aero_glass_enabled=c.default.systemPreferences.isAeroGlassEnabled());const t={type:"info",title:m.default.t("系统信息"),message:JSON.stringify(e,null,2),buttons:[m.default.t("关闭"),m.default.t("打开GPU排障页面"),I.get("autoOpenDevTools")?m.default.t("启动时不打开调试工具"):m.default.t("启动时打开调试工具"),I.get("screenShareNotOnTop")?m.default.t("屏幕分享时窗口置顶"):m.default.t("屏幕分享时窗口不置顶"),I.get("screenShareNotSetParent")?m.default.t("屏幕分享时设置父子窗口"):m.default.t("屏幕分享时窗口不设置父子窗口"),I.get("disableCache")?m.default.t("打开本地缓存"):m.default.t("关闭本地缓存"),m.default.t("清除本地记录信息")]};c.default.dialog.showMessageBox(t).then((e=>{switch(e.response){case 1:{const e=new c.default.BrowserWindow({title:m.default.t("GPU排障")});e.setMenu(null),e.loadURL("chrome://gpu"),e.show()}break;case 2:I.set("autoOpenDevTools",!I.get("autoOpenDevTools"));break;case 3:I.set("screenShareNotOnTop",!I.get("screenShareNotOnTop"));break;case 4:I.set("screenShareNotSetParent",!I.get("screenShareNotSetParent"));break;case 5:I.set("disableCache",!I.get("disableCache"));break;case 6:I.clear()}}))})),!0}))}closeAllWindow(e){if(this.closeAllWindowInvoking)return;this._info("CloseAllWindowStart"),this.closeAllWindowInvoking=!0;let t=Promise.resolve();this.tcicMainView&&(this.initializeOption.classSubType===T.College&&this.unInitWSService(),this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.getBrowserViews().length>0&&this.tcicDefaultEntryMainWindow.removeBrowserView(this.tcicMainView),t=new Promise((e=>{const t=this.tcicMainView?this.tcicMainView.webContents:null;t?(t.once("destroyed",(()=>{this._info("MainViewDestroyed"),this.tcicMainView=null,this.mainViewDevTools&&this.mainViewDevTools.close(),e()})),t.destroy&&t.destroy()):e()})));let i=Promise.resolve(),n=Promise.resolve();this.tcicBoardView&&(n=new Promise((e=>{const t=this.tcicBoardView.webContents;t.once("destroyed",(()=>{this._info("BoardViewDestroyed"),this.tcicBoardView=null,this.boardViewDevTools&&this.boardViewDevTools.close(),e()})),t.destroy&&t.destroy()})));let o=Promise.resolve();this.tcicScreenShareBoardWindow&&(o=new Promise((e=>{this.tcicScreenShareBoardWindow.once("closed",(()=>{this._info("ShareBoardWindowClosed"),e()})),this.tcicScreenShareBoardWindow.close()})));let r=Promise.resolve();this.tcicScreenShareMainWindow&&(r=new Promise((e=>{this.tcicScreenShareMainWindow.once("closed",(()=>{this._info("ShareMainWindowClosed"),e()})),this.tcicScreenShareMainWindow.close()})));let s=Promise.resolve();if(this.tcicScreenShareCameraWindow&&(s=new Promise((e=>{this.tcicScreenShareCameraWindow.once("closed",(()=>{this._info("CameraMainWindowClosed"),e()})),this.tcicScreenShareCameraWindow.close()}))),this.ipcListeners&&(this.ipcListeners.forEach((e=>{e.channel&&e.listener&&c.default.ipcMain.off(e.channel,e.listener)})),this.ipcListeners=[]),this.ipcHandlers&&(this.ipcHandlers.forEach((e=>{e.channel&&c.default.ipcMain.removeHandler(e.channel)})),this.ipcHandlers=[]),this.gpuInfoWatcher&&c.default.app.off("gpu-info-update",this.gpuInfoWatcher),!e){this.tcicDefaultEntryMainWindow&&(i=new Promise((e=>{this.tcicDefaultEntryMainWindow.once("closed",(()=>{this._info("EntryMainWindowClosed"),this.tcicDefaultEntryMainWindow=null,e()})),this.tcicDefaultEntryMainWindow.close()})));try{this.onAllWindowClosedCallback&&this.onAllWindowClosedCallback()}catch(e){console.error("业务侧传入的onClose回调内发生了异常:",e)}}let a=Promise.resolve();return this.tcicScreenShareVideoWindow&&(a=new Promise((e=>{this.tcicScreenShareVideoWindow.once("closed",(()=>{this._info("ShareVideoWindowClosed"),e()})),this.tcicScreenShareVideoWindow.close()}))),Promise.all([t,i,n,o,r,a,s]).then((()=>{this.closeAllWindowInvoking=!1,this._info("CloseAllWindowFinish")}))}focus(){this.tcicScreenShareBoardWindow?this.tcicScreenShareBoardWindow.focus():this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.focus()}show(){this.tcicScreenShareBoardWindow?this.tcicScreenShareBoardWindow.show():this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.show()}sendCustomData(e){this.tcicMainView&&this.tcicMainView.webContents.send("sendCustomMessage",e)}_getClassName(){return"TencentCloudClass"}closeScreenShareBoardWindow(){this.tcicScreenShareBoardWindow&&(this.tcicScreenShareBoardWindow.getChildWindows().forEach((e=>{e.setParentWindow(null)})),this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.getBrowserViews().length>0&&this.tcicScreenShareBoardWindow.removeBrowserView(this.tcicBoardView),this.tcicScreenShareBoardWindow.close())}seriousErrorHandler(e,t=""){this.seriousErrorTimes+=1;const i=JSON.stringify({times:this.seriousErrorTimes,reason:e,detail:t});this._info("SeriouseError",i),c.crashReporter.addExtraParameter("seriousError",i),console.error("TCIC seriousErrorHandler",this.seriousErrorTimes,e);let n=!this.closeAllWindowInvoking&&this.seriousErrorTimes<=3,o=m.default.t("客户端遇到多次异常即将关闭,可从课堂列表再次进入,如果问题持续出现,请联系客服人员\n\n异常原因:{{reason}} - {{detail}}\n\n用户ID:{{arg_2}}",{reason:e,detail:t,arg_2:this.userId});switch(e){case"clean-exit":case"abnormal-exit":case"killed":n=!1;break;case"oom":o=m.default.t("客户端由于内存不足无法正常工作,请退出其它应用后从课堂列表再次进入\n\n用户ID:{{arg_0}}",{arg_0:this.userId}),n=!1}this.closeAllWindow(n).then((()=>{if(n)this.createAndInitWindow();else{const e={type:"info",title:m.default.t("客户端异常"),message:o,buttons:[m.default.t("退出课堂")]};c.default.dialog.showMessageBox(e).then((()=>{}))}}))}isPointInsideRect(e,t){return e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}isPointInsideClickableRects(e){if(!this.clickableRects.length)return!1;for(const t of this.clickableRects)if(this.isPointInsideRect(e,t))return!0;return!1}isPointInTransparentArea(e){return s(this,void 0,void 0,(function*(){if(!this.tcicScreenShareMainWindow||!this.tcicMainView)return!1;try{const t=this.tcicScreenShareMainWindow.getPosition(),i=e.x-t[0],n=e.y-t[1];return 0===(yield this.tcicMainView.webContents.capturePage({x:i,y:n,width:1,height:1})).getBitmap()[3]}catch(e){return this._info("capturePage","error"),!1}}))}detectScreenShareMainWindowMouseEventIgnored(e,t){return s(this,void 0,void 0,(function*(){if(!(this.watchMouseEventEnabled&&this.tcicScreenShareMainWindow&&this.tcicScreenShareBoardWindow&&this.tcicMainView))return;let i=!1;if("domRect"===this.clickableAreaDetectMode?i=!this.isPointInsideClickableRects({x:e,y:t}):"screenCapture"===this.clickableAreaDetectMode&&(i=yield this.isPointInTransparentArea({x:e,y:t})),i!==this.screenShareMainWindowMouseEventIgnored&&(this.tcicScreenShareMainWindow.setIgnoreMouseEvents(i,{forward:this.touchScreenOptimizeEnabled}),this.screenShareMainWindowMouseEventIgnored=i),0===this.shareParams.type){const i=this.isPointInsideRect({x:e,y:t},this.shareWindowBounds);let n=!1;n=0===this.lastSelectedScreenBoardToolType||!i,this.screenShareBoardWindowMouseEventIgnored!==n&&(this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(n),this.screenShareBoardWindowMouseEventIgnored=n)}"darwin"===process.platform&&(0===this.lastSelectedScreenBoardToolType||this.tcicScreenShareBoardWindow.isFocused()||this.tcicScreenShareBoardWindow.focus()),process.platform}))}enableScreenShareMainWindowTouchScreenOptimize(){!this.touchScreenOptimizePerformed&&this.watchMouseEventEnabled&&this.touchScreenOptimizeEnabled&&(this.touchScreenOptimizePerformed=!0,this.tcicMainView&&this.tcicMainView.webContents.postMessage("enableWatchMouseMoveEvent",!0),this.tcicBoardView&&(this.tcicBoardView.webContents.isLoading()?this.tcicBoardView.webContents.on("did-finish-load",(()=>{this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!0)})):this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!0)))}disableScreenShareMainWindowTouchScreenOptimize(){this.touchScreenOptimizePerformed&&(this.touchScreenOptimizePerformed=!1,console.log("disableScreenShareMainWindowTouchScreenOptimize"),this.tcicMainView&&this.tcicMainView.webContents.postMessage("enableWatchMouseMoveEvent",!1),this.tcicScreenShareBoardWindow&&(this.tcicBoardView.webContents.isLoading()?this.tcicBoardView.webContents.on("did-finish-load",(()=>{this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!1)})):this.tcicBoardView.webContents.postMessage("enableWatchMouseMoveEvent",!1)))}enableScreenShareMainWindowWatchMouseMove(){if(this.watchMouseEventEnabled)return;this.watchMouseEventEnabled=!0,console.log("enableWatchMouseMove");let e=0,t=0;this.watchMouseMoveTimer=setInterval((()=>{const i=c.default.screen.getCursorScreenPoint();i.x===e&&i.y===t||(e=i.x,t=i.y,this.detectScreenShareMainWindowMouseEventIgnored(e,t))}),300),this.enableScreenShareMainWindowTouchScreenOptimize(),this.tcicScreenShareMainWindow.on("closed",(()=>{this.disableScreenShareMainWindowWatchMouseMove()}))}disableScreenShareMainWindowWatchMouseMove(){var e;this.watchMouseEventEnabled&&(this.watchMouseEventEnabled=!1,this.watchMouseMoveTimer&&(clearInterval(this.watchMouseMoveTimer),this.watchMouseMoveTimer=null),this.disableScreenShareMainWindowTouchScreenOptimize(),null===(e=this.tcicScreenShareMainWindow)||void 0===e||e.setIgnoreMouseEvents(!1),this.screenShareMainWindowMouseEventIgnored=!1)}patchScreenShareMainWindowClickThrough(){"darwin"===process.platform?this.enableScreenShareMainWindowWatchMouseMove():"win32"===process.platform&&(g.isWin7()||c.default.app.getGPUFeatureStatus().gpu_compositing.includes("enabled")&&(this.enableScreenShareMainWindowWatchMouseMove(),this.gpuInfoWatcher||(this.gpuInfoWatcher=()=>{c.default.app.getGPUFeatureStatus().gpu_compositing.includes("enabled")||this.disableScreenShareMainWindowWatchMouseMove()},c.default.app.on("gpu-info-update",this.gpuInfoWatcher))))}createAndInitMainView(){if(this.tcicMainView)return;this.tcicMainView=new c.default.BrowserView({webPreferences:{preload:h.default.join(__dirname,"mainRenderer.bundle.js"),nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1,webSecurity:!1}}),this.tcicMainView.webContents.__sentryName="tcicMainView";const{spans:e}=v.sentry.startTransWithSpans([{name:"tcicMainView",op:"tcicMainView",description:"tcicMainView loadUrl到domReady",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"domReady",description:"domReady耗时"}),[t,i,n]=e;this.tcicMainView.webContents.once("dom-ready",(()=>{this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.show(),n.finish()})),p.TIWCacheManager.EnableWebContentsCache(this.tcicMainView.webContents,!0),this.tcicMainView.setAutoResize({width:!0,height:!0,horizontal:!0,vertical:!0}),this.tcicMainView.webContents.on("page-title-updated",((e,t,i)=>{i&&(this.windowTitle=t,this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.setTitle(t),this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.setTitle(t))}));const o=`${this.classUrl}&seriousError=${this.seriousErrorTimes}`,r=this.tcicMainView.webContents.loadURL(o).finally((()=>{t.finish()})),s=new Promise(((e,t)=>{this.tcicMainView.webContents.on("did-finish-load",(()=>{this._info("MainViewDidFinishLoad"),e()})),this.tcicMainView.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("MainViewDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).then((()=>{i.finish()}),(()=>{i.finish()}));Promise.all([r,s]).then((()=>{this.initializeOption.classSubType===T.College&&this.initWSService(),this._info("MainViewInitFinish"),this.tcicMainView.webContents.focus(),this.tcicMainView.webContents.send("init",JSON.parse(JSON.stringify(this.initializeOption)))})).catch((e=>{this._info("MainViewInitFail",JSON.stringify({error:JSON.stringify(e)}))})),this.tcicMainView.webContents.on("render-process-gone",((e,t)=>{this._info("MainViewRenderProcessGone",JSON.stringify({from:"tcicMainView.webContents",detail:t})),this.seriousErrorHandler(t.reason)})),this.tcicMainView.webContents.on("unresponsive",(()=>{this._info("MainViewUnresponsive"),this.seriousErrorHandler("unresponsive")})),this._info("MainViewInit",JSON.stringify({url:o}))}getMainWindowMinSize(e){e||(e="top");const t=c.default.screen.getPrimaryDisplay().workAreaSize;let i=718,n=110+i+45;n>t.height&&(i=Math.ceil(538.5),n=110+i+45,n>t.height&&(i=Math.ceil(359),n=110+i+45));const o=Math.ceil(i/9*16);return{width:Math.max(o,890),height:n}}createAndInitDefaultEntryMainWindow(){if(this.tcicDefaultEntryMainWindow)return;this._info("EntryMainWindowInit");const e=this.getMainWindowMinSize();let t=e;if(I.has("MainWindowBounds")&&(t=I.get("MainWindowBounds")),this.initializeOption.classSubType===T.College){console.log("大教学模式");const e=c.default.screen.getPrimaryDisplay().workAreaSize,t="win32"===process.platform;this.tcicDefaultEntryMainWindow=new c.default.BrowserWindow({width:e.width,height:e.height,fullscreen:t,resizable:!1,show:!1,frame:!1,maximizable:!1,skipTaskbar:!0,transparent:!0,title:"",webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}})}else console.log("其他模式"),this.tcicDefaultEntryMainWindow=new c.default.BrowserWindow({width:t.width<e.width?e.width:t.width,height:t.height<e.height?e.height:t.height,minWidth:e.width,minHeight:e.height,show:!1,frame:!1,maximizable:!1,fullscreen:!1,skipTaskbar:!1,title:this.windowTitle,backgroundColor:"#14181D",webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}});this.tcicDefaultEntryMainWindow.setMenu(null);let i=null;this.tcicDefaultEntryMainWindow.on("resize",(()=>{if(i&&clearTimeout(i),i=setTimeout((()=>{if(i=null,!this.tcicDefaultEntryMainWindow.isMinimized()&&!this.isMainWindowMaximized){const e=this.tcicDefaultEntryMainWindow.getBounds();I.set("MainWindowBounds",e)}}),100),this.tcicScreenShareVideoWindow){const e=this.tcicScreenShareVideoWindow.getBounds();this.resizeScreenShareVideoWindow({width:e.width,height:e.height})}if(this.tcicScreenShareCameraWindow){const e=this.tcicScreenShareCameraWindow.getBounds();this.resizeScreenShareCameraWindow({width:e.width,height:e.height})}})),this.tcicDefaultEntryMainWindow.on("move",(()=>{if(this.tcicScreenShareVideoWindow){const e=this.tcicDefaultEntryMainWindow.getPosition();this.tcicScreenShareVideoWindow.setPosition(e[0],e[1])}if(this.tcicScreenShareCameraWindow){const e=this.tcicDefaultEntryMainWindow.getPosition();this.tcicScreenShareCameraWindow.setPosition(e[0],e[1])}})),this.tcicDefaultEntryMainWindow.on("close",(e=>{this._info("CloseDefaultEntryMainWindow",JSON.stringify({invoke:this.closeAllWindowInvoking,sharing:this.isScreenSharing})),console.log("getUpdateStatus() CloseDefaultEntryMainWindow",(0,M.getUpdateStatus)()),(0,M.getUpdateStatus)()||this.closeAllWindowInvoking||(e.preventDefault(),this.isScreenSharing||this.tcicMainView&&this.tcicMainView.webContents.send("leaveClass"))}))}createAndInitBoardView(e,t){if(this.tcicBoardView)return;this._info("BoardViewInit",JSON.stringify({x:e.bounds.x,y:e.bounds.y,width:e.bounds.width,height:e.bounds.height,params:JSON.stringify(t)})),this.tcicBoardView=new c.default.BrowserView({webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,webSecurity:!1,session:c.default.session.fromPartition("board")}}),this.tcicBoardView.webContents.__sentryName="tcicBoardView";const{spans:i}=v.sentry.startTransWithSpans([{name:"tcicBoardView",op:"tcicBoardView",description:"tcicBoardView loadUrl到domReady",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"domReady",description:"domReady耗时"}),[n,o,r]=i;if(this.tcicBoardView.webContents.once("dom-ready",(()=>{this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.show(),r.finish()})),p.TIWCacheManager.EnableWebContentsCache(this.tcicBoardView.webContents,!0),this.tcicBoardView.setAutoResize({width:!0,height:!0,horizontal:!0,vertical:!0}),t){const i=this.boardUrl?this.tcicBoardView.webContents.loadURL(this.boardUrl).finally((()=>{n.finish()})):this.tcicBoardView.webContents.loadFile("board.html").finally((()=>{n.finish()})),o=new Promise(((e,t)=>{this.tcicBoardView.webContents.on("did-finish-load",(()=>{this._info("BoardViewDidFinishLoad"),e()})),this.tcicBoardView.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("BoardViewDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).finally((()=>{n.finish()}));Promise.all([i,o]).then((()=>{this._info("BoardViewInitFinish",JSON.stringify({boardMethodCache:JSON.stringify(this.callBoardMethodCache)})),t.shareWindowBounds={x:this.shareWindowBounds.x-e.bounds.x,y:this.shareWindowBounds.y-e.bounds.y,width:this.shareWindowBounds.width,height:this.shareWindowBounds.height},this.isBoardViewLoaded=!0,this.tcicBoardView.webContents.send("initBoard",t),this.callBoardMethodCache.forEach((e=>{this.callBoardMethod(e)})),this.callBoardMethodCache=[]})).catch((e=>{this._info("BoardViewInitFail",JSON.stringify({error:JSON.stringify(e)}))}))}this.tcicBoardView.webContents.on("render-process-gone",((e,t)=>{this._info("BoardViewRenderProcessGone",JSON.stringify({from:"tcicBoardView.webContents",details:t})),this.seriousErrorHandler(t.reason)})),this.tcicBoardView.webContents.on("unresponsive",(()=>{this._info("BoardViewUnResponsive"),this.seriousErrorHandler("unresponsive")}))}recreateScreenShareBoardWindow(e,t){console.log("recreateScreenShareBoardWindow"),this.closeScreenShareBoardWindow(),this.createAndInitScreenShareBoardWindow(e,t),this.attachBoardViewToScreenShareBoardWindow(),this.updateZOrderAccordingShareWindow(this.shareMainWindowDisplay,this.shareBoardWindowDisplay),this.tcicScreenShareBoardWindow.flashFrame(!1),this.screenShareMainWindowMouseEventIgnored=null,this.tcicMainView&&this.tcicMainView.webContents.send("rpc-no-ret",{method:"addIncludedShareWindows",args:[[this.tcicScreenShareBoardWindow.getMediaSourceId().split(":")[1]]]})}createAndInitScreenShareBoardWindow(e,t){this._info("BoardWindowInit",JSON.stringify({x:e.bounds.x,y:e.bounds.y,width:e.bounds.width,height:e.bounds.height,params:JSON.stringify(t)})),this.tcicScreenShareBoardWindow=new c.default.BrowserWindow({x:e.bounds.x,y:e.bounds.y,enableLargerThanScreen:!0,width:e.bounds.width,height:e.bounds.height,fullscreen:this.shouldFullscreen,frame:!1,transparent:!0,hasShadow:!1,skipTaskbar:!1,title:this.windowTitle,minimizable:!1,maximizable:!1,resizable:!1,acceptFirstMouse:!0,webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareBoardWindow.setMenu(null),this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(!0),this.screenShareBoardWindowMouseEventIgnored=!0,"darwin"===process.platform&&this.tcicScreenShareBoardWindow.setVisibleOnAllWorkspaces(!0),this.tcicScreenShareBoardWindow.on("restore",(()=>{var e;console.log("tcicScreenShareBoardWindow restore"),null===(e=this.tcicScreenShareBoardWindow)||void 0===e||e.setOpacity(1)})),this.tcicScreenShareBoardWindow.on("closed",(()=>{this.tcicScreenShareBoardWindow=null}))}createAndInitScreenShareCameraWindow(e){this.tcicScreenShareCameraWindow&&(this.tcicScreenShareCameraWindow.close(),this.tcicScreenShareCameraWindow=null);const t=this.tcicDefaultEntryMainWindow.getBounds();this._info("CameraWindowInit",JSON.stringify({bounds:JSON.stringify(t),params:JSON.stringify(e)})),this.tcicScreenShareCameraWindow=new c.default.BrowserWindow({x:t.x,y:t.y,width:t.width,height:t.height,frame:!1,hasShadow:!1,minimizable:!1,maximizable:!1,skipTaskbar:!0,focusable:!1,opacity:0,title:"",webPreferences:{preload:h.default.join(__dirname,"cameraRenderer.bundle.js"),nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareCameraWindow.webContents.__sentryName="tcicScreenShareCameraWindow";const{spans:i}=v.sentry.startTransWithSpans([{name:"tcicScreenShareCameraWindow",op:"tcicScreenShareCameraWindow",description:"tcicScreenShareCameraWindow loadUrl到show",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"show",description:"show耗时"}),[n,o,r]=i;this.resizeScreenShareCameraWindow({width:960,height:540}),this.tcicScreenShareCameraWindow.setIgnoreMouseEvents(!0),this.tcicScreenShareCameraWindow.setMenu(null),this.tcicScreenShareCameraWindow.once("show",(()=>{this.tcicDefaultEntryMainWindow.moveAbove(this.tcicScreenShareCameraWindow.getMediaSourceId()),this.tcicDefaultEntryMainWindow.show();const e="win32"===process.platform?0:1;this.tcicScreenShareCameraWindow.setOpacity(e),r.finish()}));const s=this.tcicScreenShareCameraWindow.webContents.loadFile(h.default.join(__dirname,"camera.html")).finally((()=>{n.finish()})),a=new Promise(((e,t)=>{this.tcicScreenShareCameraWindow.webContents.on("did-finish-load",(()=>{this._info("CameraWindowDidFinishLoad"),e()})),this.tcicScreenShareCameraWindow.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("CameraWindowDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).finally((()=>{o.finish()}));return new Promise(((e,t)=>{Promise.all([s,a]).then((()=>{const t=this.tcicScreenShareCameraWindow.getMediaSourceId().split(":")[1];this._info("CameraWindowInitFinish",JSON.stringify({sourceId:t})),e({sourceId:t})})).catch((e=>{this._info("CameraWindowInitFail",JSON.stringify({error:JSON.stringify(e)})),t(e)}))}))}resizeScreenShareCameraWindow(e){const t=this.tcicDefaultEntryMainWindow.getBounds();e.width>t.width&&(e.height=Math.floor(e.height/e.width*t.width),e.width=t.width),e.height>t.height&&(e.width=Math.floor(e.width/e.height*t.height),e.height=t.height),t.width=e.width,t.height=e.height,this.tcicScreenShareCameraWindow.setBounds(t)}closeScreenShareCameraWindow(){this.tcicScreenShareCameraWindow&&(this.tcicScreenShareCameraWindow.close(),this.tcicScreenShareCameraWindow=null)}createAndInitScreenShareMainWindow(e){this.tcicScreenShareMainWindow||(this._info("ShareMainWindowInit",JSON.stringify({x:e.bounds.x,y:e.bounds.y,width:e.bounds.width,height:e.bounds.height})),this.tcicScreenShareMainWindow=new c.default.BrowserWindow({x:e.bounds.x,y:e.bounds.y,enableLargerThanScreen:!0,width:e.bounds.width,height:e.bounds.height,fullscreen:this.shouldFullscreen,transparent:!0,frame:!1,hasShadow:!1,minimizable:!1,maximizable:!1,resizable:!1,skipTaskbar:!0,acceptFirstMouse:!0,webPreferences:{nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareMainWindow.setMenu(null),this.tcicScreenShareMainWindow.on("close",(e=>{console.log("getUpdateStatus() tcicScreenShareMainWindow",(0,M.getUpdateStatus)()),(0,M.getUpdateStatus)()||!this.closeAllWindowInvoking&&this.isScreenSharing&&e.preventDefault()})),this.tcicScreenShareMainWindow.on("closed",(()=>{this.tcicScreenShareMainWindow=null})),this.patchScreenShareMainWindowClickThrough())}createAndInitScreenShareVideoWindow(e){this.tcicScreenShareVideoWindow&&(this.tcicScreenShareVideoWindow.close(),this.tcicScreenShareVideoWindow=null);const t=this.tcicDefaultEntryMainWindow.getBounds();this._info("VideoWindowInit",JSON.stringify({x:t.x,y:t.y,width:e.bounds.width,height:e.bounds.height,params:JSON.stringify(e)})),this.tcicScreenShareVideoWindow=new c.default.BrowserWindow({x:t.x,y:t.y,width:e.bounds.width,height:e.bounds.height,frame:!1,hasShadow:!1,minimizable:!1,maximizable:!1,skipTaskbar:!0,focusable:!1,opacity:0,title:"",webPreferences:{preload:h.default.join(__dirname,"videoRenderer.bundle.js"),nodeIntegration:!0,enableRemoteModule:!0,backgroundThrottling:!1,contextIsolation:!1}}),this.tcicScreenShareVideoWindow.webContents.__sentryName="tcicScreenShareVideoWindow";const{spans:i}=v.sentry.startTransWithSpans([{name:"tcicScreenShareVideoWindow",op:"tcicScreenShareVideoWindow",description:"tcicScreenShareVideoWindow loadUrl到domReady",trimEnd:!0}],{op:"loadUrl",description:"loadUrl耗时"},{op:"did-finish-load",description:"did-finish-load耗时"},{op:"domReady",description:"domReady耗时"}),[n,o,r]=i;this.tcicScreenShareVideoWindow.setIgnoreMouseEvents(!0),this.tcicScreenShareVideoWindow.setMenu(null),this.tcicScreenShareVideoWindow.once("show",(()=>{this.tcicDefaultEntryMainWindow.moveAbove(this.tcicScreenShareVideoWindow.getMediaSourceId()),this.tcicDefaultEntryMainWindow.show();const e="win32"===process.platform?0:1;this.tcicScreenShareVideoWindow.setOpacity(e),r.finish()}));const s=this.tcicScreenShareVideoWindow.webContents.loadFile(h.default.join(__dirname,"video.html")).finally((()=>{n.finish()})),a=new Promise(((e,t)=>{this.tcicScreenShareVideoWindow.webContents.on("did-finish-load",(()=>{this._info("VideoWindowDidFinishLoad"),e()})),this.tcicScreenShareVideoWindow.webContents.on("did-fail-load",((e,i,n,o,r,s,a)=>{this._info("VideoWindowDidFailLoad",JSON.stringify({code:i,desc:n})),t(e)}))})).finally((()=>{o.finish()}));return new Promise(((e,t)=>{Promise.all([s,a]).then((()=>{const t=this.tcicScreenShareVideoWindow.getMediaSourceId().split(":")[1];this._info("VideoWindowInitFinish",JSON.stringify({sourceId:t})),e({sourceId:t})})).catch((e=>{this._info("VideoWindowInitFail",JSON.stringify({error:JSON.stringify(e)})),t(e)}))}))}resizeScreenShareVideoWindow(e){const t=this.tcicDefaultEntryMainWindow.getBounds();e.width>t.width&&(e.height=Math.floor(e.height/e.width*t.width),e.width=t.width),e.height>t.height&&(e.width=Math.floor(e.width/e.height*t.height),e.height=t.height),t.width=e.width,t.height=e.height,this.tcicScreenShareVideoWindow.setBounds(t)}closeScreenShareVideoWindow(){this.tcicScreenShareVideoWindow&&(this.tcicScreenShareVideoWindow.close(),this.tcicScreenShareVideoWindow=null)}attachMainViewToDefaultEntryMainWindow(){if(this.tcicDefaultEntryMainWindow&&this.tcicMainView){this.tcicScreenShareMainWindow&&this.tcicScreenShareMainWindow.getBrowserViews().length>0&&this.tcicScreenShareMainWindow.removeBrowserView(this.tcicMainView),0===this.tcicDefaultEntryMainWindow.getBrowserViews().length&&this.tcicDefaultEntryMainWindow.addBrowserView(this.tcicMainView);const e=this.tcicDefaultEntryMainWindow.getContentBounds();this.tcicMainView.setBounds({x:0,y:0,width:e.width,height:e.height})}}attachMainViewToScreenShareMainWindow(){if(this.tcicScreenShareMainWindow&&this.tcicMainView){this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.getBrowserViews().length>0&&this.tcicDefaultEntryMainWindow.removeBrowserView(this.tcicMainView),0===this.tcicScreenShareMainWindow.getBrowserViews().length&&this.tcicScreenShareMainWindow.addBrowserView(this.tcicMainView);const e=this.tcicScreenShareMainWindow.getContentBounds();this.tcicMainView.setBounds({x:0,y:0,width:e.width,height:e.height})}}attachBoardViewToScreenShareBoardWindow(){if(this.tcicScreenShareBoardWindow&&this.tcicBoardView){this.tcicScreenShareBoardWindow.addBrowserView(this.tcicBoardView);const e=this.tcicScreenShareBoardWindow.getContentBounds();this.tcicBoardView.setBounds({x:0,y:0,width:e.width,height:e.height})}}openDevTools(){const e=c.default.screen.getPrimaryDisplay().size,t=e.width/2,i=600;this.tcicMainView&&(this.mainViewDevTools||(this.mainViewDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2+t,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 主视图"),webPreferences:{backgroundThrottling:!1}}),this.mainViewDevTools.on("close",(e=>{this.tcicMainView?(e.preventDefault(),this.mainViewDevTools.hide()):this.mainViewDevTools=null})),this.tcicMainView.webContents.setDevToolsWebContents(this.mainViewDevTools.webContents)),this.tcicMainView.webContents.openDevTools({mode:"detach"}),this.mainViewDevTools.show()),this.tcicBoardView&&(this.boardViewDevTools||(this.boardViewDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 白板"),webPreferences:{backgroundThrottling:!1}}),this.boardViewDevTools.on("close",(e=>{this.tcicScreenShareBoardWindow?(e.preventDefault(),this.boardViewDevTools.hide()):this.boardViewDevTools=null})),this.tcicBoardView.webContents.setDevToolsWebContents(this.boardViewDevTools.webContents)),this.tcicBoardView.webContents.openDevTools({mode:"detach"}),this.boardViewDevTools.show()),this.tcicDefaultEntryMainWindow&&this.tcicDefaultEntryMainWindow.webContents.openDevTools({mode:"detach"}),this.tcicScreenShareVideoWindow&&(this.videoWindowDevTools||(this.videoWindowDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 视频"),webPreferences:{backgroundThrottling:!1}}),this.videoWindowDevTools.on("close",(e=>{this.tcicScreenShareBoardWindow?(e.preventDefault(),this.videoWindowDevTools.hide()):this.videoWindowDevTools=null})),this.tcicScreenShareVideoWindow.webContents.setDevToolsWebContents(this.videoWindowDevTools.webContents)),this.tcicScreenShareVideoWindow.webContents.openDevTools({mode:"detach"}),this.videoWindowDevTools.show()),this.tcicScreenShareCameraWindow&&(this.cameraWindowDevTools||(this.cameraWindowDevTools=new c.default.BrowserWindow({width:t,height:i,x:(e.width-2*t)/2,y:(e.height-i)/2,title:m.default.t("开发者调试工具 - 辅助摄像头"),webPreferences:{backgroundThrottling:!1}}),this.cameraWindowDevTools.on("close",(e=>{this.tcicScreenShareBoardWindow?(e.preventDefault(),this.cameraWindowDevTools.hide()):this.cameraWindowDevTools=null})),this.tcicScreenShareCameraWindow.webContents.setDevToolsWebContents(this.cameraWindowDevTools.webContents)),this.tcicScreenShareCameraWindow.webContents.openDevTools({mode:"detach"}),this.cameraWindowDevTools.show())}callBoardMethod(e){var t;if(this.isBoardViewLoaded){if(this._info("CallBoardMethod",JSON.stringify({params:JSON.stringify(e)})),"board"===e.module){if(this.tcicScreenShareBoardWindow&&"setToolType"===e.method){const t=e.params[0];0===t?(this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(!0),this.screenShareBoardWindowMouseEventIgnored=!0,"darwin"===process.platform&&this.tcicScreenShareBoardWindow.blur()):(this.tcicScreenShareBoardWindow.setIgnoreMouseEvents(!1),this.screenShareBoardWindowMouseEventIgnored=!1),this.lastSelectedScreenBoardToolType=t}null===(t=this.tcicBoardView)||void 0===t||t.webContents.send("callMethod",e)}}else this.callBoardMethodCache.push(e)}addLifecycleIPCListener(e,t){console.debug("addLifecycleIPCListener:",e);const i=(i,...n)=>(console.debug("chan:",e,"name:",i.sender.__sentryName,"id:",i.sender.id,"frameId:",i.frameId,"processId:",i.processId,"args:",...n),t(i,...n));c.default.ipcMain.on(e,i),this.ipcListeners.push({channel:e,listener:i})}addLifecycleIPCHandler(e,t){console.debug("addLifecycleIPCHandler:",e);const i=(i,...n)=>(console.debug("hand:",e,"name:",i.sender.__sentryName,"id:",i.sender.id,"frameId:",i.frameId,"processId:",i.processId,"args:",...n),t(i,...n));c.default.ipcMain.handle(e,i),this.ipcHandlers.push({channel:e,handler:i})}registerIPCEvent(){this.addLifecycleIPCHandler("getAppInfo",(()=>({appVersion:c.app.getVersion(),appName:c.app.getName()}))),this.addLifecycleIPCHandler("getUserInfo",(()=>({id:this.userId,mac_address:(0,_.getMAC)()}))),this.addLifecycleIPCHandler("getSystemInfo",((e,t)=>s(this,void 0,void 0,(function*(){return yield u.get(t)})))),this.addLifecycleIPCListener("callMethod",((e,t)=>{this.callBoardMethod(t)})),this.addLifecycleIPCListener("setClickableAreaDetectMode",((e,t)=>{this.clickableAreaDetectMode=t.mode})),this.addLifecycleIPCListener("updateClickableRects",((e,t)=>{this.clickableRects=t.rects})),this.addLifecycleIPCListener("enableTouchScreenOptimize",(e=>{this.touchScreenOptimizeEnabled=!0,this.enableScreenShareMainWindowTouchScreenOptimize()})),this.addLifecycleIPCListener("onMouseEvent",((e,t)=>{this.detectScreenShareMainWindowMouseEventIgnored(t.x,t.y)})),this.addLifecycleIPCListener("onReloadWindow",((e,t,i)=>{this._info("onReloadWindow",`reason: ${t}, detail: ${i}`)})),this.addLifecycleIPCListener("onPageFinished",((e,t)=>{})),this.addLifecycleIPCListener("onCloseWindow",(()=>{this._info("onCloseWindow"),this.closeAllWindow().then()})),this.addLifecycleIPCListener("onMinimizeWindow",(()=>{this.tcicDefaultEntryMainWindow.isMinimized()?(this.tcicDefaultEntryMainWindow.restore(),console.log("TCIC unminimized")):(this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.setOpacity(0),this.tcicDefaultEntryMainWindow.minimize(),console.log("TCIC minimized"))})),this.tcicDefaultEntryMainWindow.on("restore",(()=>{if(this.tcicScreenShareVideoWindow){const e="win32"===process.platform?0:1;this.tcicScreenShareVideoWindow.setOpacity(e)}})),this.addLifecycleIPCListener("onMaximizeWindow",(()=>{this.isMainWindowMaximized?(console.log("TCIC unmaximized"),this.isMainWindowMaximized=!1,this.tcicDefaultEntryMainWindow.setResizable(!0),this.tcicDefaultEntryMainWindow.unmaximize(),g.setThickFrame(this.tcicDefaultEntryMainWindow,!0).then((()=>{this.tcicDefaultEntryMainWindow.setBounds(this.mainWindowBoundsBeforeMaximize)}))):(this.mainWindowBoundsBeforeMaximize=this.tcicDefaultEntryMainWindow.getBounds(),g.setThickFrame(this.tcicDefaultEntryMainWindow,!1).then((()=>{console.log("TCIC maximized"),this.isMainWindowMaximized=!0,this.tcicDefaultEntryMainWindow.maximize(),this.tcicDefaultEntryMainWindow.setResizable(!1)})))})),this.addLifecycleIPCListener("onClassLayoutChanged",((e,t)=>{if(!this.isMainWindowMaximized){const e=this.getMainWindowMinSize(t);this.tcicDefaultEntryMainWindow.setMinimumSize(e.width,e.height);const i=this.tcicDefaultEntryMainWindow.getBounds();if(i.width<e.width||i.height<e.height){this.tcicDefaultEntryMainWindow.setBounds({width:i.width<e.width?e.width:i.width,height:i.height<e.height?e.height:i.height},!0);const t=this.tcicDefaultEntryMainWindow.getBounds();I.set("MainWindowBounds",t),console.log("TCIC resize after layout",t)}}})),this.addLifecycleIPCListener("onScreenShareSnapshot",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onScreenShareSnapshot",t)})),this.addLifecycleIPCListener("onBoardCanRedoChange",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onBoardCanRedoChange",t)})),this.addLifecycleIPCListener("onBoardCanUndoChange",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onBoardCanUndoChange",t)})),this.addLifecycleIPCHandler("saveImage",((e,t)=>new Promise(((e,i)=>{const n=i=>{const n=t.base64Data.replace(/^data:image\/\w+;base64,/,""),o=Buffer.from(n,"base64");i?l.default.writeFile(i,o,(i=>{e(i?{snapId:t.snapId,module:"electron",errcode:-5,errmsg:i.message}:{snapId:t.snapId,snapName:t.snapName,totalSlices:1,totalSize:n.length,sliceIndex:0,sliceSize:n.length})})):e({snapId:t.snapId,module:"electron",errcode:0,errmsg:""})};t.dialog?c.default.dialog.showSaveDialog(this.tcicDefaultEntryMainWindow,{defaultPath:t.snapName,title:m.default.t("保存图片"),filters:[{name:"Custom File Type",extensions:["png","jpg"]}]}).then((e=>{n(e.filePath)})):g.getDesktopPath().then((e=>{const i=h.default.join(e,t.snapName);n(i)}))})))),this.addLifecycleIPCHandler("downloadMusic",((e,t)=>new Promise(((e,i)=>{let n;n="win32"===process.platform?h.default.join(process.env.USERPROFILE,"TencentCloudClass"):h.default.join(process.env.HOME,"TencentCloudClass"),n=h.default.join(n,"document"),l.default.existsSync(n)||l.default.mkdirSync(n,{recursive:!0});const o=h.default.join(n,`${t.documentId}_${t.url.substring(t.url.lastIndexOf("/")+1)}`);l.default.existsSync(o)?e(o):S.httpRequest(t.url,null,null,o).then((()=>{e(o)})).catch((e=>{i(e)}))})))),this.addLifecycleIPCHandler("loadVideo",((e,t)=>new Promise(((e,i)=>{this.createAndInitScreenShareVideoWindow(t).then((i=>{c.default.ipcMain.once("canplay",((t,n)=>{this.resizeScreenShareVideoWindow(n),e(i)})),this.tcicScreenShareVideoWindow.webContents.send("loadVideo",t.url)}))})))),this.addLifecycleIPCHandler("playVideo",(e=>{this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("playVideo")})),this.addLifecycleIPCHandler("seekVideo",((e,t)=>{this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("seekVideo",t)})),this.addLifecycleIPCHandler("pauseVideo",(e=>{this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("pauseVideo")})),this.addLifecycleIPCHandler("stopVideo",(e=>{this.tcicScreenShareVideoWindow&&(this.tcicScreenShareVideoWindow.webContents.send("stopVideo"),this.closeScreenShareVideoWindow())})),this.addLifecycleIPCHandler("setVideoVolume",((e,t)=>(this.tcicScreenShareVideoWindow&&this.tcicScreenShareVideoWindow.webContents.send("setVideoVolume",t),Promise.resolve()))),this.addLifecycleIPCListener("onVideoTimeSeeked",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onVideoTimeSeeked",t)})),this.addLifecycleIPCListener("onVideoTimeUpdate",((e,t)=>{this.tcicMainView&&this.tcicMainView.webContents.send("onVideoTimeUpdate",t)})),this.addLifecycleIPCHandler("startSubCamera",((e,t)=>new Promise(((e,i)=>{this.createAndInitScreenShareCameraWindow(t).then((i=>{c.default.ipcMain.once("playing",((t,n)=>{this.resizeScreenShareCameraWindow(n),e(i)})),this.tcicScreenShareCameraWindow&&this.tcicScreenShareCameraWindow.webContents.send("start",t)}))})))),this.addLifecycleIPCHandler("stopSubCamera",((e,t)=>new Promise(((e,t)=>{this.tcicScreenShareCameraWindow&&(this.tcicScreenShareCameraWindow&&this.tcicScreenShareCameraWindow.webContents.send("stop"),this.closeScreenShareCameraWindow()),e()})))),this.addLifecycleIPCHandler("getDeskTopWindows",((e,t)=>new Promise(((e,i)=>{let n=null;"win32"===process.platform?n=g:"darwin"===process.platform&&(n=w),null===n&&i(-2);let o=0;for(const e of t.pptArrName)if(""!==e&&(o=n.getDesktopWindow(e),o>0))break;if(t.bToShare)if(o>0)i(-1);else{for(const e of t.pptArrShareName)if(""!==e&&(o=n.getDesktopWindow(e),o>0))break;o>0?e(o):i(-1)}else o>0?e(o):i(-1)})))),this.addLifecycleIPCHandler("startScreenShare",((e,t,i)=>s(this,void 0,void 0,(function*(){this._info("StartScreenShare",JSON.stringify(t)),this.checkShareWindowBoundsTimer&&(clearInterval(this.checkShareWindowBoundsTimer),this.checkShareWindowBoundsTimer=null),this.shareParams=t,this.isScreenSharing=!0,this.tcicDefaultEntryMainWindow.hide();const e=this.getDisplay(t);return this.needToShowTaskbarFix="win32"===process.platform&&e.size.width===e.workAreaSize.width&&e.size.height===e.workAreaSize.height,this.needToShowTaskbarFix&&(this.isTaskbarAutoHiddenInDesktopEnabled=yield g.isTaskbarAutoHiddenInDesktopEnabled(),this.isTaskbarAutoHiddenInDesktopEnabled&&(yield g.setTaskbarAutoHiddenInDesktopEnabled(!1)),this.isTaskbarAutoHiddenInTabletEnabled=yield g.isTaskbarAutoHiddenInTabletEnabled(),this.isTaskbarAutoHiddenInTabletEnabled&&(yield g.setTaskbarAutoHiddenInTabletEnabled(!1)),c.default.screen.getAllDisplays().length>1&&(this.isShowTaskbarOnMultipleDisplays=yield g.isShowTaskbarOnMultipleDisplays(),this.isShowTaskbarOnMultipleDisplays||(yield g.setShowTaskbarOnMultipleDisplays(!0)))),new Promise((e=>{const n=()=>{t.followTarget?(this.shareMainWindowDisplay=this.getDisplay(t),this.shareBoardWindowDisplay=this.shareMainWindowDisplay):(this.shareMainWindowDisplay=this.getCurrentDisplay(),this.shareBoardWindowDisplay=this.getDisplay(t)),i||(this.createAndInitBoardView(this.shareBoardWindowDisplay,t),this.createAndInitScreenShareBoardWindow(this.shareBoardWindowDisplay,t),this.attachBoardViewToScreenShareBoardWindow(),this.createAndInitScreenShareMainWindow(this.shareMainWindowDisplay),this.attachMainViewToScreenShareMainWindow(),this.tcicScreenShareBoardWindow.hide(),this.tcicScreenShareMainWindow.hide(),setTimeout((()=>{this.tcicScreenShareBoardWindow.show(),this.tcicScreenShareMainWindow.show()}),600)),this.updateZOrderAccordingShareWindow(this.shareMainWindowDisplay,this.shareBoardWindowDisplay);const n=(0,D.debounce)(((e,t)=>{this.tcicBoardView&&this.tcicBoardView.webContents.send("onShareWindowBoundsChanged",{x:e.x-t.bounds.x,y:e.y-t.bounds.y,width:e.width,height:e.height})}),150,{trailing:!0,leading:!0});this.checkShareWindowBoundsTimer=setInterval((()=>{const e=this.getShareWindowBounds(t);if(void 0!==e.isMinimized&&this.shareWindowBounds.isMinimized!==e.isMinimized)return this.shareWindowBounds=e,void(e.isMinimized?this.tcicMainView&&this.tcicMainView.webContents.send("onElectronScreenSharePause"):this.tcicMainView&&this.tcicMainView.webContents.send("onElectronScreenShareResume"));if(this.shareWindowBounds.x!==e.x||this.shareWindowBounds.y!==e.y||this.shareWindowBounds.width!==e.width||this.shareWindowBounds.height!==e.height){this.shareWindowBounds=e;const i=this.getDisplay(t);this.shareBoardWindowDisplay.id!==i.id&&(this._info("ShareBoardWindowDisplayChanged",JSON.stringify({from:JSON.stringify(this.shareBoardWindowDisplay.bounds),to:JSON.stringify(i.bounds)})),console.log("ShareBoardWindowDisplayChanged",JSON.stringify({shareBoardWindowDisplayId:this.shareBoardWindowDisplay.id,from:JSON.stringify(this.shareBoardWindowDisplay.bounds),to:JSON.stringify(i.bounds)})),this.shareBoardWindowDisplay=i,this.recreateScreenShareBoardWindow(i,t)),n(e,i)}}),300);const o=this.tcicScreenShareMainWindow.getMediaSourceId().split(":")[1],r=this.tcicScreenShareBoardWindow.getMediaSourceId().split(":")[1];0===t.type?e({excludeShareWindowSourceIds:[o],includeShareWindowSourceIds:[r]}):e({excludeShareWindowSourceIds:[o],includeShareWindowSourceIds:[]})};if("win32"===process.platform){let e=0;const i=setInterval((()=>{const o=this.getDisplay(t);e+=1,(o.size.width!==o.workAreaSize.width||o.size.height!==o.workAreaSize.height||e>50)&&(clearInterval(i),n())}),100)}else n()}))})))),this.addLifecycleIPCHandler("hasScreenCapturePermission",(e=>s(this,void 0,void 0,(function*(){return w.hasScreenCapturePermission()})))),this.addLifecycleIPCHandler("openSystemPreferences",(e=>s(this,void 0,void 0,(function*(){return w.requestScreenCaptureAccess()})))),this.addLifecycleIPCHandler("getExcludeSelectWindows",(e=>s(this,void 0,void 0,(function*(){const e=[];if(this.tcicDefaultEntryMainWindow){const t=this.tcicDefaultEntryMainWindow.getMediaSourceId().split(":")[1];e.push(t)}return Promise.resolve(e)})))),this.addLifecycleIPCHandler("stopScreenShare",((e,t)=>s(this,void 0,void 0,(function*(){return this._info("StopScreenShare",JSON.stringify(t)),this.isScreenSharing=!1,this.attachMainViewToDefaultEntryMainWindow(),setTimeout((()=>{this.tcicDefaultEntryMainWindow.show(),setTimeout((()=>{this.tcicDefaultEntryMainWindow.focus();const e=this.tcicDefaultEntryMainWindow.getPosition();this.tcicDefaultEntryMainWindow.setPosition(e[0]+1,e[1]+1)}),300)}),600),this.tcicScreenShareMainWindow&&this.tcicScreenShareMainWindow.close(),this.tcicBoardView&&this.tcicBoardView.webContents.destroy&&this.tcicBoardView.webContents.destroy(),this.tcicBoardView=null,this.tcicScreenShareBoardWindow&&this.tcicScreenShareBoardWindow.close(),this.screenShareMainWindowMouseEventIgnored=!1,this.checkShareWindowBoundsTimer&&(clearInterval(this.checkShareWindowBoundsTimer),this.checkShareWindowBoundsTimer=null),this.needToShowTaskbarFix&&(this.isTaskbarAutoHiddenInDesktopEnabled&&(yield g.setTaskbarAutoHiddenInDesktopEnabled(!0)),this.isTaskbarAutoHiddenInTabletEnabled&&(yield g.setTaskbarAutoHiddenInTabletEnabled(!0)),c.default.screen.getAllDisplays().length>1&&(this.isShowTaskbarOnMultipleDisplays||(yield g.setShowTaskbarOnMultipleDisplays(!1)))),Promise.resolve()}))))}getCurrentDisplay(){return c.default.screen.getDisplayMatching(this.tcicDefaultEntryMainWindow.getBounds())}updateZOrderAccordingShareWindow(e,t){I.get("screenShareNotOnTop")||this.tcicScreenShareMainWindow&&this.tcicScreenShareBoardWindow&&(e.id===t.id?I.get("screenShareNotSetParent")?this.tcicScreenShareMainWindow.setAlwaysOnTop(!0,"screen-saver"):(this.tcicScreenShareMainWindow.setAlwaysOnTop(!1),this.tcicScreenShareMainWindow.setParentWindow(this.tcicScreenShareBoardWindow),this.tcicScreenShareBoardWindow.setAlwaysOnTop(!0,"screen-saver")):(this.tcicScreenShareMainWindow.setParentWindow(null),this.tcicScreenShareMainWindow.setAlwaysOnTop(!0,"screen-saver"),this.tcicScreenShareBoardWindow.setAlwaysOnTop(!0,"screen-saver")))}getShareWindowBounds(e){if(0===e.type){if("win32"===process.platform){const t=g.getWindowBounds(parseInt(e.displayId,10)),i=c.default.screen.screenToDipRect(null,t);return i.isMinimized=t.isMinimized,i}if("darwin"===process.platform)return w.getWindowBounds(parseInt(e.displayId,10))}return this.getDisplay(e).bounds}getDisplay(e){if(e.displayId){const t=c.default.screen.getAllDisplays();if(t.length>0){if("win32"===process.platform)return 0===e.type?c.default.screen.getDisplayMatching(g.getWindowBounds(parseInt(e.displayId,10))):c.default.screen.getDisplayMatching(g.getDesktopBounds(parseInt(e.displayId,10)));if("darwin"===process.platform&&0===e.type)return c.default.screen.getDisplayMatching(w.getWindowBounds(parseInt(e.displayId,10)))}for(const i of t)if(i.id.toString()===e.displayId)return i}return this.getCurrentDisplay()}initCacheModule(){return new Promise(((e,t)=>{let i=this.classUrl,n=null,o=null;try{n=new URL(this.classUrl),o=n.protocol,n.protocol="http:",n.search="",i=n.pathname}catch(e){return console.error("initCacheModule parse classUrl error:",e),c.default.dialog.showErrorBox(m.default.t("出错"),m.default.t("传入非法URL,课堂无法正常初始化: {{arg_0}}",{arg_0:this.classUrl})),void t(e)}let r=i.indexOf(".html");-1!==r&&(r=i.length);const s=i.lastIndexOf("/",r);if(-1===s)return c.default.dialog.showErrorBox(m.default.t("出错"),m.default.t("传入非法URL,课堂无法正常初始化: {{arg_0}}",{arg_0:this.classUrl})),void t("no / in url");n.pathname=i.substring(0,s),n.protocol=o,i=n.toString(),p.TIWCacheManager.SetCallback((e=>{this.tcicMainView&&this.tcicMainView.webContents.send("onVersionUpdate",{force:e})})),p.TIWCacheManager.SetConfig({configUrl:`${i}/cache/tiwcache.json`,configPath:h.default.join(__dirname,"config.json"),resourcePath:h.default.join(__dirname,"resource.zip"),resourceDir:b.tcicResourceDir}).then((()=>{this._info("initCacheModule",JSON.stringify({code:0,error:""})),e()})).catch((t=>{this._info("initCacheModule",JSON.stringify({code:-1,error:JSON.stringify(t)})),e()}))}))}createAndInitWindow(){this.shouldFullscreen=!1,"win32"===process.platform&&(c.default.systemPreferences.isAeroGlassEnabled()?this.shouldFullscreen=!0:c.default.dialog.showErrorBox(m.default.t("出错"),m.default.t("DWM未开启,不支持窗口透明特性"))),this.initCacheModule().then((()=>{p.TIWCacheManager.EnableCache(!I.get("disableCache")),this.createAndInitMainView(),I.get("autoOpenDevTools")&&this.openDevTools(),this.attachMainViewToDefaultEntryMainWindow(),this.registerIPCEvent()}))}checkHasInitialize(){return!!this.tcicDefaultEntryMainWindow}initWSService(){this.wss=new W.WebSocketServer({port:18081}),this.wss.on("connection",(e=>{e.on("message",(e=>{try{const t=JSON.parse(e.toString());this.tcicMainView&&this.tcicMainView.webContents.send("onReceiveMessage",t)}catch(e){console.error("message format error")}}))})),this.addLifecycleIPCHandler("onReceiveMessage",((e,t)=>new Promise(((e,i)=>{this.wss.clients.forEach((e=>{e.readyState===W.WebSocket.OPEN&&e.send(JSON.stringify(t))})),e()}))))}unInitWSService(){this.wss&&(this.wss.close(),this.wss=null)}}t.TencentCloudClass=B},61:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commonOption=void 0,t.commonOption={dsn:"https://9497a4f3e4e64dddb4dd2b2f12b39a7a@sentry.qcloudtiw.com/2",environment:"production"}},893:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hasScreenCapturePermission=t.requestScreenCaptureAccess=t.macOSVersion=t.getWindowBounds=t.getDesktopWindow=void 0;const a=r(i(124)),c=s(i(420)),d=r(i(728)),l=s(i(451)),h=s(i(747)),u=i(933),w=i(327),f=d.types.void,p=d.types.int,S=d.types.int,g=process.arch.includes("64")?d.types.uint64:d.types.uint32,m=g,y=m,W=m,C=m,b=g,M=d.types.uint32,v=d.types.uint32,_=d.types.int,D=d.types.CString,I=d.types.double,T=(0,l.default)({x:I,y:I}),V=(0,l.default)({width:I,height:I}),B=(0,l.default)({origin:T,size:V}),P=d.refType(B),k=(0,c.default)(g),x=134217984;let E=null,O=null;if("darwin"===process.platform)try{const e=a.DynamicLibrary("/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics");E=a.Library(e,{CGWindowListCopyWindowInfo:[W,[b,M]],CGWindowListCreateDescriptionFromArray:[W,[W]],CGRectMakeWithDictionaryRepresentation:[p,[C,P]],CGWindowListCreateImage:[m,[B,S,S,S]]});const t=a.DynamicLibrary("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation");O=a.Library(t,{CFArrayCreate:[W,[S,k,S,S]],CFStringCreateWithCString:[y,[S,D,v]],CFArrayGetCount:[_,[W]],CFArrayGetValueAtIndex:[m,[W,_]],CFDictionaryGetValue:[m,[C,y]],CFStringGetCString:[p,[y,D,_,v]],CFStringGetCStringPtr:[D,[y,v]],CFStringGetLength:[_,[y]],CFStringGetMaximumSizeForEncoding:[_,[_,v]],CFRelease:[f,[m]]})}catch(e){console.error(e)}t.getDesktopWindow=function(e){let t=0;if(E&&O){const i=O.CFStringCreateWithCString(0,"kCGWindowName",x),n=E.CGWindowListCopyWindowInfo(1,0),o=O.CFArrayGetCount(n);for(let r=0;r<o;++r){const o=O.CFArrayGetValueAtIndex(n,r),s=O.CFDictionaryGetValue(o,i);let a=O.CFStringGetCStringPtr(s,x);if(null===a&&s>0){const i=O.CFStringGetLength(s),n=O.CFStringGetMaximumSizeForEncoding(i,x)+1,o=new Buffer(n);if(o.type=d.types.CString,O.CFStringGetCString(s,o,n,x)&&(a=o.toString("utf8").replace(/\0/g,"")),a===e){t=1,console.log(`+++++=====${e}++++${a}`);break}}}O.CFRelease(n)}return t},t.getWindowBounds=function(e){const t={x:0,y:0,width:0,height:0,isMinimized:!1};if(E&&O)try{const i=new k(1);i[0]=e;const n=O.CFArrayCreate(0,i,i.length,0),o=E.CGWindowListCreateDescriptionFromArray(n);if(0===o)return t;if(O.CFArrayGetCount(o)>0){const e=O.CFArrayGetValueAtIndex(o,0),i=O.CFStringCreateWithCString(0,"kCGWindowBounds",x),n=O.CFDictionaryGetValue(e,i),r=new B;E.CGRectMakeWithDictionaryRepresentation(n,r.ref()),t.x=r.origin.x,t.y=r.origin.y,t.width=r.size.width,t.height=r.size.height;const s=O.CFStringCreateWithCString(0,"kCGWindowIsOnscreen",x),a=O.CFDictionaryGetValue(e,s);t.isMinimized=0===a,O.CFRelease(i),O.CFRelease(s)}O.CFRelease(o),O.CFRelease(n)}catch(e){console.error(e)}return t};let U;function A(){if(!U){const e=(e=>{const t=/<key>ProductVersion<\/key>\s*<string>([\d.]+)<\/string>/.exec(e);if(t)return t[1].replace("10.16","11")})(h.default.readFileSync("/System/Library/CoreServices/SystemVersion.plist","utf8"));if(!e)return;U=(e=>{const{length:t}=e.split(".");return 1===t?`${e}.0.0`:2===t?`${e}.0`:e})(e)}return U}t.macOSVersion=A;let R=!1;t.requestScreenCaptureAccess=function(){if(E&&O)try{const e=A().split(".").map((e=>parseInt(e,10)));if(e[0]<10||10===e[0]&&e[1]<15)return;const t=new B;t.origin.x=0,t.origin.y=0,t.size.width=1,t.size.height=1;const i=E.CGWindowListCreateImage(t,1,0,0);if(O.CFRelease(i),R){const e="security",t="Privacy_ScreenCapture";u.shell.openExternal(`x-apple.systempreferences:com.apple.preference.${e}${t?`?${t}`:""}`)}else R=!0}catch(e){console.error(e)}},t.hasScreenCapturePermission=function(){return(0,w.hasScreenCapturePermission)()}},519:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TCIC=t.classInstance=void 0;const r=i(209),s=i(867),a=i(231),c=i(412),d=o(i(933)),l=i(914),h=i(95);t.classInstance=null;let u="";t.TCIC={bootstrap:r.bootstrap,sentry:s.sentry,ResourceDir:h.tcicResourceDir,initialize(e){return n(this,void 0,void 0,(function*(){const i=e.onClose;e.onClose=()=>{i&&i(),t.classInstance=null},t.classInstance?this.show():(t.classInstance=new a.TencentCloudClass,globalThis.dbg||(globalThis.dbg={}),globalThis.dbg.cl=t.classInstance,yield t.classInstance.initialize(e))}))},closeAllWindow(){t.classInstance&&t.classInstance.closeAllWindow()},focus(){t.classInstance&&t.classInstance.focus()},show(){t.classInstance&&t.classInstance.show()},getVersion:()=>c.tcicSdkVersion,configUpdateUrl(e){console.log("configUpdateUrl:---------\x3e",e),u=e},setUpdateView(e){console.log("setUpdateView ----------\x3e> ",u),(0,l.setUpdateUrl)({url:u,notifiView:e.notifiView})},setUpdateUrl(e){console.log("--\x3echecking-for-update: setUpdateUrl",e.url),e.notifiView.send("gotUrl",e.url),(0,l.setUpdateUrl)(e)},checkUpdate(){console.log("--\x3echecking-for-update checkUpdate::in main"),(0,l.checkUpdate)()}};const w={downloading:!1,quitAndInstall:!1};[{name:"setUpdateUrl",handler:(e,i)=>{t.TCIC.setUpdateUrl(i)}},{name:"checkUpdate",handler:e=>{t.TCIC.checkUpdate()}},{name:"downloadUpdate",handler:e=>{w.downloading||(w.downloading=!0,(0,l.downloadUpdate)())}},{name:"quitAndInstall",handler:e=>{w.quitAndInstall||(w.quitAndInstall=!0,(0,l.quitAndInstall)())}}].forEach((e=>{d.default.ipcMain.handle(e.name,e.handler)})),e.exports=t.TCIC},209:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.bootstrap=void 0,i(867);const s=i(817),a=i(953),c=r(i(60)),d=i(933);let l=!1;t.bootstrap=()=>{if(!l){if(process.on("uncaughtException",(e=>{console.error("uncaughtException:",e)})),(0,a.startCrashReporter)(),s.TIWCacheManager.RegisterAsPrivileged(),"win32"===process.platform){const e=c.getPrimaryDisplaySize();e.width*e.height<=2073600&&(c.getMaxTouches()>1||c.isWin7())&&d.app.commandLine.appendSwitch("disable-gpu-compositing"),c.isWin7()&&d.app.commandLine.appendSwitch("disable-site-isolation-trials")}l=!0}},(0,t.bootstrap)()},953:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.startCrashReporter=void 0,i(699);const a=r(i(933)),c=s(i(747)),d=s(i(622)),l=i(95);t.startCrashReporter=()=>{if(a.app.isReady())throw new Error("startCrashReporter should be called before app.ready");a.app.setPath("crashDumps",d.default.join(l.tcicResourceDir,"crash"));const e=a.app.getPath("crashDumps");c.default.existsSync(e)||c.default.mkdirSync(e,{recursive:!0});const t={last:a.crashReporter.getLastCrashReport(),uploaded:a.crashReporter.getUploadedReports()};globalThis.dbg||(globalThis.dbg={});const{dbg:i}=globalThis;i.crashReports=t,i.electron=a.default}},364:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isMAC=t.getMAC=void 0;const n=i(87),o=/(?:[a-z0-9]{1,2}[:-]){5}[a-z0-9]{1,2}/i,r=/(?:[0]{1,2}[:-]){5}[0]{1,2}/;t.getMAC=function(e){const t=(0,n.networkInterfaces)();if(e){const i=t[e];if(!i)return"notfound";for(const e of i)if(!1===r.test(e.mac))return e.mac;return"notvalid"}for(const[e,i]of Object.entries(t))if(i)for(const e of i)if(!1===r.test(e.mac))return e.mac;return"unknown"},t.isMAC=function(e){return o.test(e)}},867:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sentry=void 0;const a=r(i(317)),c=i(615),d=i(412),l=i(61),h=i(933),u=i(364),w=i(519),f=i(317),p=i(785),S=i(409),g=[new p.SentryMinidump,new p.ElectronBreadcrumbs,new p.MainContext,new p.ChildProcess,new p.OnUncaughtException,new p.PreloadInjection,new p.AdditionalContext,new p.Screenshots,...S.defaultIntegrations.filter((e=>"OnUncaughtException"!==e.name&&"Context"!==e.name))];g.push(new p.MainProcessSession);class m{constructor(){this.inited=!1,this.appStartUpTrans=null,this.appStartUpSpans=[],this.captureMsg=a.captureMessage,this.captureError=function(e,t){return this.inited?a.captureException(e,t):""},this.closeAndFlush=()=>s(this,void 0,void 0,(function*(){return!this.inited||(yield a.close(2e3),this.inited=!1,!0)}))}static get instance(){return m.inst||(m.inst=new m,m.inst.init()),m.inst}init(){if(this.inited)return;a.init(Object.assign(Object.assign({},l.commonOption),{initialScope:{tags:{sdk:d.tcicSdkVersion,"extra.sdk":d.tcicSdkVersion,appName:h.app.getName(),appVersion:h.app.getVersion()},user:{mac_address:(0,u.getMAC)()}},getRendererName(e){if(e.__sentryName)return e.__sentryName;if(w.classInstance){const t=h.BrowserWindow.fromWebContents(e),{tcicMainView:i,tcicBoardView:n,tcicScreenShareVideoWindow:o,tcicDefaultEntryMainWindow:r,tcicScreenShareMainWindow:s,tcicScreenShareBoardWindow:a,tcicScreenShareCameraWindow:c}=w.classInstance.wins;switch(t){case i:return"tcicMainView";case n:return"tcicBoardView";case o:return"tcicScreenShareVideoWindow";case r:return"tcicDefaultEntryMainWindow";case s:return"tcicScreenShareMainWindow";case a:return"tcicScreenShareBoardWindow";case c:return"tcicScreenShareCameraWindow"}}return e.getTitle()},getSessions:()=>[h.session.defaultSession],IPCMode:f.IPCMode.Protocol,autoSessionTracking:!1,defaultIntegrations:!1,integrations:[...g,new c.CaptureConsole({levels:["error","warn","assert"]})],tracesSampleRate:1}));const e=a.startTransaction({op:"app-start",name:"appStartUp",description:"app启动时序",trimEnd:!0});this.appStartUpTrans=e;const t=e.startChild({op:"app.ready",description:"从第一行代码到app.ready耗时"});h.app.whenReady().then((()=>{t.finish()})),a.captureMessage("Sentry-inited.","info"),this.inited=!0}startUpAppChildSpan(e){const t=this.appStartUpTrans.startChild(e),i=t.finish.bind(t);return t.finish=(...e)=>{i(...e),this.finishAppStartUpTrans()},t}finishAppStartUpTrans(e){if(this.appStartUpTrans){for(const e of this.appStartUpSpans)if(!e.endTimestamp)return;this.appStartUpTrans.finish(e)}}startTransWithSpans(e,...t){const i=a.startTransaction(...e),n=[];for(const e of t){const t=i.startChild(e),o=t.finish.bind(t);t.finish=(...e)=>{o(...e);for(const e of n)if(!e.endTimestamp)return;i.finish()},n.push(t)}return{trans:i,spans:n}}setUserId(e){a.setUser({id:e}),a.captureMessage("UserId-updated.","info")}addClue(e){a.addBreadcrumb(e)}startTransaction(...e){return a.startTransaction(...e)}}t.sentry=m.instance},95:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tcicResourceDir=void 0;const o=n(i(747)),r=n(i(622));let s;s="win32"===process.platform?r.default.join(process.env.USERPROFILE,"TencentCloudClass"):r.default.join(process.env.HOME,"TencentCloudClass"),o.default.existsSync(s)||o.default.mkdirSync(s,{recursive:!0}),t.tcicResourceDir=s},817:function(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TIWCacheManager=void 0;const r=o(i(528)),s=i(933),a=o(i(747)),c=o(i(622)),d=o(i(605)),l=o(i(211)),h=o(i(138)),u=i(867);var w;!function(e){e[e.None=0]="None",e[e.Downloading=1]="Downloading",e[e.DownloadFailed=2]="DownloadFailed",e[e.DownloadSucc=3]="DownloadSucc"}(w||(w={}));class f{constructor(){this.retentionTime=2592e5,this.url="",this.path="",this.reg="",this.status=w.None,this.createTime=Date.parse((new Date).toString())}}class p{static EnableCache(e){if(p._enabled=e,p._timer&&(clearTimeout(p._timer),p._timer=null),p._enabled&&p._config&&p._serverConfig){const e=(t="")=>n(this,void 0,void 0,(function*(){console.log("refreshwork ",t,this._serverConfig.interval),yield p.RefreshServerConfig().catch((e=>{console.error(e)})),console.log("refreshwork done. set timer"),p._timer&&clearTimeout(p._timer),p._timer=setTimeout((()=>e("timer")),1e3*this._serverConfig.interval)}));e("1st")}}static SetCallback(e){p._cacheCallback=e}static SetConfig(e){return new Promise(((t,i)=>n(this,void 0,void 0,(function*(){const n=u.sentry.startTransaction({name:"TIWCacheManager::SetConfig",op:"TIWCacheManager::SetConfig",description:"TIWCacheManager::SetConfig 耗时"});try{p._config=e;const n=p.GetConfigDir(),o=p.GetZipDir(),r=p.GetResourceDir(),s=p.GetDocumentDir(),c=p.GetCourseCacheDir();a.default.existsSync(n)||a.default.mkdirSync(n,{recursive:!0}),a.default.existsSync(o)||a.default.mkdirSync(o,{recursive:!0}),a.default.existsSync(r)||a.default.mkdirSync(r,{recursive:!0}),a.default.existsSync(s)||a.default.mkdirSync(s,{recursive:!0}),c.length>0&&!a.default.existsSync(c)&&a.default.mkdirSync(c,{recursive:!0}),c.length>0&&!p._hadLoadCourseConfig&&(p._hadLoadCourseConfig=!0,p._coursewares.clear(),p.LoadCoursewareConfig());const d=p.GetConfigPath(),l=p.GetZipPath();let u=null;if(a.default.existsSync(d)&&(u=p.LoadServerConfigFromLocalFile(d),p.IsBundleResourceNew(e.configPath,u))){p.RemoveDirSync(r);const e=[];a.default.existsSync(d)&&e.push(a.default.promises.unlink(d)),a.default.existsSync(l)&&e.push(a.default.promises.unlink(l)),yield Promise.all(e),u=null}u?(console.warn("TIWCacheManager use cache files"),p._serverConfig=u,t()):a.default.existsSync(e.configPath)?a.default.existsSync(e.resourcePath)?a.default.promises.copyFile(e.configPath,d).then((()=>{console.info("TIWCacheManager update config file");const n=p.LoadServerConfigFromLocalFile(d);a.default.promises.copyFile(e.resourcePath,l).then((()=>{console.info("TIWCacheManager update resource file");try{p.RemoveDirSync(r),new h.default(l).extractAllTo(r,!0),p._serverConfig=n,t()}catch(e){a.default.existsSync(l)&&a.default.promises.unlink(l),a.default.existsSync(d)&&a.default.promises.unlink(d),console.error("TIWCacheManager resource unzip failed",e),i(e)}})).catch((()=>{i(`TIWCacheManager copyFile file error: ${e.resourcePath}`)}))})).catch((()=>{i(`TIWCacheManager resource file not found: ${e.configPath}`)})):i(`TIWCacheManager resource file not found: ${e.resourcePath}`):i(`TIWCacheManager config file not found: ${e.configPath}`)}catch(e){u.sentry.captureError(e,{tags:{ctx:"TIWCacheManager::SetConfig"}}),i(e)}finally{n.finish()}}))))}static PreloadCourseware(e,t=""){if(0===p.GetCourseConfigPath().length)return void Promise.reject("not set courseCacheDir by Call SetConfig");const i=p.GetCoursewarwId(e);if(0===i.length)return void Promise.reject("the zipUrl is not right courseware zip");const n=new f;n.url=e,n.reg=t,n.path=i;let o=!1;if(p._coursewares.hasOwnProperty(i)){const t=p._coursewares.get(i);t.status===w.Downloading&&t.url===e||(p._coursewares.set(i,n),o=!0)}else p._coursewares.set(i,n),o=!0;if(!o)return void Promise.reject("the zipUrl is donwloading");const r=p._coursewares.get(i);r.status=w.Downloading,p.SaveCoursewareConfig();const s=c.default.join(p.GetCourseCacheDir(),i,"/");p.RemoveDirSync(s),a.default.mkdirSync(s);const d=c.default.join(p.GetCourseCacheDir(),n.path,`${Date.parse((new Date).toString())}_tiwcourseware.zip`);return p.HttpRequest(e,null,null,d).then((()=>(new h.default(d).extractAllTo(s,!0),a.default.existsSync(d)&&a.default.unlinkSync(d),r.status=w.DownloadSucc,p.SaveCoursewareConfig(),Promise.resolve()))).catch((e=>(a.default.existsSync(d)&&a.default.unlinkSync(d),r.status=w.DownloadFailed,p.SaveCoursewareConfig(),Promise.reject("coursezip fetch failed"))))}static RefreshServerConfig(){return n(this,void 0,void 0,(function*(){if(console.warn("RefreshServerConfig:",p._isRefreshing,p._config.configUrl),!p._config.configUrl)return Promise.reject(r.default.t("缺少配置文件URL"));if(p._isRefreshing)return Promise.reject(r.default.t("上次刷新未完成"));const e=p.GetConfigPath(!0);p._isRefreshing=!0;try{const t=p._config.configUrl;yield p.HttpRequest(t,null,null,e);const i=p.LoadServerConfigFromLocalFile(e),n=p.GetResourceInfo(i);if(!n)return Promise.reject(r.default.t("新配置缺少可用资源信息"));const o=p.GetResourceInfo(p._serverConfig);if(o&&n&&o.version===n.version&&n.devBuildTime<=o.devBuildTime)return Promise.reject(r.default.t("新配置版本低于老配置版本: {{arg_0}} < {{arg_1}}",{arg_0:n.version,arg_1:o.version}));console.log("TIWCacheManager new config fetched",i);const s=p.GetZipPath(!0);yield p.HttpRequest(n.url,null,null,s).then((()=>{const t=`${s}.uncompressed`;a.default.existsSync(t)||a.default.mkdirSync(t,{recursive:!0}),new h.default(s).extractAllTo(t,!0);const n=p.GetResourceDir(),o=`${t}.bak`;a.default.renameSync(n,o),a.default.renameSync(t,n),p.RemoveDirSync(o);const r=p.GetConfigPath();a.default.existsSync(r)&&a.default.unlinkSync(r),a.default.existsSync(e)&&a.default.renameSync(e,r);const c=p.GetZipPath();if(a.default.existsSync(c)&&a.default.unlinkSync(c),a.default.renameSync(s,c),p._serverConfig=i,console.log("TIWCacheManager resource prepare done"),p._cacheCallback){const e=p._serverConfig.forceUpdate;p._cacheCallback(e)}return Promise.resolve()})).catch((e=>{a.default.existsSync(s)&&a.default.unlinkSync(s),console.error("TIWCacheManager resource fetch failed",e)}))}catch(t){a.default.existsSync(e)&&a.default.unlinkSync(e),console.error("TIWCacheManager config fetch failed",t)}finally{p._isRefreshing=!1,console.warn("RefreshServerConfig finished")}}))}static RegisterAsPrivileged(){return s.app.isReady()?(console.error("RegisterAsPrivileged can only be used before the ready event of the app module gets emitted!!!"),!1):(s.protocol.registerSchemesAsPrivileged([{scheme:p.TIWCacheSchemeHttp,privileges:p.TIWCacheSchemePrivileges},{scheme:p.TIWCacheSchemeHttps,privileges:p.TIWCacheSchemePrivileges}]),!0)}static GetResourcePath(e){if(!(p._enabled&&p._config&&p._config.resourceDir))return"";const t=p.GetResourceInfo(p._serverConfig);if(!t)return"";let i="";try{const n=new URL(e);if(t.hostnames&&!t.hostnames[n.hostname])return"";do{const o=`${n.origin}${n.pathname}`;if(t.files&&t.files.hasOwnProperty(o)){const e=t.files[o];if(e.toLowerCase().startsWith("http"))return e;i=c.default.join(p.GetResourceDir(),e);break}if(!i&&t.regexes)for(const e in t.regexes){let n=t.regexes[e];const r=o.match(e);if(r&&r.length>0){for(let e=1;e<=r.length;++e){const t=new RegExp(`\\$${e}`,"g");n=n.replace(t,r[e])}i=c.default.join(p.GetResourceDir(),n);break}}if(!i&&t.documents)for(const e in t.documents){const n=t.documents[e],r=o.match(e);if(r&&r.length>=3){const e=r[1],t=r[2],s=p.GetDocumentDir();i=o.replace(e,s),a.default.existsSync(i)||p.DownloadDocumentCategory(c.default.join(s,t,n),`${e}/${t}/${n}`);break}}if(!i){const t=p.GetCourseCacheDir();if(t.length>0)for(const[n,o]of p._coursewares)if(0===o.reg.length){const o=e.indexOf(n);if(-1!==o){const r=e.substring(o+n.length+1);i=c.default.join(t,n,r);break}}}}while(0)}catch(e){return console.error("GetResourcePath error:",e),""}return a.default.existsSync(i)?(console.debug("TIWCacheManager GetResourcePath : ==>> Hit :",e,i),i):(console.debug("TIWCacheManager GetResourcePath not hit :::::: url:",e," local:",i),"")}static EnableWebContentsCache(e,t){if(t){const t=e.session,i=t.protocol;if(i.isProtocolRegistered(p.TIWCacheSchemeHttp)||i.isProtocolRegistered(p.TIWCacheSchemeHttps))return;const n=(e,t)=>{if(p.TIWCacheFileMap.has(e.url)){const i=p.TIWCacheFileMap.get(e.url);console.debug("schemeHandler hit:",e.url,"path:",i),t({path:i}),p.TIWCacheFileMap.delete(e.url)}else console.warn("schemeHandler 404:",e.url),t({statusCode:404})};console.assert(!i.isProtocolRegistered(p.TIWCacheSchemeHttp),"tiw-cache duplicate registered!!!"),console.assert(!i.isProtocolRegistered(p.TIWCacheSchemeHttps),"tiw-caches duplicate registered!!!");let o=i.registerFileProtocol(p.TIWCacheSchemeHttp,n);console.assert(!0===o,`${p.TIWCacheSchemeHttp} register failed`),o=i.registerFileProtocol(p.TIWCacheSchemeHttps,n),console.assert(!0===o,`${p.TIWCacheSchemeHttps} register failed`),t.webRequest.onBeforeRequest(((e,t)=>{let i=e.url;const n=i.indexOf("://"),o=i.substring(0,n).toLowerCase(),r=i.substring(n);if(o===p.TIWCacheSchemeHttp||o===p.TIWCacheSchemeHttps){if(p.TIWCacheFileMap.has(i))return console.warn("onBeforeRequest hit:",i),void t({});i=o===p.TIWCacheSchemeHttp?`http${r}`:`https${r}`}else if("http"!==o&&"https"!==o)return void t({});console.assert("http"===o||"https"===o,"unexpected URL scheme: %s, %s",o,r);const s=p.GetResourcePath(i);if(""!==s){if(s.startsWith("http"))return console.warn(i," use redirect http(s):",s),void t({cancel:!1,redirectURL:s});if(i="https"===o||o===p.TIWCacheSchemeHttps?p.TIWCacheSchemeHttps+r:p.TIWCacheSchemeHttp+r,p.TIWCacheFileMap.set(i,s),i===e.url)return console.warn(i," already equals tiw-cache."),void t({});console.warn(e.url," redirect tiw-cache:",i),t({cancel:!1,redirectURL:i})}else t({})}))}else e.session.protocol.unregisterProtocol(p.TIWCacheSchemeHttp),e.session.protocol.unregisterProtocol(p.TIWCacheSchemeHttps),e.session.webRequest.onBeforeRequest(null)}static HttpRequest(e,t,i,n){const o=e.toLowerCase().startsWith("https://")?l.default:d.default;return new Promise(((r,s)=>{const c=n?a.default.createWriteStream(n):null,d=i?JSON.stringify(i):null,l=d?"POST":"GET";t||(t={}),d&&(t.hasOwnProperty("Content-Type")||(t["Content-Type"]="application/json"),t.hasOwnProperty("Content-Length")||(t["Content-Length"]=d.length.toString()));const h={method:l,headers:t},u=o.request(e,h,(t=>{if(200!==t.statusCode){const i=new Error(`Failed to get '${e}' (${t.statusCode})`);return console.error(i),void s(i)}if(c)t.pipe(c);else{let e="";t.on("data",(t=>{e+=t.toString()})),t.on("end",(()=>{r(e)}))}}));i&&u.write(d),c&&(c.on("finish",(()=>r(null))),c.on("error",(e=>{console.error(e),a.default.unlink(n,(()=>s(e)))}))),u.on("error",(e=>{console.error(e),n?a.default.unlink(n,(()=>s(e))):s(e)})),u.end()}))}static GetCoursewarwId(e){const t=new URL(e).pathname;let i=t.lastIndexOf("/");if(-1!==i){const e=t.substring(0,i);if(i=e.lastIndexOf("/"),-1!==i)return e.substring(i+1)}return""}static GetCourseConfigPath(){return void 0!==p._config.courseCacheDir&&p._config.courseCacheDir.length>0?c.default.join(p._config.courseCacheDir,"tiwcache_course_config.json"):""}static LoadServerConfigFromLocalFile(e){const t=a.default.readFileSync(e,"utf8");return JSON.parse(t)}static GetResourceInfo(e){if(!e)return;const t=`${p._config.sdkAppId}`,i=`${p._config.schoolId}`;let n=e.resources.find((e=>-1!==t.search(e.sdkAppId)&&-1!==i.search(e.schoolId)));return n||(n=e.resources.find((e=>"0"===e.sdkAppId&&"0"===e.schoolId))),n}static LoadCoursewareConfig(){const e=p.GetCourseConfigPath();if(a.default.existsSync(e)){p._coursewares.clear();const t=a.default.readFileSync(e,"utf8"),i=JSON.parse(t);for(const e in i)p._coursewares.set(e,i[e]);let n=!1;const o=p.GetCourseCacheDir(),r=Date.parse((new Date).toString());for(const[e,t]of p._coursewares)if(r.valueOf()-t.createTime.valueOf()>t.retentionTime.valueOf()){const i=o+t.path;p.RemoveDirSync(i),p._coursewares.delete(e),n=!0}else t.status!==w.DownloadSucc&&(t.createTime=Date.parse((new Date).toString()),t.status=w.None,n=!0);n&&p.SaveCoursewareConfig()}}static SaveCoursewareConfig(){const e=p.GetCourseConfigPath();a.default.existsSync(e)&&a.default.unlinkSync(e);const t={};for(const[e,i]of p._coursewares)t[e]=i;a.default.writeFileSync(e,JSON.stringify(t))}static GetConfigPath(e){return c.default.join(p.GetConfigDir(),`${e?(+new Date).toString():""}tiwcache.json`)}static GetZipPath(e){return c.default.join(p.GetZipDir(),`${e?(+new Date).toString():""}tiwresource.zip`)}static GetConfigDir(){return c.default.join(p._config.resourceDir,"tiwcache")}static GetLogDir(){return c.default.join(p._config.resourceDir,"tiwcache")}static GetZipDir(){return c.default.join(p._config.resourceDir,"tiwcache")}static GetResourceDir(){return c.default.join(p._config.resourceDir,"tiwcache","resource")}static GetDocumentDir(){return c.default.join(p._config.resourceDir,"tiwcache","document")}static GetCourseCacheDir(){return void 0===p._config.courseCacheDir?"":c.default.join(p._config.courseCacheDir,"tiwcache_courseware")}static IsBundleResourceNew(e,t){const i=p.LoadServerConfigFromLocalFile(e),n=p.GetResourceInfo(i),o=p.GetResourceInfo(t);return n&&o&&n.devBuildTime>o.devBuildTime}static DownloadDocumentCategory(e,t){if(a.default.existsSync(e))return p.DownloadDocumentFiles(e,t);if(p._documentState.get(t))return Promise.reject(r.default.t("下载中"));p._documentState.set(t,!0),console.log("TIWCacheManager document downloading",t);const i=c.default.normalize(e.substring(0,e.lastIndexOf(c.default.sep)+1));return a.default.mkdirSync(i),p.HttpRequest(t,null,null,e).then((()=>(console.log("TIWCacheManager document downloaded",t,e),p.ClearExpiredDocuments(),p.DownloadDocumentFiles(e,t)))).finally((()=>{p._documentState.set(t,!1)}))}static DownloadDocumentFiles(e,t,i=0){let n=p._documentInfo.get(e);if(!n){if(n=p.LoadDocumentInfoFromLocalFile(e,t),!n)return Promise.reject(r.default.t("课件文件列表解析失败"));n.files.sort(((e,t)=>e.priority-t.priority)),console.log("TIWCacheManager document info",t,n),p._documentInfo.set(e,n)}if(i>=n.files.length)return Promise.resolve();const o=n.files[i];if(!a.default.existsSync(o.path)){const n=o.path.substring(0,o.path.lastIndexOf(c.default.sep)+1);return a.default.mkdirSync(n,{recursive:!0}),console.log("TIWCacheManager document file downloading",t,i),p.HttpRequest(o.url,null,null,o.path).then((()=>(console.log("TIWCacheManager document file downloaded",t,i,o),p.DownloadDocumentFiles(e,t,i+1))))}return p.DownloadDocumentFiles(e,t,i+1)}static LoadDocumentInfoFromLocalFile(e,t){const i=a.default.readFileSync(e,"utf-8"),n=JSON.parse(i);n.path=e,n.url=t;const o=e.substring(0,e.lastIndexOf(c.default.sep)+1),r=t.substring(0,t.lastIndexOf("/")+1);return n.files.forEach((e=>{e.path=c.default.join(o,e.name),e.url=`${r}/${e.name}`})),n}static RemoveDirSync(e,t){if(!a.default.existsSync(e))return!0;let i=!0;return a.default.readdirSync(e).forEach((n=>{const o=c.default.join(e,n),r=a.default.statSync(o);!t||t(r)?r.isDirectory()?p.RemoveDirSync(o)||(i=!1):a.default.unlinkSync(o):r.isDirectory()&&p.RemoveDirSync(o,t)||(i=!1)})),!!i&&(a.default.rmdirSync(e),!0)}static ClearExpiredDocuments(){const e=new Date;p.RemoveDirSync(p.GetDocumentDir(),(t=>!t.isDirectory()||new Date(t.atime.getTime()+2592e5)<e))}}p.TIWCacheSchemeHttp="tiw-cache",p.TIWCacheSchemeHttps="tiw-caches",p.TIWCacheSchemePrivileges={standard:!0,secure:!0,bypassCSP:!0,allowServiceWorkers:!0,supportFetchAPI:!0,corsEnabled:!0},p.TIWCacheFileMap=new Map,p._enabled=!1,p._timer=null,p._isRefreshing=!1,p._documentState=new Map,p._documentInfo=new Map,p._cacheCallback=null,p._hadLoadCourseConfig=!1,p._coursewares=new Map,t.TIWCacheManager=p},699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},914:function(__unused_webpack_module,exports,__webpack_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t},__awaiter=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.quitAndInstall=exports.getUpdateStatus=exports.downloadUpdate=exports.checkUpdate=exports.setUpdateUrl=exports.getWebjs=exports.insertUpdateDom=void 0;const electron_updater_1=__webpack_require__(346),path=__importStar(__webpack_require__(622)),fs=__importStar(__webpack_require__(747));let FEED_URL=null;function loadView(e){return fs.readFileSync(path.resolve(__dirname,"view",e)).toString()}const tplStr=JSON.stringify({tpl:loadView("update.html")}),updatingConfig={isUpdating:!1};function insertUpdateDom(){const wraper=document.createElement("DIV"),loadTextObj="#replace#",loadText=loadTextObj.tpl,getJs=/<script>([^\^]+)<\/script>/gi.exec(loadText);wraper.innerHTML=loadText,document.body.appendChild(wraper),getJs&&eval(getJs[1])}function getWebjs(e,t){return`${e.toString().replace('"#replace#"',t)};${e.name}()`}function setUpdateUrl(e){const t=function(){let t=!1;return i=>!t&&(t=!0,e.notifiView)?e.notifiView.executeJavaScript(getWebjs(i,tplStr)):new Promise((e=>{e(!1)}))}(),i=function(t,i){e.notifiView&&e.notifiView.send("message",t,i)};FEED_URL=e.url,electron_updater_1.autoUpdater.setFeedURL(FEED_URL),electron_updater_1.autoUpdater.autoDownload=!1,electron_updater_1.autoUpdater.autoInstallOnAppQuit=!1,[{name:"error",handler(n){console.log("--\x3echecking-for-update =>",n),t(insertUpdateDom).then((()=>{i("error",n)})),console.log("will call cb",e.cb),e.cb&&e.cb("error",n)}},{name:"checking-for-update",handler(n){t(insertUpdateDom).then((()=>{console.log("--\x3echecking-for-update checking-for-updatingConfig.isUpdating",updatingConfig.isUpdating),i("checking-for-update",n)})).catch((e=>{console.log("checking-for-update:",e)})),e.cb&&e.cb("checking-for-update",n)}},{name:"update-available",handler(n){t(insertUpdateDom).then((()=>__awaiter(this,void 0,void 0,(function*(){if(i("update-available",n),console.log("--\x3echecking-for-update ::update-available=>",n,e.cb),e.cb){const t=yield e.cb("update-available",n);console.log("--\x3echecking-for-update ::confirmResult=>",t),t&&(console.log("--\x3echecking-for-update ::confirmResult=> isUpdating",updatingConfig.isUpdating),electron_updater_1.autoUpdater.downloadUpdate())}})))).catch((e=>{console.log("--\x3echecking-for-update -------\x3enotifiViewAction err ",e),console.error(e)}))}},{name:"update-not-available",handler(n){t(insertUpdateDom).then((()=>__awaiter(this,void 0,void 0,(function*(){i("update-not-available",n),console.log("--\x3echecking-for-update update-not-available ----\x3e>> ",n),e.cb&&e.cb("update-not-available",n)}))))}},{name:"download-progress",handler(t){console.log("download-progress::----",t),i("download-progress",t),e.cb&&e.cb("download-progress",t)}},{name:"update-downloaded",handler(t,n,o,r,s,a){return __awaiter(this,void 0,void 0,(function*(){const t={releaseNotes:n,releaseName:o,releaseDate:r,updateUrl:s,quitAndUpdate:a};e.cb&&(yield e.cb("update-downloaded",t))&&quitAndInstall(),updatingConfig.isUpdating=!0,i("update-downloaded",t)}))}}].forEach((e=>{electron_updater_1.autoUpdater.on(e.name,e.handler)}))}function checkUpdate(){console.log("checkUpdate fn:-----------\x3e",FEED_URL),FEED_URL?electron_updater_1.autoUpdater.checkForUpdates():console.error("Need setUpdateUrl")}exports.insertUpdateDom=insertUpdateDom,exports.getWebjs=getWebjs,exports.setUpdateUrl=setUpdateUrl,exports.checkUpdate=checkUpdate;const USER_HOME=process.env.HOME||process.env.USERPROFILE;function clearUpdateCache(){try{let e;"win32"===process.platform?e=path.join(process.env.LOCALAPPDATA||path.join(USER_HOME,"AppData","Local"),"TuritoWhiteboard-updater"):"darwin"===process.platform&&(e=path.join(__webpack_require__(87).homedir(),"Library","Application Support","Caches","TuritoWhiteboard-updater")),e&&fs.existsSync(e)&&(console.info("MAIN::clearUpdateCache do...",e),fs.rmdir(e,{recursive:!0},(()=>{})))}catch(e){console.error("MAIN::clearUpdateCache error",e)}}function downloadUpdate(){console.log("downloadUpdate----\x3e call"),electron_updater_1.autoUpdater.downloadUpdate()}function getUpdateStatus(){return updatingConfig.isUpdating}function quitAndInstall(){console.log("quitAndInstall----\x3e call"),electron_updater_1.autoUpdater.quitAndInstall()}exports.downloadUpdate=downloadUpdate,exports.getUpdateStatus=getUpdateStatus,exports.quitAndInstall=quitAndInstall},593:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.httpRequest=void 0;const o=n(i(211)),r=n(i(605)),s=n(i(747));t.httpRequest=function(e,t,i,n){const a=e.toLowerCase().startsWith("https://")?o.default:r.default;return new Promise(((o,r)=>{const c=n?s.default.createWriteStream(n):null,d=i?JSON.stringify(i):null,l=d?"POST":"GET";t||(t={}),d&&(t.hasOwnProperty("Content-Type")||(t["Content-Type"]="application/json"),t.hasOwnProperty("Content-Length")||(t["Content-Length"]=d.length.toString()));const h={method:l,headers:t},u=a.request(e,h,(t=>{if(200!==t.statusCode){const i=new Error(`Failed to get '${e}' (${t.statusCode})`);return console.error(i),void r(i)}if(c)t.pipe(c);else{let e="";t.on("data",(t=>{e+=t.toString()})),t.on("end",(()=>{o(e)}))}}));i&&u.write(d),c&&(c.on("finish",(()=>o(null))),c.on("error",(e=>{console.error(e),s.default.unlink(n,(()=>r(e)))}))),u.on("error",(e=>{console.error(e),n?s.default.unlink(n,(()=>r(e))):r(e)})),u.end()}))}},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tcicSdkBranch=t.tcicSdkVersion=void 0,t.tcicSdkVersion="1.8.14",t.tcicSdkBranch=""},60:function(e,t,i){var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(t,i);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,o)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return o(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(o,r){function s(e){try{c(n.next(e))}catch(e){r(e)}}function a(e){try{c(n.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getDesktopWindow=t.isWin7=t.getDesktopBounds=t.getWindowBounds=t.setThickFrame=t.setShowTaskbarOnMultipleDisplays=t.isShowTaskbarOnMultipleDisplays=t.setTaskbarAutoHiddenInTabletEnabled=t.isTaskbarAutoHiddenInTabletEnabled=t.setTaskbarAutoHiddenInDesktopEnabled=t.isTaskbarAutoHiddenInDesktopEnabled=t.getPrimaryDisplaySize=t.getMaxTouches=t.getDesktopPath=void 0;const c=a(i(124)),d=a(i(747)),l=r(i(87)),h=a(i(622)),u=a(i(728)),w=a(i(451)),f=a(i(26)),p=u.default.types.bool,S=u.default.types.int,g=u.default.types.uint,m=process.arch.includes("64")?u.default.types.uint64:u.default.types.uint32,y=u.default.types.long,W=u.default.types.ulong,C=W,b=process.arch.includes("64")?u.default.types.int64:u.default.types.int32,M=process.arch.includes("64")?u.default.types.ulonglong:W,v=M,_=M,D=M,I=(0,w.default)({left:y,top:y,right:y,bottom:y}),T=u.default.refType(I),V=(0,w.default)({cbSize:C,hWnd:D,uCallbackMessage:g,uEdge:g,rc:I,lParam:b}),B=u.default.refType(V),P=536870912;let k=null,x=null;if("win32"===process.platform)try{k=c.default.Library("user32",{SendNotifyMessageA:[p,[D,g,m,"string"]],GetSystemMetrics:[S,[S]],FindWindowA:[D,["string",y]],GetWindowLongA:[y,[D,S]],SetWindowLongA:[y,[D,S,y]],GetWindowRect:[p,[D,T]],EnumDisplayMonitors:[p,[_,y,"pointer",b]],FindWindowW:[D,[y,"string"]],FindWindowExW:[D,[y,y,"string","string"]]}),x=c.default.Library("shell32",{SHAppBarMessage:[g,[g,B]]})}catch(e){console.error(e)}const E=function(e){return new Promise(((t,i)=>{const n={};f.default.list(e).on("data",(e=>{n[e.key]=e.data})).on("finish",(()=>{t(n)})).on("error",(e=>{i(e)}))}))},O=function(e){return new Promise(((t,i)=>{f.default.putValue(e,(e=>{e&&i(e),t()}))}))},U=function(){k&&k.SendNotifyMessageA(65535,26,0,"TraySettings")};t.getDesktopPath=function(){return s(this,void 0,void 0,(function*(){let e=h.default.join(l.homedir(),"Desktop"),t=d.default.existsSync(e);if("win32"===process.platform&&!t){const i="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",[n,o]=yield E(i).then((e=>[null,e])).catch((e=>[e,null]));if(!n&&o)try{t=!0,e=o[i].values.Desktop.value}catch(e){}}return t?e:""}))},t.getMaxTouches=function(){if(k){const e=95;return k.GetSystemMetrics(e)}return 0},t.getPrimaryDisplaySize=function(){if(k){const e=0,t=1;return{width:k.GetSystemMetrics(e),height:k.GetSystemMetrics(t)}}return null},t.isTaskbarAutoHiddenInDesktopEnabled=function(){return s(this,void 0,void 0,(function*(){if(x){const e=new V;return e.cbSize=V.size,1===x.SHAppBarMessage(4,e.ref())}return!1}))},t.setTaskbarAutoHiddenInDesktopEnabled=function(e){return s(this,void 0,void 0,(function*(){if(k&&x){const t=new V;return t.cbSize=V.size,t.hWnd=k.FindWindowA("Shell_TrayWnd",0),t.lParam=e?1:0,x.SHAppBarMessage(10,t.ref()),!0}return!1}))},t.isTaskbarAutoHiddenInTabletEnabled=function(){return s(this,void 0,void 0,(function*(){if("win32"===process.platform){const e="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",[t,i]=yield E(e).then((e=>[null,e])).catch((e=>[e,null]));if(!t&&i)try{return!!i[e].values.TaskbarAutoHideInTabletMode.value}catch(e){}}return!1}))},t.setTaskbarAutoHiddenInTabletEnabled=function(e){return s(this,void 0,void 0,(function*(){if("win32"===process.platform)try{const t={"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced":{TaskbarAutoHideInTabletMode:{value:e?1:0,type:"REG_DWORD"}}};return yield O(t),U(),!0}catch(e){}return!1}))},t.isShowTaskbarOnMultipleDisplays=function(){return s(this,void 0,void 0,(function*(){if("win32"===process.platform){const e="HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",[t,i]=yield E(e).then((e=>[null,e])).catch((e=>[e,null]));if(!t&&i)try{return!!i[e].values.MMTaskbarEnabled.value}catch(e){}}return!1}))},t.setShowTaskbarOnMultipleDisplays=function(e){return s(this,void 0,void 0,(function*(){if("win32"===process.platform)try{const t={"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced":{MMTaskbarEnabled:{value:e?1:0,type:"REG_DWORD"}}};return yield O(t),U(),!0}catch(e){}return!1}))},t.setThickFrame=function(e,t){return s(this,void 0,void 0,(function*(){if(k){const i=parseInt(e.getMediaSourceId().split(":")[1],10),n=k.GetWindowLongA(i,-16),o=t?262144|n:-262145&n;return k.SetWindowLongA(i,-16,o),!0}return!1}))},t.getWindowBounds=function(e){const t={x:0,y:0,width:0,height:0,isMinimized:!1};if(k){const i=new I;k.GetWindowRect(e,i.ref())&&(t.x=i.left,t.y=i.top,t.width=i.right-i.left,t.height=i.bottom-i.top);const n=k.GetWindowLongA(e,-16);t.isMinimized=(n&P)===P}return t};const A=new Map;t.getDesktopBounds=function(e){let t=A.get(e);if(t)return t;if(t={x:0,y:0,width:0,height:0},k){let i=0;const n=e,o=c.default.Callback(p,[v,_,T,b],((e,o,r,s)=>{if(i+=1,i===n){const e=r.deref();return t.x=e.left,t.y=e.top,t.width=e.right-e.left,t.height=e.bottom-e.top,!1}return!0}));k.EnumDisplayMonitors(0,0,o,0)}return A.set(e,t),t},t.isWin7=function(){const e=l.release().split(".");if(e.length>=3){const t=parseInt(e[0],10),i=parseInt(e[1],10);return!(t>=10||6===t&&i>=2)}return!1},t.getDesktopWindow=function(e){const t=Buffer.from(e,"ucs2"),i=k.FindWindowW(0,t);return console.log(`+++++++++++++++++++++${i}`),i}},317:e=>{e.exports=require("@sentry/electron/main")},785:e=>{e.exports=require("@sentry/electron/main/integrations")},615:e=>{e.exports=require("@sentry/integrations")},409:e=>{e.exports=require("@sentry/node")},138:e=>{e.exports=require("adm-zip")},933:e=>{e.exports=require("electron")},765:e=>{e.exports=require("electron-store")},346:e=>{e.exports=require("electron-updater")},124:e=>{e.exports=require("ffi-napi")},747:e=>{e.exports=require("fs")},605:e=>{e.exports=require("http")},211:e=>{e.exports=require("https")},528:e=>{e.exports=require("i18next")},239:e=>{e.exports=require("i18next-resources-to-backend")},804:e=>{e.exports=require("lodash")},327:e=>{e.exports=require("mac-screen-capture-permissions")},87:e=>{e.exports=require("os")},622:e=>{e.exports=require("path")},420:e=>{e.exports=require("ref-array-napi")},728:e=>{e.exports=require("ref-napi")},451:e=>{e.exports=require("ref-struct-napi")},26:e=>{e.exports=require("regedit")},293:e=>{e.exports=require("systeminformation")},311:e=>{e.exports=require("tiw-log")},439:e=>{e.exports=require("ws")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var i=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(i.exports,i,i.exports,__webpack_require__),i.exports}var __webpack_exports__=__webpack_require__(519);return __webpack_exports__})()}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var __webpack_modules__={9:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setAppInfo=t.getAppInfo=void 0;let n={appName:"",appVersion:""};t.getAppInfo=()=>n,t.setAppInfo=e=>{n=e}},61:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commonOption=void 0,t.commonOption={dsn:"https://9497a4f3e4e64dddb4dd2b2f12b39a7a@sentry.qcloudtiw.com/2",environment:"production"}},505:function(__unused_webpack_module,exports,__webpack_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&__createBinding(t,e,n);return __setModuleDefault(t,e),t},__awaiter=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function c(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((o=o.apply(e,t||[])).next())}))},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.insertUpdateDom=void 0,__webpack_require__(91);const electron=__importStar(__webpack_require__(933)),dns_1=__importDefault(__webpack_require__(881)),trtc_electron_sdk_1=__importDefault(__webpack_require__(557)),TRTCDefine=__importStar(__webpack_require__(574)),rendererUtil=__importStar(__webpack_require__(818)),version_1=__webpack_require__(412),sentry_1=__webpack_require__(664),appInfo_1=__webpack_require__(9),fs_1=__webpack_require__(747),path_1=__importDefault(__webpack_require__(622)),electron_1=__webpack_require__(933),i18next_1=__importDefault(__webpack_require__(528)),i18next_resources_to_backend_1=__importDefault(__webpack_require__(239)),querystring_1=__webpack_require__(191),initI18nLang=(e="en")=>(console.log(`checking-for-update: : initI18nLang ${e}`),i18next_1.default.use((0,i18next_resources_to_backend_1.default)(((t,n,o)=>{const r=path_1.default.resolve(__dirname,"..","locales",`${e}.json`);fs_1.promises.readFile(r,"utf8").then((e=>{o(null,JSON.parse(e))})).catch((e=>{o(e,null)}))}))),i18next_1.default.init({lng:e,load:"languageOnly",fallbackLng:!1,keySeparator:!1,nsSeparator:!1}));(0,sentry_1.initSentry)();let currentBoardToolType=0,classStatusEventLast="",pptSharingState=!1;const TStateScreenShareBoardUndo="TStateScreenShareBoardUndo",TStateScreenShareBoardRedo="TStateScreenShareBoardRedo";function initLang(){const e=(0,querystring_1.parse)(window.location.href);let t=e.lng;"string"!=typeof e.lng&&(t=e.lng[0]);let n="en";return["ja","en","ko","zh-tw","zh"].find((e=>{if(t.toLocaleLowerCase().match(e))return n=e,!0})),initI18nLang(n)}window.TRTCCloud=trtc_electron_sdk_1.default,window.TRTCDefine=TRTCDefine,window.addEventListener("beforeunload",(e=>{console.warn("beforeunload:",e)}));const checkUploadFlag={inited:!1,cb:null},_Electron={getAppInfo(){return __awaiter(this,void 0,void 0,(function*(){let e=(0,appInfo_1.getAppInfo)();return e.appVersion||(e=yield electron_1.ipcRenderer.invoke("getAppInfo"),(0,appInfo_1.setAppInfo)(e)),e}))},registerRPCMethod(e,t){rpcMethods[e]=t},whenCanCheckUpload(e){checkUploadFlag.inited?e():checkUploadFlag.cb=e},getPlatform:()=>process.platform,hasScreenCapturePermission:()=>electron.ipcRenderer.invoke("hasScreenCapturePermission"),openSystemPreferences:()=>electron.ipcRenderer.invoke("openSystemPreferences"),getExcludeSelectWindows:()=>electron.ipcRenderer.invoke("getExcludeSelectWindows"),getClientInfo:()=>({sdkVersion:version_1.tcicSdkVersion,appInfo:(0,appInfo_1.getAppInfo)(),platform:process.platform}),getSystemInfo:e=>electron.ipcRenderer.invoke("getSystemInfo",e),sendCustomMessage(e){electron.ipcRenderer.send("onRecvCustomMessage",e)},reloadWindow(e,t){electron.ipcRenderer.send("onReloadWindow",e,t)},onPageFinished(e){electron.ipcRenderer.send("onPageFinished",e)},closeWindow(){if(window.TCIC){const e=window.TCIC.SDK.instance.getState(window.TCIC.TMainState.Class_Status),t=getClassStatusEvent(e);t!==classStatusEventLast&&electron.ipcRenderer.send(t)}electron.ipcRenderer.send("onCloseWindow",0)},minimizeWindow(){electron.ipcRenderer.send("onMinimizeWindow",0)},maximizeWindow(){electron.ipcRenderer.send("onMaximizeWindow",0)},openUrl(e){electron.shell.openExternal(e)},selectScreenCaptureTarget(e){this._selectedSource=e},startScreenShare(e){return __awaiter(this,void 0,void 0,(function*(){return this._selectedSource&&(e.type=this._selectedSource.type,e.displayId=this._selectedSource.sourceId),electron.ipcRenderer.invoke("startScreenShare",e,pptSharingState)}))},stopScreenShare:()=>pptSharingState?Promise.resolve():electron.ipcRenderer.invoke("stopScreenShare"),getDesktopWindows:e=>new Promise(((t,n)=>{electron.ipcRenderer.invoke("getDeskTopWindows",e).then((e=>{t(e)})).catch((e=>{n(e)}))})),callMethod(e){electron.ipcRenderer.send("callMethod",e),"board"===e.module&&"setToolType"===e.method&&(currentBoardToolType=e.params[0])},saveSnapshot(e,t,n,o){const r={snapId:e,base64Data:t,snapName:n,dialog:o};return new Promise(((e,t)=>{electron.ipcRenderer.invoke("saveImage",r).then((n=>{n.hasOwnProperty("errcode")?t(n):e(n)}))}))},checkDNSParsing:e=>new Promise((t=>{const n=Date.now();dns_1.default.lookup(e,((e,o,r)=>{t({error:e,cost:Date.now()-n,address:o})}))})),loadVideo(e,t){const n=e.getBoundingClientRect(),o={x:n.left,y:n.top,width:n.width,height:n.height};return electron.ipcRenderer.invoke("loadVideo",{bounds:o,url:t})},playVideo:()=>electron.ipcRenderer.invoke("playVideo"),pauseVideo:()=>electron.ipcRenderer.invoke("pauseVideo"),stopVideo:()=>electron.ipcRenderer.invoke("stopVideo"),seekVideo:e=>electron.ipcRenderer.invoke("seekVideo",e),setVideoVolume:e=>electron.ipcRenderer.invoke("setVideoVolume",e),downloadMusic:e=>electron.ipcRenderer.invoke("downloadMusic",e),startSubCamera:e=>electron.ipcRenderer.invoke("startSubCamera",e),stopSubCamera:()=>electron.ipcRenderer.invoke("stopSubCamera"),onReceiveMessage:e=>electron.ipcRenderer.invoke("onReceiveMessage",e),getWindowId(){const e=electron.remote.getCurrentWindow();let t="";try{t=e.getMediaSourceId().split(":")[1]}catch(e){console.error(e)}finally{return t}},setUpdateUrl:e=>electron.ipcRenderer.invoke("setUpdateUrl",e),checkUpdate:()=>(console.log("will check Update---\x3e"),electron.ipcRenderer.invoke("checkUpdate")),quitAndInstall:()=>(console.log("will check Update---\x3e"),electron.ipcRenderer.invoke("quitAndInstall")),downloadUpdate:()=>(console.log("downloadUpdate:"),electron.ipcRenderer.invoke("downloadUpdate")),updateClickableRects(e){const t=updateClickableRectsCache.length!==e.length,n=JSON.stringify(e);(t||n!==updateClickableRectsHash)&&(electron.ipcRenderer.send("updateClickableRects",{rects:e}),updateClickableRectsCache=e,updateClickableRectsHash=n)},setClickableAreaDetectMode:e=>electron.ipcRenderer.send("setClickableAreaDetectMode",{mode:e})};let updateClickableRectsCache=[],updateClickableRectsHash="";window.Electron=_Electron;const rpcMethods={},getClassStatusEvent=e=>e===window.TCIC.TClassStatus.Already_Start?"onTCICClassStart":e===window.TCIC.TClassStatus.Has_Ended?"onTCICClassStop":e===window.TCIC.TClassStatus.Has_Expired?"onTCICClassExpired":"onTCICClassInit",initPromise=new Promise(((e,t)=>{electron.ipcRenderer.on("init",((t,n)=>{window.TCIC&&(window.TCIC.SDK.instance.registerState(TStateScreenShareBoardUndo,"屏幕共享白板撤销状态",!1),window.TCIC.SDK.instance.registerState(TStateScreenShareBoardRedo,"屏幕共享白板重做状态",!1),window.TCIC.SDK.instance.subscribeState(window.TCIC.TMainState.Class_Layout,(e=>{electron.ipcRenderer.send("onClassLayoutChanged",e)})),window.TCIC.SDK.instance.subscribeState(window.TCIC.TMainState.Class_Status,(e=>{classStatusEventLast=getClassStatusEvent(e),electron.ipcRenderer.send(classStatusEventLast)})),window.TCIC.SDK.instance.subscribeState(window.TCICUI.Constant.TStatePassThroughStatus,(e=>{electron.remote.getCurrentWindow().setIgnoreMouseEvents(e,{forward:!0})})),window.TCIC.SDK.instance.subscribeState(window.TCICUI.Constant.TStatePPtSharingState,(e=>{pptSharingState=e}))),e(n)})),electron.ipcRenderer.on("onScreenShareSnapshot",((e,t)=>{window.screenShareSnapshotCallback&&window.screenShareSnapshotCallback(t)})),electron.ipcRenderer.on("leaveClass",(e=>{window.TCIC?window.TCIC.SDK.instance.leaveClass():window.Electron.closeWindow()})),electron.ipcRenderer.on("sendCustomMessage",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Recv_Custom_Msg,t)})),electron.ipcRenderer.on("onBoardCanRedoChange",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(TStateScreenShareBoardRedo,t)})),electron.ipcRenderer.on("onBoardCanUndoChange",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(TStateScreenShareBoardUndo,t)})),electron.ipcRenderer.on("onVideoTimeUpdate",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(window.TCIC.TMainState.Vod_Time_Update,t)})),electron.ipcRenderer.on("onVideoTimeSeeked",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(window.TCIC.TMainState.Vod_Time_Seeked,t)})),electron.ipcRenderer.on("onVersionUpdate",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Version_Update,t)})),electron.ipcRenderer.on("onReceiveMessage",((e,t)=>{window.TCICUI&&window.TCICUI.onReceiveMessage(t)})),electron.ipcRenderer.on("rpc-no-ret",((e,t)=>{rpcMethods[t.method]&&rpcMethods[t.method](...t.args)})),electron.ipcRenderer.on("onElectronScreenSharePause",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Electron_Screen_Share_Pause)})),electron.ipcRenderer.on("onElectronScreenShareResume",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Electron_Screen_Share_Resume)}))}));function touchScreenOptimize(e){const t="touchstart",n=()=>{window.removeEventListener(t,n,!0),electron.ipcRenderer.send("enableTouchScreenOptimize"),console.warn("touchScreenOptimize triggered.");const e=["touchstart","touchmove","touchend","mousedown","mousemove","mouseup"];electron.ipcRenderer.on("enableWatchMouseMoveEvent",((t,n)=>{rendererUtil.watchEvents(window,e,n)}))};window.addEventListener(t,n,!0)}function loadView(e){return(0,fs_1.readFileSync)(path_1.default.resolve(__dirname,"view",e)).toString()}function insertUpdateDom(){const wraper=document.createElement("DIV"),loadText=loadView("update.html"),getJs=/<script>([^^]+)<\/script>/gi.exec(loadText);wraper.innerHTML=loadText,document.body.appendChild(wraper),getJs&&eval(getJs[1])}initPromise.then((e=>{setTimeout((()=>{touchScreenOptimize(e)}),1e3)})),exports.insertUpdateDom=insertUpdateDom,window.addEventListener("DOMContentLoaded",(()=>{console.log("DOMContentLoaded:!!!!!!"),insertUpdateDom(),setTimeout((()=>__awaiter(void 0,void 0,void 0,(function*(){yield initLang(),electron.ipcRenderer.send("canCheckUpdate")}))),100)}));const updateTips={enable:!0,updateAvailable:{title:()=>i18next_1.default.t("版本更新通知"),msgList:()=>["",i18next_1.default.t("步骤1:点击同意按钮进入下载页面。"),i18next_1.default.t("步骤2:启动下载并按照提供的安装说明进行操作。"),i18next_1.default.t("步骤3:下载完成后,返回TMS页面并重新加入课堂。")]},downloadProgress:{title:()=>i18next_1.default.t("下载中")},updateDownloaded:{title:()=>i18next_1.default.t("准备安装"),msgList:()=>[i18next_1.default.t("单击“确定”进行安装。安装完成后,请返回TMS页面并重新加入课堂。或单击“取消”返回当前课程。")]}};function callUpdateDialog(e,...t){const n=window;if(n._tcic_update_dialog){if("eventTrigger"===e){const e=n._tcic_update_dialog.eventTrigger;return e&&e(...t)}{if(!updateTips.enable)return!1;const o=n._tcic_update_dialog[e];return console.log(`--\x3echecking-for-update: ${e}`,o),o&&o(...t)}}}electron.ipcRenderer.on("message",((e,t,n)=>{console.log("--\x3echecking-for-update ",e,t,n);const o={"update-available":()=>{console.log(`checking-for-update: 000>, setText ${updateTips.updateAvailable.title()}`),callUpdateDialog("setText",{title:updateTips.updateAvailable.title(),ok:i18next_1.default.t("确定"),cancel:i18next_1.default.t("取消"),close:i18next_1.default.t("关闭")}),callUpdateDialog("eventTrigger",["update-available",t,n]);const e=callUpdateDialog("sconfirm",updateTips.updateAvailable.msgList());e&&e.then((e=>{e&&(electron.ipcRenderer.invoke("downloadUpdate"),console.log("confirmResult:",e))}))},"download-progress":()=>{callUpdateDialog("eventTrigger",["download-progress",t,n]),callUpdateDialog("setText",{title:updateTips.downloadProgress.title()}),callUpdateDialog("process","",Math.floor(n.percent))},"update-downloaded":()=>{callUpdateDialog("eventTrigger",["update-downloaded",t,n]),callUpdateDialog("setText",{title:updateTips.updateDownloaded.title()}),callUpdateDialog("sconfirm",updateTips.updateDownloaded.msgList()).then((e=>{e&&(electron.ipcRenderer.invoke("quitAndInstall"),console.log("confirmResult:",e))}))}};if(o[t]){const e=function(t){window._tcic_update_dialog?t():setTimeout((()=>{e(t)}),100)};e(o[t])}}))},91:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(486),n(664),(0,n(768).startCrashReporter)()},768:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.startCrashReporter=void 0,n(699);const a=i(n(933));t.startCrashReporter=()=>{const e={last:a.crashReporter.getLastCrashReport(),uploaded:a.crashReporter.getUploadedReports()};globalThis.dbg||(globalThis.dbg={});const{dbg:t}=globalThis;t.crashReports=e,t.electron=a.default}},664:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function c(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._initSentry=t.initSentry=void 0;const c=i(n(298)),s=n(61),d=n(736),l=n(74),p=[new l.Integrations.InboundFilters,new l.Integrations.FunctionToString,new d.TryCatch,new d.Breadcrumbs,new d.GlobalHandlers,new d.Dedupe];let u=!1;t.initSentry=()=>a(void 0,void 0,void 0,(function*(){(0,t._initSentry)()})),t._initSentry=()=>a(void 0,void 0,void 0,(function*(){if(u)return;const e=Object.assign(Object.assign({},s.commonOption),{defaultIntegrations:!1,integrations:[...p]});c.init(e),u=!0})),(0,t.initSentry)(),window.sentry={init:t._initSentry}},818:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.watchEvents=void 0;const o=n(933);(0,n(664).initSentry)();const r=e=>{let t,n;if(e instanceof TouchEvent?(t=Math.round(e.changedTouches[0].screenX),n=Math.round(e.changedTouches[0].screenY)):(t=e.screenX,n=e.screenY),0!==t||0!==n){const r={type:e.type,x:t,y:n};o.ipcRenderer.send("onMouseEvent",r),console.log("onMouseEvent",r)}};t.watchEvents=function(e,t,n){t.forEach((t=>{n?e.addEventListener(t,r,{capture:!0,passive:!1}):e.removeEventListener(t,r,{capture:!0})}))}},699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tcicSdkBranch=t.tcicSdkVersion=void 0,t.tcicSdkVersion="1.8.13",t.tcicSdkBranch=""},736:e=>{e.exports=require("@sentry/browser")},74:e=>{e.exports=require("@sentry/core")},486:e=>{e.exports=require("@sentry/electron/preload")},298:e=>{e.exports=require("@sentry/electron/renderer")},881:e=>{e.exports=require("dns")},933:e=>{e.exports=require("electron")},747:e=>{e.exports=require("fs")},528:e=>{e.exports=require("i18next")},239:e=>{e.exports=require("i18next-resources-to-backend")},622:e=>{e.exports=require("path")},191:e=>{e.exports=require("querystring")},557:e=>{e.exports=require("trtc-electron-sdk")},574:e=>{e.exports=require("trtc-electron-sdk/liteav/trtc_define")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__=__webpack_require__(505)})();
|
|
1
|
+
(()=>{"use strict";var __webpack_modules__={9:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.setAppInfo=t.getAppInfo=void 0;let n={appName:"",appVersion:""};t.getAppInfo=()=>n,t.setAppInfo=e=>{n=e}},61:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.commonOption=void 0,t.commonOption={dsn:"https://9497a4f3e4e64dddb4dd2b2f12b39a7a@sentry.qcloudtiw.com/2",environment:"production"}},505:function(__unused_webpack_module,exports,__webpack_require__){var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&__createBinding(t,e,n);return __setModuleDefault(t,e),t},__awaiter=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function c(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((o=o.apply(e,t||[])).next())}))},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.insertUpdateDom=void 0,__webpack_require__(91);const electron=__importStar(__webpack_require__(933)),dns_1=__importDefault(__webpack_require__(881)),trtc_electron_sdk_1=__importDefault(__webpack_require__(557)),TRTCDefine=__importStar(__webpack_require__(574)),rendererUtil=__importStar(__webpack_require__(818)),version_1=__webpack_require__(412),sentry_1=__webpack_require__(664),appInfo_1=__webpack_require__(9),fs_1=__webpack_require__(747),path_1=__importDefault(__webpack_require__(622)),electron_1=__webpack_require__(933),i18next_1=__importDefault(__webpack_require__(528)),i18next_resources_to_backend_1=__importDefault(__webpack_require__(239)),querystring_1=__webpack_require__(191),initI18nLang=(e="en")=>(console.log(`checking-for-update: : initI18nLang ${e}`),i18next_1.default.use((0,i18next_resources_to_backend_1.default)(((t,n,o)=>{const r=path_1.default.resolve(__dirname,"..","locales",`${e}.json`);fs_1.promises.readFile(r,"utf8").then((e=>{o(null,JSON.parse(e))})).catch((e=>{o(e,null)}))}))),i18next_1.default.init({lng:e,load:"languageOnly",fallbackLng:!1,keySeparator:!1,nsSeparator:!1}));(0,sentry_1.initSentry)();let currentBoardToolType=0,classStatusEventLast="",pptSharingState=!1;const TStateScreenShareBoardUndo="TStateScreenShareBoardUndo",TStateScreenShareBoardRedo="TStateScreenShareBoardRedo";function initLang(){const e=(0,querystring_1.parse)(window.location.href);let t=e.lng;"string"!=typeof e.lng&&(t=e.lng[0]);let n="en";return["ja","en","ko","zh-tw","zh"].find((e=>{if(t.toLocaleLowerCase().match(e))return n=e,!0})),initI18nLang(n)}window.TRTCCloud=trtc_electron_sdk_1.default,window.TRTCDefine=TRTCDefine,window.addEventListener("beforeunload",(e=>{console.warn("beforeunload:",e)}));const checkUploadFlag={inited:!1,cb:null},_Electron={getAppInfo(){return __awaiter(this,void 0,void 0,(function*(){let e=(0,appInfo_1.getAppInfo)();return e.appVersion||(e=yield electron_1.ipcRenderer.invoke("getAppInfo"),(0,appInfo_1.setAppInfo)(e)),e}))},registerRPCMethod(e,t){rpcMethods[e]=t},whenCanCheckUpload(e){checkUploadFlag.inited?e():checkUploadFlag.cb=e},getPlatform:()=>process.platform,hasScreenCapturePermission:()=>electron.ipcRenderer.invoke("hasScreenCapturePermission"),openSystemPreferences:()=>electron.ipcRenderer.invoke("openSystemPreferences"),getExcludeSelectWindows:()=>electron.ipcRenderer.invoke("getExcludeSelectWindows"),getClientInfo:()=>({sdkVersion:version_1.tcicSdkVersion,appInfo:(0,appInfo_1.getAppInfo)(),platform:process.platform}),getSystemInfo:e=>electron.ipcRenderer.invoke("getSystemInfo",e),sendCustomMessage(e){electron.ipcRenderer.send("onRecvCustomMessage",e)},reloadWindow(e,t){electron.ipcRenderer.send("onReloadWindow",e,t)},onPageFinished(e){electron.ipcRenderer.send("onPageFinished",e)},closeWindow(){if(window.TCIC){const e=window.TCIC.SDK.instance.getState(window.TCIC.TMainState.Class_Status),t=getClassStatusEvent(e);t!==classStatusEventLast&&electron.ipcRenderer.send(t)}electron.ipcRenderer.send("onCloseWindow",0)},minimizeWindow(){electron.ipcRenderer.send("onMinimizeWindow",0)},maximizeWindow(){electron.ipcRenderer.send("onMaximizeWindow",0)},openUrl(e){electron.shell.openExternal(e)},selectScreenCaptureTarget(e){this._selectedSource=e},startScreenShare(e){return __awaiter(this,void 0,void 0,(function*(){return this._selectedSource&&(e.type=this._selectedSource.type,e.displayId=this._selectedSource.sourceId),electron.ipcRenderer.invoke("startScreenShare",e,pptSharingState)}))},stopScreenShare:()=>pptSharingState?Promise.resolve():electron.ipcRenderer.invoke("stopScreenShare"),getDesktopWindows:e=>new Promise(((t,n)=>{electron.ipcRenderer.invoke("getDeskTopWindows",e).then((e=>{t(e)})).catch((e=>{n(e)}))})),callMethod(e){electron.ipcRenderer.send("callMethod",e),"board"===e.module&&"setToolType"===e.method&&(currentBoardToolType=e.params[0])},saveSnapshot(e,t,n,o){const r={snapId:e,base64Data:t,snapName:n,dialog:o};return new Promise(((e,t)=>{electron.ipcRenderer.invoke("saveImage",r).then((n=>{n.hasOwnProperty("errcode")?t(n):e(n)}))}))},checkDNSParsing:e=>new Promise((t=>{const n=Date.now();dns_1.default.lookup(e,((e,o,r)=>{t({error:e,cost:Date.now()-n,address:o})}))})),loadVideo(e,t){const n=e.getBoundingClientRect(),o={x:n.left,y:n.top,width:n.width,height:n.height};return electron.ipcRenderer.invoke("loadVideo",{bounds:o,url:t})},playVideo:()=>electron.ipcRenderer.invoke("playVideo"),pauseVideo:()=>electron.ipcRenderer.invoke("pauseVideo"),stopVideo:()=>electron.ipcRenderer.invoke("stopVideo"),seekVideo:e=>electron.ipcRenderer.invoke("seekVideo",e),setVideoVolume:e=>electron.ipcRenderer.invoke("setVideoVolume",e),downloadMusic:e=>electron.ipcRenderer.invoke("downloadMusic",e),startSubCamera:e=>electron.ipcRenderer.invoke("startSubCamera",e),stopSubCamera:()=>electron.ipcRenderer.invoke("stopSubCamera"),onReceiveMessage:e=>electron.ipcRenderer.invoke("onReceiveMessage",e),getWindowId(){const e=electron.remote.getCurrentWindow();let t="";try{t=e.getMediaSourceId().split(":")[1]}catch(e){console.error(e)}finally{return t}},setUpdateUrl:e=>electron.ipcRenderer.invoke("setUpdateUrl",e),checkUpdate:()=>(console.log("will check Update---\x3e"),electron.ipcRenderer.invoke("checkUpdate")),quitAndInstall:()=>(console.log("will check Update---\x3e"),electron.ipcRenderer.invoke("quitAndInstall")),downloadUpdate:()=>(console.log("downloadUpdate:"),electron.ipcRenderer.invoke("downloadUpdate")),updateClickableRects(e){const t=updateClickableRectsCache.length!==e.length,n=JSON.stringify(e);(t||n!==updateClickableRectsHash)&&(electron.ipcRenderer.send("updateClickableRects",{rects:e}),updateClickableRectsCache=e,updateClickableRectsHash=n)},setClickableAreaDetectMode:e=>electron.ipcRenderer.send("setClickableAreaDetectMode",{mode:e})};let updateClickableRectsCache=[],updateClickableRectsHash="";window.Electron=_Electron;const rpcMethods={},getClassStatusEvent=e=>e===window.TCIC.TClassStatus.Already_Start?"onTCICClassStart":e===window.TCIC.TClassStatus.Has_Ended?"onTCICClassStop":e===window.TCIC.TClassStatus.Has_Expired?"onTCICClassExpired":"onTCICClassInit",initPromise=new Promise(((e,t)=>{electron.ipcRenderer.on("init",((t,n)=>{window.TCIC&&(window.TCIC.SDK.instance.registerState(TStateScreenShareBoardUndo,"屏幕共享白板撤销状态",!1),window.TCIC.SDK.instance.registerState(TStateScreenShareBoardRedo,"屏幕共享白板重做状态",!1),window.TCIC.SDK.instance.subscribeState(window.TCIC.TMainState.Class_Layout,(e=>{electron.ipcRenderer.send("onClassLayoutChanged",e)})),window.TCIC.SDK.instance.subscribeState(window.TCIC.TMainState.Class_Status,(e=>{classStatusEventLast=getClassStatusEvent(e),electron.ipcRenderer.send(classStatusEventLast)})),window.TCIC.SDK.instance.subscribeState(window.TCICUI.Constant.TStatePassThroughStatus,(e=>{electron.remote.getCurrentWindow().setIgnoreMouseEvents(e,{forward:!0})})),window.TCIC.SDK.instance.subscribeState(window.TCICUI.Constant.TStatePPtSharingState,(e=>{pptSharingState=e}))),e(n)})),electron.ipcRenderer.on("onScreenShareSnapshot",((e,t)=>{window.screenShareSnapshotCallback&&window.screenShareSnapshotCallback(t)})),electron.ipcRenderer.on("leaveClass",(e=>{window.TCIC?window.TCIC.SDK.instance.leaveClass():window.Electron.closeWindow()})),electron.ipcRenderer.on("sendCustomMessage",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Recv_Custom_Msg,t)})),electron.ipcRenderer.on("onBoardCanRedoChange",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(TStateScreenShareBoardRedo,t)})),electron.ipcRenderer.on("onBoardCanUndoChange",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(TStateScreenShareBoardUndo,t)})),electron.ipcRenderer.on("onVideoTimeUpdate",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(window.TCIC.TMainState.Vod_Time_Update,t)})),electron.ipcRenderer.on("onVideoTimeSeeked",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.setState(window.TCIC.TMainState.Vod_Time_Seeked,t)})),electron.ipcRenderer.on("onVersionUpdate",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Version_Update,t)})),electron.ipcRenderer.on("onReceiveMessage",((e,t)=>{window.TCICUI&&window.TCICUI.onReceiveMessage(t)})),electron.ipcRenderer.on("rpc-no-ret",((e,t)=>{rpcMethods[t.method]&&rpcMethods[t.method](...t.args)})),electron.ipcRenderer.on("onElectronScreenSharePause",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Electron_Screen_Share_Pause)})),electron.ipcRenderer.on("onElectronScreenShareResume",((e,t)=>{window.TCIC&&window.TCIC.SDK.instance.notify(window.TCIC.TMainEvent.Electron_Screen_Share_Resume)}))}));function touchScreenOptimize(e){const t="touchstart",n=()=>{window.removeEventListener(t,n,!0),electron.ipcRenderer.send("enableTouchScreenOptimize"),console.warn("touchScreenOptimize triggered.");const e=["touchstart","touchmove","touchend","mousedown","mousemove","mouseup"];electron.ipcRenderer.on("enableWatchMouseMoveEvent",((t,n)=>{rendererUtil.watchEvents(window,e,n)}))};window.addEventListener(t,n,!0)}function loadView(e){return(0,fs_1.readFileSync)(path_1.default.resolve(__dirname,"view",e)).toString()}function insertUpdateDom(){const wraper=document.createElement("DIV"),loadText=loadView("update.html"),getJs=/<script>([^^]+)<\/script>/gi.exec(loadText);wraper.innerHTML=loadText,document.body.appendChild(wraper),getJs&&eval(getJs[1])}initPromise.then((e=>{setTimeout((()=>{touchScreenOptimize(e)}),1e3)})),exports.insertUpdateDom=insertUpdateDom,window.addEventListener("DOMContentLoaded",(()=>{console.log("DOMContentLoaded:!!!!!!"),insertUpdateDom(),setTimeout((()=>__awaiter(void 0,void 0,void 0,(function*(){yield initLang(),electron.ipcRenderer.send("canCheckUpdate")}))),100)}));const updateTips={enable:!0,updateAvailable:{title:()=>i18next_1.default.t("版本更新通知"),msgList:()=>["",i18next_1.default.t("步骤1:点击同意按钮进入下载页面。"),i18next_1.default.t("步骤2:启动下载并按照提供的安装说明进行操作。"),i18next_1.default.t("步骤3:下载完成后,返回TMS页面并重新加入课堂。")]},downloadProgress:{title:()=>i18next_1.default.t("下载中")},updateDownloaded:{title:()=>i18next_1.default.t("准备安装"),msgList:()=>[i18next_1.default.t("单击“确定”进行安装。安装完成后,请返回TMS页面并重新加入课堂。或单击“取消”返回当前课程。")]}};function callUpdateDialog(e,...t){const n=window;if(n._tcic_update_dialog){if("eventTrigger"===e){const e=n._tcic_update_dialog.eventTrigger;return e&&e(...t)}{if(!updateTips.enable)return!1;const o=n._tcic_update_dialog[e];return console.log(`--\x3echecking-for-update: ${e}`,o),o&&o(...t)}}}electron.ipcRenderer.on("message",((e,t,n)=>{console.log("--\x3echecking-for-update ",e,t,n);const o={"update-available":()=>{console.log(`checking-for-update: 000>, setText ${updateTips.updateAvailable.title()}`),callUpdateDialog("setText",{title:updateTips.updateAvailable.title(),ok:i18next_1.default.t("确定"),cancel:i18next_1.default.t("取消"),close:i18next_1.default.t("关闭")}),callUpdateDialog("eventTrigger",["update-available",t,n]);const e=callUpdateDialog("sconfirm",updateTips.updateAvailable.msgList());e&&e.then((e=>{e&&(electron.ipcRenderer.invoke("downloadUpdate"),console.log("confirmResult:",e))}))},"download-progress":()=>{callUpdateDialog("eventTrigger",["download-progress",t,n]),callUpdateDialog("setText",{title:updateTips.downloadProgress.title()}),callUpdateDialog("process","",Math.floor(n.percent))},"update-downloaded":()=>{callUpdateDialog("eventTrigger",["update-downloaded",t,n]),callUpdateDialog("setText",{title:updateTips.updateDownloaded.title()}),callUpdateDialog("sconfirm",updateTips.updateDownloaded.msgList()).then((e=>{e&&(electron.ipcRenderer.invoke("quitAndInstall"),console.log("confirmResult:",e))}))}};if(o[t]){const e=function(t){window._tcic_update_dialog?t():setTimeout((()=>{e(t)}),100)};e(o[t])}}))},91:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),n(486),n(664),(0,n(768).startCrashReporter)()},768:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.startCrashReporter=void 0,n(699);const a=i(n(933));t.startCrashReporter=()=>{const e={last:a.crashReporter.getLastCrashReport(),uploaded:a.crashReporter.getUploadedReports()};globalThis.dbg||(globalThis.dbg={});const{dbg:t}=globalThis;t.crashReports=e,t.electron=a.default}},664:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function c(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,c)}s((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._initSentry=t.initSentry=void 0;const c=i(n(298)),s=n(61),d=n(736),l=n(74),p=[new l.Integrations.InboundFilters,new l.Integrations.FunctionToString,new d.TryCatch,new d.Breadcrumbs,new d.GlobalHandlers,new d.Dedupe];let u=!1;t.initSentry=()=>a(void 0,void 0,void 0,(function*(){(0,t._initSentry)()})),t._initSentry=()=>a(void 0,void 0,void 0,(function*(){if(u)return;const e=Object.assign(Object.assign({},s.commonOption),{defaultIntegrations:!1,integrations:[...p]});c.init(e),u=!0})),(0,t.initSentry)(),window.sentry={init:t._initSentry}},818:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.watchEvents=void 0;const o=n(933);(0,n(664).initSentry)();const r=e=>{let t,n;if(e instanceof TouchEvent?(t=Math.round(e.changedTouches[0].screenX),n=Math.round(e.changedTouches[0].screenY)):(t=e.screenX,n=e.screenY),0!==t||0!==n){const r={type:e.type,x:t,y:n};o.ipcRenderer.send("onMouseEvent",r),console.log("onMouseEvent",r)}};t.watchEvents=function(e,t,n){t.forEach((t=>{n?e.addEventListener(t,r,{capture:!0,passive:!1}):e.removeEventListener(t,r,{capture:!0})}))}},699:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},412:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tcicSdkBranch=t.tcicSdkVersion=void 0,t.tcicSdkVersion="1.8.14",t.tcicSdkBranch=""},736:e=>{e.exports=require("@sentry/browser")},74:e=>{e.exports=require("@sentry/core")},486:e=>{e.exports=require("@sentry/electron/preload")},298:e=>{e.exports=require("@sentry/electron/renderer")},881:e=>{e.exports=require("dns")},933:e=>{e.exports=require("electron")},747:e=>{e.exports=require("fs")},528:e=>{e.exports=require("i18next")},239:e=>{e.exports=require("i18next-resources-to-backend")},622:e=>{e.exports=require("path")},191:e=>{e.exports=require("querystring")},557:e=>{e.exports=require("trtc-electron-sdk")},574:e=>{e.exports=require("trtc-electron-sdk/liteav/trtc_define")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__=__webpack_require__(505)})();
|
package/dist/resource.zip
CHANGED
|
Binary file
|
package/locales/ko.json
CHANGED
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"立即更新": "지금 업데이트",
|
|
43
43
|
"取消": "취소",
|
|
44
44
|
"新版本下载完成": "새 버전 다운로드 됨",
|
|
45
|
-
"点击确定马上安装新版本": "새 버전을
|
|
45
|
+
"点击确定马上安装新版本": "새 버전을 설정하시려면확인을 눌러주세요!",
|
|
46
46
|
"版本更新通知": "버전 업데이트 알림",
|
|
47
|
-
"正在下载安装程式": "
|
|
47
|
+
"正在下载安装程式": "설정 프로그램 다운로드 중",
|
|
48
48
|
"确定": "확인",
|
|
49
49
|
"步骤1:点击同意按钮进入下载页面。": "1단계: 동의 버튼을 클릭하면 다운로드 페이지로 이동합니다.",
|
|
50
|
-
"步骤2:启动下载并按照提供的安装说明进行操作。": "2단계:
|
|
50
|
+
"步骤2:启动下载并按照提供的安装说明进行操作。": "2단계: 설정 지침에 따라 다운로드를시작합니다.",
|
|
51
51
|
"步骤3:下载完成后,返回TMS页面并重新加入课堂。": "3단계: 다운로드가 완료되면 TMS 페이지로 돌아가서 수업에 다시 참여하십시오.",
|
|
52
|
-
"准备安装": "
|
|
53
|
-
"单击“确定”进行安装。安装完成后,请返回TMS页面并重新加入课堂。或单击“取消”返回当前课程。": "확인을 클릭하여
|
|
52
|
+
"准备安装": "설정 준비",
|
|
53
|
+
"单击“确定”进行安装。安装完成后,请返回TMS页面并重新加入课堂。或单击“取消”返回当前课程。": "확인을 클릭하여 설정합니다. 설정가 완료되면 TMS 페이지로 돌아가 수업에 다시 참여하세요. 취소를 클릭하면 현재 수업으로 돌아갑니다."
|
|
54
54
|
}
|