define("vgtv-full/models/vg-tv-model",["jquery","backbone"],function(t,e){var i=e.Model.extend({defaults:{additional:null,articleUrl:null,assetType:"",category:{id:0,parseId:0,title:""},description:"",descriptionFront:"",duration:0,id:0,images:{front:null,main:""},published:0,status:"",title:"",titleFront:null},getImageUrlFromImageURI:function(t){return t+"?t[]=306x172q80"},parse:function(t){return{id:t.id,imageUrl:this.getImageUrlFromImageURI(t.images.main),title:t.title}}});return i}),define("vgtv-full/collections/vg-tv-collections",["jquery","backbone","underscore","vgtv-full/models/vg-tv-model"],function(t,e,i,n){var s=e.Collection.extend({model:n,initialize:function(t,e){this.url=e,this.refreshCollection()},refreshCollection:function(t){t=i.defaults({error:function(){console.error('Widget "VGTV-full": Failed at fetching collection')},cache:!0}),this.fetch(t)},setItem:function(t){return this.item=t,this},getItem:function(){return this.item},setUrl:function(t){return this.url=t,this},parse:function(t){return t.assets?t.assets:t._embedded&&t._embedded.assets?t._embedded.assets:[]}});return s}),define("text!vgtv-full/templates/main.tpl",[],function(){return'
\n \n \n
\n\n'}),define("vgtv-full/scripts/xiti-tracking",["jquery","backbone","underscore","utils","statistics"],function(t,e,i,n,s){var l=new s,r={trackTabClick:function(e){var i=t.trim(t(e.currentTarget).text()).toLowerCase();l.actionClick(e,"Bottom::VGTV::"+i)},trackMovieClick:function(e){var i=t(e.currentTarget),n=t.trim(i.find(".movie-title").text()).replace(/\:/g,"_"),s=i.attr("href").split("=")[1];l.navigationClick(e,"Bottom::VGTV::"+n+"_"+s)}};return r}),define("vgtv-full/views/main",["jquery","backbone","underscore","vgtv-full/collections/vg-tv-collections","generic-view-decorator","text!vgtv-full/templates/main.tpl","utils","vgtv-full/scripts/xiti-tracking"],function(t,e,i,n,s,l,r,a){var o=[{name:"SISTE",path:"/assets",params:[]},{name:"MEST SETT",path:"/assets/most-seen",params:[{key:"interval",val:"day"}]},{name:"NYHETER",path:"/categories/1/assets",params:[]},{name:"SERIER",path:"/categories/172/assets",params:[]},{name:"SPORT",path:"/categories/3/assets",params:[]},{name:"RAMPELYS",path:"/categories/5/assets",params:[]}],c=function(t){var e=[{key:"limit",val:3},{key:"appName",val:"vg.no"}];return s.buildResourceUrl({domain:"svp.vg.no/svp/api/v1/vgtv",path:t.path,query:e.concat(t.params)})},u=e.View.extend({init:function(t){this.setTemplatePath("text!vgtv-full/templates/main.tpl"),this.config=t.config,this.refreshCollection(o[3])},refreshCollection:function(t){var e=new n(this,c(t));e.setItem(t),this.collection=e,this.listenTo(this.collection,"sync",this.render),this.listenTo(this.collection,"error",this.error)},error:function(){this.trigger("wid-empty-collection")},render:function(){this.collection.length||this.trigger("wid-empty-collection"),this.trigger("wid-render-success"),this.trigger("wid-render-success");var t=new m(this.collection);this.$el.addClass("widget vgtv-full"),this.$el.html(i.template(l)({videos:this.collection.toJSON()})),this.$("#vgtv-menu").html(t.render().el),this.$(".movie-list a").on("click",a.trackMovieClick)},customScripts:function(){}}),v=e.View.extend({tagName:"li",template:function(){return i.template("<%= name %>")({name:this.menuItem.name})},events:{click:"showTab"},initialize:function(t,e){this.menuItem=t,this.collection=e},showTab:function(t){t.preventDefault(),this.collection.setItem(this.menuItem).setUrl(c(this.menuItem)).refreshCollection(this.menuItem),a.trackTabClick(t)},render:function(){return this.$el.html(this.template()),this}}),m=e.View.extend({tagName:"ul",initialize:function(t){this.collection=t},render:function(){return i.each(o,i.bind(function(e){var i=new v(e,this.collection);this.$el.append(t(i.render().el).addClass(this.collection.getItem()==e?"active":""))},this)),this}});return i.extend(u.prototype,s),u}),define("vgtv-full/main",["jquery","backbone","underscore","vgtv-full/views/main"],function(t,e,i,n){var s=function(t){this.mainView=new n(t)};return s}),define("vgtv-full",["vgtv-full/main"],function(t){return t});