vendor: 4,877 bytes, lines 1-2
1/*! For license information please see 78.05988081.chunk.js.LICENSE.txt */ 2(this["webpackJsonpdaimaku-front"]=this["webpackJsonpdaimaku-front"]||[]).push([[78],{1308:function(t,e,r){"use strict";r.r(e);var n=r(866),o=r(4),a=r(0),c=r.n(a),i=r(114),u=r(135),s=r(13);function l(){l=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",i=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(C){u=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var a=e&&e.prototype instanceof h?e:h,c=Object.create(a.prototype),i=new L(o||[]);return n(c,"_invoke",{value:E(t,r,i)}),c}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(C){return{type:"throw",arg:C}}}t.wrap=s;var d={};function h(){}function p(){}function v(){}var y={};u(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(S([])));m&&m!==e&&r.call(m,a)&&(y=m);var w=v.prototype=h.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function O(t,e){var o;n(this,"_invoke",{value:function(n,a){function c(){return new e((function(o,c){!function n(o,a,c,i){var u=f(t[o],t,a);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,c,i)}),(function(t){n("throw",t,c,i)})):e.resolve(l).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,i)}))}i(u.arg)}(n,a,o,c)}))}return o=o?o.then(c,c):c()}})}function E(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return N()}for(r.method=o,r.arg=a;;){var c=r.delegate;if(c){var i=x(c,r);if(i){if(i===d)continue;return i}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=f(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:N}}function N(){return{value:void 0,done:!0}}return p.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,i,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,i,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(O.prototype),u(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var c=new O(s(e,r,n,o),a);return t.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},b(w),u(w,i,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
2h(k),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return c.type="throw",c.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(i&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var c=a?a.completion:{};return c.type=t,c.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}e.default=function(t){var e=Object(a.useRef)(null),r=Object(a.useRef)(null),f=Object(a.useRef)(null),d=Object(a.useRef)([]),h=Object(a.useRef)(null),p=Object(a.useState)(""),v=Object(o.a)(p,2),y=v[0],g=v[1],m=Object(a.useState)(""),w=Object(o.a)(m,2),b=w[0],O=w[1],E=Object(a.useState)(""),x=Object(o.a)(E,2),j=(x[0],x[1],Object(a.useState)("")),k=Object(o.a)(j,2),L=(k[0],k[1],{iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),S=function(){var t=Object(n.a)(l().mark((function t(){var n,o;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.mediaDevices.getDisplayMedia({video:!0,audio:!1});case 3:return n=t.sent,e.current.srcObject=n,f.current=n,r.current=new RTCPeerConnection(L),n.getTracks().forEach((function(t){r.current.addTrack(t,n)})),r.current.onicecandidate=function(t){t.candidate&&(console.log("New ICE candidate:",JSON.stringify(t.candidate)),d.current.push(t.candidate))},r.current.ontrack=function(t){var e=document.createElement("video");e.srcObject=t.streams[0],e.autoplay=!0,document.body.appendChild(e)},t.next=12,r.current.createOffer();case 12:return o=t.sent,t.next=15,r.current.setLocalDescription(o);case 15:console.log("SDP offer:",JSON.stringify(o)),O(o),t.next=22;break;case 19:t.prev=19,t.t0=t.catch(0),console.error("Error starting desktop share:",t.t0);case 22:case"end":return t.stop()}}),t,null,[[0,19]])})));return function(){return t.apply(this,arguments)}}(),N=function(){var t=Object(n.a)(l().mark((function t(e){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.current.setRemoteDescription(e);case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),C=function(){var t=Object(n.a)(l().mark((function t(n,o){var a;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,r.current=new RTCPeerConnection(L),r.current.onicecandidate=function(t){t.candidate&&console.log("New ICE candidate:",t.candidate)},r.current.ontrack=function(t){e.current.srcObject=t.streams[0]},t.next=6,r.current.setRemoteDescription(n);case 6:return t.next=8,r.current.createAnswer();case 8:return a=t.sent,t.next=11,r.current.setLocalDescription(a);case 11:return console.log("ans",JSON.stringify(r.current.localDescription)),console.log("send answer"),h.current.send(JSON.stringify({event:"answer",data:{code:o,answer:r.current.localDescription}})),t.abrupt("return",r.current.localDescription);case 17:t.prev=17,t.t0=t.catch(0),console.error("Error starting desktop share:",t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,17]])})));return function(e,r){return t.apply(this,arguments)}}(),_=function(){var t=Object(n.a)(l().mark((function t(e){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,r.current.addIceCandidate(new RTCIceCandidate(e));case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}
2(),P=function(){h.current=new WebSocket("ws://www.it266.com:8010/"),h.current.onopen=function(){console.log("\u8fde\u63a5\u6210\u529f"),s.a.toast("\u8fde\u63a5\u6210\u529f"),h.current.send(JSON.stringify({event:"login"}))},h.current.onmessage=function(t){console.log("\u63a5\u6536\u5230\u6d88\u606f\uff1a",t.data);var e=JSON.parse(t.data);switch(e.event){case"offer":C(e.data.offer,e.data.code);break;case"connect":var r=e.data.code;console.log(r),h.current.send(JSON.stringify({event:"offer",data:{code:r,offer:b}}));break;case"answer":N(e.data.answer);var n=e.data.code;h.current.send(JSON.stringify({event:"candidate",data:{code:n,candidate:d.current}}));break;case"candidate":for(var o=0;o<e.data.candidate.length;o++)console.log(e.data.candidate[o]),_(e.data.candidate[o])}}};return Object(a.useEffect)((function(){}),[]),c.a.createElement("div",null,c.a.createElement("h1",null,"\u8001\u5e08\u7aef"),c.a.createElement(i.a,{onClick:function(){S()}},"\u83b7\u53d6\u5c4f\u5e55"),c.a.createElement(i.a,{onClick:P},"\u8fde\u63a5ws"),c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("h1",null,"\u5b66\u751f\u7aef"),c.a.createElement(i.a,{onClick:P},"\u8fde\u63a5ws"),c.a.createElement(u.a,{placeholder:"\u8001\u5e08code",onChange:function(t){g(t.target.value)}}),c.a.createElement(i.a,{onClick:function(){h.current.send(JSON.stringify({event:"connect",data:{code:y}}))}},"\u8fde\u63a5\u8001\u5e08"),c.a.createElement("video",{ref:e,autoPlay:!0,style:{width:"100%",height:"auto"}}))}},866:function(t,e,r){"use strict";function n(t,e,r,n,o,a,c){try{var i=t[a](c),u=i.value}catch(s){return void r(s)}i.done?e(u):Promise.resolve(u).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,a){var c=t.apply(e,r);function i(t){n(c,o,a,i,u,"next",t)}function u(t){n(c,o,a,i,u,"throw",t)}i(void 0)}))}}r.d(e,"a",(function(){return o}))}}]); 3//# sourceMappingURL=78.05988081.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.