Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 832
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 839
import{g as $}from"./load_locale-DFZ8Ujfq.js";import"./client-wT6vtYO_.js";import{a as _,g as N}from"./index-BdTwX--g.js";import{k as G}from"./initial_state-CaZA8Ule.js";import{ao as x,ap as R,aq as B,ar as j,as as M,at as W,au as J,av as P,aw as D,ax as A,ay as L,az as q,aA as F,aB as I,aC as H,aD as z,F as K,aE as U,aF as V}from"./useSelectableClick-DSv4aXzQ.js";var y={},d={},v;function Y(){if(v)return d;v=1,Object.defineProperty(d,"__esModule",{value:!0}),d.createBackoff=i;var e={exponential:function(c,o){return Math.floor(Math.random()*Math.pow(2,c)*o)},fibonacci:function(c,o){var n=1;if(c>n)for(var t=1,n=2,r=2;r2&&arguments[2]!==void 0?arguments[2]:{};i(this,o),this.url=n,this.protocols=t,this.reconnectEnabled=!0,this.listeners={},this.backoff=a(r.backoff||"exponential",r),this.backoff.onReady=this.onBackoffReady.bind(this),(typeof r.connect>"u"||r.connect)&&this.open()}return e(o,[{key:"open",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.isReconnect=t;var r=this.ws&&this.ws.binaryType;this.ws=new s(this.url,this.protocols),this.ws.onclose=this.onCloseCallback.bind(this),this.ws.onerror=this.onErrorCallback.bind(this),this.ws.onmessage=this.onMessageCallback.bind(this),this.ws.onopen=this.onOpenCallback.bind(this),r&&(this.ws.binaryType=r)}},{key:"onBackoffReady",value:function(t,r){this.open(!0)}},{key:"onCloseCallback",value:function(t){!this.isReconnect&&this.listeners.onclose&&this.listeners.onclose.apply(null,arguments),this.reconnectEnabled&&t.code<3e3&&this.backoff.backoff()}},{key:"onErrorCallback",value:function(){this.listeners.onerror&&this.listeners.onerror.apply(null,arguments)}},{key:"onMessageCallback",value:function(){this.listeners.onmessage&&this.listeners.onmessage.apply(null,arguments)}},{key:"onOpenCallback",value:function(){this.listeners.onopen&&this.listeners.onopen.apply(null,arguments),this.isReconnect&&this.listeners.onreconnect&&this.listeners.onreconnect.apply(null,arguments),this.isReconnect=!1}},{key:"close",value:function(t,r){typeof t>"u"&&(t=1e3),this.reconnectEnabled=!1,this.ws.close(t,r)}},{key:"send",value:function(t){this.ws.send(t)}},{key:"bufferedAmount",get:function(){return this.ws.bufferedAmount}},{key:"readyState",get:function(){return this.ws.readyState}},{key:"binaryType",get:function(){return this.ws.binaryType},set:function(t){this.ws.binaryType=t}},{key:"extensions",get:function(){return this.ws.extensions},set:function(t){this.ws.extensions=t}},{key:"protocol",get:function(){return this.ws.protocol},set:function(t){this.ws.protocol=t}},{key:"onclose",set:function(t){this.listeners.onclose=t},get:function(){return this.listeners.onclose}},{key:"onerror",set:function(t){this.listeners.onerror=t},get:function(){return this.listeners.onerror}},{key:"onmessage",set:function(t){this.listeners.onmessage=t},get:function(){return this.listeners.onmessage}},{key:"onopen",set:function(t){this.listeners.onopen=t},get:function(){return this.listeners.onopen}},{key:"onreconnect",set:function(t){this.listeners.onreconnect=t},get:function(){return this.listeners.onreconnect}}]),o}();return c.CONNECTING=s.CONNECTING,c.OPEN=s.OPEN,c.CLOSING=s.CLOSING,c.CLOSED=s.CLOSED,y.default=c,y}var ne=ee();const k=N(ne);let b;const p=[],f={},te=e=>{p.push(e)},se=e=>{const i=p.indexOf(e);i!==-1&&p.splice(i,1)},O=({channelName:e,params:i,onConnect:a})=>{const s=g(e,i);f[s]=f[s]||0,f[s]===0&&b.send(JSON.stringify({type:"subscribe",stream:e,...i})),f[s]+=1,a()},E=({channelName:e,params:i,onDisconnect:a})=>{const s=g(e,i);f[s]=f[s]||1,f[s]===1&&b.readyState===k.OPEN&&b.send(JSON.stringify({type:"unsubscribe",stream:e,...i})),f[s]-=1,a()},oe={connected(){p.forEach(e=>O(e))},received(e){const{stream:i}=e;p.filter(({channelName:a,params:s})=>{const c=i[0];if(i.length===1)return a===c;const o=i[1];return["hashtag","hashtag:local"].includes(a)?a===c&&s.tag===o:a==="list"?a===c&&s.list===o:!1}).forEach(a=>{a.onReceive(e)})},disconnected(){p.forEach(e=>E(e))},reconnected(){}},g=(e,i)=>Object.keys(i).length===0?e:`${e}&${Object.keys(i).map(a=>`${a}=${i[a]}`).join("&")}`,ie=(e,i,a)=>(s,c)=>{const o=c().getIn(["meta","streaming_api_base_url"]),n=G(),{onConnect:t,onReceive:r,onDisconnect:l}=a(s,c);if(!n)throw new Error("Trying to connect to the streaming server but no access token is available.");if(!o.startsWith("ws")){const m=C(o,n,g(e,i),{connected(){t()},received(T){r(T)},disconnected(){l()},reconnected(){t()}});return()=>{m.close()}}const u={channelName:e,params:i,onConnect:t,onReceive:r,onDisconnect:l};return te(u),b?b.readyState===k.OPEN&&O(u):b=C(o,n,"",oe),()=>{se(u),E(u)}},ae=["update","delete","notification","conversation","filters_changed","announcement","announcement.delete","announcement.reaction"],re=(e,i)=>{i({event:e.type,payload:e.data})},C=(e,i,a,{connected:s,received:c,disconnected:o,reconnected:n})=>{const t=a.split("&");if(a=t.shift(),e.startsWith("ws")){const l=new k(`${e}/api/v1/streaming/?${t.join("&")}`,i);return l.onopen=s,l.onmessage=u=>c(JSON.parse(u.data)),l.onclose=o,l.onreconnect=n,l}a=a.replace(/:/g,"/"),a.endsWith(":media")&&(a=a.replace("/media",""),t.push("only_media=true")),t.push(`access_token=${i}`);const r=new EventSource(`${e}/api/v1/streaming/${a}?${t.join("&")}`);return r.onopen=()=>{s()},ae.forEach(l=>{r.addEventListener(l,u=>re(u,c))}),r.onerror=o,r},S=e=>Math.floor(Math.random()*Math.floor(e)),h=(e,i,a={},s={})=>{const{messages:c}=$();return ie(i,a,(o,n)=>{const t=n().getIn(["meta","locale"]);let r;const l=async u=>{await u(o,n),r=setTimeout(()=>l(u),2e4+S(2e4))};return{onConnect(){o(q(e)),r&&(clearTimeout(r),r=null),s.fillGaps&&o(s.fillGaps())},onDisconnect(){o(L({timeline:e})),s.fallback&&(r=setTimeout(()=>l(s.fallback),S(4e4)))},onReceive(u){switch(u.event){case"update":o(A(e,JSON.parse(u.payload),s.accept));break;case"status.update":o(D(JSON.parse(u.payload)));break;case"delete":o(P(u.payload));break;case"notification":{const m=JSON.parse(u.payload);o(W(m,c,t)),o(J(m));break}case"notifications_merged":{o(M());break}case"conversation":o(j(JSON.parse(u.payload)));break;case"announcement":o(B(JSON.parse(u.payload)));break;case"announcement.reaction":o(R(JSON.parse(u.payload)));break;case"announcement.delete":o(x(u.payload));break}}}})};async function ce(e){await e(K({maxId:void 0}));try{await e(U())}catch{}await e(V())}const he=()=>h("home","user",{},{fallback:ce,fillGaps:F}),me=({onlyMedia:e}={})=>h(`community${e?":media":""}`,`public:local${e?":media":""}`,{},{fillGaps:()=>I({onlyMedia:e})}),ye=({onlyMedia:e,onlyRemote:i}={})=>h(`public${i?":remote":""}${e?":media":""}`,`public${i?":remote":""}${e?":media":""}`,{},{fillGaps:()=>H({onlyMedia:e,onlyRemote:i})}),de=(e,i,a,s)=>h(`hashtag:${e}${a?":local":""}`,`hashtag${a?":local":""}`,{tag:i},{accept:s}),ke=()=>h("direct","direct"),ge=e=>h(`list:${e}`,"list",{list:e},{fillGaps:()=>z(e)});export{ye as a,me as b,he as c,de as d,ke as e,ge as f};
//# sourceMappingURL=streaming-BDJNBh6w.js.map