// source --> https://www.haberizma.com/wp-content/themes/esenhaber/js/dl.js 
this.JSON||(this.JSON={}),function(){function f(t){return t<10?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var n,r,f,o,u,i=gap,a=e[t];switch(a&&"object"==typeof a&&"function"==typeof a.toJSON&&(a=a.toJSON(t)),"function"==typeof rep&&(a=rep.call(e,t,a)),typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";if(gap+=indent,u=[],"[object Array]"===Object.prototype.toString.apply(a)){for(o=a.length,n=0;n<o;n+=1)u[n]=str(n,a)||"null";return f=0===u.length?"[]":gap?"[\n"+gap+u.join(",\n"+gap)+"\n"+i+"]":"["+u.join(",")+"]",gap=i,f}if(rep&&"object"==typeof rep)for(o=rep.length,n=0;n<o;n+=1)"string"==typeof(r=rep[n])&&(f=str(r,a))&&u.push(quote(r)+(gap?": ":":")+f);else for(r in a)Object.hasOwnProperty.call(a,r)&&(f=str(r,a))&&u.push(quote(r)+(gap?": ":":")+f);return f=0===u.length?"{}":gap?"{\n"+gap+u.join(",\n"+gap)+"\n"+i+"}":"{"+u.join(",")+"}",gap=i,f}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var n,r,f=t[e];if(f&&"object"==typeof f)for(n in f)Object.hasOwnProperty.call(f,n)&&(r=walk(f,n),void 0!==r?f[n]=r:delete f[n]);return reviver.call(t,e,f)}var j;if(cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();window.DM||(DM={_apiKey:null,_session:null,_userStatus:"unknown",_refreshRequested:!1,_refreshCallbacks:[],_sessionLoadingMethod:null,_logging:!0,_domain:{api:"https://api.dailymotion.com",www:"//www.dailymotion.com",cdn:"//api.dmcdn.net"},_oauth:{logoutUrl:"https://www.dailymotion.com/oauth/logout",authorizeUrl:"https://www.dailymotion.com/oauth/authorize",tokenUrl:"https://graphql.api.dailymotion.com/oauth/token"},copy:function(o,t,n,e){for(var r in t)(n||void 0===o[r])&&(o[r]=e?e(t[r]):t[r]);return o},create:function(o,t){for(var n=window.DM,e=o?o.split("."):[],r=e.length,i=0;i<r;i++){var l=e[i],a=n[l];a||(a=t&&i+1==r?t:{},n[l]=a),n=a}return n},provide:function(o,t,n){return DM.copy("string"==typeof o?DM.create(o):o,t,n)},guid:function(){return"f"+(Math.random()*(1<<30)).toString(16).replace(".","")},log:function(o){DM._logging&&(window.Debug&&window.Debug.writeln?window.Debug.writeln(o):window.console&&window.console.log(o)),DM.Event&&DM.Event.fire("dm.log",o)},error:function(o){window.console&&window.console.error(o),DM.Event&&DM.Event.fire("dm.error",o)},$:function(o){return"string"==typeof o&&(o=document.getElementById(o)),o},parseBool:function(o){return!0===o||!1===o?o:0!==o&&("string"==typeof o?!o.match(/^(?:|false|no|off|0)$/i):!!o)},type:function(o){if(!DM._class2type){DM._class2type={};for(var t="Boolean Number String Function Array Date RegExp Object".split(" "),n=0,e=t.length;n<e;n++){var r=t[n];DM._class2type["[object "+r+"]"]=r.toLowerCase()}DM._class2type["[object Undefined]"]="undefined"}return null===o?String(o):DM._class2type[Object.prototype.toString.call(o)]||"object"}});DM.provide("JSON",{stringify:function(t){return window.Prototype&&Object.toJSON?Object.toJSON(t):JSON.stringify(t)},parse:function(t){return JSON.parse(t)},flatten:function(t){var n={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null===i||void 0===i)continue;n[r]="string"==typeof i?i:DM.JSON.stringify(i)}return n}});DM.provide("Array",{indexOf:function(r,n){if(r.indexOf)return r.indexOf(n);var e=r.length;if(e)for(var t=0;t<e;t++)if(r[t]===n)return t;return-1},merge:function(r,n){for(var e=0;e<n.length;e++)DM.Array.indexOf(r,n[e])<0&&r.push(n[e]);return r},flatten:function(r){for(var n in r)r.hasOwnProperty(n)&&"array"==DM.type(r[n])&&(r[n]=r[n].join(","));return r},filter:function(r,n){for(var e=[],t=0;t<r.length;t++)n(r[t])&&e.push(r[t]);return e},keys:function(r,n){var e=[];for(var t in r)(n||r.hasOwnProperty(t))&&e.push(t);return e},map:function(r,n){for(var e=[],t=0;t<r.length;t++)e.push(n(r[t]));return e},forEach:function(r,n,e){if(r)if("[object Array]"!==Object.prototype.toString.apply(r)&&(r instanceof Function||"number"!=typeof r.length))for(var t in r)(e||r.hasOwnProperty(t))&&n(r[t],t,r);else if(r.forEach)r.forEach(n);else for(var f=0,o=r.length;f<o;f++)n(r[f],f,r)}});DM.provide("Cookie",{_domain:null,_enabled:!1,setEnabled:function(e){DM.Cookie._enabled=e},getEnabled:function(){return DM.Cookie._enabled},getKeyValuePair:function(e){var o=e.indexOf("=");o=o<0?e.length:o;var n,t,a=e.substr(0,o),i=e.substr(o+1);try{n=decodeURIComponent(a)}catch(e){console.error("Could not decode cookie key: "+a)}try{t=decodeURIComponent(i)}catch(e){console.error("Could not decode cookie value: "+i)}return{key:n,value:t}},getCookieValue:function(e){for(var o=e+"=",n=document.cookie.split(";"),t=0;t<n.length;t++){for(var a=n[t];" "==a.charAt(0);)a=a.substring(1,a.length);if(0==a.indexOf(o))return a.substring(o.length,a.length)}return null},load:function(){var e,o,n=document.cookie.split("; ");return DM.Array.forEach(n,function(o){var n=DM.Cookie.getKeyValuePair(o);n.key.match("dms_"+DM._apiKey)&&(n.value=n.value.replace(/^"(.+(?="$))"$/,"$1"),e=n)}),e&&(o=DM.QS.decode(e.value),o.expires=parseInt(o.expires,10),DM.Cookie._domain=o.base_domain),o},setRaw:function(e,o,n){var t=(e+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent);document.cookie="dms_"+DM._apiKey+'="'+t+'"'+(t&&0==o?"":"; expires="+new Date(1e3*o).toGMTString())+"; path=/"+(n&&"localhost"!==n?"; domain=."+n:""),DM.Cookie._domain=n},setNeonCookies:function(e,o,n){if(void 0!==n){var t=new Date;t.setSeconds(t.getSeconds()+n);var a=new Date(t.getTime()),i=a.setSeconds(a.getSeconds()+7776e3);e&&(document.cookie="access_token="+e+"; expires="+new Date(t).toUTCString()+"; path=/"),o&&(document.cookie="refresh_token="+o+"; expires="+new Date(i).toUTCString()+"; path=/")}},set:function(e){e?DM.Cookie.setRaw(DM.QS.encode(e),e.expires,e.base_domain):DM.Cookie.clear()},clear:function(){DM.Cookie.setRaw("",0,DM.Cookie._domain)}});DM.provide("EventProvider",{subscribers:function(){return this._subscribersMap||(this._subscribersMap={}),this._subscribersMap},subscribe:function(s,r){var i=this.subscribers();i[s]?i[s].push(r):i[s]=[r]},unsubscribe:function(s,r){var i=this.subscribers()[s];DM.Array.forEach(i,function(s,t){s==r&&(i[t]=null)})},monitor:function(s,r){if(!r()){var i=this,t=function(){r.apply(r,arguments)&&i.unsubscribe(s,t)};this.subscribe(s,t)}},clear:function(s){delete this.subscribers()[s]},fire:function(){var s=Array.prototype.slice.call(arguments),r=s.shift();DM.Array.forEach(this.subscribers()[r],function(r){r&&r.apply(this,s)})}}),DM.provide("Event",DM.EventProvider);DM.provide("",{init:function(e){if(e=DM.copy(e||{},{logging:!0}),DM._apiKey=e.apiKey,!e.logging&&window.location.toString().indexOf("dm_debug=1")<0&&(DM._logging=!1),DM._apiKey){DM._apiSecret=e.apiSecret||null,DM.Cookie.setEnabled(e.cookie),DM.Auth.readFragment();var o,i=DM.Auth.loadSiteSession();null!==i.session?(o=i.session,DM._sessionLoadingMethod=i.loading_method):e.session?(o=e.session,DM._sessionLoadingMethod="init_options"):DM.Auth._receivedSession?(o=DM.Auth._receivedSession,DM._sessionLoadingMethod="fragment"):(o=DM.Cookie.load(),DM._sessionLoadingMethod="local_cookies"),null!==o&&DM.Auth.isSessionExpired(o)?DM.Auth.refreshToken(o,function(){e.status&&DM.getLoginStatus()}):DM.Auth.setSession(o,o?"connected":"unknown"),e.status&&DM.getLoginStatus()}}});window.setTimeout(function(){window.dmAsyncInit&&dmAsyncInit()},0);DM.provide("QS",{encode:function(n,e,o){e=void 0===e?"&":e,o=!1===o?function(n){return n}:encodeURIComponent;var r=[];return DM.Array.forEach(n,function(n,e){null!==n&&void 0!==n&&r.push(o(e)+"="+o(n))}),r.sort(),r.join(e)},decode:function(n){for(var e=n.split("&"),o=decodeURIComponent,r={},t=0;t<e.length;t+=1){var i=e[t].indexOf("=");if(!(i<0))for(var d=o(e[t].substring(0,i)).replace(/\]/g,"").split("["),u=o(e[t].substring(i+1)),c=r;d.length>0;){var f=d.shift();0!==f.length&&(0===d.length?c[f]=u:void 0===c[f]&&(c[f]={}),c=c[f])}}return r}});DM.provide("",{api:function(){DM.ApiServer.call.apply(DM.ApiServer,arguments)}}),DM.provide("ApiServer",{type:null,METHODS:["get","post","delete"],_callbacks:{},_calls:[],call:function(){for(var e,r,t,a=Array.prototype.slice.call(arguments),s=a.shift(),i=a.shift(),o=!1;void 0!==i;){var n=typeof i;if("string"!==n||e)if("function"!==n||t)if("object"!==n||r){if("boolean"!==n||o)return void DM.log("Invalid argument passed to DM.api(): "+i);o=i}else r=DM.ApiServer.formatCallParams(i);else t=i;else e=i.toLowerCase();i=a.shift()}if(e=e||"get",r=r||{},"/"===s[0]&&(s=s.substr(1)),DM.Array.indexOf(DM.ApiServer.METHODS,e)<0)return void DM.log("Invalid method passed to DM.api(): "+e);DM.ApiServer.transport(s,e,r,t,o)},formatCallParams:function(e){var r=e.subrequests,t=[],a="";if(r){var s=DM.type(r);if("object"!=s)throw new Error('Unexpected type "'+s+'" for "subrequests" parameter. Expected type: object');for(fieldName in r){var i=r[fieldName],o=[];o.push(fieldName+".fields("+(i.fields||[]).join(",")+")"),delete i.fields;for(subRequestParam in i)o.push(subRequestParam+"("+i[subRequestParam]+")");o.length&&t.push(o.join("."))}delete e.subrequests}if(t.length&&(a=t.join(",")),e.fields){var n=DM.type(e.fields);if("array"==n)e.fields.push(a),e.fields=e.fields.join(",");else{if("string"!=n)throw new Error('Unexpected type "'+n+'"  for "fields" parameter, Allowed types: array, string');e.fields.length?e.fields+=","+a:e.fields=a}}else a&&(e.fields=a);return e},getSimpleCallURL:function(e,r){var t=DM.QS.encode(r),a=t.length?(e.indexOf("?")>-1?"&":"?")+t:"";return DM._domain.api+"/"+e+a},transport:function(e,r,t,a,s){try{DM.ApiServer.xhr(),DM.ApiServer.transport=DM.ApiServer.ajax,DM.ApiServer.type="ajax"}catch(e){DM.ApiServer.transport=DM.ApiServer.jsonp,DM.ApiServer.type="jsonp"}DM.ApiServer.transport(e,r,t,a,s)},jsonp:function(e,r,t,a){var s,i=DM.guid(),o=document.createElement("script");t.method=r,t.callback="DM.ApiServer._callbacks."+i;var n=DM.getSession();n&&n.access_token&&!t.access_token&&(t.access_token=n.access_token),t=DM.Array.flatten(t);var l=DM.ApiServer.getSimpleCallURL(e,t);if(l.length>2e3)throw new Error("JSONP only support a maximum of 2000 bytes of input.");DM.ApiServer._callbacks[i]=function(e){a&&a(e),delete DM.ApiServer._callbacks[i],o.src=null,o.parentNode.removeChild(o),s&&(clearTimeout(s),s=null)},o.async=!0,o.src=l,document.getElementsByTagName("head")[0].appendChild(o),s=setTimeout(function(){DM.ApiServer._callbacks[i]({error:{code:500,message:"The request has timed out",type:"transport_error"}})},5e3)},ajax:function(e,r,t,a,s){var i={path:e,method:r,params:t,cb:a};s?DM.ApiServer.performSimpleCall(e,r,t,a):(DM.ApiServer._calls.push(i),DM.ApiServer.ajaxHandleQueue())},ajaxHandleQueue:function(){!DM.ApiServer._callTimeout&&DM.ApiServer._calls.length>0?DM.ApiServer._callTimeout=setTimeout(function(){DM.ApiServer.performMultipleCalls(DM.ApiServer._calls),DM.ApiServer._calls=[],delete DM.ApiServer._callTimeout},0):10==DM.ApiServer._calls.length&&(DM.ApiServer._callTimeout&&(clearTimeout(DM.ApiServer._callTimeout),delete DM.ApiServer._callTimeout),DM.ApiServer.performMultipleCalls(DM.ApiServer._calls),DM.ApiServer._calls=[])},performSimpleCall:function(e,r,t,a){if(DM._session&&DM.Auth.isSessionExpired())return void DM.Auth.refreshToken(DM._session,function(s){if(s.error)return void(a&&a(s));DM.ApiServer.performSimpleCall(e,r,t,a)});var s=DM.getSession();s&&s.access_token&&!t.access_token&&(t.access_token=s.access_token),t=DM.Array.flatten(t);var i=DM.ApiServer.getSimpleCallURL(e,t),o=DM.ApiServer.xhr();o.open(r,i),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(),o.onreadystatechange=function(){if(4==o.readyState){var e,r={error:{code:500,message:"Invalid server response",type:"transport_error"}};if(o.status)try{e=DM.JSON.parse(o.responseText)}catch(e){}"object"!=DM.type(e)&&(e=r,DM.error("Cannot parse call response data "+o.responseText)),a&&a(e)}}},performMultipleCalls:function(e){for(var r=[],t=DM._domain.api,a=0,s=e.length;a<s;a++){var i=e[a];r.push({call:i.method.toUpperCase()+" /"+i.path,args:i.params,id:a})}if(DM._session&&DM.Auth.isSessionExpired())return void DM.Auth.refreshToken(DM._session,function(r){if(r.error)return void DM.Array.forEach(e,function(e){e&&e.cb&&e.cb(r)});DM.ApiServer.performMultipleCalls(e)});var o=DM.getSession();o&&o.access_token&&(t+="?access_token="+encodeURIComponent(o.access_token));var n=DM.ApiServer.xhr();n.open("POST",t),n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(DM.JSON.stringify(r)),n.onreadystatechange=function(){if(4==n.readyState){var r,t={error:{code:500,message:"Invalid server response",type:"transport_error"}};if(n.status)try{r=DM.JSON.parse(n.responseText)}catch(e){}var a=DM.type(r);if("array"==a)for(var s=0,o=r.length;s<o;s++){var l=r[s];i="id"in l&&e[l.id]?e[l.id]:null,i?(i.cb&&("result"in l?i.cb(l.result):"error"in l?i.cb({error:l.error}):i.cb({error:{code:500,message:"Missing result or error key",type:"transport_error"}})),e[l.id]=null):DM.error("Response with no valid call id: "+DM.JSON.stringify(l))}else"object"==a&&"error"in r?t=r:DM.error("Cannot parse multicall response data "+n.responseText);DM.Array.forEach(e,function(e){e&&e.cb&&e.cb(t)})}}},xhr:function(){var e=new window.XMLHttpRequest;if(!("withCredentials"in e))throw new Error("Browser is not CORS capable");return e}});DM.provide("",{getLoginStatus:function(e){e&&DM.Auth.refreshToken(DM._session,function(t){e({status:DM._userStatus,session:t})})},getSession:function(){return DM.Auth.isSessionExpired()&&DM.Auth.setSession(null,"notConnected"),DM._session},login:function(e,t){var n=void 0!==window.screenX?window.screenX:window.screenLeft,o=void 0!==window.screenY?window.screenY:window.screenTop,s=void 0!==window.outerWidth?window.outerWidth:document.documentElement.clientWidth,i=void 0!==window.outerHeight?window.outerHeight:document.documentElement.clientHeight-22,r=parseInt(n+(s-500)/2,10),a=parseInt(o+(i-520)/2.5,10),c="width=500,height=520,left="+r+",top="+a+",status,scrollbars=yes";if(t=DM.copy(t||{},{client_id:DM._apiKey,response_type:"token",display:"popup",scope:"",redirect_uri:document.location.href,state:"dmauth_"+DM.guid()}),"popup"===t.display){var u=window.open(DM._oauth.authorizeUrl+"?"+DM.QS.encode(t),"dmauth",c);DM.Auth._active[t.state]={cb:e||function(){},win:u},DM.Auth._popupMonitor()}else location.href=DM._oauth.authorizeUrl+"?"+DM.QS.encode(t)},logout:function(e){var t,n=DM._oauth.logoutUrl,o=DM.getSession(),s=[];o&&o.access_token&&(s.push("access_token="+encodeURIComponent(o.access_token)),t="_"+o.access_token+"_logout",window[t]=function(n){"array"!=DM.type(n)||n.length?e(n):(e({}),DM.Auth.setSession(null,"notConnected")),window[t]=null},s.push("callback="+t));var i=document.getElementById("dm_l_o_sc");i&&i.parentNode.removeChild(i),i=document.createElement("script"),i.type="text/javascript",i.id="dm_l_o_sc",document.body.appendChild(i),i.src=n+(s.length?"?"+s.join("&"):"")}}),DM.provide("Auth",{_active:{},_receivedSession:null,loadSiteSession:function(){var e=!0,t={},n={session:null,loading_method:null};if(window.location.host.match(/dailymotion\.com$/)){var o=DM.Cookie.getCookieValue("sid"),s=DM.Cookie.getCookieValue("access_token"),i=DM.Cookie.getCookieValue("refresh_token");i&&(t.refresh_token=i,e=!1);var r="neon_cookie";s&&(t.access_token=s,e=!1),i||s||!o||(t.access_token=o,r="sid_cookie",e=!1),i&&!t.access_token&&(t.expires=Math.round((new Date).getTime()/1e3)-10)}return e||(n.session=t,n.loading_method=r),n},refreshToken:function(e,t){if(t=t||function(){},DM._refreshCallbacks.push(t),!DM._refreshRequested){DM._refreshRequested=!0;var n=function(e){for(;DM._refreshCallbacks.length>0;){DM._refreshCallbacks.pop()(e)}DM._refreshRequested=!1};if(!DM.Auth.isSessionExpired(e))return void n(e);if(DM._apiKey&&DM._apiSecret&&e&&e.refresh_token){var o=DM.ApiServer.xhr(),s={grant_type:"refresh_token",client_id:DM._apiKey,client_secret:DM._apiSecret,refresh_token:e.refresh_token},i=DM.QS.encode(s);o.open("POST",DM._oauth.tokenUrl),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(i),o.onreadystatechange=function(){if(4==o.readyState){var e,t={error:{code:500,message:"Invalid server response",type:"transport_error"}};if(o.status)try{e=DM.JSON.parse(o.responseText)}catch(e){}"object"!=DM.type(e)&&(e=t,DM.error("Cannot parse call response data "+o.responseText)),o.status&&200!==o.status&&(e=t);var s=e.access_token?e:null;DM.Auth.setSession(s,s?"connected":"notConnected"),n(e)}}}else n(e)}},readFragment:function(){var e=window.location.hash.replace("%23","#"),t=e.substr(e.lastIndexOf("#")+1);if(t.indexOf("access_token=")>=0||t.indexOf("error=")>=0){var n=DM.QS.decode(t);window.opener&&window.opener.DM.Auth.setSession&&"dmauth"==window.name&&"dmauth"!=window.opener.name?(document.documentElement.style.display="none",window.opener.DM.Auth.recvSession(n)):n&&"state"in n&&0==n.state.indexOf("dmauth_")&&("access_token"in n&&(DM.Auth._receivedSession=n),window.location.hash=e.substr(0,e.lastIndexOf("#")))}},recvSession:function(e){if(e||DM.error("Received invalid session"),"error"in e&&DM.error("Received auth error `"+e.error+"': "+e.error_description),!("state"in e))return void DM.error("Received a session with not `state' field");if(!(e.state in DM.Auth._active))return void DM.error("Received a session from an inactive window");var t;if(e){t={};for(k in e)t[k]=e[k]}else t=e;DM.Auth._active[e.state].session=t},setSession:function(e,t){var n=!DM._session&&e,o=DM._session&&!e,s=n||o||DM._session&&e&&DM._session.access_token!=e.access_token,i=t!=DM._userStatus;if(e&&"expires_in"in e){e.expires=Math.round((new Date).getTime()/1e3)+parseInt(e.expires_in,10);var r=parseInt(e.expires_in,10);delete e.expires_in}var a={session:e,status:t};return DM._session=e,DM._userStatus=t,s&&DM.Cookie&&DM.Cookie.getEnabled()&&DM.Cookie.set(e),"neon_cookie"===DM._sessionLoadingMethod&&DM.Cookie.setNeonCookies(e.access_token,e.refresh_token,r),i&&DM.Event.fire("auth.statusChange",a),o&&DM.Event.fire("auth.logout",a),n&&DM.Event.fire("auth.login",a),s&&DM.Event.fire("auth.sessionChange",a),a},isSessionExpired:function(e,t){return void 0===e&&(e=DM._session),void 0===t&&(t=DM._sessionLoadingMethod),!e||("neon_cookie"===t?!DM.Cookie.getCookieValue("access_token"):e&&"expires"in e&&(new Date).getTime()>1e3*e.expires)},_popupMonitor:function(){for(var e in DM.Auth._active){if("win"in DM.Auth._active[e])try{DM.Auth._active[e].win.closed&&(delete DM.Auth._active[e].win,DM.Auth.recvSession({error:"access_denied",error_description:"Client closed the window",state:e}))}catch(e){}if("session"in DM.Auth._active[e]){var t=DM.Auth._active[e];delete DM.Auth._active[e];var n=t.session;"access_token"in n?DM.Auth.setSession(n,"connected"):DM.Auth.setSession(null,"notConnected"),"win"in t&&t.win.close(),"cb"in t&&t.cb({status:DM._userStatus,session:DM._session})}}var o=!1;for(var e in DM.Auth._active){o=!0;break}o&&!DM.Auth._popupInterval?DM.Auth._popupInterval=window.setInterval(DM.Auth._popupMonitor,100):!o&&DM.Auth._popupInterval&&(window.clearInterval(DM.Auth._popupInterval),DM.Auth._popupInterval=null)}});DM.provide("",{player:function(e,t){return DM.Player.create(e,t)}}),DM.provide("Player",{_INSTANCES:{},_INTERVAL_ID:null,_PROTOCOL:null,API_MODE:null,EVENT_HANDLERS:{},apiReady:!1,autoplay:!1,currentTime:0,bufferedTime:0,duration:NaN,seeking:!1,error:null,ended:!1,muted:!1,volume:1,paused:!0,fullscreen:!1,controls:void 0,rebuffering:!1,qualities:[],quality:void 0,subtitles:[],subtitle:void 0,video:null,play:function(){this.api("play")},togglePlay:function(){this.api("toggle-play")},pause:function(){this.api("pause")},seek:function(e){this.api("seek",e)},load:function(e,t){this.api("load",e,t)},setMuted:function(e){this.api("muted",e)},toggleMuted:function(){this.api("toggle-muted")},setVolume:function(e){this.api("volume",e)},setQuality:function(e){this.api("quality",e)},setSubtitle:function(e){this.api("subtitle",e)},setFullscreen:function(e){this.api("fullscreen",e)},setControls:function(e){this.api("controls",e)},toggleControls:function(){this.api("toggle-controls")},setProp:function(){this.api.apply(this,["set-prop"].concat([].slice.call(arguments)))},watchOnSite:function(e){this.api("watch-on-site")},api:function(e){var t=2<=arguments.length?[].slice.call(arguments,1):[];this._send(e,t)},create:function(e,t){if(!(e=DM.$(e))||1!=e.nodeType)throw new Error("Invalid first argument sent to DM.player(), requires a HTML element or element id: "+e);if(!t||"object"!=typeof t)throw new Error("Missing `options' parameter for DM.player()");if(t=DM.copy(t,{width:480,height:270,title:"video player",params:{},events:{}}),location.search.length>1&&-1!==location.search.indexOf("dm:params")){var i=DM.QS.decode(location.search.substr(1));"dm:params"in i&&(t.params=DM.copy(DM.QS.decode(i["dm:params"]),t.params))}DM._domain.www=DM._domain.www.replace(/^https?\:/,""),DM.Player._PROTOCOL=window.location&&/^https?:$/.test(window.location.protocol)?window.location.protocol:"http:";var a=document.createElement("iframe");if(DM.Array.forEach(["id","style","class"],function(t){var i=e.getAttribute(t);i&&a.setAttribute(t,i)}),a.setAttribute("frameborder","0"),a.setAttribute("allowfullscreen","true"),a.setAttribute("webkitallowfullscreen","true"),a.setAttribute("mozallowfullscreen","true"),a.title="Dailymotion "+t.title,a.type="text/html",a.width=t.width,a.height=t.height,e.parentNode.replaceChild(a,e),DM.copy(a,DM.Player),a.init(t.video,t.params),"object"==typeof t.events)for(var s in t.events)a.addEventListener(s,t.events[s],!1);return a},init:function(e,t){DM.Player._installHandlers(),t="object"==typeof t?t:{},t.api=DM.Player.API_MODE,location.origin?t.origin=location.origin:t.origin="*",DM._apiKey&&(t.apiKey=DM._apiKey),this.id=t.id=this.id?this.id:DM.guid(),this.src=DM.Player._PROTOCOL+DM._domain.www+"/embed"+(e?"/video/"+e:"")+"?"+DM.QS.encode(t),DM.Player._INSTANCES[this.id]!=this&&(DM.Player._INSTANCES[this.id]=this,this.addEventListener("unload",function(){delete DM.Player._INSTANCES[this.id]})),this.autoplay=DM.parseBool(t.autoplay)},_installHandlers:function(){if(null===DM.Player.API_MODE&&window.postMessage){DM.Player.API_MODE="postMessage";var e=function(e){if(e.origin&&0===e.origin.indexOf(DM.Player._PROTOCOL+DM._domain.www)){var t=DM.QS.decode(e.data);if(t.id&&t.event){DM.$(t.id)._recvEvent(t)}}};window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e)}},_send:function(e,t){if(this.apiReady)"postMessage"==DM.Player.API_MODE&&this.contentWindow.postMessage(JSON.stringify({command:e,parameters:t||[]}),DM.Player._PROTOCOL+DM._domain.www);else try{console&&"function"==typeof console.warn&&console.warn('Player not ready. Ignoring command : "'+e+'"')}catch(e){}},_dispatch:document.createEvent?function(e){var t=document.createEvent("HTMLEvents");t.initEvent(e,!0,!0),this.dispatchEvent(t)}:function(e){if("on"+e in this)t=document.createEventObject(),this.fireEvent("on"+e,t);else if(e in this.EVENT_HANDLERS){var t={type:e,target:this};DM.Array.forEach(this.EVENT_HANDLERS[e],function(e){e(t)})}},_recvEvent:function(e){switch(e.event){case"apiready":if(this.apiReady)return;this.apiReady=!0;break;case"start":this.ended=!1;break;case"loadedmetadata":this.error=null;break;case"timeupdate":case"ad_timeupdate":this.currentTime=parseFloat(e.time);break;case"progress":this.bufferedTime=parseFloat(e.time);break;case"durationchange":this.duration=parseFloat(e.duration);break;case"seeking":this.seeking=!0,this.currentTime=parseFloat(e.time);break;case"seeked":this.seeking=!1,this.currentTime=parseFloat(e.time);break;case"fullscreenchange":this.fullscreen=DM.parseBool(e.fullscreen);break;case"controlschange":this.controls=DM.parseBool(e.controls);break;case"volumechange":this.volume=parseFloat(e.volume),this.muted=DM.parseBool(e.muted);break;case"video_start":case"ad_start":case"ad_play":case"playing":case"play":this.paused=!1;break;case"end":this.ended=!0;break;case"ad_pause":case"ad_end":case"video_end":case"pause":this.paused=!0;break;case"error":this.error={code:e.code,title:e.title,message:e.message};break;case"rebuffer":this.rebuffering=DM.parseBool(e.rebuffering);break;case"qualitiesavailable":this.qualities=e.qualities;break;case"qualitychange":this.quality=e.quality;break;case"subtitlesavailable":this.subtitles=e.subtitles;break;case"subtitlechange":this.subtitle=e.subtitle;break;case"videochange":this.video={videoId:e.videoId,title:e.title}}this._dispatch(e.event)},addEventListener:function(e,t,i){"on"+e in this&&this.attachEvent?this.attachEvent("on"+e,t,i):(e in this.EVENT_HANDLERS||(this.EVENT_HANDLERS[e]=[]),this.EVENT_HANDLERS[e].push(t))}});