// Realtime Cloud Messaging JavaScript Library // Copyright 2015, Realtime.co // // Visit us at framework.realtime.co and learn more. // // Date: Wed May 13 2015 16:16 v2.1.22 var IbtRealTimeSJType="IbtRealTimeSJ";function loadOrtcFactory(h,k){var a=new OrtcFactory(h);k(a,null)}function OrtcFactory(){this.createClient=function(){return new IbtRealTimeSJ}} function OrtcError(h){this.code=h;switch(h){case 1:this.message="Was not possible to load the kaazing api";break;case 2:this.message="Was not possible to load the socket.io api";break;case 3:this.message="Is not possible to load more than one factory of each ORTC type";break;case 4:this.message="Unknown ORTC type";break;case 5:this.message="Pusher key is not defined";break;case 6:this.message="Was not possible to load the pusher api";break;default:this.message="Unknown error"}} String.prototype.ortcTreatUrl=function(){var h=this;h&&(h=h.replace(/\s+/g,""),"/"==h.charAt(h.length-1)&&(h=h.substring(0,h.length-1)));return h};function ortcIsValidUrl(h){return/^\s*(http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?\s*$/.exec(h)?!0:!1}function ortcIsValidInput(h){return/^[\w-:\/\.]*$/.exec(h)?!0:!1}function ortcIsValidBoolean(h){return/^(true|false|0|1)$/.exec(h)?!0:!1}function ortcIsFunction(h){return"function"==typeof h?!0:!1} function ortcIsString(h){return"string"==typeof h?!0:!1}function ortcIsArray(h){return h instanceof Array}function ortcStrToArray(h){try{return h=h.replace(/[^\w,]/gi,""),0a?"0"+a:a}"use strict";"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var A=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, w=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,l,B,H={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},y;"function"!=typeof JSON.stringify&&(JSON.stringify=function(a,k,s){var x;B=l="";if("number"==typeof s)for(x=0;x=a};a.countRTO=function(a){var e;return 100e;e++)c.push(String.fromCharCode(e));b=(y.lastIndex=0,c.join("").replace(y,function(c){return d[c]="\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4),""}),y.lastIndex=0,d)}a=a.replace(y,function(d){return b[d]})}return a};var s="websocket xdr-streaming xhr-streaming iframe-eventsource iframe-htmlfile xdr-polling xhr-polling iframe-xhr-polling jsonp-polling".split(" "); a.probeProtocols=function(){for(var a={},e=0;e