function CheckPopUpMigration(){}function pad(n,t){return n=n.toString(),n.length<t?pad("0"+n,t):n}var LP,SessionDetailsServiceModule;(function(n){"use strict";function t(n){return typeof n!="undefined"}n.isDefined=t})(LP=LP||{}),function(n){"use strict";function t(n){var i={},t,r;for(t in n)n.hasOwnProperty(t)&&(r=n[t],i[r]||(i[r]=t));return i}function i(n){var t;if(t=function(){switch(!1){case n.toLowerCase()!=="true":return!0;case n.toLowerCase()!=="false":return!1}}(),typeof t=="boolean")return t}n.parseEnum=t,n.parseBoolean=i}(LP=LP||{}),function(n){"use strict";var t={Continue:100,SwitchingProtocols:101,Processing:102,OK:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,IMUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,RequestEntityTooLarge:413,RequestURITooLong:414,UnsupportedMediaType:415,RequestedRangeNotSatisfiable:416,ExpectationFailed:417,ImaTeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,ConnectionClosedWithoutResponse:444,UnavailableForLegalReasons:451,InvalidToken:498,ClientClosedRequest:499,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HTTPVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,SiteIsFrozen:530,NetworkConnectTimeoutError:599,Unreachable:0,Failure:-1};t.__values=LP.parseEnum(t),n.HttpStatusCodes=t}(LP.enums=LP.enums||{}),function(n){"use strict";function i(n,t){return n=n+"",n.indexOf(t)===0}function r(n){return n===t.Unreachable||n===t.Failure}function u(n){return i(n,2)}function f(n){return i(n,4)}function e(n){return i(n,5)}function o(n,i){var r=t.__values[n];return"["+n+" "+r+"] requested url: "+i}var t=LP.enums.HttpStatusCodes;n.http={formatStatusCodeString:o,is2xxCode:u,is4xxCode:f,is5xxCode:e,isExceptionalCode:r}}(LP.helpers=LP.helpers||{}),$(function(){"use strict";$(document).ajaxError(function(n,t,i){var u,f,e;try{if(u=LP.helpers.http,f=LP.enums.HttpStatusCodes,console.error(i.type+" "+t.statusText+" "+t.status+" "+i.url),e=u.formatStatusCodeString(t.status,i.url),n.request=i.data||null,typeof Logger!="undefined")try{switch(t.status){case f.Forbidden:case f.Failure:case f.NotFound:Logger.Error(e,null,n);break;default:u.is4xxCode(t.status)||u.is5xxCode(t.status)||u.isExceptionalCode(t.status)?Logger.Error(e,null,n):u.is3xxCode(t.status)&&Logger.Warning(e,null,n)}}catch(o){}}catch(s){}}),typeof antiForgeryToken!="undefined"&&$(document).ajaxSend(function(n,t,i){(i.url===null||i.url.toLowerCase().indexOf("conchatserver")===-1)&&t.setRequestHeader("AntiForgeryToken",antiForgeryToken)})}),function(){"use strict";window.addEventListener("error",function(n){if(typeof Logger!="undefined")try{Logger.Error(n.message,!1,n)}catch(t){}})}(),function(){$type=String,$type.__typeName="String",$type.__class=!0,$prototype=$type.prototype,$prototype.endsWith=function(n){return this.substr(this.length-n.length)===n},$prototype.startsWith=function(n){return this.substr(0,n.length)===n},$prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")},$prototype.trimEnd=function(){return this.replace(/\s+$/,"")},$prototype.trimStart=function(){return this.replace(/^\s+/,"")},$type.format=function(){return String._toFormattedString(!1,arguments)},$type._toFormattedString=function(n,t){for(var f="",e=t[0],o,u,c,r,i=0;;){if(o=e.indexOf("{",i),u=e.indexOf("}",i),o<0&&u<0){f+=e.slice(i);break}if(u>0&&(u<o||o<0)){if(e.charAt(u+1)!=="}")throw new Error("format stringFormatBraceMismatch");f+=e.slice(i,u+1),i=u+2;continue}if(f+=e.slice(i,o),i=o+1,e.charAt(i)==="{"){f+="{",i++;continue}if(u<0)throw new Error("format stringFormatBraceMismatch");var s=e.substring(i,u),h=s.indexOf(":"),l=parseInt(h<0?s:s.substring(0,h),10)+1;if(isNaN(l))throw new Error("format stringFormatInvalid");c=h<0?"":s.substring(h+1),r=t[l],(typeof r=="undefined"||r===null)&&(r=""),f+=r.toFormattedString?r.toFormattedString(c):n&&r.localeFormat?r.localeFormat(c):r.format?r.format(c):r.toString(),i=u+1}return f}}(window),function(n){"use strict";function r(n){var i=t.serviceHost+t.serviceUrl+n;return i.indexOf("http")===-1&&(i="https://"+i),i}function i(n,i,u,f){if(t.inProgress[n])return null;t.inProgress[n]=!0;var e=r(n);$.ajax({type:"POST",url:e,data:i,dataType:"json",xhrFields:{withCredentials:!0},xhr:function(){var n=new window.XMLHttpRequest;return n.upload.addEventListener("progress",function(n){if(n.lengthComputable){var t=n.loaded/n.total;u&&u.inProgress&&u.inProgress(t)}},!1),n.addEventListener("progress",function(n){if(n.lengthComputable){var t=n.loaded/n.total;u&&u.inProgress&&u.inProgress(t)}},!1),n},beforeSend:function(){u&&u.beforeSend&&u.beforeSend()},success:function(i){var r=f?f(i.status):"";i&&(i.errorMessage=r),u&&u.success&&u.success(i),setTimeout(function(){t.inProgress[n]=!1},2e3)},complete:function(){u&&u.complete&&u.complete()},error:function(i){u&&u.error&&u.error(i),setTimeout(function(){t.inProgress[n]=!1},2e3)}})}function u(n){t.serviceHost=n;var r=function(n){var t={Failed:1,InvalidModel:2,MemberDoesntExist:3,InvalidPhoneNumber:4},i="";switch(parseInt(n)){case t.Failed:i="Something went wrong. Please try again later.";break;case t.InvalidModel:case t.MemberDoesntExist:i="Request is invalid. Please try again later.";break;case t.InvalidPhoneNumber:i="Phone number is not valid. Please try again."}return i};this.createSendMessageRequestObj=function(n,t){return{toDestinationID:n,content:t}},this.createUpdateSubscriptionRequestObj=function(n,t,i){return{setToEnable:n,phoneNumberVm:{countryCode:t,phone:i}}},this.sendMessage=function(n,r){var u=function(n){var t={Failed:1,InvalidModel:2,InvalidMessage:3,MemberDoesntExist:4,ExpertDoesntExist:5,MemberDidntConsultWithExpert:6,ConversationBlocked:7},i="";switch(parseInt(n)){case t.Failed:i="Something went wrong. Please try again later.";break;case t.InvalidModel:case t.InvalidMessage:i="Message is invalid. Please try again.";break;case t.MemberDoesntExist:i="We can't find this member. Please try again later.";break;case t.ExpertDoesntExist:i="We can’t find this expert. Please try again later.";break;case t.MemberDidntConsultWithExpert:i="You can only message an expert after a session with him.";break;case t.ConversationBlocked:i="New message cannot be sent at this time."}return i};i(t.serviceMethod.SEND_MESSAGE,n,r,u)},this.isSubscribedToSmsNotification=function(n){i(t.serviceMethod.IS_SUBSCRIBED,{},n,r)},this.updateSmsNotficationSubscription=function(n,u){i(t.serviceMethod.UPDATE_SUBSCRIPTION,n,u,r)},this.countUnreadInboxConversations=function(n){i(t.serviceMethod.COUNT_UNREAD_INBOX,{},n,r)}}var t={serviceHost:"",serviceUrl:"/Member/InstantMessages/",serviceMethod:{SEND_MESSAGE:"SendMessage",IS_SUBSCRIBED:"IsSubscribedToSmsNotification",UPDATE_SUBSCRIPTION:"UpdateSmsNotficationSubscription",COUNT_UNREAD_INBOX:"CountUnreadInboxConversations"},inProgress:{}};n.InstantMessagesService=u}(LP.services=LP.services||{}),SessionDetailsServiceModule=function(){"use strict";function r(t){return n.serviceUrl+"/"+t}function u(n,t,i,u){var e=function(n){console.error(n.responseText)},f;n.type==="GET"?(f=r(n.name)+(t?"?"+t:""),$.ajax({type:n.type,url:f,cache:!1,dataType:"text",success:i,error:u?u:e})):n.type==="POST"}function t(){return n.serviceRoot}var n={},i={UPDATE_MEMBER_PAID_SESSIONS:{name:"UpdateMemberPaidSessionsCount",type:"GET"}};return n.setServiceRoot=function(i){n.serviceRoot=i,n.serviceUrl=t()+"SessionDetailsProvider.svc"},n.setServiceRoot("/Touch.Services/"),n.serviceUrl=t()+"SessionDetailsProvider.svc",n.method="POST",n.updateMemberPaidSessionsCount=function(n){u(i.UPDATE_MEMBER_PAID_SESSIONS,n?"hireExpert=true":null,function(n){var t=JSON.parse(n)})},n}()