ocsjs/index.min.js

17 lines
179 KiB
JavaScript
Raw Permalink Normal View History

2022-05-08 12:56:22 +00:00
/*!
* ocsjs 3.7.3 ( https://github.com/enncy/online-course-script#readme )
* ocs - online course script 在线网络课程辅助工具
* 版权所有 enncy
* 开源协议 MIT
*/
var F1=Object.defineProperty,C1=Object.defineProperties;var B1=Object.getOwnPropertyDescriptors;var sr=Object.getOwnPropertySymbols;var _s=Object.prototype.hasOwnProperty,Ss=Object.prototype.propertyIsEnumerable;var xs=(v,Ee,De)=>Ee in v?F1(v,Ee,{enumerable:!0,configurable:!0,writable:!0,value:De}):v[Ee]=De,Ie=(v,Ee)=>{for(var De in Ee||(Ee={}))_s.call(Ee,De)&&xs(v,De,Ee[De]);if(sr)for(var De of sr(Ee))Ss.call(Ee,De)&&xs(v,De,Ee[De]);return v},Ze=(v,Ee)=>C1(v,B1(Ee));var Ds=(v,Ee)=>{var De={};for(var Ne in v)_s.call(v,Ne)&&Ee.indexOf(Ne)<0&&(De[Ne]=v[Ne]);if(v!=null&&sr)for(var Ne of sr(v))Ee.indexOf(Ne)<0&&Ss.call(v,Ne)&&(De[Ne]=v[Ne]);return De};(function(v,Ee){typeof exports=="object"&&typeof module!="undefined"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(v=typeof globalThis!="undefined"?globalThis:v||self,Ee(v.OCS={}))})(this,function(v){"use strict";function Ee(e,t){const n=Object.create(null),r=e.split(",");for(let u=0;u<r.length;u++)n[r[u]]=!0;return t?u=>!!n[u.toLowerCase()]:u=>!!n[u]}const Ne=Ee("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");function Au(e){return!!e||e===""}function ar(e){if(ne(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],u=Ae(r)?Ps(r):ar(r);if(u)for(const i in u)t[i]=u[i]}return t}else{if(Ae(e))return e;if(Fe(e))return e}}const Ts=/;(?![^(]*\))/g,Os=/:(.+)/;function Ps(e){const t={};return e.split(Ts).forEach(n=>{if(n){const r=n.split(Os);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function wn(e){let t="";if(Ae(e))t=e;else if(ne(e))for(let n=0;n<e.length;n++){const r=wn(e[n]);r&&(t+=r+" ")}else if(Fe(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Fu=e=>Ae(e)?e:e==null?"":ne(e)||Fe(e)&&(e.toString===_u||!ue(e.toString))?JSON.stringify(e,Cu,2):String(e),Cu=(e,t)=>t&&t.__v_isRef?Cu(e,t.value):xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,u])=>(n[`${r} =>`]=u,n),{})}:Bu(t)?{[`Set(${t.size})`]:[...t.values()]}:Fe(t)&&!ne(t)&&!Su(t)?String(t):t,fe={},Bt=[],Ue=()=>{},$s=()=>!1,Is=/^on[^a-z]/,An=e=>Is.test(e),lr=e=>e.startsWith("onUpdate:"),Te=Object.assign,cr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ks=Object.prototype.hasOwnProperty,se=(e,t)=>ks.call(e,t),ne=Array.isArray,xt=e=>Fn(e)==="[object Map]",Bu=e=>Fn(e)==="[object Set]",ue=e=>typeof e=="function",Ae=e=>typeof e=="string",fr=e=>typeof e=="symbol",Fe=e=>e!==null&&typeof e=="object",xu=e=>Fe(e)&&ue(e.then)&&ue(e.catch),_u=Object.prototype.toString,Fn=e=>_u.call(e),Rs=e=>Fn(e).slice(8,-1),Su=e=>Fn(e)==="[object Object]",dr=e=>Ae(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Cn=Ee(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Bn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Ls=/-(\w)/g,Ke=Bn(e=>e.replace(Ls,(t,n)=>n?n.toUpperCase():"")),Ms=/\B([A-Z])/g,_t=Bn(e=>e.replace(Ms,"-$1").toLowerCase()),xn=Bn(e=>e.charAt(0).toUpperCase()+e.slice(1)),hr=Bn(e=>e?`on${xn(e)}`:""),Kt=(e,t)=>!Object.is(e,t),pr=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},_n=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},js=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Du;const Ns=()=>Du||(Du=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let et;class Us{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&et&&(this.parent=et,this.index=(et.scopes||(et.scopes=[])).push(this)-1)}run(t){if(this.active)try{return et=this,t()}finally{et=this.parent}}on(){et=this}off(){et=this.parent}stop(t){if(this.active){let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.scopes)for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);if(this.parent&&!t){const u=this.parent.scopes.pop();u&&u!==this&&(this.parent.scopes[this.index]=u,u.index=this.index)}this.active=!1}}}function Ws(e,t=et){t&&t.active&&t.effects.push(e)}const gr=e=>{const t=new Set(e);ret
- \u8BB0\u5F55\u6E05\u7A7A
- \u9891\u7E41\u9A8C\u8BC1\u7801
\u8D85\u661F\u540E\u53F0\u53EF\u4EE5\u770B\u5230\u5B66\u4E60\u65F6\u957F
\u8BF7\u8C28\u614E\u8BBE\u7F6E\u2757
\u5982\u679C\u8BBE\u7F6E\u540E\u65E0\u6548\u5219\u662F\u8D85\u661F\u4E0D\u5141\u8BB8\u4F7F\u7528\u500D\u901F\u3002`},{default:()=>[h("input",{style:{color:e.playbackRate>2?"red":""},type:"number",value:e.playbackRate,min:"1",max:"16",step:"1",onChange:t=>{e.playbackRate=t.target.valueAsNumber,v.store.currentMedia&&(v.store.currentMedia.playbackRate=t.target.valueAsNumber)}},null)]})]),h("label",null,[U("\u64AD\u653E\u8DEF\u7EBF")]),h("div",null,[h(Ce,{title:"\u5982\u679C\u5F53\u524D\u89C6\u9891\u5361\u987F\u4E25\u91CD\uFF0C\u53EF\u4EE5\u5C1D\u8BD5\u5207\u6362\u8DEF\u7EBF\u3002"},{default:()=>[h("select",{id:"video-line",value:e.line||"",onChange:t=>{e.line=t.target.value,v.store.videojs&&v.store.currentMedia&&Zo(e,v.store.videojs,v.store.currentMedia,t.target.value)}},[e.line?h("option",{value:e.line},[U("\u6307\u5B9A-"),e.line]):h("option",{value:""},[U("\u8BF7\u6307\u5B9A\u8DEF\u7EBF(\u64AD\u653E\u89C6\u9891\u540E\u624D\u53EF\u9009\u62E9, \u65E0\u9700\u4FDD\u5B58)")]),Array.from(e.playlines||[{label:"\u516C\u7F511"},{label:"\u516C\u7F512"}]).map(t=>h("option",{value:t.label},[t.label]))])]})]),h("label",null,[U("\u97F3\u91CF\u8C03\u8282")]),h("div",null,[h("input",{class:"ocs-setting-item",type:"range",min:"0",max:"1",step:"0.05",value:e.volume,onInput:t=>{e.volume=t.target.valueAsNumber,v.store.currentMedia&&(v.store.currentMedia.volume=t.target.valueAsNumber)}},null),h("span",null,[U(" "),Math.round(e.volume*100),U("% ")])]),h("label",null,[U("\u590D\u4E60\u6A21\u5F0F")]),h("div",null,[h(Ce,{title:"\u9047\u5230\u770B\u8FC7\u7684\u89C6\u9891,\u97F3\u9891,ppt\u4F1A\u91CD\u65B0\u64AD\u653E\uFF0C\u5E76\u4E14\u4ECE\u7B2C\u4E00\u4E2A\u7AE0\u8282\u5F00\u59CB\u3002"},{default:()=>[h("input",{class:"ocs-setting-item",type:"checkbox",checked:e.restudy,onChange:t=>{e.restudy=t.target.checked}},null)]})]),h("hr",null,null),h("hr",null,null),gn("\u81EA\u52A8\u7B54\u9898",{selected:e.upload},t=>e.upload=t.target.value),h("label",null,[U("\u7B54\u9898\u95F4\u9694(\u79D2)")]),h("div",null,[h("input",{type:"number",value:v.store.setting.cx.work.period,min:"3",step:"1",onChange:t=>v.store.setting.cx.work.period=t.target.valueAsNumber,onInput:t=>v.store.setting.cx.work.period=t.target.valueAsNumber},null)]),h("label",null,[U("\u641C\u9898\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4(\u79D2)")]),h("div",null,[h(Ce,{title:"\u6BCF\u9053\u9898\u6700\u591A\u505An\u79D2, \u8D85\u8FC7\u5219\u8DF3\u8FC7\u6B64\u9898\u3002"},{default:()=>[h("input",{type:"number",value:v.store.setting.cx.work.timeout,min:"0",step:"1",onChange:t=>v.store.setting.cx.work.timeout=t.target.valueAsNumber,onInput:t=>v.store.setting.cx.work.timeout=t.target.valueAsNumber},null)]})]),h("label",null,[U("\u641C\u9898\u8D85\u65F6\u91CD\u8BD5\u6B21\u6570")]),h("div",null,[h("input",{type:"number",value:v.store.setting.cx.work.retry,min:"0",max:"2",step:"1",onChange:t=>v.store.setting.cx.work.retry=t.target.valueAsNumber,onInput:t=>v.store.setting.cx.work.retry=t.target.valueAsNumber},null)]),h("label",null,[U("\u7B54\u9898\u5B8C\u6210\u540E\u7B49\u5F85(\u79D2)")]),h("div",null,[h(Ce,{title:"\u81EA\u52A8\u7B54\u9898\u5B8C\u6210\u540E\u7684\u7B49\u5F85\u65F6\u95F4, \u53EF\u9002\u5F53\u5EF6\u957F\u65B9\u4FBF\u5BF9\u9898\u76EE\u68C0\u67E5\u6216\u8005\u4F7F\u7528\u7B2C\u4E09\u65B9\u5DE5\u5177\u7B54\u9898\u3002"},{default:()=>[h("input",{type:"number",value:v.store.setting.cx.work.waitForCheck,min:"5",step:"1",onChange:t=>v.store.setting.cx.work.waitForCheck=t.target.valueAsNumber,onInput:t=>v.store.setting.cx.work.waitForCheck=t.target.valueAsNumber},null)]})])])])}}),iv=ze({setup(){const e=v.store.setting.cx.work;return()=>h("div",{class:"ocs-setting-panel"},[h("div",{class:"ocs-setting-items"},[gn("\u81EA\u52A8\u7B54\u9898",{selected:e.upload},t=>e.upload=t.target.value),h("label",null,[U("\u7B54\u9898\u95F4\u9694(\u79D2)")]),h("div",null,[h("input",{type:"number",value:e.period,min:"3",step:"1",onChange:t=>e.period=t.target.valueAsNumber,onInput:t=>e.period=t.target.valueAsNumber},null)]),h("label",null,[U("\u641C\u9898\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4(\u79D2)")]),h("div",null,[h(
`)})}function x(){return Promise.resolve(n.asArray(document.styleSheets)).then(L).then(_).then(function(q){return q.map(X)});function _(q){return q.filter(function(J){return J.type===CSSRule.FONT_FACE_RULE}).filter(function(J){return r.shouldProcess(J.style.getPropertyValue("src"))})}function L(q){var J=[];return q.forEach(function(te){try{n.asArray(te.cssRules||[]).forEach(J.push.bind(J))}catch(we){console.log("Error while reading CSS rules from "+te.href,we.toString())}}),J}function X(q){return{resolve:function(){var te=(q.parentStyleSheet||{}).href;return r.inlineAll(q.cssText,te)},src:function(){return q.style.getPropertyValue("src")}}}}}function $e(){return{inlineAll:x,impl:{newImage:G}};function G(_){return{inline:L};function L(X){return n.isDataUrl(_.src)?Promise.resolve():Promise.resolve(_.src).then(X||n.getAndEncode).then(function(q){return n.dataAsUrl(q,n.mimeType(_.src))}).then(function(q){return new Promise(function(J,te){_.onload=J,_.onerror=te,_.src=q})})}}function x(_){if(!(_ instanceof Element))return Promise.resolve(_);return L(_).then(function(){return _ instanceof HTMLImageElement?G(_).inline():Promise.all(n.asArray(_.childNodes).map(function(X){return x(X)}))});function L(X){var q=X.style.getPropertyValue("background");return q?r.inlineAll(q).then(function(J){X.style.setProperty("background",J,X.style.getPropertyPriority("background"))}).then(function(){return X}):Promise.resolve(X)}}}})()})(es);var ov=es.exports,sv={exports:{}};(function(e){var t=function(n){var r=Object.prototype,u=r.hasOwnProperty,i,o=typeof Symbol=="function"?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(E,b,D){return Object.defineProperty(E,b,{value:D,enumerable:!0,configurable:!0,writable:!0}),E[b]}try{c({},"")}catch{c=function(b,D,N){return b[D]=N}}function f(E,b,D,N){var M=b&&b.prototype instanceof j?b:j,re=Object.create(M.prototype),de=new we(N||[]);return re._invoke=X(E,D,de),re}n.wrap=f;function p(E,b,D){try{return{type:"normal",arg:E.call(b,D)}}catch(N){return{type:"throw",arg:N}}}var m="suspendedStart",F="suspendedYield",$="executing",w="completed",A={};function j(){}function I(){}function z(){}var ve={};c(ve,s,function(){return this});var $e=Object.getPrototypeOf,G=$e&&$e($e(ce([])));G&&G!==r&&u.call(G,s)&&(ve=G);var x=z.prototype=j.prototype=Object.create(ve);I.prototype=z,c(x,"constructor",z),c(z,"constructor",I),I.displayName=c(z,l,"GeneratorFunction");function _(E){["next","throw","return"].forEach(function(b){c(E,b,function(D){return this._invoke(b,D)})})}n.isGeneratorFunction=function(E){var b=typeof E=="function"&&E.constructor;return b?b===I||(b.displayName||b.name)==="GeneratorFunction":!1},n.mark=function(E){return Object.setPrototypeOf?Object.setPrototypeOf(E,z):(E.__proto__=z,c(E,l,"GeneratorFunction")),E.prototype=Object.create(x),E},n.awrap=function(E){return{__await:E}};function L(E,b){function D(re,de,k,Y){var V=p(E[re],E,de);if(V.type==="throw")Y(V.arg);else{var ie=V.arg,be=ie.value;return be&&typeof be=="object"&&u.call(be,"__await")?b.resolve(be.__await).then(function(ge){D("next",ge,k,Y)},function(ge){D("throw",ge,k,Y)}):b.resolve(be).then(function(ge){ie.value=ge,k(ie)},function(ge){return D("throw",ge,k,Y)})}}var N;function M(re,de){function k(){return new b(function(Y,V){D(re,de,Y,V)})}return N=N?N.then(k,k):k()}this._invoke=M}_(L.prototype),c(L.prototype,a,function(){return this}),n.AsyncIterator=L,n.async=function(E,b,D,N,M){M===void 0&&(M=Promise);var re=new L(f(E,b,D,N),M);return n.isGeneratorFunction(b)?re:re.next().then(function(de){return de.done?de.value:re.next()})};function X(E,b,D){var N=m;return function(re,de){if(N===$)throw new Error("Generator is already running");if(N===w){if(re==="throw")throw de;return Z()}for(D.method=re,D.arg=de;;){var k=D.delegate;if(k){var Y=q(k,D);if(Y){if(Y===A)continue;return Y}}if(D.method==="next")D.sent=D._sent=D.arg;else if(D.method==="throw"){if(N===m)throw N=w,D.arg;D.dispatchException(D.arg)}else D.method==="return"&&D.abrupt("return",D.arg);N=$;var V=p(E,b,D);if(V.type==="norma
\u5982\u8BBE\u7F6E\u4E3A0, \u5219\u4E0D\u4F1A\u81EA\u52A8\u6682\u505C
\u81EA\u52A8\u6682\u505C\u53EF\u4EE5\u5E2E\u52A9\u4F60\u83B7\u53D6\u667A\u6167\u6811\u7684\u5E73\u65F6\u5206\uFF0C\u6BCF\u5929\u5B66\u4E60\u8D85\u8FC7\u534A\u5C0F\u65F6\u5C31\u7B97\u4E00\u6B21\u5E73\u65F6\u5206\u3002`},{default:()=>[h("input",{type:"number",value:e.watchTime,min:"0",max:"24",step:"0.5",onChange:n=>{e.watchTime=n.target.valueAsNumber;const r=new Date;r.setMinutes(r.getMinutes()+e.watchTime*60),e.closeDate=r,ys(n.target.valueAsNumber)}},null)]}),h("span",null,[U("\u5C0F\u65F6")])]),h("label",null,[U("\u6682\u505C\u65F6\u95F4")]),h("div",null,[e.watchTime===0?h("span",null,[U("\u8BBE\u7F6E\u4E3A0\u5C06\u4E0D\u4F1A\u81EA\u52A8\u6682\u505C")]):h("span",null,[U("\u5C06\u5728 "),e.closeDate.toLocaleString(),U(" \u6682\u505C")])])]:[],e.creditStudy===!0?h(Pe,null,[h("label",null,[U("\u89C6\u9891\u500D\u901F ")]),h("div",null,[h(Ce,{title:"\u5B66\u5206\u8BFE\u4E0D\u5141\u8BB8\u500D\u901F\uFF01"},{default:()=>[h("input",{type:"number",value:"1"},null)]})])]):h(Pe,null,[h("label",null,[U("\u89C6\u9891\u500D\u901F ")]),h("div",null,[h(Ce,{title:"\u667A\u6167\u6811\u6700\u9AD81.5\u500D\u901F, \u8D85\u8FC71.5\u5BB9\u6613\u5C01\u53F7\uFF01"},{default:()=>[h("input",{type:"number",step:"0.25",max:"1.5",min:"1",value:e.playbackRate,onChange:n=>{e.playbackRate=n.target.valueAsNumber}},null)]})])]),h("label",null,[U("\u97F3\u91CF\u8C03\u8282")]),h("div",null,[h("input",{type:"range",min:"0",max:"1",step:"0.05",value:e.volume,onInput:n=>{e.volume=n.target.valueAsNumber,v.store.currentMedia&&(v.store.currentMedia.volume=n.target.valueAsNumber)}},null),h("span",null,[U(" "),Math.round(e.volume*100),U("% ")])]),h("label",null,[U("\u590D\u4E60\u6A21\u5F0F")]),h("div",null,[h(Ce,{title:"\u5C06\u64AD\u653E\u8FC7\u7684\u89C6\u9891\u518D\u64AD\u653E\u4E00\u904D\u3002"},{default:()=>[h("input",{type:"checkbox",checked:e.restudy,onChange:n=>e.restudy=n.target.checked},null)]})])])])}}),bs=ze({setup(e,{slots:t}){const n=v.store.setting.zhs.work;return()=>h("div",{class:"ocs-setting-panel"},[h("div",{class:"ocs-setting-items"},[t.upload?t.upload():gn("\u81EA\u52A8\u7B54\u9898",{selected:n.upload},r=>n.upload=r.target.value),h("label",null,[U("\u7B54\u9898\u95F4\u9694(\u79D2)")]),h("div",null,[h("input",{type:"number",onChange:r=>n.period=r.target.valueAsNumber,onInput:r=>n.period=r.target.valueAsNumber,value:n.period,min:"3",step:"1"},null)]),h("label",null,[U("\u641C\u9898\u8BF7\u6C42\u8D85\u65F6\u65F6\u95F4(\u79D2)")]),h("div",null,[h(Ce,{title:"\u6BCF\u9053\u9898\u6700\u591A\u505An\u79D2, \u8D85\u8FC7\u5219\u8DF3\u8FC7\u6B64\u9898\u3002"},{default:()=>[h("input",{type:"number",onChange:r=>n.timeout=r.target.valueAsNumber,onInput:r=>n.timeout=r.target.valueAsNumber,value:n.timeout,min:"0",step:"1"},null)]})]),h("label",null,[U("\u641C\u9898\u8D85\u65F6\u91CD\u8BD5\u6B21\u6570")]),h("div",null,[h("input",{type:"number",onChange:r=>n.retry=r.target.valueAsNumber,onInput:r=>n.retry=r.target.valueAsNumber,value:n.retry,min:"0",max:"2",step:"1"},null)])])])}}),l1=ze({setup(){const e=v.store.setting.zhs.work;return()=>h(bs,null,{upload:gn("\u81EA\u52A8\u7B54\u9898",{selected:e.upload,options:[{value:"nomove",label:"\u5B8C\u6210\u540E\u8BF7\u81EA\u884C\u68C0\u67E5\u5E76\u63D0\u4EA4"}]},t=>e.upload=t.target.value)})}});async function ws(e,t="work"){const{period:n,timeout:r,retry:u}=e;if(e.upload==="close")W("warn","\u81EA\u52A8\u7B54\u9898\u5DF2\u88AB\u5173\u95ED\uFF01");else if(v.store.setting.answererWrappers.length===0)W("warn","\u9898\u5E93\u914D\u7F6E\u4E3A\u7A7A\uFF0C\u8BF7\u8BBE\u7F6E\u3002");else{v.store.workResults=[];const i=new mn({root:".examPaper_subject",elements:{title:".subject_describe,.smallStem_describe",options:".subject_node .nodeLab"},answerer:(s,a)=>vn(v.store.setting.answererWrappers,a,s.title[0].innerText),work:{handler(s,a,l){var c;if(s==="judgement"||s==="single"||s==="multiple")((c=l.querySelector("input"))==null?void 0:c.checked)||l.click();else if(s==="completion"&&a.trim()){const f=l.querySelector("textarea");f&&(f.value=a)}}},onResult:s=>{var a;s.ctx&&v.store.workResults.push(s),console.log(s),W("info","\u989