instrument-b962153b.js 5.7 KB

1
  1. import{d as A,g as E,o as v,s as T,a$ as I,by as K,f as y,a as k,c as b,ad as D,e as U,h as g,T as O,R,F as C,v as M,q as X,i as H,aF as S,j as N,bz as Y,aH as B,aI as P,bA as V,bB as w,aJ as x,aK as F,aL as q}from"./index-f4812bff.js";function $(){import.meta.url,import("_").catch(()=>1);async function*n(){}}(function(){if(typeof window>"u")return;var n,l="ontouchstart"in window;document.createTouch||(document.createTouch=function(i,e,r,s,d,m,L){return new c(e,r,{pageX:s,pageY:d,screenX:m,screenY:L,clientX:s-window.pageXOffset,clientY:d-window.pageYOffset},0,0)}),document.createTouchList||(document.createTouchList=function(){for(var i=u(),e=0;e<arguments.length;e++)i[e]=arguments[e];return i.length=arguments.length,i}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(i){var e=this;do{if(e.matches(i))return e;e=e.parentElement||e.parentNode}while(e!==null&&e.nodeType===1);return null});var c=function(e,r,s,d,m){d=d||0,m=m||0,this.identifier=r,this.target=e,this.clientX=s.clientX+d,this.clientY=s.clientY+m,this.screenX=s.screenX+d,this.screenY=s.screenY+m,this.pageX=s.pageX+d,this.pageY=s.pageY+m};function u(){var i=[];return i.item=function(e){return this[e]||null},i.identifiedTouch=function(e){return this[e+1]||null},i}var p=!1;function o(i){return function(e){e.type==="mousedown"&&(p=!0),e.type==="mouseup"&&(p=!1),!(e.type==="mousemove"&&!p)&&((e.type==="mousedown"||!n||n&&!n.dispatchEvent)&&(n=e.target),n.closest("[data-no-touch-simulate]")==null&&t(i,e),e.type==="mouseup"&&(n=null))}}function t(i,e){var r=document.createEvent("Event");r.initEvent(i,!0,!0),r.altKey=e.altKey,r.ctrlKey=e.ctrlKey,r.metaKey=e.metaKey,r.shiftKey=e.shiftKey,r.touches=f(e),r.targetTouches=f(e),r.changedTouches=a(e),n.dispatchEvent(r)}function a(i){var e=u();return e.push(new c(n,1,i,0,0)),e}function f(i){return i.type==="mouseup"?u():a(i)}function h(){window.addEventListener("mousedown",o("touchstart"),!0),window.addEventListener("mousemove",o("touchmove"),!0),window.addEventListener("mouseup",o("touchend"),!0)}h.multiTouchOffset=75,l||new h})();const z=A({name:"App",setup(){const n=E(),l=async()=>await Y(),c=async()=>{try{const o=n.isCbs||window.location.href.includes("simple-detail")?{code:200,data:{}}:await l();if((o==null?void 0:o.code)===5e3){const a=M();if(X(o.message),a.isApp)postMessage({api:"login"});else{if(/(192|localhost)/.test(location.origin))return;window.parent.postMessage({api:"onLogin"},"*"),setTimeout(()=>{window.location.href=`${location.origin}/classroom`},500)}return}const t=(o==null?void 0:o.data)||{};H(t),y.platformType=t.clientType==="STUDENT"?"STUDENT":""}catch(o){y.status="error",S(),console.log("🚀 ~ error:",o)}};v(async()=>{if(n.Authorization&&T(n.Authorization),!window.location.href.includes("simple-detail")){if(!I()){const o=await K();if(o!=null&&o.content){const t=o.content,a=t.tokenType+" "+t.accessToken;T(a)}}if(n.productXmlImg){y.status="login";return}}c(),k(N())});const u=o=>{o.code==="ArrowUp"?window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowUp"},"*"):o.code==="ArrowDown"&&window.parent.postMessage({api:"documentBodyKeyup",code:"ArrowDown"},"*")};b(()=>{const o=document.getElementById("loading");o&&document.body.removeChild(o),n.platform=="pc"&&(document.body.addEventListener("keyup",t=>u(t)),document.addEventListener("contextmenu",function(t){t.preventDefault()}),document.addEventListener("keydown",function(t){(t.key==="F12"||t.ctrlKey&&t.shiftKey&&t.key==="I"||t.metaKey&&t.altKey&&t.key==="I")&&t.preventDefault()})),document.addEventListener("contextmenu",function(t){}),document.addEventListener("keydown",function(t){(t.key==="F12"||t.ctrlKey&&t.shiftKey&&t.key==="I"||t.metaKey&&t.altKey&&t.key==="I")&&t.preventDefault()})}),D(()=>{n.platform=="pc"&&document.body.removeEventListener("keyup",u)});const p=U(()=>y.status==="login");return()=>g(C,null,[y.status==="error"?g(O,null,null):p.value?g(R,null,null):null])}}),Q=[{path:"/",component:V},{path:"/product-img",component:()=>w(()=>import("./index-4dd4374d.js"),["./index-4dd4374d.js","./index-f4812bff.js","../css/index-0eacd2ac.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/evaluat-report",component:()=>w(()=>import("./index-7e2d6170.js"),["./index-7e2d6170.js","./index-f4812bff.js","../css/index-0eacd2ac.css","./plyr.min-c8c2777b.js","../css/plyr-ad8ef5ae.css","./index-ef61ae53.js","../css/index-8073eb72.css"],import.meta.url)},{path:"/preview",component:()=>w(()=>import("./index-40989b0a.js"),["./index-40989b0a.js","./index-f4812bff.js","../css/index-0eacd2ac.css","../css/index-e2246bb5.css"],import.meta.url)},{path:"/view-figner",component:()=>w(()=>import("./index-f4812bff.js").then(n=>n.bY),["./index-f4812bff.js","../css/index-0eacd2ac.css"],import.meta.url)},{path:"/simple-detail",component:()=>w(()=>import("./index-1338df21.js"),["./index-1338df21.js","./index-f4812bff.js","../css/index-0eacd2ac.css","../css/index-2cf15a52.css"],import.meta.url)},{path:"/:pathMatch(.*)*",component:x,meta:{title:"404 Not Fund"}}],_=B({history:P(),routes:Q});_.beforeEach((n,l,c)=>{n.meta.title&&(document.title=n.meta.title),c()});(function(){var p,o,t,a,f,h;const n=E(),l=navigator.userAgent,c=window.DAYA||((o=(p=window.webkit)==null?void 0:p.messageHandlers)==null?void 0:o.DAYA)||window.COLEXIU||((a=(t=window.webkit)==null?void 0:t.messageHandlers)==null?void 0:a.COLEXIU)||window.ORCHESTRA||((h=(f=window.webkit)==null?void 0:f.messageHandlers)==null?void 0:h.ORCHESTRA),u=n.isCbs?"/cbs-app":(l.includes("COLEXIUSTUDENT"),"/edu-app");F({isApp:!!c,platformApi:u,platformType:(l.includes("COLEXIUSTUDENT"),""),proxy:""})})();q(z).use(_).mount("#app");export{$ as __vite_legacy_guard};