You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
5 lines
47 KiB
5 lines
47 KiB
(self.webpackChunk=self.webpackChunk||[]).push([[3897],{53660:function(tt,Be){(function($,s){s(Be)})(this,function($){"use strict";var s=function(){return(s=Object.assign||function(t){for(var o,i=1,u=arguments.length;i<u;i++)for(var d in o=arguments[i])Object.prototype.hasOwnProperty.call(o,d)&&(t[d]=o[d]);return t}).apply(this,arguments)};function M(t,o,i,u){return new(i||(i=Promise))(function(d,m){function p(h){try{O(u.next(h))}catch(f){m(f)}}function k(h){try{O(u.throw(h))}catch(f){m(f)}}function O(h){var f;h.done?d(h.value):(f=h.value,f instanceof i?f:new i(function(S){S(f)})).then(p,k)}O((u=u.apply(t,o||[])).next())})}function V(t,o){var i,u,d,m,p={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return m={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function k(O){return function(h){return function(f){if(i)throw new TypeError("Generator is already executing.");for(;p;)try{if(i=1,u&&(d=2&f[0]?u.return:f[0]?u.throw||((d=u.return)&&d.call(u),0):u.next)&&!(d=d.call(u,f[1])).done)return d;switch(u=0,d&&(f=[2&f[0],d.value]),f[0]){case 0:case 1:d=f;break;case 4:return p.label++,{value:f[1],done:!1};case 5:p.label++,u=f[1],f=[0];continue;case 7:f=p.ops.pop(),p.trys.pop();continue;default:if(!(d=(d=p.trys).length>0&&d[d.length-1])&&(f[0]===6||f[0]===2)){p=0;continue}if(f[0]===3&&(!d||f[1]>d[0]&&f[1]<d[3])){p.label=f[1];break}if(f[0]===6&&p.label<d[1]){p.label=d[1],d=f;break}if(d&&p.label<d[2]){p.label=d[2],p.ops.push(f);break}d[2]&&p.ops.pop(),p.trys.pop();continue}f=o.call(t,p)}catch(S){f=[6,S],u=0}finally{i=d=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([O,h])}}}var Z=function(){function t(){}return t.add=function(o){t.HANDLE_LIST.push(o),window.addEventListener("message",o,!1)},t.remove=function(o){var i=t.HANDLE_LIST.indexOf(o);i>=0&&t.HANDLE_LIST.splice(i,1),window.removeEventListener("message",o,!1)},t.empty=function(){for(;t.HANDLE_LIST.length;)window.removeEventListener("message",t.HANDLE_LIST.shift(),!1)},t.parse=function(o){try{return typeof o=="object"?o:o&&JSON.parse(o)}catch(i){return console.log("Message.parse Error:",i),o}},t.HANDLE_LIST=[],t}();function _e(t){return{}.toString.call(t)==="[object Function]"}var Q,Se,Pe,le,Ie={origin:""};function L(t,o){Ie[t]=o}function X(t){return Ie[t]}function ve(t){var o=X("origin");return!!function(i,u){return i!==u&&(i.replace(/www\./i,"").toLowerCase()!==u.replace(/www\./i,"").toLowerCase()||(i.match("www.")?void 0:(L("origin",u),!1)))}(o,t.origin)&&(console.warn("postMessage \u57DF\u540D\u68C0\u67E5\u4E0D\u901A\u8FC7",{safeOrigin:o,eventOrigin:t.origin}),!0)}(function(t){t.unknown="unknown",t.spreadsheet="s",t.writer="w",t.presentation="p",t.pdf="f"})(Q||(Q={})),function(t){t.wps="w",t.et="s",t.presentation="p",t.pdf="f"}(Se||(Se={})),function(t){t.nomal="nomal",t.simple="simple"}(Pe||(Pe={})),function(t){t[t.requestFullscreen=1]="requestFullscreen",t[t.exitFullscreen=0]="exitFullscreen"}(le||(le={}));var Te,te,ie,ke=(Te=0,function(){return Te+=1}),xe=function(t,o,i){i===void 0&&(i=!0);var u=o;if(!te){var d=function k(O){var h=O.clientHeight,f=O.clientWidth;h!==0||f!==0||ie?h===0&&f===0||!ie||(ie.disconnect(),ie=null):window.ResizeObserver&&(ie=new ResizeObserver(function(S){k(O)})).observe(O),te.style.cssText+="height: "+h+"px; width: "+f+"px"}.bind(null,u);(te=document.createElement("iframe")).classList.add("web-office-iframe");var m={id:"office-iframe",src:t,scrolling:"no",frameborder:"0",allowfullscreen:"allowfullscreen",webkitallowfullscreen:"true",mozallowfullscreen:"true",allow:"clipboard-read; clipboard-write"};for(var p in u?(m.style="width: "+u.clientWidth+"px; height: "+u.clientHeight+"px;",i&&window.addEventListener("resize",d)):((u=document.createElement("div")).classList.add("web-office-default-container"),function(k){var O=document.createElement("style");document.head.appendChild(O);var h=O.sheet;h.insertRule(k,h.cssRules.length)}(".web-office-default-container {position: absolute; padding: 0; margin: 0; width: 100%; height: 100%; left: 0; top: 0;}"),document.body.appendChild(u),m.style="position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;"),m)te.setAttribute(p,m[p]);u.appendChild(te),te.destroy=function(){te.parentNode.removeChild(te),te=null,window.removeEventListener("resize",d),ie&&(ie.disconnect(),ie=null)}}return te},K=function(t){xe().contentWindow&&xe().contentWindow.postMessage(JSON.stringify(t),X("origin"))};function Le(t,o,i){return new Promise(function(u){var d=ke(),m=function(p){if(!ve(p)){var k=Z.parse(p.data);k.eventName===i&&k.msgId===d&&(u(k.data),Z.remove(m))}};Z.add(m),K({data:t,msgId:d,eventName:o})})}var He=function(t){return Le(t,"wps.jssdk.api","wps.api.reply")},Ne=function(t){return Le(t,"api.basic","api.basic.reply")},z={idMap:{}};function Re(t){return M(this,void 0,void 0,function(){var o,i,u,d,m,p,k,O,h,f;return V(this,function(S){switch(S.label){case 0:return ve(t)?[2]:(o=Z.parse(t.data),i=o.eventName,u=o.callbackId,d=o.data,u&&(m=z.idMap[u])?(p=m.split(":"),k=p[0],O=p[1],i==="api.callback"&&z[k]&&z[k][O]?[4,(f=z[k][O]).callback.apply(f,d.args)]:[3,2]):[3,2]);case 1:h=S.sent(),K({result:h,callbackId:u,eventName:"api.callback.reply"}),S.label=2;case 2:return[2]}})})}var Ze=function(t){return M(void 0,void 0,void 0,function(){function o(){return Object.keys(z.idMap).find(function(S){return z.idMap[S]===u+":"+i})}var i,u,d,m,p,k,O,h,f;return V(this,function(S){switch(S.label){case 0:return i=t.prop,u=t.parentObjId,[4,W([d=t.value])];case 1:return m=S.sent(),p=m[0],k=m[1],t.value=p[0],O=Object.keys(k)[0],h=z[u],d===null&&h&&h[i]&&((f=o())&&delete z.idMap[f],delete h[i],Object.keys(h).length||delete z[u],Object.keys(z.idMap).length||Z.remove(Re)),O&&(Object.keys(z.idMap).length||Z.add(Re),z[u]||(z[u]={}),z[u][i]={callbackId:O,callback:k[O]},(f=o())&&delete z.idMap[f],z.idMap[O]=u+":"+i),[2]}})})},ye=function(t,o,i,u){return M(void 0,void 0,void 0,function(){var d,m,p,k,O,h,f,S;return V(this,function(B){switch(B.label){case 0:return d=ke(),k=new Promise(function(j,a){m=j,p=a}),O={},o.args?[4,W(o.args)]:[3,2];case 1:h=B.sent(),f=h[0],S=h[1],o.args=f,O=S,B.label=2;case 2:return t!=="api.setter"?[3,4]:[4,Ze(o)];case 3:B.sent(),B.label=4;case 4:return function(j){var a=j[0],l=j[1];typeof(a=s({},a)).data=="function"&&(a.data=a.data()),l(),K(a)}([{eventName:t,data:o,msgId:d},function(){var j=this,a=function(l){return M(j,void 0,void 0,function(){var e,E,g;return V(this,function(y){switch(y.label){case 0:return ve(l)?[2]:(e=Z.parse(l.data)).eventName==="api.callback"&&e.callbackId&&O[e.callbackId]?[4,O[e.callbackId].apply(O,e.data.args)]:[3,2];case 1:E=y.sent(),K({result:E,eventName:"api.callback.reply",callbackId:e.callbackId}),y.label=2;case 2:return e.eventName===t+".reply"&&e.msgId===d&&(e.error?((g=new Error("")).stack=e.error+`
|
|
`+i,u&&u(),p(g)):m(e.result),Z.remove(a)),[2]}})})};return Z.add(a),k}]),[2,k]}})})};function W(t){return M(this,void 0,void 0,function(){var o,i,u,d,m,p,k,O,h,f,S;return V(this,function(B){switch(B.label){case 0:o={},i=[],u=t.slice(0),B.label=1;case 1:return u.length?(d=void 0,[4,u.shift()]):[3,13];case 2:return(m=B.sent())&&m.done?[4,m.done()]:[3,4];case 3:B.sent(),B.label=4;case 4:if(!function(j){if(!j)return!1;for(var a=j;Object.getPrototypeOf(a)!==null;)a=Object.getPrototypeOf(a);return Object.getPrototypeOf(j)===a}(d))return[3,11];for(k in d={},p=[],m)p.push(k);O=0,B.label=5;case 5:return O<p.length?(h=p[O],f=m[h],/^[A-Z]/.test(h)?f&&f.done?[4,f.done()]:[3,7]:[3,8]):[3,10];case 6:B.sent(),B.label=7;case 7:f&&f.objId?f={objId:f.objId}:typeof f=="function"&&(S=ke(),o[S]=f,f={callbackId:S}),B.label=8;case 8:d[h]=f,B.label=9;case 9:return O++,[3,5];case 10:return[3,12];case 11:m&&m.objId?d={objId:m.objId}:typeof m=="function"&&m.objId===void 0?(S=ke(),o[S]=m,d={callbackId:S}):d=m,B.label=12;case 12:return i.push(d),[3,1];case 13:return[2,[i,o]]}})})}var Ue=function(t,o){o===void 0&&(o=!0);var i=s({},t),u=i.headers,d=u===void 0?{}:u,m=i.subscriptions,p=m===void 0?{}:m,k=i.mode,O=k===void 0?Pe.nomal:k,h=i.commonOptions,f=d.backBtn,S=f===void 0?{}:f,B=d.shareBtn,j=B===void 0?{}:B,a=d.otherMenuBtn,l=a===void 0?{}:a,e=function(c,n){c.subscribe&&typeof c.subscribe=="function"&&(c.callback=n,p[n]=c.subscribe,o&&delete c.subscribe)};if(e(S,"wpsconfig_back_btn"),e(j,"wpsconfig_share_btn"),e(l,"wpsconfig_other_menu_btn"),l.items&&Array.isArray(l.items)){var E=[];l.items.forEach(function(c,n){switch(c===void 0&&(c={}),c.type){case"export_img":c.type=1,c.callback="export_img";break;case"export_pdf":c.type=1,c.callback="export_pdf";break;case"save_version":c.type=1,c.callback="save_version";break;case"about_wps":c.type=1,c.callback="about_wps";break;case"split_line":c.type=2;break;case"custom":c.type=3,e(c,"wpsconfig_other_menu_btn_"+n),E.push(c)}}),E.length&&(Ge||Qe)&&(l.items=E)}i.url=i.url||i.wpsUrl;var g=[];if((O===Pe.simple||h&&h.isShowTopArea===!1)&&g.push("simple","hidecmb"),i.debug&&g.push("debugger"),i.url&&g.length&&(i.url=i.url+(i.url.indexOf("?")>=0?"&":"?")+g.join("&")),h&&(h.isParentFullscreen||h.isBrowserViewFullscreen)&&(document.addEventListener("fullscreenchange",Ee),document.addEventListener("webkitfullscreenchange",Ee),document.addEventListener("mozfullscreenchange",Ee)),i.wordOptions&&(i.wpsOptions=i.wordOptions),i.excelOptions&&(i.etOptions=i.excelOptions),i.pptOptions&&(i.wppOptions=i.pptOptions),typeof p.print=="object"){var y="wpsconfig_print";typeof p.print.subscribe=="function"&&(p[y]=p.print.subscribe,i.print={callback:y},p.print.custom!==void 0&&(i.print.custom=p.print.custom)),delete p.print}return typeof p.exportPdf=="function"&&(p[y="wpsconfig_export_pdf"]=p.exportPdf,i.exportPdf={callback:y},delete p.exportPdf),i.commandBars&&Oe(i.commandBars,!1),s(s({},i),{subscriptions:p})},ze=function(t){t===void 0&&(t="");var o="";if(!o&&t){var i=t.toLowerCase();i.indexOf("/office/s/")!==-1&&(o=Q.spreadsheet),i.indexOf("/office/w/")!==-1&&(o=Q.writer),i.indexOf("/office/p/")!==-1&&(o=Q.presentation),i.indexOf("/office/f/")!==-1&&(o=Q.pdf)}if(!o){var u=t.match(/[\?&]type=([a-z]+)/)||[];o=Se[u[1]]||""}return o};function Oe(t,o){o===void 0&&(o=!0);var i=t.map(function(u){var d=u.attributes;if(!Array.isArray(d)){var m=[];for(var p in d)if(d.hasOwnProperty(p)){var k={name:p,value:d[p]};m.push(k)}u.attributes=m}return u});return o&&K({data:i,eventName:"setCommandBars"}),i}var $e=window.navigator.userAgent.toLowerCase(),Ge=/Android|webOS|iPhone|iPod|BlackBerry|iPad/i.test($e),Qe=function(){try{return window._parent.location.search.indexOf("from=wxminiprogram")!==-1}catch(t){return!1}}();function Ee(){var t={status:le.requestFullscreen},o=document,i=o.fullscreenElement||o.webkitFullscreenElement||o.mozFullScreenElement;t.status=i?le.requestFullscreen:le.exitFullscreen,K({data:t,eventName:"fullscreenchange"})}var Ke=function(){z.idMap={}};function Je(){console.group("JSSDK \u4E8B\u4EF6\u673A\u5236\u8C03\u6574\u8BF4\u660E"),console.warn("jssdk.on\u3001jssdk.off \u548C jssdk.Application.Sub \u5C06\u5728\u540E\u7EED\u7248\u672C\u4E2D\u88AB\u5F03\u7528\uFF0C\u5EFA\u8BAE\u4F7F\u7528\u6539\u8FDB\u540E\u7684 ApiEvent"),console.warn("\u5177\u4F53\u8BF7\u53C2\u8003\uFF1Ahttps://wwo.wps.cn/docs/front-end/basic-usage/events/intro/"),console.groupEnd()}var me=0,Fe=new Set;function pe(t){return me+=1,!t&&function(o){Fe.forEach(function(i){return i(o)})}(me),me}function he(){var t=new Error("");return(t.stack||t.message||"").split(`
|
|
`).slice(2).join(`
|
|
`)}function Ye(t,o){var i,u=this,d=o.Events,m=o.Enum,p=o.Props,k=p[0],O=p[1],h={objId:me};switch(function j(a,l,e){for(var E=l.slice(0),g=function(){var y=E.shift();!y.alias&&~Ae.indexOf(y.prop)&&E.push(s(s({},y),{alias:y.prop+"Async"})),Object.defineProperty(a,y.alias||y.prop,{get:function(){var c=this,n=y.cache===1,r=n&&this["__"+y.prop+"CacheValue"];if(!r){var v=he(),A=pe(n),I=function(){for(var C,T=[],N=0;N<arguments.length;N++)T[N]=arguments[N];return y.caller!==void 0?function w(b,_,P){for(var F=_.slice(0),R=function(){var D=F.shift();!D.alias&&~Ae.indexOf(D.prop)&&F.push(s(s({},D),{alias:D.prop+"Async"})),Object.defineProperty(b,D.alias||D.prop,{get:function(){var U=this,se=D.cache===1,je=se&&this["__"+D.prop+"CacheValue"];if(!je){var ue=he(),re=pe(se),ae=function(){for(var fe,x=[],H=0;H<arguments.length;H++)x[H]=arguments[H];return D.caller!==void 0?w(fe={objId:pe()},P[D.caller],P):fe={},oe(ae,fe,"api.caller",{obj:ae,args:x,parentObjId:b.objId,objId:fe.objId,prop:D.prop},ue),fe};return ae.objId=-1,D.getter!==void 0&&(ae.objId=re,w(ae,P[D.getter],P)),oe(b,ae,"api.getter",{parentObjId:b.objId,objId:ae.objId,prop:D.prop},ue,function(){delete U["__"+D.prop+"CacheValue"]}),se&&(this["__"+D.prop+"CacheValue"]=ae),ae}return je},set:function(U){var se=he();return oe(b,{},"api.setter",{value:U,parentObjId:b.objId,objId:-1,prop:D.prop},se)}})};F.length;)R()}(C={objId:pe()},e[y.caller],e):C={},oe(I,C,"api.caller",{obj:I,args:T,parentObjId:a.objId,objId:C.objId,prop:y.prop},v),C};return I.objId=-1,y.getter!==void 0&&(I.objId=A,j(I,e[y.getter],e)),oe(a,I,"api.getter",{parentObjId:a.objId,objId:I.objId,prop:y.prop},v,function(){delete c["__"+y.prop+"CacheValue"]}),n&&(this["__"+y.prop+"CacheValue"]=I),I}return r},set:function(c){var n=he();return oe(a,{},"api.setter",{value:c,parentObjId:a.objId,objId:-1,prop:y.prop},n)}})};E.length;)g()}(h,k,O),h.Events=d,h.Enum=m,t.Enum=h.Enum,t.Events=h.Events,t.Props=p,ze(t.url)){case Q.writer:t.WordApplication=t.WpsApplication=function(){return h};break;case Q.spreadsheet:t.ExcelApplication=t.EtApplication=function(){return h};break;case Q.presentation:t.PPTApplication=t.WppApplication=function(){return h};break;case Q.pdf:t.PDFApplication=function(){return h}}t.Application=h,t.Free=function(j){return ye("api.free",{objId:j},"")},t.Stack=h.Stack=(i=function(j){t&&t.Free(j)},function(){var j=[],a=function(l){j.push(l)};return Fe.add(a),{End:function(){i(j),Fe.delete(a)}}});var f={};Z.add(function(j){return M(u,void 0,void 0,function(){var a,l,e,E,g;return V(this,function(y){switch(y.label){case 0:return ve(j)?[2]:(a=Z.parse(j.data)).eventName==="api.event"&&a.data?(l=a.data,e=l.eventName,E=l.data,(g=f[e])?[4,g(E)]:[3,2]):[3,2];case 1:y.sent(),y.label=2;case 2:return[2]}})})}),h.Sub={};var S=function(j){var a=d[j];Object.defineProperty(h.Sub,a,{set:function(l){Je(),f[a]=l,K({eventName:"api.event.register",data:{eventName:a,register:!!l,objId:me+=1}})}})};for(var B in d)S(B)}var Ae=["ExportAsFixedFormat","GetOperatorsInfo","ImportDataIntoFields","ReplaceText","ReplaceBookmark","GetBookmarkText","GetComments"];function De(t,o,i){for(var u=o.slice(0),d=function(){var m=u.shift();!m.alias&&~Ae.indexOf(m.prop)&&u.push(s(s({},m),{alias:m.prop+"Async"})),Object.defineProperty(t,m.alias||m.prop,{get:function(){var p=this,k=m.cache===1,O=k&&this["__"+m.prop+"CacheValue"];if(!O){var h=he(),f=pe(k),S=function(){for(var j=[],a=0,l;a<arguments.length;a++)j[a]=arguments[a];return m.caller!==void 0?(l={objId:pe()},De(l,i[m.caller],i)):l={},oe(B,l,"api.caller",{obj:B,args:j,parentObjId:t.objId,objId:l.objId,prop:m.prop},h),l},B=S;return B.objId=-1,m.getter!==void 0&&(B.objId=f,De(B,i[m.getter],i)),oe(t,B,"api.getter",{parentObjId:t.objId,objId:B.objId,prop:m.prop},h,function(){delete p["__"+m.prop+"CacheValue"]}),k&&(this["__"+m.prop+"CacheValue"]=B),B}return O},set:function(p){var k=he();return oe(t,{},"api.setter",{value:p,parentObjId:t.objId,objId:-1,prop:m.prop},k)}})};u.length;)d()}function oe(t,o,i,u,d,m){var p,k=(t.done?t.done():Promise.resolve()).then(function(){return p||(p=ye(i,u,d,m)),p});o.done=function(){return k},o.then=function(O,h){return u.objId>=0?(o.then=null,o.catch=null,k.then(function(){O(o)}).catch(function(f){return h(f)})):k.then(O,h)},o.catch=function(O){return k.catch(O)},o.Destroy=function(){return ye("api.free",{objId:o.objId},"")}}var Y={},q=null,de={fileOpen:"fileOpen",tabSwitch:"tabSwitch",fileSaved:"fileSaved",fileStatus:"fileStatus",fullscreenChange:"fullscreenChange",error:"error",stage:"stage"},ne={getToken:"api.getToken",onToast:"event.toast",onHyperLinkOpen:"event.hyperLinkOpen",getClipboardData:"api.getClipboardData"};function Me(t,o,i,u,d,m,p){var k=this;i===void 0&&(i={}),Z.add(function(O){return M(k,void 0,void 0,function(){var h,f,S,B,j,a,l,e,E,g,y,c,n,r,v,A,I,C,T;return V(this,function(N){switch(N.label){case 0:return ve(O)?[2]:(h=Z.parse(O.data),f=h.eventName,S=f===void 0?"":f,B=h.data,j=B===void 0?null:B,a=h.url,l=a===void 0?null:a,["wps.jssdk.api"].indexOf(S)!==-1?[2]:S!=="ready"?[3,1]:(d.apiReadySended&&function(w){var b=[];Object.keys(Y).forEach(function(_){Y[_].forEach(function(P){var F=_;w.off(F,P),b.push({handle:P,eventName:F})}),delete Y[_]}),b.forEach(function(_){var P=_.eventName,F=_.handle;q==null||q.ApiEvent.AddApiEventListener(P,F)})}(o),K({eventName:"setConfig",data:s(s({},i),{version:t.version})}),t.tokenData&&t.setToken(s(s({},t.tokenData),{hasRefreshTokenConfig:!!i.refreshToken})),t.iframeReady=!0,[3,15]));case 1:return S!=="error"?[3,2]:(o.emit(de.error,j),[3,15]);case 2:return S!=="open.result"?[3,3]:(((I=j==null?void 0:j.fileInfo)===null||I===void 0?void 0:I.officeVersion)!==void 0&&(t.mainVersion=j.fileInfo.officeVersion,console.log("aliyun Main Version: V"+t.mainVersion)),o.emit(de.fileOpen,j),[3,15]);case 3:return S!=="api.scroll"?[3,4]:(window.scrollTo(j.x,j.y),[3,15]);case 4:if(S!==ne.getToken)return[3,9];e={token:!1},N.label=5;case 5:return N.trys.push([5,7,,8]),[4,d.refreshToken()];case 6:return e=N.sent(),[3,8];case 7:return E=N.sent(),console.error("refreshToken: "+(E||"fail to get")),[3,8];case 8:return K({eventName:ne.getToken+".reply",data:e}),[3,15];case 9:if(S!==ne.getClipboardData)return[3,14];g={text:"",html:""},N.label=10;case 10:return N.trys.push([10,12,,13]),[4,d.getClipboardData()];case 11:return g=N.sent(),[3,13];case 12:return y=N.sent(),console.error("getClipboardData: "+(y||"fail to get")),[3,13];case 13:return K({eventName:ne.getClipboardData+".reply",data:g}),[3,15];case 14:S===ne.onToast?d.onToast(j):S===ne.onHyperLinkOpen?d.onHyperLinkOpen(j):S==="stage"?o.emit(de.stage,j):S==="event.callback"?(c=j.eventName,n=j.data,r=c,c==="fullScreenChange"&&(r=de.fullscreenChange),c==="file.saved"&&(r=de.fileStatus),(!((C=i.commonOptions)===null||C===void 0)&&C.isBrowserViewFullscreen||!((T=i.commonOptions)===null||T===void 0)&&T.isParentFullscreen)&&r==="fullscreenchange"&&(v=n.status,A=n.isDispatchEvent,i.commonOptions.isBrowserViewFullscreen?function(w,b,_,P){w===0?b.style="position: static; width: "+_.width+"; height: "+_.height:w===1&&(b.style="position: absolute; width: 100%; height: 100%"),P&&function(F){["fullscreen","fullscreenElement"].forEach(function(D){Object.defineProperty(document,D,{get:function(){return!!F.status},configurable:!0})});var R=new CustomEvent("fullscreenchange");document.dispatchEvent(R)}({status:w})}(v,m,p,A):i.commonOptions.isParentFullscreen&&function(w,b,_){var P=document.querySelector(_),F=P&&P.nodeType===1?P:b;if(w===0){var R=document,D=R.exitFullscreen||R.mozCancelFullScreen||R.msExitFullscreen||R.webkitCancelFullScreen||R.webkitExitFullscreen;D.call(document)}else if(w===1){var U=F.requestFullscreen||F.mozRequestFullScreen||F.msRequestFullscreen||F.webkitRequestFullscreen;U.call(F)}}(v,m,i.commonOptions.isParentFullscreen)),o.emit(r,n)):S==="api.ready"&&Ye(t,j),N.label=15;case 15:return typeof u[S]=="function"&&u[S](t,l||j),[2]}})})})}function Ce(t){return new Promise(function(o){var i=function(u){ve(u)||Z.parse(u.data).eventName===t&&(o(),Z.remove(i))};Z.add(i)})}function Ve(t){var o,i=this;t===void 0&&(t={}),q&&q.destroy();try{var u=Ue(t),d=u.subscriptions,m=d===void 0?{}:d,p=u.mount,k=p===void 0?null:p,O=u.url,h=u.refreshToken,f=u.onToast,S=u.onHyperLinkOpen,B=u.getClipboardData;L("origin",(O.match(/https*:\/\/[^\/]+/g)||[])[0]);var j=xe(O,k),a=Ce("ready"),l=Ce("open.result"),e=Ce("api.ready"),E=k?{width:k.clientWidth+"px",height:k.clientHeight+"px"}:{width:"100vw",height:"100vh"};delete u.mount,O&&delete u.url,delete u.subscriptions;var g=(o=o||Object.create(null),{on:function(n,r){(o[n]||(o[n]=[])).push(r)},off:function(n,r){o[n]&&o[n].splice(o[n].indexOf(r)>>>0,1)},emit:function(n,r){(o[n]||[]).slice().map(function(v){v(r)}),(o["*"]||[]).slice().map(function(v){v(n,r)})}}),y={apiReadySended:!1},c=function(n,r,v){return M(i,void 0,void 0,function(){return V(this,function(A){switch(A.label){case 0:return function(I,C,T){if(Y[I]){var N=!!Y[I].find(function(w){return w===C});return N&&T==="off"?(g.off(I,C),Y[I]=Y[I].filter(function(w){return w!==C}),!!Y[I].length||(Y[I]=void 0,!1)):(N||T!=="on"||(Y[I].push(C),g.on(I,C)),!0)}return T==="on"?(Y[I]=[],Y[I].push(C),!1):T==="off"||void 0}(n,r,v)?[3,2]:[4,a];case 1:A.sent(),function(I,C){var T=I.eventName,N=I.type,w=I.handle;C==="on"?g.on(T,w):g.off(T,w),N==="base.event"&&K({eventName:"basic.event",data:{eventName:T,action:C}}),Je()}(function(I,C){var T=I,N="base.event";switch(T){case de.fileSaved:console.warn("fileSaved\u4E8B\u4EF6\u76D1\u542C\u5373\u5C06\u5F03\u7528\uFF0C \u63A8\u8350\u4F7F\u7528fileStatus\u8FDB\u884C\u6587\u4EF6\u72B6\u6001\u7684\u76D1\u542C"),T="fileStatus";break;case de.fullscreenChange:T="fullscreenchange";break;case"error":case"fileOpen":N="callback.event"}return{eventName:T,type:N,handle:C}}(n,r),v),A.label=2;case 2:return[2]}})})};return q={url:O,iframe:j,version:"1.1.19",iframeReady:!1,tokenData:null,commandBars:null,tabs:{getTabs:function(){return M(this,void 0,void 0,function(){return V(this,function(n){switch(n.label){case 0:return[4,a];case 1:return n.sent(),[2,Ne({api:"tab.getTabs"})]}})})},switchTab:function(n){return M(this,void 0,void 0,function(){return V(this,function(r){switch(r.label){case 0:return[4,a];case 1:return r.sent(),[2,Ne({api:"tab.switchTab",args:{tabKey:n}})]}})})}},setCooperUserColor:function(n){return M(this,void 0,void 0,function(){return V(this,function(r){switch(r.label){case 0:return[4,a];case 1:return r.sent(),[2,Ne({api:"setCooperUserColor",args:n})]}})})},setToken:function(n){return M(this,void 0,void 0,function(){return V(this,function(r){switch(r.label){case 0:return[4,a];case 1:return r.sent(),q.tokenData=n,K({eventName:"setToken",data:n}),[2]}})})},ready:function(){return M(this,void 0,void 0,function(){return V(this,function(n){switch(n.label){case 0:return y.apiReadySended?[3,2]:[4,l];case 1:n.sent(),y.apiReadySended=!0,K({eventName:"api.ready"}),n.label=2;case 2:return[4,e];case 3:return n.sent(),[2,new Promise(function(r){return setTimeout(function(){return r(q==null?void 0:q.Application)},0)})]}})})},destroy:function(){Y={},j.destroy(),Z.empty(),q=null,Fe=new Set,me=0,document.removeEventListener("fullscreenchange",Ee),Ke()},save:function(){return M(this,void 0,void 0,function(){return V(this,function(n){switch(n.label){case 0:return[4,a];case 1:return n.sent(),[2,He({api:"save"})]}})})},setCommandBars:function(n){return M(this,void 0,void 0,function(){return V(this,function(r){switch(r.label){case 0:return[4,a];case 1:return r.sent(),Oe(n),[2]}})})},updateConfig:function(n){return n===void 0&&(n={}),M(this,void 0,void 0,function(){return V(this,function(r){switch(r.label){case 0:return[4,a];case 1:return r.sent(),n.commandBars?(console.warn("Deprecated: `updateConfig()` \u65B9\u6CD5\u5373\u5C06\u5E9F\u5F03\uFF0C\u8BF7\u4F7F\u7528`setCommandBars()`\u4EE3\u66FF`updateConfig()`\u66F4\u65B0`commandBars`\u914D\u7F6E\u3002"),[4,Oe(n.commandBars)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}})})},executeCommandBar:function(n){return M(this,void 0,void 0,function(){return V(this,function(r){switch(r.label){case 0:return[4,a];case 1:return r.sent(),Oe([{cmbId:n,attributes:[{name:"click",value:!0}]}]),[2]}})})},on:function(n,r){return M(this,void 0,void 0,function(){return V(this,function(v){return[2,this.ApiEvent.AddApiEventListener(n,r)]})})},off:function(n,r){return M(this,void 0,void 0,function(){return V(this,function(v){return[2,this.ApiEvent.RemoveApiEventListener(n,r)]})})},ApiEvent:{AddApiEventListener:function(n,r){return M(this,void 0,void 0,function(){return V(this,function(v){switch(v.label){case 0:return[4,c(n,r,"on")];case 1:return[2,v.sent()]}})})},RemoveApiEventListener:function(n,r){return M(this,void 0,void 0,function(){return V(this,function(v){switch(v.label){case 0:return[4,c(n,r,"off")];case 1:return[2,v.sent()]}})})}}},function(n,r,v,A,I,C){r&&_e(r)&&(I.refreshToken=r,n.refreshToken={eventName:ne.getToken}),C&&_e(C)&&(I.getClipboardData=C,n.getClipboardData={eventName:ne.getClipboardData}),v&&_e(v)&&(I.onToast=v,n.onToast={eventName:ne.onToast}),A&&_e(A)&&(I.onHyperLinkOpen=A,n.onHyperLinkOpen={eventName:ne.onHyperLinkOpen})}(u,h,f,S,y,B),Me(q,g,u,m,y,j,E),q}catch(n){console.error(n)}}console.log("aliyun JS-SDK V1.1.19");var Xe=Object.freeze({__proto__:null,listener:Me,config:Ve});window.WPS=Xe;var We=Ve,J={config:We};$.config=We,$.default=J,Object.defineProperty($,"__esModule",{value:!0})})},74131:function(tt,Be,$){"use strict";$.r(Be),$.d(Be,{default:function(){return j}});var s=$(59301),M=$(53660),V=$.n(M),Z=$(89070),_e={box:"box___JDRma",question_buuton:"question_buuton___tVuIm",selectQuestion:"selectQuestion___xdvxF",addQuestion:"addQuestion___FQqbC",submit_button:"submit_button___NUmmN"},Q=$(8591),Se=$(71418),Pe=$(24905),le=$(3113),Ie=$(89392),L={modalContent:"modalContent___hC3en",modalContentLeft:"modalContentLeft___v0x0I",green:"green___pAmUz",textArea:"textArea___ucgCJ",red:"red___eb0mt",row:"row___td54s",html:"html___F0iOy",line:"line___I6TCQ",submit_button:"submit_button___JCIit",Drawrap:"Drawrap___EoEUV",iframe:"iframe___SOG0q",c:"c___b2vnF",cpp:"cpp___P7I43",java:"java___WVWs5",python:"python___jYtaY"},X=$(85149),ve=Object.defineProperty,Te=Object.defineProperties,te=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,ke=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,K=(a,l,e)=>l in a?ve(a,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[l]=e,Le=(a,l)=>{for(var e in l||(l={}))ke.call(l,e)&&K(a,e,l[e]);if(ie)for(var e of ie(l))xe.call(l,e)&&K(a,e,l[e]);return a},He=(a,l)=>Te(a,te(l)),Ne=(a,l,e)=>new Promise((E,g)=>{var y=r=>{try{n(e.next(r))}catch(v){g(v)}},c=r=>{try{n(e.throw(r))}catch(v){g(v)}},n=r=>r.done?E(r.value):Promise.resolve(r.value).then(y,c);n((e=e.apply(a,l)).next())});const z=({problemset:a,dispatch:l,question:e,solutionVis:E,pageCache:g,disabled:y,onSubmit:c})=>{const[n,r]=(0,s.useState)({}),[v,A]=(0,s.useState)([]),I=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,s.useEffect)(()=>{const w=(0,Ie.cloneDeep)(e);r(w),A(w.choices)},[e]);const C=()=>Ne(void 0,null,function*(){var w;if(!v.some(P=>P==null?void 0:P.checked)){Q.ZP.warning("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4");return}const b=(w=v==null?void 0:v.filter(P=>P==null?void 0:P.checked))==null?void 0:w.map(P=>P==null?void 0:P.choice_id),_=yield c(e==null?void 0:e.smart_plan_item_bank_id,b)}),T=(w,b)=>{console.log(w.target.checked);const _=v.map((P,F)=>He(Le({},P),{checked:F===b?w.target.checked:P.checked}));A(_)},N=(w=!1)=>{let b="";return v.forEach((_,P)=>{w?_!=null&&_.me_answered&&(b=b+I[P]):_!=null&&_.is_answer&&(b=b+I[P])}),b};return s.createElement("div",null,s.createElement("div",{className:"c-light-primary mb5 font16"},"\u591A\u9009\u9898"),s.createElement(X.Z,{value:n==null?void 0:n.name}),v==null?void 0:v.map((w,b)=>{const{is_answer:_,checked:P,choice_text:F,me_answered:R}=w;let D="";return E&&_&&(D=L.green),E&&!_&&(P||R)&&(D=L.red),s.createElement("div",{key:b,style:{pointerEvents:E?"none":"auto"},className:`${L.row} ${D}`},s.createElement(Pe.default,{disabled:(e==null?void 0:e.status)=="ended"||(e==null?void 0:e.is_answered)||(g==null?void 0:g.is_end),style:{padding:3},onChange:U=>T(U,b),checked:P||(w==null?void 0:w.me_answered)}),s.createElement("span",null,I[b],".\xA0"),s.createElement(X.Z,{className:L.html,value:F}),E&&_&&s.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),E&&!_&&(P||R)&&s.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),E&&s.createElement(s.Fragment,null,s.createElement("div",{className:L.line}),s.createElement("div",{className:"c-grey-333 mb5"},s.createElement("b",null,"\u6211\u7684\u7B54\u6848:\xA0"),N(!0)||"--"),s.createElement("div",{className:"c-grey-333 mb5"},s.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),N()),s.createElement("div",{className:"c-grey-333 mb10"},s.createElement("b",null,"\u89E3\u6790:\xA0"),(n==null?void 0:n.analysis)||"\u6682\u65E0\u89E3\u6790")),(e==null?void 0:e.status)!="ended"&&!(e!=null&&e.is_answered)&&!(g!=null&&g.is_end)&&s.createElement("div",{className:"flex justify-center"},s.createElement(le.ZP,{className:L.submit_button,type:"primary",onClick:()=>{C()}},"\u63D0\u4EA4")))};var Re=(0,Z.connect)(({problemset:a})=>({problemset:a}))(z),Ze=$(5112),ye=$(95237),W=$(59301),Ue=Object.defineProperty,ze=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,$e=Object.getOwnPropertySymbols,Ge=Object.prototype.hasOwnProperty,Qe=Object.prototype.propertyIsEnumerable,Ee=(a,l,e)=>l in a?Ue(a,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[l]=e,Ke=(a,l)=>{for(var e in l||(l={}))Ge.call(l,e)&&Ee(a,e,l[e]);if($e)for(var e of $e(l))Qe.call(l,e)&&Ee(a,e,l[e]);return a},Je=(a,l)=>ze(a,Oe(l)),me=(a,l,e)=>new Promise((E,g)=>{var y=r=>{try{n(e.next(r))}catch(v){g(v)}},c=r=>{try{n(e.throw(r))}catch(v){g(v)}},n=r=>r.done?E(r.value):Promise.resolve(r.value).then(y,c);n((e=e.apply(a,l)).next())});const Fe=({problemset:a,dispatch:l,question:e,pageCache:E,solutionVis:g,disabled:y,onSubmit:c})=>{const[n,r]=(0,s.useState)({}),[v,A]=(0,s.useState)([]),[I]=(0,Z.useSearchParams)(),C=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,s.useEffect)(()=>{const w=(0,Ie.cloneDeep)(e);r(w),A(w.choices)},[e]);const T=()=>me(void 0,null,function*(){var w;if(!v.some(_=>_==null?void 0:_.checked)){Q.ZP.warning("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4");return}const b=yield c(e==null?void 0:e.smart_plan_item_bank_id,(w=v.find(_=>_.checked))==null?void 0:w.choice_id)}),N=(w,b)=>{const _=v.map((P,F)=>Je(Ke({},P),{checked:F===b?w.target.checked:!1}));A(_)};return W.createElement("div",null,W.createElement("div",{className:"c-light-primary mb5 font16"},"\u5355\u9009\u9898"),W.createElement(X.Z,{value:n==null?void 0:n.name}),v==null?void 0:v.map((w,b)=>{const{is_answer:_,checked:P,choice_text:F,me_answered:R}=w;let D="";return g&&_&&(D=L.green),g&&!_&&(P||R)&&(D=L.red),W.createElement("div",{key:b,style:{pointerEvents:g?"none":"auto"},className:`${L.row} ${D}`},W.createElement(Ze.ZP,{disabled:(e==null?void 0:e.status)=="ended"||(e==null?void 0:e.is_answered)||(E==null?void 0:E.is_end),onChange:U=>N(U,b),checked:P||(w==null?void 0:w.me_answered)}),W.createElement("span",null,C[b],".\xA0"),W.createElement(X.Z,{className:L.html,value:F}),g&&_&&W.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),g&&!_&&(P||R)&&W.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),g&&W.createElement(s.Fragment,null,W.createElement("div",{className:L.line}),W.createElement("div",{className:"c-grey-333 mb5"},W.createElement("b",null,"\u6211\u7684\u7B54\u6848:\xA0"),C[v.findIndex(w=>w==null?void 0:w.me_answered)]||"--"),W.createElement("div",{className:"c-grey-333 mb5"},W.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),C[v.findIndex(w=>w==null?void 0:w.is_answer)]),W.createElement(ye.Z,{className:"c-grey-333 mb10"},W.createElement("b",null,"\u89E3\u6790:\xA0"),W.createElement(X.Z,{className:`${L.html} font14`,value:(n==null?void 0:n.analysis)||"\u6682\u65E0\u89E3\u6790"}))),(e==null?void 0:e.status)!="ended"&&!(e!=null&&e.is_answered)&&!(E!=null&&E.is_end)&&W.createElement("div",{className:"flex justify-center"},W.createElement(le.ZP,{className:L.submit_button,type:"primary",onClick:()=>{T()}},"\u63D0\u4EA4")))};var pe=(0,Z.connect)(({problemset:a})=>({problemset:a}))(Fe),he=Object.defineProperty,Ye=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,oe=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,q=(a,l,e)=>l in a?he(a,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[l]=e,de=(a,l)=>{for(var e in l||(l={}))oe.call(l,e)&&q(a,e,l[e]);if(De)for(var e of De(l))Y.call(l,e)&&q(a,e,l[e]);return a},ne=(a,l)=>Ye(a,Ae(l)),Me=(a,l,e)=>new Promise((E,g)=>{var y=r=>{try{n(e.next(r))}catch(v){g(v)}},c=r=>{try{n(e.throw(r))}catch(v){g(v)}},n=r=>r.done?E(r.value):Promise.resolve(r.value).then(y,c);n((e=e.apply(a,l)).next())});const Ce=({problemset:a,dispatch:l,question:e,solutionVis:E,pageCache:g,disabled:y,onSubmit:c})=>{var n,r;const[v,A]=(0,s.useState)({}),[I,C]=(0,s.useState)([]),T=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];(0,s.useEffect)(()=>{const b=(0,Ie.cloneDeep)(e);A(b),C(b.choices)},[e]);const N=()=>Me(void 0,null,function*(){var b;if(!I.some(P=>P==null?void 0:P.checked)){Q.ZP.warning("\u8BF7\u60A8\u4F5C\u7B54\u540E\u518D\u63D0\u4EA4");return}const _=yield c(e==null?void 0:e.smart_plan_item_bank_id,(b=I.find(P=>P.checked))==null?void 0:b.choice_id)}),w=(b,_)=>{console.log(b.target.checked);const P=I.map((F,R)=>ne(de({},F),{checked:R===_?b.target.checked:!1}));C(P)};return s.createElement("div",null,s.createElement("div",{className:"c-light-primary mb5 font16"},"\u5224\u65AD\u9898"),s.createElement(X.Z,{value:v==null?void 0:v.name}),I==null?void 0:I.map((b,_)=>{const{is_answer:P,checked:F,choice_text:R,me_answered:D}=b;let U="";return E&&P&&(U=L.green),E&&!P&&(F||D)&&(U=L.red),s.createElement("div",{key:_,style:{pointerEvents:E?"none":"auto"},className:`${L.row} ${U}`},s.createElement(Ze.ZP,{disabled:(e==null?void 0:e.status)=="ended"||(e==null?void 0:e.is_answered)||(g==null?void 0:g.is_end),onChange:se=>w(se,_),checked:F||(b==null?void 0:b.me_answered)}),s.createElement(X.Z,{className:L.html,value:R}),E&&P&&s.createElement("span",{style:{paddingTop:4},className:"iconfont icon-duigou1 font16"}),E&&!P&&(F||D)&&s.createElement("span",{style:{fontWeight:600,paddingTop:5},className:"iconfont icon-guanbi font16"}))}),E&&s.createElement(s.Fragment,null,s.createElement("div",{className:L.line}),s.createElement("div",{className:"c-grey-333 mb5"},s.createElement("b",null,"\u6211\u7684\u7B54\u6848:\xA0"),((n=I.find(b=>b==null?void 0:b.me_answered))==null?void 0:n.choice_text)||"--"),s.createElement("div",{className:"c-grey-333 mb5"},s.createElement("b",null,"\u6B63\u786E\u7B54\u6848:\xA0"),(r=I.find(b=>b==null?void 0:b.is_answer))==null?void 0:r.choice_text),s.createElement("div",{className:"c-grey-333 mb10"},s.createElement("b",null,"\u89E3\u6790:\xA0"),(v==null?void 0:v.analysis)||"\u6682\u65E0\u89E3\u6790")),(e==null?void 0:e.status)!="ended"&&!(e!=null&&e.is_answered)&&!(g!=null&&g.is_end)&&s.createElement("div",{className:"flex justify-center"},s.createElement(le.ZP,{className:L.submit_button,type:"primary",onClick:()=>{N()}},"\u63D0\u4EA4")))};var Ve=(0,Z.connect)(({problemset:a})=>({problemset:a}))(Ce),Xe=$(43428),We=$(94941),J=$(59301),t=(a,l,e)=>new Promise((E,g)=>{var y=r=>{try{n(e.next(r))}catch(v){g(v)}},c=r=>{try{n(e.throw(r))}catch(v){g(v)}},n=r=>r.done?E(r.value):Promise.resolve(r.value).then(y,c);n((e=e.apply(a,l)).next())});const o=({problemset:a,dispatch:l,question:e,pageCache:E,solutionVis:g,disabled:y,onSubmit:c})=>{var n;const[r,v]=(0,s.useState)(!1),[A,I]=(0,s.useState)(""),C=(0,Z.useParams)(),[T,N]=(0,s.useState)(!1),w=(0,s.useRef)(null),[b]=(0,Z.useSearchParams)();(0,s.useEffect)(()=>{if(r){const F=document.getElementById("iframeSmartPlan");if(F){const R={type:"showIntelligentTeacherStatus",aiStatus:e==null?void 0:e.enable_ai_tutor,questionStatus:(e==null?void 0:e.status)==="ended",pptStatus:E==null?void 0:E.is_end};F.contentWindow.postMessage(R,"*")}}},[e,E]),(0,s.useEffect)(()=>{const F=sessionStorage.getItem("iframeVisible"),R=sessionStorage.getItem("iframeUrl");F==="true"&&R&&(v(!0),I(R));const D=U=>{U.state&&U.state.isIframePage?v(!0):v(!1)};return window.addEventListener("popstate",D),()=>{window.removeEventListener("popstate",D)}},[]);const _=()=>t(void 0,null,function*(){if(N(!0),e!=null&&e.hack_identifier){const F=yield(0,We.nF)({id:e==null?void 0:e.hack_identifier});(F==null?void 0:F.status)===0&&(I(`/myproblems/${F==null?void 0:F.identifier}?type=smartPlan&exercisesId=${b.get("id")}&coursesId=${b.get("course_id")}&questionId=${e==null?void 0:e.id}&smartPlanItemBankId=${e==null?void 0:e.smart_plan_item_bank_id}&isMiniprogram=true`),sessionStorage.setItem("iframeVisible","true"),sessionStorage.setItem("iframeUrl",`/myproblems/${F==null?void 0:F.identifier}?type=smartPlan&exercisesId=${b.get("id")}&coursesId=${b.get("course_id")}&questionId=${e==null?void 0:e.id}&smartPlanItemBankId=${e==null?void 0:e.smart_plan_item_bank_id}&isMiniprogram=true`),history.pushState({isIframePage:!0},"",window.location.href))}N(!1)}),P={C:J.createElement("span",{className:L.c},"C"),"C++":J.createElement("span",{className:L.cpp},"C++"),Java:J.createElement("span",{className:L.java},"Java"),Python:J.createElement("span",{className:L.python},"Python")};return J.createElement("div",null,J.createElement("div",{className:"c-light-primary mb10 font16"},"\u7F16\u7A0B\u9898"),J.createElement("div",{style:{color:"#333",fontSize:"16px",marginBottom:"5px"}},J.createElement("span",{className:"mr10"},"\u7F16\u7A0B\u8BED\u8A00"),(n=e==null?void 0:e.languages)==null?void 0:n.map((F,R,D)=>J.createElement(s.Fragment,{key:R},P[F==null?void 0:F.language]))),J.createElement(X.Z,{value:e==null?void 0:e.name,className:"mt20 mb20"}),J.createElement(X.Z,{value:e==null?void 0:e.description}),g&&J.createElement("div",null,J.createElement("div",{className:L.line}),J.createElement(ye.Z,{className:"c-grey-333 mb5",align:"middle"},J.createElement("b",null,"\u53C2\u8003\u7B54\u6848:\xA0"),J.createElement(X.Z,{className:`${L.html} font14`,value:(e==null?void 0:e.answer_text)||"\u6682\u65E0\u89E3\u6790"})),J.createElement(ye.Z,{className:"c-grey-333 mb10",align:"middle"},J.createElement("b",null,"\u89E3\u6790:\xA0"),J.createElement(X.Z,{className:`${L.html} font14`,value:(e==null?void 0:e.analysis)||"\u6682\u65E0\u89E3\u6790"}))),J.createElement("div",{className:"flex justify-center mt20"},J.createElement(le.ZP,{loading:T,className:L.submit_button,type:"primary",onClick:()=>t(void 0,null,function*(){yield _(),v(!0)})},(e==null?void 0:e.status)!="ended"&&!(E!=null&&E.is_end)?"\u8FDB\u5165\u7B54\u9898":"\u67E5\u770B\u7B54\u9898")),J.createElement(Xe.Z,{title:"",placement:"bottom",rootClassName:L.Drawrap,width:"100vw",height:"100vh",closable:!1,onClose:()=>{v(!1)},maskClosable:!1,open:r},J.createElement(Se.Z,{spinning:T},J.createElement("div",{style:{width:"100%",height:"100%",minHeight:"100vh"}},r&&J.createElement("iframe",{ref:w,id:"iframeSmartPlan",style:{width:"100vw",height:"100vh",minWidth:"1200px"},src:A,frameBorder:"0"})))))};var i=(0,Z.connect)(({problemset:a})=>({problemset:a}))(o),u=$(99064),d=$(82020),m=$(59301),p=(a,l,e)=>new Promise((E,g)=>{var y=r=>{try{n(e.next(r))}catch(v){g(v)}},c=r=>{try{n(e.throw(r))}catch(v){g(v)}},n=r=>r.done?E(r.value):Promise.resolve(r.value).then(y,c);n((e=e.apply(a,l)).next())});const k=({user:a,officeToken:l,globalSetting:e,loading:E,problemset:g,dispatch:y,pageCache:c,pageNum:n,aiImg:r})=>{var v,A,I,C,T;const[N,w]=(0,s.useState)([]),[b]=(0,Z.useSearchParams)(),[_,P]=(0,s.useState)(0),[F,R]=(0,s.useState)(!1),[D,U]=(0,s.useState)(!(c!=null&&c.allow_answer&&!(c!=null&&c.is_end)&&(l==null?void 0:l.Status)!=="ended")),[se,je]=(0,s.useState)(!1),[ue,re]=(0,s.useState)(!1),[ae,fe]=(0,s.useState)({});(0,s.useEffect)(()=>{U(!(c!=null&&c.allow_answer&&!(c!=null&&c.is_end)&&(l==null?void 0:l.Status)!=="ended"))},[c==null?void 0:c.allow_answer,!(c!=null&&c.is_end),(l==null?void 0:l.Status)!=="ended"]),(0,s.useEffect)(()=>{(n||c!=null&&c.page)&&x()},[n,c==null?void 0:c.page,c==null?void 0:c.allow_answer,c==null?void 0:c.has_item_bank,c==null?void 0:c.randomData,,c==null?void 0:c.enable_extra]);const x=()=>p(void 0,null,function*(){var ee,we,be,ge,qe,et;R(!0);let ce=yield(0,u.ZP)(`/api/courses/${b.get("course_id")}/smart_plans/${b.get("id")}/item_banks.json`,{method:"get",params:{position:n||(c==null?void 0:c.page)}});(ce==null?void 0:ce.status)==0&&(fe(ce==null?void 0:ce.data),w((ee=ce==null?void 0:ce.data)==null?void 0:ee.item_banks),P(0),je((ge=(be=(we=ce==null?void 0:ce.data)==null?void 0:we.item_banks)==null?void 0:be[0])==null?void 0:ge.enable_ai_tutor),H((et=(qe=ce==null?void 0:ce.data)==null?void 0:qe.item_banks)==null?void 0:et[0])),R(!1)}),H=ee=>{if(c!=null&&c.is_end){re(!0);return}switch(ee==null?void 0:ee.solution_visibility){case"hidden":re(!1);break;case"show_after_edit":ee!=null&&ee.is_answered?re(!0):re(!1);break;case"show_after_submission":(ee==null?void 0:ee.status)==="ended"?re(!0):re(!1);break;case"show_after_ended":c!=null&&c.is_end?re(!0):re(!1);break}},G=(ee,we)=>p(void 0,null,function*(){const be=yield(0,u.ZP)(`/api/smart_plan_item_banks/${ee}/user_answers.json`,{method:"post",body:{item_choice_id:we}});return(be==null?void 0:be.status)===0?(yield x(),Q.ZP.success("\u63D0\u4EA4\u6210\u529F"),!0):!1});return m.createElement("section",null,m.createElement(Se.Z,{spinning:F},m.createElement("div",{className:_e.box},N[_]&&m.createElement("div",null,((v=N[_])==null?void 0:v.item_type)==="SINGLE"&&m.createElement(pe,{question:N[_],onSubmit:G,disabled:D,pageCache:c,solutionVis:ue}),((A=N[_])==null?void 0:A.item_type)==="MULTIPLE"&&m.createElement(Re,{question:N[_],onSubmit:G,disabled:D,pageCache:c,solutionVis:ue}),((I=N[_])==null?void 0:I.item_type)==="JUDGMENT"&&m.createElement(Ve,{question:N[_],onSubmit:G,disabled:D,pageCache:c,solutionVis:ue}),((C=N[_])==null?void 0:C.item_type)==="PROGRAM"&&m.createElement(i,{question:N[_],onSubmit:G,disabled:D,pageCache:c,solutionVis:ue})),se&&m.createElement(d.Z,{item_bank_ids:[(T=N[_])==null?void 0:T.id],isStudent:!0,aiImg:r}))))};var O=(0,Z.connect)(({user:a,classroomList:l,loading:e,globalSetting:E,problemset:g})=>({user:a,classroomList:l,globalSetting:E,loading:e.effects,problemset:g}))(k),h=$(955),f=$(43418),S=(a,l,e)=>new Promise((E,g)=>{var y=r=>{try{n(e.next(r))}catch(v){g(v)}},c=r=>{try{n(e.throw(r))}catch(v){g(v)}},n=r=>r.done?E(r.value):Promise.resolve(r.value).then(y,c);n((e=e.apply(a,l)).next())});const B=({user:a,classroomList:l,globalSetting:e,loading:E,dispatch:g})=>{const y=(0,s.useRef)(),c=(0,Z.useParams)(),[n]=(0,Z.useSearchParams)(),[r,v]=(0,s.useState)(),[A,I]=(0,s.useState)(),[C,T]=(0,s.useState)(),[N,w]=(0,s.useState)(""),[b,_]=(0,s.useState)("380rem"),P=(0,s.useRef)(A),F=(0,s.useRef)(),[R,D]=(0,s.useState)("");n.get("educoder_session")&&(0,h.d8)("_educoder_session",n.get("educoder_session"),30),(0,s.useEffect)(()=>{r!=null&&r.WebofficeURL&&re()},[r]),(0,s.useEffect)(()=>{if(je(),localStorage.userInfo)try{JSON.parse(localStorage.userInfo).real_name!=="\u6E38\u5BA2"&&(F.current=document.createElement("meta"),F.current.name="viewport",F.current.content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no",document.head.appendChild(F.current))}catch(x){}return()=>{document.head.removeChild(F.current)}},[]),(0,s.useEffect)(()=>{if(A!=null&&A.is_end&&!(r!=null&&r.IsCreator)){let x=JSON.parse(sessionStorage.getItem("endPPTIds"))||[];x&&(x!=null&&x.includes(n.get("id")))||(Q.ZP.info("\u672C\u6B21\u6388\u8BFE\u5DF2\u7ED3\u675F\uFF0C\u611F\u8C22\u60A8\u7684\u53C2\u4E0E\uFF01"),(x==null?void 0:x.length)===0?x=[n.get("id")]:x.push(n.get("id")),sessionStorage.setItem("endPPTIds",JSON.stringify(x)))}},[A==null?void 0:A.is_end,r]),(0,s.useEffect)(()=>{if(A!=null&&A.enable_extra&&!(A!=null&&A.is_end)){let x=JSON.parse(localStorage.getItem("extraPPTIds"))||[];x&&!(x!=null&&x.includes(n.get("id")))&&f.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,maskClosable:!1,keyboard:!1,closable:!1,cancelButtonProps:{style:{display:"none"}},title:"\u63D0\u793A",content:"\u606D\u559C\u4F60\u5DF2\u5B8C\u6210\u6240\u6709\u57FA\u7840\u4E60\u9898\uFF01\u8001\u5E08\u8FD8\u51C6\u5907\u4E86\u62D3\u5C55\u4E60\u9898\uFF0C\u53EF\u4EE5\u5F00\u59CB\u6311\u6218\u4E86\u54E6\uFF01",onOk:()=>S(void 0,null,function*(){(x==null?void 0:x.length)===0?x=[n.get("id")]:x.push(n.get("id")),localStorage.setItem("extraPPTIds",JSON.stringify(x))})})}},[A==null?void 0:A.enable_extra,N]),(0,s.useEffect)(()=>{(A==null?void 0:A.is_end)===!1&&(r==null?void 0:r.Status)=="in_progress"&&U()},[A==null?void 0:A.is_end,r]),(0,s.useEffect)(()=>{C&&se(C)},[C]),(0,s.useEffect)(()=>{P.current=A},[A]);const U=()=>S(void 0,null,function*(){const x=yield(0,u.ZP)(`/api/courses/${n.get("course_id")}/smart_plans/${n.get("id")}/start_class.json`,{method:"post"})});(0,s.useEffect)(()=>{var x;((x=a==null?void 0:a.userInfo)==null?void 0:x.real_name)==="\u6E38\u5BA2"&&g({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!1}})},[a==null?void 0:a.userInfo]);function se(x){return S(this,null,function*(){yield y.current.ready();const H=y.current.Application;H.ActivePresentation.SlideShowWindow.View.GotoSlide(x),yield(yield H.ActivePresentation.SlideShowSettings).Run()})}function je(){return S(this,null,function*(){var x;const H=yield(0,u.ZP)(`/api/courses/${n.get("course_id")}/smart_plans/${n.get("id")}/get_office_token.json`,{method:"get",params:{is_student:!0}}),G=((x=H==null?void 0:H.data)==null?void 0:x.FileName)||"";document.title=G,v(H==null?void 0:H.data),ue()})}function ue(){return S(this,null,function*(){var x,H;try{const G=yield(0,u.ZP)(`/api/courses/${n.get("course_id")}/smart_plans/${n.get("id")}/set_page_cache.json`,{method:"post",body:{type:1}});(x=G==null?void 0:G.data)!=null&&x.page&&T((H=G==null?void 0:G.data)==null?void 0:H.page),I(G==null?void 0:G.data)}catch(G){}setTimeout(()=>{var G;((G=P.current)==null?void 0:G.is_end)===!1&&ue()},1e3)})}function re(){return S(this,null,function*(){var x=document.getElementById("weboffice-zone");y.current=V().config({mount:x,url:r.WebofficeURL,refreshToken:ae}),y.current.setToken({token:r.AccessToken,timeout:25*60*1e3}),fe()})}function ae(){return new Promise(function(x){return S(this,null,function*(){const H=yield(0,u.ZP)(`/api/courses/${n.get("course_id")}/smart_plans/${n.get("id")}/refresh_office_token.json`,{method:"get",access_token:r==null?void 0:r.AccessToken,refresh_token:r==null?void 0:r.RefreshToken});x(H==null?void 0:H.data)})})}function fe(){return S(this,null,function*(){yield y.current.ready();const x=y.current.Application;console.log("app:",x);const ee=yield(yield(yield x.ActivePresentation).Slides).Count;console.log("count:",ee);const we=yield x.ActivePresentation.SlideShowWindow.View.Slide.SlideIndex;console.log("curryPage:",we),w(we);try{x.Sub.SlideSelectionChanged=ge=>S(this,null,function*(){console.log("\u5207\u6362\u540E\u7684\u9875\u7801\uFF1A",ge),w(ge)})}catch(ge){console.error("\u4E8B\u4EF6\u7ED1\u5B9A\u51FA\u9519:",ge)}x.Sub.SlideShowEnd=()=>S(this,null,function*(){_("380rem")});const be=yield x.ActivePresentation.ExportAsFixedFormat({FixedFormatType:x.Enum.PpFixedFormatType.ppFixedFormatTypeIMG,From:1,To:1});console.log(be),D(be),setTimeout(()=>S(this,null,function*(){yield(yield x.ActivePresentation.SlideShowSettings).Run()}),500)})}return s.createElement("div",null,s.createElement("div",{id:"weboffice-zone",style:{height:b}}),s.createElement(O,{pageCache:A,pageNum:N,officeToken:r,aiImg:R}))};var j=(0,Z.connect)(({user:a,classroomList:l,loading:e,globalSetting:E})=>({user:a,classroomList:l,globalSetting:E,loading:e.effects}))(B)}}]);
|