1!function(o,t){"use strict";var e=o.get("ccmalogin");_.extend(e.prototype,{userCookieName:"_super3_user_",loginURL:"https://registre-super3.3cat.cat/super3/login",infoLogin:"https://registre-super3.3cat.cat/super3/consulta-sessio.json",loginModalURL:"https://registre-super3.3cat.cat/super3/login-modal",logoutURL:"https://registre-super3.3cat.cat/super3/logout",profileURL:"https://www.3cat.cat/tv3/sx3/",callbackURL:window.location.protocol+"//www.3cat.cat/usuaris/login.html",loginModalTemplate:"htmltwig.login.modal.sx3",profileModalTemplate:"htmltwig.dropcarnet.sx3",logoutModalTemplate:"htmltwig.login.modal.sx3",profileSx3:"",zona:"",dataNaixement:"",loginQualifio:function(o){o.preventDefault();$(o.currentTarget).find("button").attr("data-element");this.loginPopup("body",!1)},events:{openLogin:"loginQualifio","click .ccmalogin.loginbutton":"login","click .ccmalogin.logoutbutton":"logout","click .ccmalogin.profilebutton":"profile","click .ccmalogin.canvibutton":"canviProfile"},login:function(o){o.preventDefault();var t=$(o.currentTarget).hasClass("carnet"),e=parent.$("body").find(".sx3loginmodal").length>0;if($(o.currentTarget).hasClass("inmodal")){var i=$(o.currentTarget).find("button").attr("data-element");void 0!==i&&!1!==i||(i="body"),t?(e&&(parent.$("body").find(".sx3loginmodal").modal("hide"),parent.$("body").find(".ccmalogin.loginbutton").click()),this.loginPopup(i)):this.loginPopup(i)}else this.goToURL(this.loginURL)},loginPopup:function(o){var t=$(".sx3loginmodal"),e=this;t.length>0&&t.remove(),this.getTemplate(this.loginModalTemplate,function(t){$(o).append(t({url:e.loginModalURL+"?ret="+e.callbackURL})),$(".sx3loginmodal").modal("show"),$(".sx3loginmodal").on("hidden",function(o){$(document).trigger("cerrarModal")})})},logout:function(o){$(o.currentTarget).hasClass("inmodal")?this.logoutPopup(o):this.goToURL(this.logoutURL)},logoutPopup:function(){var o=$(".sp3logout"),t=this;o.length>0&&o.remove(),this.getTemplate(this.loginModalTemplate,function(o){$("body").append(o({url:t.logoutURL+"?ret="+t.callbackURL}))})},profile:function(){var o=$(".sx3loginmodal"),t=this;o.length>0&&o.remove(),this.getTemplate(this.profileModalTemplate,function(o){$(".modal_usuari").after(o({profileSx3:t.profileSx3,zona:t.profileSx3.toLowerCase(),usuari:t.user.username,nom:t.user.nom,cognoms:t.user.cognoms,imatge:t.user.foto,dataNaixement:t.dataNaixement})),t.$el.find("#barcode").length>0&&JsBarcode("#barcode",t.user.username,{format:"EAN8",width:4,height:40,displayValue:!1}),$(".sx3loginmodal").modal("show"),$(".sx3loginmodal").on("hidden",function(o){$(document).trigger("cerrarModal"),$("html").removeClass("dropCarnet-present")}),$("html").addClass("dropCarnet-present"),"registre-super3.3cat.cat"==document.location.hostname&&($(".ccmalogin").removeClass("inmodal"),$(".canvibutton").addClass("logoutbutton").removeClass("canvibutton"))})},canviProfile:function(o){var t=$(o.currentTarget).find("button").attr("data-element");void 0!==t&&!1!==t||(t="body"),$(".sx3loginmodal").modal("hide"),this.loginPopup(t)},registerPostMessageListeners:function(){var o=this;window.addEventListener("message",function(t){"https://www.3cat.cat"!==t.origin&&"http://www.3cat.cat"!==t.origin&&"https://registre-super3.3cat.cat"!==t.origin||"login"!==t.data||(o.checkUserFromCookie(),$(".sx3loginmodal").modal("hide"))})},onLogin:function(){this.getProfileSx3(),this.$el.find(".ccmalogin .imageuser").attr("src",this.user.foto),this.$el.find(".ccmalogin.loggedblock").show(),this.$el.find(".ccmalogin.loginblock").hide(),this.$el.find(".cap_sx3").addClass("C-usuariPresent")},onLogout:function(){this.$el.find(".ccmalogin.loginblock").show(),this.$el.find(".ccmalogin.loggedblock").hide(),this.$el.find(".cap_sx3").removeClass("C-usuariPresent")},checkUserFromCookie:function(){var o=this.getUserFromCookie();void 0===o||o.error?$(document).trigger("logoutRU"):$(document).trigger("loginRU",o)},getProfileSx3:function(){var o=this;$.get(this.infoLogin+"?access_token="+this.user.jsessionid,function(t){o.dataNaixement=t.datanaixement;var e=new Date,i=t.datanaixement.split("/");
1i=new Date(i[2]+"-"+i[1]+"-"+i[0]),o.profileSx3=e-i>2209032e5?"X3":"S3"})},goToURL:function(o){window.location.href=o+"?ret="+this.profileURL},getUserFromCookie:function(){var o=$.cookie(this.userCookieName);if(void 0!==o)return JSON.parse(o)}}),t.Moduls.login=_.extend({},t.Moduls.login,{type:"sp3",getUserCookie:function(){var o,t;return void 0!==(o=$.cookie("_super3_user_"))&&(t=JSON.parse(o)),t},isLogged:function(){var o=this.getUserCookie();return!(void 0===o||o.error)},getUser:function(){var o=this.getUserCookie(),t="";return void 0!==o&&void 0!==o.username&&(t=o.username),{idint:t,username:t}}})}(ModulJitpub,window);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.