BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
www
/
app.imagivibe.com
/
public
/
build
/
assets
📤 Upload
📝 New File
📁 New Folder
Close
Editing: echo-DL0QqwGZ.js
function p(r){"@babel/helpers - typeof";return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},p(r)}function u(r,i){if(!(r instanceof i))throw new TypeError("Cannot call a class as a function")}function E(r,i){for(var t=0;t<i.length;t++){var n=i[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function c(r,i,t){return i&&E(r.prototype,i),Object.defineProperty(r,"prototype",{writable:!1}),r}function v(){return v=Object.assign||function(r){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},v.apply(this,arguments)}function a(r,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(i&&i.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),i&&b(r,i)}function y(r){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},y(r)}function b(r,i){return b=Object.setPrototypeOf||function(n,e){return n.__proto__=e,n},b(r,i)}function T(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function A(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function N(r,i){if(i&&(typeof i=="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A(r)}function h(r){var i=T();return function(){var n=y(r),e;if(i){var s=y(this).constructor;e=Reflect.construct(n,arguments,s)}else e=n.apply(this,arguments);return N(this,e)}}var g=function(){function r(){u(this,r)}return c(r,[{key:"listenForWhisper",value:function(t,n){return this.listen(".client-"+t,n)}},{key:"notification",value:function(t){return this.listen(".Illuminate\\Notifications\\Events\\BroadcastNotificationCreated",t)}},{key:"stopListeningForWhisper",value:function(t,n){return this.stopListening(".client-"+t,n)}}]),r}(),P=function(){function r(i){u(this,r),this.namespace=i}return c(r,[{key:"format",value:function(t){return[".","\\"].includes(t.charAt(0))?t.substring(1):(this.namespace&&(t=this.namespace+"."+t),t.replace(/\./g,"\\"))}},{key:"setNamespace",value:function(t){this.namespace=t}}]),r}();function R(r){try{new r}catch(i){if(i.message.includes("is not a constructor"))return!1}return!0}var m=function(r){a(t,r);var i=h(t);function t(n,e,s){var o;return u(this,t),o=i.call(this),o.name=e,o.pusher=n,o.options=s,o.eventFormatter=new P(o.options.namespace),o.subscribe(),o}return c(t,[{key:"subscribe",value:function(){this.subscription=this.pusher.subscribe(this.name)}},{key:"unsubscribe",value:function(){this.pusher.unsubscribe(this.name)}},{key:"listen",value:function(e,s){return this.on(this.eventFormatter.format(e),s),this}},{key:"listenToAll",value:function(e){var s=this;return this.subscription.bind_global(function(o,l){if(!o.startsWith("pusher:")){var f=s.options.namespace.replace(/\./g,"\\"),d=o.startsWith(f)?o.substring(f.length+1):"."+o;e(d,l)}}),this}},{key:"stopListening",value:function(e,s){return s?this.subscription.unbind(this.eventFormatter.format(e),s):this.subscription.unbind(this.eventFormatter.format(e)),this}},{key:"stopListeningToAll",value:function(e){return e?this.subscription.unbind_global(e):this.subscription.unbind_global(),this}},{key:"subscribed",value:function(e){return this.on("pusher:subscription_succeeded",function(){e()}),this}},{key:"error",value:function(e){return this.on("pusher:subscription_error",function(s){e(s)}),this}},{key:"on",value:function(e,s){return this.subscription.bind(e,s),this}}]),t}(g),I=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"whisper",value:function(e,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(e),s),this}}]),t}(m),L=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"whisper",value:function(e,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(e),s),this}}]),t}(m),x=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"here",value:function(e){return this.on("pusher:subscription_succeeded",function(s){e(Object.keys(s.members).map(function(o){return s.members[o]}))}),this}},{key:"joining",value:function(e){return this.on("pusher:member_added",function(s){e(s.info)}),this}},{key:"whisper",value:function(e,s){return this.pusher.channels.channels[this.name].trigger("client-".concat(e),s),this}},{key:"leaving",value:function(e){return this.on("pusher:member_removed",function(s){e(s.info)}),this}}]),t}(I),O=function(r){a(t,r);var i=h(t);function t(n,e,s){var o;return u(this,t),o=i.call(this),o.events={},o.listeners={},o.name=e,o.socket=n,o.options=s,o.eventFormatter=new P(o.options.namespace),o.subscribe(),o}return c(t,[{key:"subscribe",value:function(){this.socket.emit("subscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"unsubscribe",value:function(){this.unbind(),this.socket.emit("unsubscribe",{channel:this.name,auth:this.options.auth||{}})}},{key:"listen",value:function(e,s){return this.on(this.eventFormatter.format(e),s),this}},{key:"stopListening",value:function(e,s){return this.unbindEvent(this.eventFormatter.format(e),s),this}},{key:"subscribed",value:function(e){return this.on("connect",function(s){e(s)}),this}},{key:"error",value:function(e){return this}},{key:"on",value:function(e,s){var o=this;return this.listeners[e]=this.listeners[e]||[],this.events[e]||(this.events[e]=function(l,f){o.name===l&&o.listeners[e]&&o.listeners[e].forEach(function(d){return d(f)})},this.socket.on(e,this.events[e])),this.listeners[e].push(s),this}},{key:"unbind",value:function(){var e=this;Object.keys(this.events).forEach(function(s){e.unbindEvent(s)})}},{key:"unbindEvent",value:function(e,s){this.listeners[e]=this.listeners[e]||[],s&&(this.listeners[e]=this.listeners[e].filter(function(o){return o!==s})),(!s||this.listeners[e].length===0)&&(this.events[e]&&(this.socket.removeListener(e,this.events[e]),delete this.events[e]),delete this.listeners[e])}}]),t}(g),j=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"whisper",value:function(e,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(e),data:s}),this}}]),t}(O),F=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"here",value:function(e){return this.on("presence:subscribed",function(s){e(s.map(function(o){return o.user_info}))}),this}},{key:"joining",value:function(e){return this.on("presence:joining",function(s){return e(s.user_info)}),this}},{key:"whisper",value:function(e,s){return this.socket.emit("client event",{channel:this.name,event:"client-".concat(e),data:s}),this}},{key:"leaving",value:function(e){return this.on("presence:leaving",function(s){return e(s.user_info)}),this}}]),t}(j),k=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"subscribe",value:function(){}},{key:"unsubscribe",value:function(){}},{key:"listen",value:function(e,s){return this}},{key:"listenToAll",value:function(e){return this}},{key:"stopListening",value:function(e,s){return this}},{key:"subscribed",value:function(e){return this}},{key:"error",value:function(e){return this}},{key:"on",value:function(e,s){return this}}]),t}(g),S=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"whisper",value:function(e,s){return this}}]),t}(k),q=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"whisper",value:function(e,s){return this}}]),t}(k),B=function(r){a(t,r);var i=h(t);function t(){return u(this,t),i.apply(this,arguments)}return c(t,[{key:"here",value:function(e){return this}},{key:"joining",value:function(e){return this}},{key:"whisper",value:function(e,s){return this}},{key:"leaving",value:function(e){return this}}]),t}(S),_=function(){function r(i){u(this,r),this._defaultOptions={auth:{headers:{}},authEndpoint:"/broadcasting/auth",userAuthentication:{endpoint:"/broadcasting/user-auth",headers:{}},broadcaster:"pusher",csrfToken:null,bearerToken:null,host:null,key:null,namespace:"App.Events"},this.setOptions(i),this.connect()}return c(r,[{key:"setOptions",value:function(t){this.options=v(this._defaultOptions,t);var n=this.csrfToken();return n&&(this.options.auth.headers["X-CSRF-TOKEN"]=n,this.options.userAuthentication.headers["X-CSRF-TOKEN"]=n),n=this.options.bearerToken,n&&(this.options.auth.headers.Authorization="Bearer "+n,this.options.userAuthentication.headers.Authorization="Bearer "+n),t}},{key:"csrfToken",value:function(){var t;return typeof window<"u"&&window.Laravel&&window.Laravel.csrfToken?window.Laravel.csrfToken:this.options.csrfToken?this.options.csrfToken:typeof document<"u"&&typeof document.querySelector=="function"&&(t=document.querySelector('meta[name="csrf-token"]'))?t.getAttribute("content"):null}}]),r}(),w=function(r){a(t,r);var i=h(t);function t(){var n;return u(this,t),n=i.apply(this,arguments),n.channels={},n}return c(t,[{key:"connect",value:function(){typeof this.options.client<"u"?this.pusher=this.options.client:this.options.Pusher?this.pusher=new this.options.Pusher(this.options.key,this.options):this.pusher=new Pusher(this.options.key,this.options)}},{key:"signin",value:function(){this.pusher.signin()}},{key:"listen",value:function(e,s,o){return this.channel(e).listen(s,o)}},{key:"channel",value:function(e){return this.channels[e]||(this.channels[e]=new m(this.pusher,e,this.options)),this.channels[e]}},{key:"privateChannel",value:function(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new I(this.pusher,"private-"+e,this.options)),this.channels["private-"+e]}},{key:"encryptedPrivateChannel",value:function(e){return this.channels["private-encrypted-"+e]||(this.channels["private-encrypted-"+e]=new L(this.pusher,"private-encrypted-"+e,this.options)),this.channels["private-encrypted-"+e]}},{key:"presenceChannel",value:function(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new x(this.pusher,"presence-"+e,this.options)),this.channels["presence-"+e]}},{key:"leave",value:function(e){var s=this,o=[e,"private-"+e,"private-encrypted-"+e,"presence-"+e];o.forEach(function(l,f){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}},{key:"socketId",value:function(){return this.pusher.connection.socket_id}},{key:"disconnect",value:function(){this.pusher.disconnect()}}]),t}(_),C=function(r){a(t,r);var i=h(t);function t(){var n;return u(this,t),n=i.apply(this,arguments),n.channels={},n}return c(t,[{key:"connect",value:function(){var e=this,s=this.getSocketIO();return this.socket=s(this.options.host,this.options),this.socket.on("reconnect",function(){Object.values(e.channels).forEach(function(o){o.subscribe()})}),this.socket}},{key:"getSocketIO",value:function(){if(typeof this.options.client<"u")return this.options.client;if(typeof io<"u")return io;throw new Error("Socket.io client not found. Should be globally available or passed via options.client")}},{key:"listen",value:function(e,s,o){return this.channel(e).listen(s,o)}},{key:"channel",value:function(e){return this.channels[e]||(this.channels[e]=new O(this.socket,e,this.options)),this.channels[e]}},{key:"privateChannel",value:function(e){return this.channels["private-"+e]||(this.channels["private-"+e]=new j(this.socket,"private-"+e,this.options)),this.channels["private-"+e]}},{key:"presenceChannel",value:function(e){return this.channels["presence-"+e]||(this.channels["presence-"+e]=new F(this.socket,"presence-"+e,this.options)),this.channels["presence-"+e]}},{key:"leave",value:function(e){var s=this,o=[e,"private-"+e,"presence-"+e];o.forEach(function(l){s.leaveChannel(l)})}},{key:"leaveChannel",value:function(e){this.channels[e]&&(this.channels[e].unsubscribe(),delete this.channels[e])}},{key:"socketId",value:function(){return this.socket.id}},{key:"disconnect",value:function(){this.socket.disconnect()}}]),t}(_),Q=function(r){a(t,r);var i=h(t);function t(){var n;return u(this,t),n=i.apply(this,arguments),n.channels={},n}return c(t,[{key:"connect",value:function(){}},{key:"listen",value:function(e,s,o){return new k}},{key:"channel",value:function(e){return new k}},{key:"privateChannel",value:function(e){return new S}},{key:"encryptedPrivateChannel",value:function(e){return new q}},{key:"presenceChannel",value:function(e){return new B}},{key:"leave",value:function(e){}},{key:"leaveChannel",value:function(e){}},{key:"socketId",value:function(){return"fake-socket-id"}},{key:"disconnect",value:function(){}}]),t}(_),V=function(){function r(i){u(this,r),this.options=i,this.connect(),this.options.withoutInterceptors||this.registerInterceptors()}return c(r,[{key:"channel",value:function(t){return this.connector.channel(t)}},{key:"connect",value:function(){if(this.options.broadcaster=="reverb")this.connector=new w(v(v({},this.options),{cluster:""}));else if(this.options.broadcaster=="pusher")this.connector=new w(this.options);else if(this.options.broadcaster=="socket.io")this.connector=new C(this.options);else if(this.options.broadcaster=="null")this.connector=new Q(this.options);else if(typeof this.options.broadcaster=="function"&&R(this.options.broadcaster))this.connector=new this.options.broadcaster(this.options);else throw new Error("Broadcaster ".concat(p(this.options.broadcaster)," ").concat(this.options.broadcaster," is not supported."))}},{key:"disconnect",value:function(){this.connector.disconnect()}},{key:"join",value:function(t){return this.connector.presenceChannel(t)}},{key:"leave",value:function(t){this.connector.leave(t)}},{key:"leaveChannel",value:function(t){this.connector.leaveChannel(t)}},{key:"leaveAllChannels",value:function(){for(var t in this.connector.channels)this.leaveChannel(t)}},{key:"listen",value:function(t,n,e){return this.connector.listen(t,n,e)}},{key:"private",value:function(t){return this.connector.privateChannel(t)}},{key:"encryptedPrivate",value:function(t){if(this.connector instanceof C)throw new Error("Broadcaster ".concat(p(this.options.broadcaster)," ").concat(this.options.broadcaster," does not support encrypted private channels."));return this.connector.encryptedPrivateChannel(t)}},{key:"socketId",value:function(){return this.connector.socketId()}},{key:"registerInterceptors",value:function(){typeof Vue=="function"&&Vue.http&&this.registerVueRequestInterceptor(),typeof axios=="function"&&this.registerAxiosRequestInterceptor(),typeof jQuery=="function"&&this.registerjQueryAjaxSetup(),(typeof Turbo>"u"?"undefined":p(Turbo))==="object"&&this.registerTurboRequestInterceptor()}},{key:"registerVueRequestInterceptor",value:function(){var t=this;Vue.http.interceptors.push(function(n,e){t.socketId()&&n.headers.set("X-Socket-ID",t.socketId()),e()})}},{key:"registerAxiosRequestInterceptor",value:function(){var t=this;axios.interceptors.request.use(function(n){return t.socketId()&&(n.headers["X-Socket-Id"]=t.socketId()),n})}},{key:"registerjQueryAjaxSetup",value:function(){var t=this;typeof jQuery.ajax<"u"&&jQuery.ajaxPrefilter(function(n,e,s){t.socketId()&&s.setRequestHeader("X-Socket-Id",t.socketId())})}},{key:"registerTurboRequestInterceptor",value:function(){var t=this;document.addEventListener("turbo:before-fetch-request",function(n){n.detail.fetchOptions.headers["X-Socket-Id"]=t.socketId()})}}]),r}();export{g as Channel,_ as Connector,P as EventFormatter,V as default};
Save
Cancel