--- a/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js Mon Sep 02 15:00:08 2024 +0200
+++ b/src/ldt/ldt/static/ldt/metadataplayer/LdtPlayer-core.js Wed Sep 04 15:36:55 2024 +0200
@@ -416,7 +416,7 @@
`),S=0;S<h.length;S++)h[S].length&&(S>0||!d)&&(h[S]=m+h[S]);return h.join(`
`)},Writer.prototype.renderPartial=function(n,l,d,m){if(d){var h=this.getConfigTags(m),S=isFunction$1(d)?d(n[1]):d[n[1]];if(S!=null){var k=n[6],A=n[5],B=n[4],M=S;A==0&&B&&(M=this.indentPartial(S,B,k));var j=this.parse(M,h);return this.renderTokens(j,l,d,M,m)}}},Writer.prototype.unescapedValue=function(n,l){var d=l.lookup(n[1]);if(d!=null)return d},Writer.prototype.escapedValue=function(n,l,d){var m=this.getConfigEscape(d)||mustache.escape,h=l.lookup(n[1]);if(h!=null)return typeof h=="number"&&m===mustache.escape?String(h):m(h)},Writer.prototype.rawValue=function(n){return n[1]},Writer.prototype.getConfigTags=function(n){return isArray$4(n)?n:n&&typeof n=="object"?n.tags:void 0},Writer.prototype.getConfigEscape=function(n){if(n&&typeof n=="object"&&!isArray$4(n))return n.escape};var mustache={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){defaultWriter.templateCache=t},get templateCache(){return defaultWriter.templateCache}},defaultWriter=new Writer;mustache.clearCache=function(){return defaultWriter.clearCache()},mustache.parse=function(n,l){return defaultWriter.parse(n,l)},mustache.render=function(n,l,d,m){if(typeof n!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+typeStr(n)+'" was given as the first argument for mustache#render(template, view, partials)');return defaultWriter.render(n,l,d,m)},mustache.escape=escapeHtml,mustache.Scanner=Scanner,mustache.Context=Context,mustache.Writer=Writer;function widgetsBase(t){var l;const n={};return n.Widget=(l=class{constructor(d,m){if(typeof d>"u")return;this.__subwidgets=[];var h=m.type||"(unknown)",S=_$1.defaults({},m,d&&d.config?d.config.default_options:{},this.constructor.defaults),k=this;_$1(S).forEach(function(B,M){k[M]=B}),this.$=jQuery("#"+this.container),typeof this.width>"u"?this.width=this.$.width():this.$.css("width",this.width),typeof this.height<"u"&&this.$.css("height",this.height),this.player=d||new t.FakeClass(["on","trigger","off","loadWidget","loadMetadata"]),this.$.addClass("Ldt-TraceMe Ldt-Widget").attr("widget-type",h),this.l10n=typeof this.constructor.messages[t.language]<"u"?this.constructor.messages[t.language]:t.language.length>2&&typeof this.constructor.messages[t.language.substr(0,2)]<"u"?this.constructor.messages[t.language.substr(0,2)]:this.constructor.messages.en;function A(){if(k.localannotations&&(k.localsource=d.loadLocalAnnotations(k.localannotations),k.source.merge(k.localsource)),k.media_id)k.media=this.getElement(k.media_id);else{var B={is_mashup:k.is_mashup||!1};k.media=k.source.getCurrentMedia(B)}k.pre_draw_callback?jQuery.when(k.pre_draw_callback()).done(k.draw()):k.draw(),k.player.trigger("widget-loaded")}this.metadata?(this.source=d.loadMetadata(this.metadata),this.source.onLoad(A)):this.source&&A()}toString(){return"Widget "+this.type}templateToHtml(d){return mustache.render(d,this)}renderTemplate(){this.$.append(this.templateToHtml(this.constructor.template))}functionWrapper(d){var m=this,h=this[d];if(typeof h<"u")return function(){return h.apply(m,Array.prototype.slice.call(arguments,0))};console.log("Error, Unknown function IriSP.Widgets."+this.type+"."+d)}getFunctionOrName(d){switch(typeof d){case"function":return d;case"string":return this.functionWrapper(d);default:return}}onMdpEvent(d,m){this.player.on(d,this.getFunctionOrName(m))}onMediaEvent(d,m){this.media.on(d,this.getFunctionOrName(m))}getWidgetAnnotations(){var d=null;return typeof this.annotation_type>"u"?d=this.media.getAnnotations():this.annotation_type.elementType==="annotationType"?d=this.annotation_type.getAnnotations():d=this.media.getAnnotationsByTypeTitle(this.annotation_type),typeof this.annotation_filter<"u"?this.annotation_filter(d):d}getWidgetAnnotationsAtTime(){var d=this.media.getCurrentTime();return this.getWidgetAnnotations().filter(function(m){return m.begin<=d&&m.end>d})}isLoaded(){var d=!_$1(this.__subwidgets).some(function(m){return!(m&&m.isLoaded())});return d}insertSubwidget(d,m,h){var S=d.attr("id"),k=this,A=this.__subwidgets.length;this.__subwidgets.push(null),typeof S>"u"&&(S=_$1.uniqueId(this.container+"_sub_widget_"+m.type),d.attr("id",S)),m.container=S,k.player.loadWidget(m,function(B){h&&(k[h]=B),k.__subwidgets[A]=B})}navigate(d){for(var m=this,h=m.media.getCurrentTime(),S=m.getWidgetAnnotations().sortBy(function(A){return A.begin}),k=0;k<S.length;k++)if(S[k].begin<=h&&h<S[k].end){k=Math.min(S.length-1,Math.max(0,k+d)),m.media.setCurrentTime(S[k].begin);break}}exportAnnotations(d){var m=this;d===void 0&&(d=this.getWidgetAnnotations());var h=jQuery,S=mustache.render(`[video:{{url}}]
`,{url:m.media.url})+d.map(function(k){return mustache.render("[{{ a.begin }}]{{ a.title }} {{ a.description }}[{{ a.end }}]",{a:k})}).join(`
-`);h("<pre>").addClass("exportContainer").text(S).dialog({title:"Annotation export",open:function(k,A){var B;document.selection?(B=document.body.createTextRange(),B.moveToElementText(this[0]),B.select()):window.getSelection&&(B=document.createRange(),B.selectNode(this[0]),window.getSelection().addRange(B))},autoOpen:!0,width:"80%",minHeight:"400",height:400,buttons:[{text:"Close",click:function(){h(this).dialog("close")}},{text:"Download",click:function(){a=document.createElement("a"),a.setAttribute("href","data:text/plain;base64,"+btoa(S)),a.setAttribute("download","Annotations - "+m.media.title.replace(/[^ \w]/g,"")+".txt"),a.click()}}]})}draw(){}generateUid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(d){var m=Math.random()*16|0,h=d==="x"?m:m&3|8;return h.toString(16)})}},Cr(l,"defaults",{}),Cr(l,"template",""),Cr(l,"messages",{en:{}}),l),n}const AdaptivePlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){console.log("DRAW ADAPTIVE PLAYER"),typeof this.video>"u"&&(this.video=this.media.video);var l=["autostart","video","height","width","url_transform"],d={},m=document.createElement("video").canPlayType(this.mime_type);d.type=m!=="no"?this.normal_player:this.fallback_player,console.log("CAN PLAY : ",d,m);for(var h=0;h<l.length;h++)typeof this[l[h]]<"u"&&(d[l[h]]=this[l[h]]);this.insertSubwidget(this.$,d)}},Cr(n,"defaults",{mime_type:'video/mp4; codecs="avc1.42E01E"',normal_player:"HtmlPlayer",fallback_player:"HtmlPlayer"}),n},helloWorldStyles={},HelloWorld=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"draw",function(){this.renderTemplate(),console.log("HelloWorldWidget was drawn")});console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget")}},Cr(n,"defaults",{text:"world"}),Cr(n,"template",'<div class="Ldt-HelloWorld"><p>{{l10n.Hello}} {{text}}</p><p>Looks like we have <span class="Ldt-HelloWorld-annotations">{{source.contents.annotation.length}} annotations</span> in this feed</p></div>'),Cr(n,"messages",{fr:{Hello:"Bonjour,"},en:{Hello:"Hello,"}}),n},annotationStyles={},Annotation=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastAnnotation=!1,this.minimized=this.start_minimized||!1,this.bounds=[0,0]}draw(){var l=this,d;function m(k){var A=l.getWidgetAnnotationsAtTime();A.length||(l.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-Empty"),l.arrow&&l.arrow.moveToTime(k),l.bounds=[k,k],l.sendBounds())}function h(){if(d){var k=d.title,A=d.description.replace(/(^\s+|\s+$)/g,""),B=d.found&&l.source.getAnnotations().regexp||!1;l.$.find(".Ldt-Annotation-Title").html(IriSP.textFieldHtml(k,B)||"("+l.l10n.untitled+")"),A?(l.$.find(".Ldt-Annotation-Description-Block").removeClass("Ldt-Annotation-EmptyBlock"),l.$.find(".Ldt-Annotation-Description").html(IriSP.textFieldHtml(A,B))):l.$.find(".Ldt-Annotation-Description-Block").addClass("Ldt-Annotation-EmptyBlock")}}function S(k){d=k;var A=typeof k.url<"u"?k.url:document.location.href.replace(/#.*$/,"")+"#id="+k.id,B=l.l10n.watching+k.title+(l.site_name?l.l10n.on_site+l.site_name:""),M=k.getTags(),j=l.$.find(".Ldt-Annotation-Tags");j.empty(),M.length?(l.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-EmptyBlock"),M.forEach(function(I){var P=I.title.replace(/(^\s+|\s+$)/g,"");if(P){var $=IriSP.jQuery('<li class="Ldt-Annotation-TagLabel"></li>').append(IriSP.jQuery("<span>").text(P));$.click(function(){l.search_on_tag_click&&l.source.getAnnotations().search(P),I.trigger("click")}),j.append($)}})):l.$.find(".Ldt-Annotation-Tags-Block").addClass("Ldt-Annotation-EmptyBlock"),h(),l.show_creator&&l.$.find(".Ldt-Annotation-Creator").text(k.creator),l.show_annotation_type&&(l.$.find(".Ldt-Annotation-Type").text(k.getAnnotationType().title),l.$.find(".Ldt-Annotation-Type").attr("title",k.getAnnotationType().description)),l.$.find(".Ldt-Annotation-Begin").text(k.begin.toString()),l.$.find(".Ldt-Annotation-End").text(k.end.toString()),k.elementType==="mashedAnnotation"?(l.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-isMashup"),l.$.find(".Ldt-Annotation-MashupMedia").text(k.getMedia().title),l.$.find(".Ldt-Annotation-MashupBegin").text(k.annotation.begin.toString()),l.$.find(".Ldt-Annotation-MashupEnd").text(k.annotation.end.toString())):l.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-isMashup"),typeof l.socialWidget<"u"?l.socialWidget.updateUrls(A,B):setTimeout(function(){typeof l.socialWidget<"u"&&l.socialWidget.updateUrls(A,B)},800),l.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Empty"),l.bounds=[k.begin,k.end],l.arrow&&l.arrow.moveToTime((1-l.arrow_position)*k.begin+l.arrow_position*k.end),l.sendBounds()}this.renderTemplate(),this.$.find(".Ldt-Annotation-Title").click(function(){return d&&l.media.setCurrentTime(d.begin),!1}),this.show_social&&this.insertSubwidget(this.$.find(".Ldt-Annotation-Social"),{type:"Social"},"socialWidget"),this.show_arrow&&this.insertSubwidget(this.$.find(".Ldt-Annotation-Arrow"),{type:"Arrow",width:this.width},"arrow"),this.onMediaEvent("timeupdate",m),this.onMdpEvent("Annotation.hide","hide"),this.onMdpEvent("Annotation.show","show"),this.onMdpEvent("Annotation.minimize","minimize"),this.onMdpEvent("Annotation.maximize","maximize"),this.onMdpEvent("Annotation.getBounds","sendBounds"),this.$.find(".Ldt-Annotation-MaxMinButton").click(this.functionWrapper("toggleSize")),this.$.on("resize",function(){l.width=l.$.parent().width(),l.$.css({width:l.width})}),this.getWidgetAnnotations().forEach(function(k){k.on("enter",function(){S(k)})}),this.source.getAnnotations().on("found",h),this.source.getAnnotations().on("not-found",h),this.source.getAnnotations().on("search-cleared",h),IriSP.attachDndData(this.$.find("h3"),function(){return{title:d.title,description:d.description,image:d.thumbnail,uri:typeof d.url<"u"?d.url:document.location.href.replace(/#.*$/,"")+"#id="+d.id,text:"["+d.begin.toString()+"] "+d.title}})}sendBounds(){this.player.trigger("Annotation.boundsChanged",this.bounds)}drawAnnotation(l){this.lastAnnotation=l.id}hide(){this.$.slideUp()}show(){this.$.slideDown()}toggleSize(){this.minimized?this.maximize():this.minimize()}minimize(){this.minimized=!0,this.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-Minimized")}maximize(){this.minimized=!1,this.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Minimized")}},Cr(n,"messages",{fr:{watching:"Je regarde ",on_site:" sur ",tags_:"Mots-clés :",description_:"Description :",creator_:"Créé par :",excerpt_from:"Extrait de :",untitled:"Segment sans titre"},en:{watching:"I'm watching ",on_site:" on ",tags_:"Keywords:",description_:"Description:",creator_:"Created by :",excerpt_from:"Excerpt from:",untitled:"Untitled segment"}}),Cr(n,"template",'{{#show_arrow}}<div class="Ldt-Annotation-Arrow"></div>{{/show_arrow}}<div class="Ldt-Annotation-Widget {{^show_arrow}}Ldt-Annotation-ShowTop{{/show_arrow}}"><div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}"><div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>{{#show_social}}<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"></div>{{/show_social}}<h3 class="Ldt-Annotation-HiddenWhenEmpty">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<a class="Ldt-Annotation-Title" href="#"></a> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">(<span class="Ldt-Annotation-Begin"></span> - <span class="Ldt-Annotation-End"></span>)</span></h3><h3 class="Ldt-Annotation-MashupOrigin Ldt-Annotation-HiddenWhenEmpty">{{l10n.excerpt_from}} <span class="Ldt-Annotation-MashupMedia"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">(<span class="Ldt-Annotation-MashupBegin"></span> - <span class="Ldt-Annotation-MashupEnd"></span>)</span></h3><div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Creator-Block"><div class="Ldt-Annotation-Label">{{l10n.creator_}}</div>{{#show_creator}}<p class="Ldt-Annotation-Labelled Ldt-Annotation-Creator"></p></div>{{/show_creator}}{{#show_description}}<div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Description-Block"><div class="Ldt-Annotation-Label">{{l10n.description_}}</div><p class="Ldt-Annotation-Labelled Ldt-Annotation-Description"></p></div>{{/show_description}}<div class="Ldt-Annotation-Tags-Block Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Cleared"><div class="Ldt-Annotation-Label">{{l10n.tags_}}</div><ul class="Ldt-Annotation-Labelled Ldt-Annotation-Tags"></ul></div></div></div></div>'),Cr(n,"defaults",{annotation_type:"chap",start_minimized:!1,show_arrow:!0,show_creator:!0,show_description:!0,arrow_position:.5,site_name:"Lignes de Temps",search_on_tag_click:!0,show_social:!0,show_annotation_type:!1}),n},annotationsControllerStyles={},AnnotationsController=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate();var l=this;this.element_$=this.$.find(".Ldt-AnnotationsController"),this.displayButton_$=this.$.find(".Ldt-AnnotationsController-ShowAnnotationsListButton"),this.writeButton_$=this.$.find(".Ldt-AnnotationsController-ShowCreateAnnotationButton"),this.writeButton_$.click(function(){l.writeButton_$.hasClass("selected")?(l.player.trigger("CreateAnnotation.hide"),l.toggle_widgets?l.player.trigger("AnnotationsList.show"):l.display_or_write&&l.player.trigger("AnnotationsList.hide")):(l.player.trigger("CreateAnnotation.show"),l.display_or_write&&l.player.trigger("AnnotationsList.hide"))}),this.displayButton_$.click(function(){l.displayButton_$.hasClass("selected")?(l.player.trigger("AnnotationsList.hide"),l.toggle_widgets?l.player.trigger("CreateAnnotation.show"):l.display_or_write&&l.player.trigger("CreateAnnotation.hide")):(l.player.trigger("AnnotationsList.show"),l.display_or_write&&l.player.trigger("CreateAnnotation.hide"))}),this.hide_without_segment&&(this.onMediaEvent("timeupdate",function(){l.refresh()}),this.onMediaEvent("settimerange",function(d){l.refresh(d)}),this.segments=this.source.getAnnotationsByTypeTitle(this.segments_annotation_type),this.currentSegment=!1),this.createAnnotationEnabled=!1,this.onMdpEvent("CreateAnnotation.hide",function(){l.hide_when_writing&&l.show(),l.createAnnotationEnabled=!1,l.writeButton_$.toggleClass("selected",!1)}),this.onMdpEvent("CreateAnnotation.show",function(){l.hide_when_writing&&l.hide(),l.createAnnotationEnabled=!0,l.writeButton_$.toggleClass("selected",!0)}),this.onMdpEvent("AnnotationsList.hide",function(){l.displayButton_$.toggleClass("selected",!1)}),this.onMdpEvent("AnnotationsList.show",function(){l.displayButton_$.toggleClass("selected",!0)}),this.starts_hidden?(this.visible=!0,this.hide()):(this.visible=!1,this.show()),this.starting_widget&&this.visible&&(this.starting_widget=="AnnotationsList"?this.player.trigger("AnnotationsList.show"):this.starting_widget=="CreateAnnotation"&&this.player.trigger("CreateAnnotation.show"))}refresh(l){if(l=typeof l<"u"?l:!1,l||this.media.getTimeRange()&&(l=this.media.getTimeRange()),this.hide_without_segment){if(!l&&!this.media.getTimeRange())_currentTime=this.media.getCurrentTime(),_currentSegments=this.segments.filter(function(h){return _currentTime>=h.begin&&_currentTime<=h.end}),_currentSegments.length>0?currentSegment=!0:currentSegment=!1;else{var d=l[0],m=l[1];_currentSegments=this.segments.filter(function(h){return d==h.begin&&m==h.end}),_currentSegments.length>0?currentSegment=!0:currentSegment=!1}!currentSegment&&_currentSegments.length==0?(this.visible||this.hide_when_writing)&&(this.writeButton_$.toggleClass("selected",!1),this.displayButton_$.toggleClass("selected",!1),this.player.trigger("CreateAnnotation.hide"),this.player.trigger("AnnotationsList.hide"),this.hide()):this.visible||(this.createAnnotationEnabled||this.show(),this.writeButton_$.toggleClass("selected",!1),this.displayButton_$.toggleClass("selected",!1),this.starting_widget=="AnnotationsList"&&this.player.trigger("AnnotationsList.show"),this.starting_widget=="CreateAnnotation"&&this.player.trigger("CreateAnnotation.show"))}}hide(){this.visible&&(this.visible=!1,this.element_$.hide())}show(){this.visible||(this.visible=!0,this.element_$.show())}},Cr(n,"defaults",{display_or_write:!1,toggle_widgets:!1,starts_hidden:!1,hide_without_segment:!1,hide_when_writing:!0,starting_widget:!1,always_show_widget:!1,segments_annotation_type:"chap",custom_write_text:!1,custom_display_text:!1}),Cr(n,"template","<div class='Ldt-AnnotationsController'><div class='Ldt-AnnotationsController-ButtonsContainer'> <div class='Ldt-AnnotationsController-Button Ldt-AnnotationsController-ShowCreateAnnotationButton'>{{#custom_write_text}}{{/custom_write_text}}{{custom_write_text}}{{^custom_write_text}}{{l10n.write}}{{/custom_write_text}}</div> <div class='Ldt-AnnotationsController-Button Ldt-AnnotationsController-ShowAnnotationsListButton'>{{#custom_display_text}}{{/custom_display_text}}{{custom_display_text}}{{^custom_display_text}}{{l10n.display}}{{/custom_display_text}}</div></div></div>"),Cr(n,"messages",{en:{write:"Write",display:"Display"},fr:{write:"Ecrire",display:"Voir"}}),n},annotationsListStyles={},AnnotationsList=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastIds=[];var m=this;this.throttledRefresh=_$1.throttle(function(h){m.refresh(h)},800),this.searchString=!1,this.lastSearch=!1,this.localSource=void 0}importUsers(){if(!this.source.users_data&&this.api_users_endpoint){this.usernames=Array();var l=this,d=this.getWidgetAnnotations(),m="";return d.forEach(function(h){l.usernames.indexOf(h.creator)==-1&&l.usernames.push(h.creator)}),this.usernames.forEach(function(h){m+=h+","}),m=m.substring(0,m.length-1),_url=mustache.render(this.api_users_endpoint,{usernames_list_string:encodeURIComponent(m),usernames_list_length:this.usernames.length}),jQuery.ajax({async:!1,url:_url,type:"GET",success:function(h){l.source.users_data=h.objects},error:function(h,S,k){console.log(h),console.log(S),console.log(k)}})}}ajaxSource(){var l=this.media.getCurrentTime(),d=this.media.duration;this.lastAjaxQuery=l;var m=mustache.render(this.ajax_url,{media:this.source.currentMedia.id,begin:Math.max(0,l-this.ajax_granularity),end:Math.min(d.milliseconds,l+this.ajax_granularity)});this.currentSource=this.player.loadMetadata(_$1.defaults({url:m},this.metadata))}showScreen(l){this.$.find(".Ldt-AnnotationsList-Screen"+l).show().siblings().hide()}ajaxMashup(){var l=this.media.getCurrentTime(),d=this.source.currentMedia.getAnnotationAtTime(l);if(typeof d<"u"&&d.id!==this.lastMashupAnnotation){this.lastMashupAnnotation=d.id;var m=d.getMedia(),h=mustache.render(this.ajax_url,{media:m.id,begin:Math.max(0,d.annotation.begin.milliseconds-this.ajax_granularity),end:Math.min(m.duration.milliseconds,d.annotation.end.milliseconds+this.ajax_granularity)});this.currentSource=this.player.loadMetadata(_$1.defaults({url:h},this.metadata))}}importAnnotations(){var l=this,d=jQuery,m=d("<textarea>");d("<div>").append(d("<span>").addClass("importAnnotationsLabel").text(l.messages.import_annotations)).addClass("importContainer").dialog({title:"Annotation import",autoOpen:!0,width:"80%",minHeight:"400",height:400,buttons:[{text:"Close",click:function(){d(this).dialog("close")}},{text:"Import",click:function(){var h=/(\[[\d:]+\])/;console.log("Import data");for(var S=m[0].value.split(h).filter(function(P){return!P.match(/^\s*$/)}),k=null,A=null,B=null,M=null,j=0;j<S.length;j++){var I=S[j];I.match(h)?(M=="text"?(A=t.timestamp2ms(I.slice(1,-1)),TODO.createAnnotation(k,A,B),k=A,A=null,B=null):(B=null,k=t.timestamp2ms(I.slice(1,-1)),A=null),M="timestamp"):(B=I,M="text"),M=="text"&&k!==null&&TODO.createAnnotation(k,k,B)}}}]})}refresh(l){if(l=typeof l<"u"&&l,this.currentSource.status!==t.Model._SOURCE_STATUS_READY)return 0;var d=this,m=this.media.getCurrentTime(),h=this.annotation_type?this.currentSource.getAnnotationsByTypeTitle(this.annotation_type):this.currentSource.getAnnotations();if(this.mashupMode){var S=this.source.currentMedia.getAnnotationAtTime(m);if(typeof S<"u"){m=m-S.begin+S.annotation.begin;var k=S.getMedia().id;h=h.filter(function(N){return N.getMedia().id===k})}}h=h.filter(function(N){return N.found!==!1}),this.filter_by_segments&&!(this.show_filters&&this.segment_filter&&this.ignoresegmentcheckbox_$[0].checked)&&(_segmentsAnnotation=this.currentSource.getAnnotationsByTypeTitle(this.segments_annotation_type),this.media.getTimeRange()?_currentSegments=_segmentsAnnotation.filter(function(N){return d.media.getTimeRange()[0]==N.begin&&d.media.getTimeRange()[1]==N.end}):_currentSegments=_segmentsAnnotation.filter(function(N){return m>=N.begin&&m<=N.end}),_currentSegments.length==0?h=h.filter(function(N){return!1}):h=h.filter(function(N){return _annotation_time=(N.begin+N.end)/2,_currentSegments[0].begin<=_annotation_time&&_currentSegments[0].end>=_annotation_time}),this.annotations_count_header&&this.annotations_count!=h.length&&(this.annotations_count=h.length,this.refreshHeader())),this.show_only_annotation_from_user&&(h=h.filter(function(N){return N.creator==d.show_only_annotation_from_user})),this.limit_count&&(h=h.sortBy(function(N){return Math.abs((N.begin+N.end)/2-m)}).slice(0,this.limit_count)),this.newest_first?h=h.sortBy(function(N){return-N.created.valueOf()}):h=h.sortBy(function(N){return N.begin}),this.show_filters&&(this.user_filter&&(_username=this.userselect_$[0].options[this.userselect_$[0].selectedIndex].value,_username!="false"&&(h=h.filter(function(N){return N.creator==_username}))),this.keyword_filter&&(_keyword=this.keywordinput_$[0].value,_keyword!=""&&(h=h.filter(function(N){return N.description.toLowerCase().match(_keyword.toLowerCase())}))),this.date_filter&&this.datefilterinput_$[0].value!=""&&(_date=this.datefilterinput_$.datepicker("getDate"),h=h.filter(function(N){return N.created.getDate()==_date.getDate()&&N.created.getMonth()==_date.getMonth()&&N.created.getFullYear()==_date.getFullYear()})),this.latest_contributions_filter&&this.latestcontributionscheckbox_$[0].checked&&(h=h.sortBy(function(N){return-N.created.valueOf()}),this.usernames.forEach(function(N){latest_ann=h.filter(function(F){return F.creator==N})[0],h=h.filter(function(F){return F.id==(latest_ann?latest_ann.id:!1)||F.creator!=N})})));var A=h.idIndex;if(l||!_$1.isEqual(A,this.lastIds)||this.searchString!==this.lastSearch){if(this.lastSearch=this.searchString,this.lastIds=A,this.list_$.html(""),h.forEach(function(N){var F=typeof N.url<"u"&&N.url?N.url:typeof d.source.projectId<"u"&&typeof N.project<"u"&&N.project&&d.source.projectId!==N.project?mustache.render(d.foreign_url,{project:N.project,media:N.media.id,annotation:N.id,annotationType:N.annotationType.id}):document.location.href.replace(/#.*$/,"")+"#id="+N.id+"&t="+N.begin/1e3,U=N.project!=d.source.projectId,J="",te=N.description,se=typeof N.thumbnail<"u"&&N.thumbnail?N.thumbnail:d.default_thumbnail;if(d.show_creator&&N.creator){var de=[],Q={},ve="";d.source.users_data&&(de=d.source.users_data.filter(function(y){return y.username==N.creator})),de.length==0?Q.username=N.creator:Q=de[0],ve=d.make_name_string_function(Q)}if(d.show_title&&N.title)var J=N.title;var he;_$1(d.polemics).each(function(y){var w=t.Model.regexpFromTextOrArray(y.keyword,!0);w.test(J+" "+te)&&(he=y.background_color)});var ke=!1;if(d.show_creation_date&&(ke=N.created.toLocaleDateString()+", "+N.created.toLocaleTimeString().replace(/\u200E/g,"").replace(/^([^\d]*\d{1,2}:\d{1,2}):\d{1,2}([^\d]*)$/,"$1$2")),d.tags==!0)var T=N.getTagTexts();else var T=!1;var u={id:N.id,media_id:N.getMedia().id,htitle:t.textFieldHtml(J),title:J,creator:ve,hdescription:t.textFieldHtml(te),description:te,begin:N.begin.toString(),end:N.end.toString(),created:ke,show_timecode:d.show_timecode,show_end_time:d.show_end_time,show_title:d.show_title&&J,thumbnail:se,url:F,tags:T,specific_style:typeof he<"u"?"background-color: "+he:"",l10n:d.l10n,editable:d.editable,external:U,show_publish:d.show_publish,show_creator:d.show_creator,show_twitter:d.show_twitter,twitter_param:jQuery.param({url:F,text:t.textFieldHtml(J)+(d.twitter_hashtag?" #"+d.twitter_hashtag:"")}),allow_annotations_deletion:d.allow_annotations_deletion},p=mustache.render(d.constructor.annotationTemplate,u),b=jQuery(p),e=function(){d.$.find(".Ldt-AnnotationsList-li").removeClass("selected"),b.addClass("selected")},c=function(){d.$.find(".Ldt-AnnotationsList-li").removeClass("selected")};b.mouseover(function(){N.trigger("select")}).mouseout(function(){N.trigger("unselect")}).click(function(){d.filter_by_segments&&d.media.getTimeRange()&&(_ann_time=(N.begin+N.end)/2,(_ann_time<=d.media.getTimeRange()[0]||_ann_time>=d.media.getTimeRange()[1])&&d.media.resetTimeRange()),N.trigger("click")}).appendTo(d.list_$),t.attachDndData(b.find("[draggable]"),{title:J,description:te,uri:F,image:N.thumbnail,text:"["+N.begin.toString()+"] "+J}),b.on("remove",function(){N.off("select",e),N.off("unselect",c)}),N.on("select",e),N.on("unselect",c)}),this.$.find(".Ldt-AnnotationsList-Tag-Li").each(function(){var N=jQuery(this);N.text().replace(/(^\s+|\s+$)/g,"")||N.remove()}),this.editable){var B=d,M=jQuery,j=function(N,F){var U="#FF9999",J="#99FF99";F===void 0&&(F=N);var te=M(N.dataset.editable_type==="multiline"?"<textarea>":"<input>").addClass("editableInput").insertBefore(M(F));te[0].value=N.dataset.editable_value,M(te).show().focus(),M(N).addClass("editing");function se(ve){M(N).removeClass("editing"),te.remove();var he=M(N).css("background-color");M(N).stop().css("background-color",ve).animate({backgroundColor:he},1e3)}function de(ve){se(U)}function Q(){var ve=te[0].value;if(ve==N.dataset.editable_value){se(J);return}if(ve==""){$(N.dataset.editable_id),B.player.trigger("Annotation.delete",N.dataset.editable_id);return}else{var he=ve;if(N.dataset.editable_type=="timestamp"&&(he=t.timestamp2ms(ve),Number.isNaN(he))){de();return}N.dataset.editable_value=ve,ve=he,M(N).text(he)}var ke=I(N.dataset.editable_id);ke===void 0?(console.log("Strange error: cannot find edited annotation"),se(U)):(N.dataset.editable_value=ve,N.dataset.editable_field=="begin"?ke.setBegin(ve):N.dataset.editable_field=="end"?ke.setEnd(ve):ke[N.dataset.editable_field]=ve,ke.modified=new Date,ke.contributor=B.player.config.username||"COCo User",B.player.addLocalAnnotation(ke),B.player.trigger("Annotation.update",ke),se(J))}M(te).bind("keydown",function(ve){ve.which==13?(ve.preventDefault(),Q()):ve.which==27&&(ve.preventDefault(),de())}).bind("blur",function(ve){Q()})},I=function(N){return B.player.getLocalAnnotation(N)},P=function(){B.player.saveLocalAnnotations(),B.source.merge(B.player.localSource)},$=function(N){B.source.getAnnotations().removeId(N,!0),B.player.deleteLocalAnnotation(N),B.refresh(!0)};this.$.find(".Ldt-AnnotationsList-Delete").click(function(N){var F=I(this.dataset.editable_id);confirm(mustache.render(B.l10n.confirm_delete_message,{annotation:F}))&&$(this.dataset.editable_id),B.refresh(!0)}),this.$.find(".Ldt-AnnotationsList-Edit").click(function(N){if(B.on_edit){var F=I(this.dataset.editable_id);B.on_edit(F)}else{var U=M(this).parents(".Ldt-AnnotationsList-li").find(".Ldt-AnnotationsList-TitleContent.Ldt-live-editable");j(U[0])}}),this.$.find(".Ldt-AnnotationsList-PublishAnnotation").click(function(N){var F=I(this.dataset.editable_id);if(confirm(mustache.render(B.l10n.confirm_publish_message,{annotation:F}))){var U=mustache.render(B.api_endpoint_template,{id:B.source.projectId});if(U!==""){var J=B.player.sourceManager.newLocalSource({serializer:t.serializers[B.api_serializer]});if(B.publish_type){var te=B.source.getAnnotationTypes().filter(function(de){return de.title==B.publish_type});te.length==1&&F.setAnnotationType(te[0].id)}var se=new t.Model.List(B.player.sourceManager);se.push(F),J.addList("annotation",se),jQuery.ajax({url:U,type:B.api_method,contentType:"application/json",data:J.serialize(),success:function(de){M(this).addClass("published");var Q=I(F.id);Q.setTags(["published"]),P(),B.player.trigger("Annotation.publish",F)},error:function(de,Q,ve){t.log("Error when sending annotation",ve)}})}}}),this.$.find(".Ldt-AnnotationsList-TimeEdit").dblclick(function(N){var F=this,U=I(F.dataset.editable_id);U!==void 0&&(U.setBegin(B.media.getCurrentTime().milliseconds),P(),B.player.trigger("Annotation.update",U),B.refresh(!0))})}if(this.$.find(".Ldt-AnnotationsList-Tag-Li").click(function(){d.source.getAnnotations().search(jQuery(this).text().replace(/(^\s+|\s+$)/g,""))}),this.$.find(".Ldt-Annotation-Timecode").click(function(){d.media.setCurrentTime(Number(this.dataset.timecode))}),this.$.find(".Ldt-AnnotationsList-Play").click(function(){var N=jQuery(this),F=N.attr("data-annotation-id");d.jwplayers[F]&&jwplayer(d.jwplayers[F]).play(),d.media.pause()}),this.source.getAnnotations().searching){var z=d.source.getAnnotations().regexp||!1;this.$.find(".Ldt-AnnotationsList-Title a, .Ldt-AnnotationsList-Description").each(function(){var N=jQuery(this);N.html(t.textFieldHtml(N.text(),z))})}this.$.find(".Ldt-AnnotationsList-DeleteButton").click(d.functionWrapper("onDeleteClick"))}return this.ajax_url&&(this.mashupMode?this.ajaxMashup():Math.abs(m-this.lastAjaxQuery)>this.ajax_granularity&&this.ajaxSource()),h.length}onDeleteClick(l){_list=this.getWidgetAnnotations(),ann_id=l.target.dataset.annotation,delete_preview_$=this.$.find(".Ldt-AnnotationsList-ul-ToDelete"),delete_preview_$.html(""),_list=_list.filter(function(I){return I.id==ann_id});var d=_list[0],m="",h="",S=this;if(d.creator){var k=[],A={};S.source.users_data&&(k=S.source.users_data.filter(function(I){return I.username==d.creator})),k.length==0?A.username=d.creator:A=k[0],h=S.make_name_string_function(A)}if(d.title){var B=d.title;B.substr(0,m.length+1)==m+":"&&(m=""),m=m+(m==""?"":": ")+d.title}var M=!1;this.show_creation_date&&(M=d.created.toLocaleDateString()+", "+d.created.toLocaleTimeString());var j={id:d.id,media_id:d.getMedia().id,htitle:t.textFieldHtml(m),hdescription:t.textFieldHtml(d.description),begin:d.begin.toString(),end:d.end.toString(),created:M,show_timecode:this.show_timecode,show_creator:this.show_creator,creator:h,tags:!1,l10n:this.l10n,allow_annotations_deletion:!1};_html=mustache.render(this.constructor.annotationTemplate,j),delete_preview_$.html(_html),this.$.find(".Ldt-AnnotationsList-ConfirmDelete").click(function(){S.sendDelete(ann_id)}),this.showScreen("Delete")}refreshHeader(){var l=" ("+this.annotations_count+" "+this.annotations_count_header_string+")";this.$.find(".Ldt-AnnotationsList-header").html(""),this.$.find(".Ldt-AnnotationsList-header").html(this.custom_header&&typeof this.custom_header=="string"?this.custom_header+l:this.l10n.header+l)}hide(){var l=this;this.visible&&(this.visible=!1,this.widget_$.slideUp(function(){l.$.find(".Ldt-AnnotationsList-header").hide()}),this.showScreen("Main"))}show(){this.visible||(this.visible=!0,this.$.find(".Ldt-AnnotationsList-header").show(),this.widget_$.slideDown(),this.showScreen("Main"))}toggle(){this.always_visible||(this.visible?this.hide():this.show())}revertToMainScreen(){this.$.find(".Ldt-AnnotationsList-ScreenMain").is(":hidden")&&this.showScreen("Main")}sendDelete(l){var d=this,m=mustache.render(this.api_delete_endpoint,{annotation_id:l,project_id:this.project_id});jQuery.ajax({url:m,type:this.api_delete_method,contentType:"application/json",success:function(h){d.showScreen("Success"),window.setTimeout(d.functionWrapper("revertToMainScreen"),d.after_send_timeout||2e3),d.currentSource.getAnnotations().removeId(l),d.player.trigger("AnnotationsList.refresh")},error:function(h,S,k){t.log("Error when sending annotation",k),d.showScreen("Error"),window.setTimeout(d.functionWrapper("revertToMainScreen"),d.after_send_timeout||2e3)}}),this.showScreen("Sending")}draw(){this.jwplayers={},this.mashupMode=this.media.elementType==="mashup",this.renderTemplate();var l=this;this.list_$=this.$.find(".Ldt-AnnotationsList-ul"),this.widget_$=this.$.find(".Ldt-AnnotationsListWidget"),this.widget_max_height&&this.widget_$.css("max-height",this.widget_max_height),this.show_filters&&(this.user_filter&&(this.userselect_$=this.$.find("#Ldt-AnnotationsList-userFilter"),this.userselect_$.change(function(){l.player.trigger("AnnotationsList.refresh")}),this.userselect_$.html("<option selected value='false'>"+this.l10n.everyone+"</option>"),this.usernames.forEach(function(h){var S=l.source.users_data.filter(function(A){return A.username==h}),k={};S.length==0?k.username=h:k=S[0],l.userselect_$.append("<option value='"+h+"'>"+l.make_name_string_function(k)+"</option>")})),this.keyword_filter&&(this.keywordinput_$=this.$.find("#Ldt-AnnotationsList-keywordsFilter"),this.keywordinput_$.keyup(function(){l.player.trigger("AnnotationsList.refresh")})),this.segment_filter&&(this.ignoresegmentcheckbox_$=this.$.find("#Ldt-AnnotationsList-ignoreSegmentsFilter"),this.ignoresegmentcheckbox_$.click(function(){l.player.trigger("AnnotationsList.refresh")})),this.date_filter&&(this.datefilterinput_$=this.$.find("#Ldt-AnnotationsList-dateFilter"),this.datefilterinput_$.datepicker({dateFormat:"dd/mm/yy"}),this.datefilterinput_$.change(function(){l.player.trigger("AnnotationsList.refresh")}),this.current_day_filter&&(currentDate=new Date,this.datefilterinput_$.datepicker("setDate",currentDate))),this.latest_contributions_filter&&(this.latestcontributionscheckbox_$=this.$.find("#Ldt-AnnotationsList-latestContributionsFilter"),this.latestcontributionscheckbox_$.click(function(){l.player.trigger("AnnotationsList.refresh")}))),this.source.getAnnotations().on("search",function(h){l.searchString=h,l.source!==l.currentSource&&(l.currentSource.getAnnotations().search(h),l.throttledRefresh())}),this.source.getAnnotations().on("found",function(){l.throttledRefresh()}),this.source.getAnnotations().on("not-found",function(){l.throttledRefresh()}),this.source.getAnnotations().on("clear-search",function(){l.searchString=!1,l.source!==l.currentSource&&l.currentSource.getAnnotations().trigger("clear-search")}),this.$.find(".Ldt-AnnotationsList-Close").click(function(){l.showScreen("Main")}),this.source.getAnnotations().on("search-cleared",function(){l.throttledRefresh()}),this.onMdpEvent("AnnotationsList.refresh",function(){l.ajax_url&&(l.mashupMode?l.ajaxMashup():l.ajaxSource()),l.throttledRefresh(!1)}),this.onMdpEvent("AnnotationsList.update",function(){l.ajax_url&&(l.mashupMode?l.ajaxMashup():l.ajaxSource()),l.throttledRefresh(!0)}),this.ajax_url?this.mashupMode?this.ajaxMashup():this.ajaxSource():this.currentSource=this.source,this.refresh_interval&&window.setInterval(function(){l.currentSource.get()},this.refresh_interval),this.annotations_count_header&&(this.annotations_count=!1),this.onMdpEvent("AnnotationsList.toggle","toggle"),this.onMdpEvent("AnnotationsList.hide","hide"),this.onMdpEvent("AnnotationsList.show","show"),this.onMdpEvent("createAnnotationWidget.addedAnnotation",this.throttledRefresh);for(var d=["timeupdate","seeked","loadedmetadata","settimerange"],m=0;m<d.length;m++)this.onMediaEvent(d[m],this.throttledRefresh);this.throttledRefresh(),this.showScreen("Main"),this.$.find(".Ldt-AnnotationsList-CancelDelete").click(function(){l.showScreen("Main")}),this.visible=!0,this.start_visible||this.hide()}},Cr(n,"defaults",{pre_draw_callback:function(){return this.importUsers()},ajax_url:!1,ajax_granularity:6e5,default_thumbnail:"",custom_external_icon:"",foreign_url:"",annotation_type:!1,refresh_interval:0,limit_count:20,newest_first:!1,show_title:!0,show_audio:!0,show_creator:!0,show_controls:!1,show_end_time:!0,show_publish:!1,show_twitter:!1,twitter_hashtag:"",on_edit:void 0,publish_type:"PublicContribution",api_endpoint_template:"",api_serializer:"ldt_annotate",api_method:"POST",editable:!1,editable_storage:"",widget_max_height:680,always_visible:!1,start_visible:!0,show_audio:!0,show_filters:!1,keyword_filter:!0,date_filter:!0,user_filter:!0,segment_filter:!0,latest_contributions_filter:!1,current_day_filter:!0,show_header:!1,custom_header:!1,annotations_count_header:!0,annotations_count_header_string:"annotations",show_creation_date:!1,show_timecode:!0,show_end_time:!0,project_id:"",allow_annotations_deletion:!1,api_delete_endpoint:"",api_delete_method:"DELETE",api_users_endpoint:"",api_users_method:"GET",make_name_string_function:function(l){return l.username?l.username:"Anonymous"},filter_by_segments:!1,segment_filter:!0,segments_annotation_type:"chap",show_only_annotation_from_user:!1,tags:!0,polemics:[{keyword:"++",background_color:"#c9ecc6"},{keyword:"--",background_color:"#f9c5c6"},{keyword:"??",background_color:"#cec5f9"},{keyword:"==",background_color:"#f9f4c6"}]}),Cr(n,"messages",{en:{voice_annotation:"Voice Annotation",now_playing:"Now playing...",previous:"Previous",next:"Next",set_time:"Double-click to update to current player time",edit_annotation:"Edit note",delete_annotation:"Delete note",publish_annotation:"Make note public",import_annotations:"Paste or load notes in this field and press Import.",confirm_delete_message:"You are about to delete {{ annotation.title }}. Are you sure you want to delete it?",confirm_publish_message:"You are about to publish {{ annotation.title }}. Are you sure you want to make it public?",tweet_annotation:"Tweet annotation",external_annotation:"This annotation was submitted to another project",everyone:"Everyone",header:"Annotations for this content",segment_filter:"All cuttings",latest_contributions:"Latest contributions",close_widget:"Close",confirm:"Confirm",cancel:"Cancel",annotation_deletion_delete:"You will delete this annotation",annotation_deletion_sending:"Your deletion request is being sent ... ",annotation_deletion_success:"The annotation has been deleted.",annotation_deletion_error:"There was an error contacting the server. The annotation has not been deleted."},fr:{voice_annotation:"Annotation Vocale",now_playing:"Lecture en cours...",previous:"Précédent",next:"Suivant",set_time:"Double-cliquer pour fixer au temps du lecteur",edit_annotation:"Éditer la note",delete_annotation:"Supprimer la note",publish_annotation:"Rendre la note publique",import_annotations:"Copiez ou chargez des notes dans ce champ et appuyez sur Import",confirm_delete_message:"Vous allez supprimer {{ annotation.title }}. Êtes-vous certain(e) ?",confirm_publish_message:"Vous allez publier {{ annotation.title }}. Êtes-vous certain(e) ?",tweet_annotation:"Tweeter l'annotation",external_annotation:"Cette annotation a été postée sur un autre projet",everyone:"Tous",header:"Annotations sur ce contenu",segment_filter:"Tous les segments",latest_contributions:"Dernières contributions",close_widget:"Fermer",confirm:"Confirmer",cancel:"Annuler",annotation_deletion_delete:"Vous allez supprimer cette annotation",annotation_deletion_sending:"Votre demande de suppression est en cours d'envoi ... ",annotation_deletion_success:"L'annotation a été supprimée.",annotation_deletion_error:"Une erreur s'est produite en contactant le serveur. L'annotation n'a pas été supprimée."}}),Cr(n,"template",'{{#show_header}}<p class="Ldt-AnnotationsList-header">{{#custom_header}}{{custom_header}}{{/custom_header}}{{^custom_header}}{{l10n.header}}{{/custom_header}}</p>{{/show_header}}<div class="Ldt-AnnotationsListWidget"><div class="Ldt-AnnotationsList-ScreenMain">{{#show_filters}}<div class="Ldt-AnnotationsList-Filters">{{#keyword_filter}}<input class="Ldt-AnnotationsList-filter-text" id="Ldt-AnnotationsList-keywordsFilter" type="text" value=""></input>{{/keyword_filter}}{{#user_filter}}<select class="Ldt-AnnotationsList-filter-dropdown" id="Ldt-AnnotationsList-userFilter"><option selected value="">{{l10n.everyone}}</option></select>{{/user_filter}}{{#date_filter}}<label class="Ldt-AnnotationsList-filter-date">Date: <input id="Ldt-AnnotationsList-dateFilter" type="text"></input></label>{{/date_filter}}{{#segment_filter}}<label class="Ldt-AnnotationsList-filter-checkbox"><input type="checkbox" id="Ldt-AnnotationsList-ignoreSegmentsFilter">{{l10n.segment_filter}}</label>{{/segment_filter}}{{#latest_contributions_filter}}<label class="Ldt-AnnotationsList-filter-checkbox"><input type="checkbox" id="Ldt-AnnotationsList-latestContributionsFilter">{{l10n.latest_contributions}}</label>{{/latest_contributions_filter}}</div>{{/show_filters}}{{#show_controls}}<div class="Ldt-AnnotationsList-Controls"><span class="Ldt-AnnotationsList-Control-Prev">{{ l10n.previous }}</span> | <span class="Ldt-AnnotationsList-Control-Next">{{ l10n.next }}</span></div>{{/show_controls}}{{#show_audio}}<div class="Ldt-AnnotationsList-Audio"></div>{{/show_audio}}<ul class="Ldt-AnnotationsList-ul"></ul></div>{{#allow_annotations_deletion}}<div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenDelete"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_delete}}<ul class="Ldt-AnnotationsList-ul-ToDelete"></ul><a class="Ldt-AnnotationsList-ConfirmDelete">{{l10n.confirm}}</a> <a class="Ldt-AnnotationsList-CancelDelete">{{l10n.cancel}}</a></div><div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenSending"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_sending}}</div><div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenSuccess"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_success}}</div><div data.annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenError"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_error}}</div>{{/allow_annotations_deletion}}</div>'),Cr(n,"annotationTemplate",'<li class="Ldt-AnnotationsList-li Ldt-Highlighter-Annotation Ldt-TraceMe" data-annotation="{{ id }}" data-begin="{{ begin_ms }}" data-end="{{ end_ms }}" trace-info="annotation-id:{{id}}, media-id:{{media_id}}" style="{{specific_style}}"><div data-annotation="{{ id }}" class="Ldt-AnnotationsList-ThumbContainer Ldt-AnnotationsList-Annotation-Screen Ldt-AnnotationsList-Annotation-ScreenMain"><a {{#url}}href="{{url}}"{{/url}} draggable="true"><img title="{{^external}}{{ begin }} - {{ end }}{{/external}}{{#external}}{{l10n.external_annotation}}{{/external}}" class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />{{#external}}<div title="{{l10n.external_annotation}}" class="Ldt-AnnotationsList-External-Icon"></div>{{/external}}</a></div>{{#allow_annotations_deletion}}<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-DeleteButton">✖</div>{{/allow_annotations_deletion}}{{#show_timecode}}<div title="{{l10n.set_time}}" class="Ldt-AnnotationsList-Duration"><span class="Ldt-AnnotationsList-Begin Ldt-live-editable Ldt-AnnotationsList-TimeEdit" data-editable_value="{{begin}}" data-editable_id="{{id}}" data-editable_field="begin" data-editable_type="timestamp">{{begin}}</span>{{#show_end_time}} - <span class="Ldt-AnnotationsList-End Ldt-live-editable" data-editable_value="{{end}}" data-editable_id="{{id}}" data-editable_field="end" data-editable_type="timestamp">{{end}}</span>{{/show_end_time}}</div>{{/show_timecode}}<h3 class="Ldt-AnnotationsList-Title Ldt-Annotation-Timecode" data-timecode="{{ begin_ms }}" draggable="true">{{#show_title}}<span class="Ldt-AnnotationsList-TitleContent Ldt-live-editable" data-editable_value="{{title}}" data-editable_type="multiline" data-editable_id="{{id}}" data-editable_field="title">{{{htitle}}}</span>{{/show_title}}{{#show_creator}}<span class="Ldt-AnnotationsList-Creator">{{ creator }}</span>{{/show_creator}}</h3><p class="Ldt-AnnotationsList-Description Ldt-live-editable" data-editable_type="multiline" data-editable_value="{{description}}" data-editable_id="{{id}}" data-editable_field="description">{{{hdescription}}}</p>{{#created}}<div class="Ldt-AnnotationsList-CreationDate">{{{created}}}</div>{{/created}}{{#tags.length}}<ul class="Ldt-AnnotationsList-Tags">{{#tags}}{{#.}}<li class="Ldt-AnnotationsList-Tag-Li"><span>{{.}}</span></li>{{/.}}{{/tags}}</ul>{{/tags.length}}{{#audio}}<div class="Ldt-AnnotationsList-Play" data-annotation-id="{{id}}">{{l10n.voice_annotation}}</div>{{/audio}}<div class="Ldt-AnnotationsList-EditControls">{{#show_twitter}}<a title="{{l10n.tweet_annotation}}" target="_blank" href="https://twitter.com/intent/tweet?{{twitter_param}}"><img width="16" height="16" src="metadataplayer/img/twitter.svg"></a>{{/show_twitter}}{{#show_publish}}<div title="{{l10n.publish_annotation}}" class="Ldt-AnnotationsList-PublishAnnotation" data-editable_id="{{id}}"></div>{{/show_publish}}{{#editable}}<div title="{{l10n.edit_annotation}}" class="Ldt-AnnotationsList-Edit" data-editable_id="{{id}}"></div><div title="{{l10n.delete_annotation}}" class="Ldt-AnnotationsList-Delete" data-editable_id="{{id}}"></div>{{/editable}}</div></li>'),n};var raphael_min={exports:{}};(function(t,n){(function(l,d){t.exports=d()})(window,function(){return function(l){var d={};function m(h){if(d[h])return d[h].exports;var S=d[h]={i:h,l:!1,exports:{}};return l[h].call(S.exports,S,S.exports,m),S.l=!0,S.exports}return m.m=l,m.c=d,m.d=function(h,S,k){m.o(h,S)||Object.defineProperty(h,S,{enumerable:!0,get:k})},m.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},m.t=function(h,S){if(1&S&&(h=m(h)),8&S||4&S&&typeof h=="object"&&h&&h.__esModule)return h;var k=Object.create(null);if(m.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:h}),2&S&&typeof h!="string")for(var A in h)m.d(k,A,(function(B){return h[B]}).bind(null,A));return k},m.n=function(h){var S=h&&h.__esModule?function(){return h.default}:function(){return h};return m.d(S,"a",S),S},m.o=function(h,S){return Object.prototype.hasOwnProperty.call(h,S)},m.p="",m(m.s=1)}([function(l,d,m){var h,S;h=[m(2)],(S=(function(k){function A(ae){if(A.is(ae,"function"))return B?ae():k.on("raphael.DOMload",ae);if(A.is(ae,v))return A._engine.create[U](A,ae.splice(0,3+A.is(ae[0],w))).add(ae);var ye=Array.prototype.slice.call(arguments,0);if(A.is(ye[ye.length-1],"function")){var Ce=ye.pop();return B?Ce.call(A._engine.create[U](A,ye)):k.on("raphael.DOMload",function(){Ce.call(A._engine.create[U](A,ye))})}return A._engine.create[U](A,arguments)}A.version="2.3.0",A.eve=k;var B,M,j=/[, ]+/,I={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},P=/\{(\d+)\}/g,$="hasOwnProperty",z={doc:document,win:window},N={was:Object.prototype[$].call(z.win,"Raphael"),is:z.win.Raphael},F=function(){this.ca=this.customAttributes={}},U="apply",J="concat",te="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,se="",de=" ",Q=String,ve="split",he="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[ve](de),ke={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},T=Q.prototype.toLowerCase,u=Math,p=u.max,b=u.min,e=u.abs,c=u.pow,y=u.PI,w="number",v="array",o=Object.prototype.toString,x=(A._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),E={NaN:1,Infinity:1,"-Infinity":1},R=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,H=u.round,Y=parseFloat,Z=parseInt,L=Q.prototype.toUpperCase,D=A._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},ee=A._availableAnimAttrs={blur:w,"clip-rect":"csv",cx:w,cy:w,fill:"colour","fill-opacity":w,"font-size":w,height:w,opacity:w,path:"path",r:w,rx:w,ry:w,stroke:"colour","stroke-opacity":w,"stroke-width":w,transform:"transform",width:w,x:w,y:w},oe=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,fe={hs:1,rg:1},ue=/,?([achlmqrstvxz]),?/gi,qe=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,rt=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,Ve=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,et=(A._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),mt=function(ae,ye){return Y(ae)-Y(ye)},Ye=function(ae){return ae},We=A._rectPath=function(ae,ye,Ce,Pe,ze){return ze?[["M",ae+ze,ye],["l",Ce-2*ze,0],["a",ze,ze,0,0,1,ze,ze],["l",0,Pe-2*ze],["a",ze,ze,0,0,1,-ze,ze],["l",2*ze-Ce,0],["a",ze,ze,0,0,1,-ze,-ze],["l",0,2*ze-Pe],["a",ze,ze,0,0,1,ze,-ze],["z"]]:[["M",ae,ye],["l",Ce,0],["l",0,Pe],["l",-Ce,0],["z"]]},Xe=function(ae,ye,Ce,Pe){return Pe==null&&(Pe=Ce),[["M",ae,ye],["m",0,-Pe],["a",Ce,Pe,0,1,1,0,2*Pe],["a",Ce,Pe,0,1,1,0,-2*Pe],["z"]]},Ge=A._getPath={path:function(ae){return ae.attr("path")},circle:function(ae){var ye=ae.attrs;return Xe(ye.cx,ye.cy,ye.r)},ellipse:function(ae){var ye=ae.attrs;return Xe(ye.cx,ye.cy,ye.rx,ye.ry)},rect:function(ae){var ye=ae.attrs;return We(ye.x,ye.y,ye.width,ye.height,ye.r)},image:function(ae){var ye=ae.attrs;return We(ye.x,ye.y,ye.width,ye.height)},text:function(ae){var ye=ae._getBBox();return We(ye.x,ye.y,ye.width,ye.height)},set:function(ae){var ye=ae._getBBox();return We(ye.x,ye.y,ye.width,ye.height)}},nt=A.mapPath=function(ae,ye){if(!ye)return ae;var Ce,Pe,ze,Je,ge,we,Ae;for(ze=0,ge=(ae=Ot(ae)).length;ze<ge;ze++)for(Je=1,we=(Ae=ae[ze]).length;Je<we;Je+=2)Ce=ye.x(Ae[Je],Ae[Je+1]),Pe=ye.y(Ae[Je],Ae[Je+1]),Ae[Je]=Ce,Ae[Je+1]=Pe;return ae};if(A._g=z,A.type=z.win.SVGAngle||z.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML",A.type=="VML"){var Et,Le=z.doc.createElement("div");if(Le.innerHTML='<v:shape adj="1"/>',(Et=Le.firstChild).style.behavior="url(#default#VML)",!Et||typeof Et.adj!="object")return A.type=se;Le=null}function Oe(ae){if(typeof ae=="function"||Object(ae)!==ae)return ae;var ye=new ae.constructor;for(var Ce in ae)ae[$](Ce)&&(ye[Ce]=Oe(ae[Ce]));return ye}A.svg=!(A.vml=A.type=="VML"),A._Paper=F,A.fn=M=F.prototype=A.prototype,A._id=0,A.is=function(ae,ye){return(ye=T.call(ye))=="finite"?!E[$](+ae):ye=="array"?ae instanceof Array:ye=="null"&&ae===null||ye==typeof ae&&ae!==null||ye=="object"&&ae===Object(ae)||ye=="array"&&Array.isArray&&Array.isArray(ae)||o.call(ae).slice(8,-1).toLowerCase()==ye},A.angle=function(ae,ye,Ce,Pe,ze,Je){if(ze==null){var ge=ae-Ce,we=ye-Pe;return ge||we?(180+180*u.atan2(-we,-ge)/y+360)%360:0}return A.angle(ae,ye,ze,Je)-A.angle(Ce,Pe,ze,Je)},A.rad=function(ae){return ae%360*y/180},A.deg=function(ae){return Math.round(180*ae/y%360*1e3)/1e3},A.snapTo=function(ae,ye,Ce){if(Ce=A.is(Ce,"finite")?Ce:10,A.is(ae,v)){for(var Pe=ae.length;Pe--;)if(e(ae[Pe]-ye)<=Ce)return ae[Pe]}else{var ze=ye%(ae=+ae);if(ze<Ce)return ye-ze;if(ze>ae-Ce)return ye-ze+ae}return ye};var $t,dt;A.createUUID=($t=/[xy]/g,dt=function(ae){var ye=16*u.random()|0;return(ae=="x"?ye:3&ye|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace($t,dt).toUpperCase()}),A.setWindow=function(ae){k("raphael.setWindow",A,z.win,ae),z.win=ae,z.doc=z.win.document,A._engine.initWin&&A._engine.initWin(z.win)};var gt=function(ae){if(A.vml){var ye,Ce=/^\s+|\s+$/g;try{var Pe=new ActiveXObject("htmlfile");Pe.write("<body>"),Pe.close(),ye=Pe.body}catch{ye=createPopup().document.body}var ze=ye.createTextRange();gt=$e(function(ge){try{ye.style.color=Q(ge).replace(Ce,se);var we=ze.queryCommandValue("ForeColor");return"#"+("000000"+(we=(255&we)<<16|65280&we|(16711680&we)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var Je=z.doc.createElement("i");Je.title="Raphaël Colour Picker",Je.style.display="none",z.doc.body.appendChild(Je),gt=$e(function(ge){return Je.style.color=ge,z.doc.defaultView.getComputedStyle(Je,se).getPropertyValue("color")})}return gt(ae)},Lt=function(){return"hsb("+[this.h,this.s,this.b]+")"},xe=function(){return"hsl("+[this.h,this.s,this.l]+")"},X=function(){return this.hex},pe=function(ae,ye,Ce){if(ye==null&&A.is(ae,"object")&&"r"in ae&&"g"in ae&&"b"in ae&&(Ce=ae.b,ye=ae.g,ae=ae.r),ye==null&&A.is(ae,"string")){var Pe=A.getRGB(ae);ae=Pe.r,ye=Pe.g,Ce=Pe.b}return(ae>1||ye>1||Ce>1)&&(ae/=255,ye/=255,Ce/=255),[ae,ye,Ce]},je=function(ae,ye,Ce,Pe){var ze={r:ae*=255,g:ye*=255,b:Ce*=255,hex:A.rgb(ae,ye,Ce),toString:X};return A.is(Pe,"finite")&&(ze.opacity=Pe),ze};function $e(ae,ye,Ce){return function Pe(){var ze=Array.prototype.slice.call(arguments,0),Je=ze.join("␀"),ge=Pe.cache=Pe.cache||{},we=Pe.count=Pe.count||[];return ge[$](Je)?(function(Ae,Ue){for(var ht=0,_t=Ae.length;ht<_t;ht++)if(Ae[ht]===Ue)return Ae.push(Ae.splice(ht,1)[0])}(we,Je),Ce?Ce(ge[Je]):ge[Je]):(we.length>=1e3&&delete ge[we.shift()],we.push(Je),ge[Je]=ae[U](ye,ze),Ce?Ce(ge[Je]):ge[Je])}}A.color=function(ae){var ye;return A.is(ae,"object")&&"h"in ae&&"s"in ae&&"b"in ae?(ye=A.hsb2rgb(ae),ae.r=ye.r,ae.g=ye.g,ae.b=ye.b,ae.hex=ye.hex):A.is(ae,"object")&&"h"in ae&&"s"in ae&&"l"in ae?(ye=A.hsl2rgb(ae),ae.r=ye.r,ae.g=ye.g,ae.b=ye.b,ae.hex=ye.hex):(A.is(ae,"string")&&(ae=A.getRGB(ae)),A.is(ae,"object")&&"r"in ae&&"g"in ae&&"b"in ae?(ye=A.rgb2hsl(ae),ae.h=ye.h,ae.s=ye.s,ae.l=ye.l,ye=A.rgb2hsb(ae),ae.v=ye.b):(ae={hex:"none"}).r=ae.g=ae.b=ae.h=ae.s=ae.v=ae.l=-1),ae.toString=X,ae},A.hsb2rgb=function(ae,ye,Ce,Pe){var ze,Je,ge,we,Ae;return this.is(ae,"object")&&"h"in ae&&"s"in ae&&"b"in ae&&(Ce=ae.b,ye=ae.s,Pe=ae.o,ae=ae.h),we=(Ae=Ce*ye)*(1-e((ae=(ae*=360)%360/60)%2-1)),ze=Je=ge=Ce-Ae,je(ze+=[Ae,we,0,0,we,Ae][ae=~~ae],Je+=[we,Ae,Ae,we,0,0][ae],ge+=[0,0,we,Ae,Ae,we][ae],Pe)},A.hsl2rgb=function(ae,ye,Ce,Pe){var ze,Je,ge,we,Ae;return this.is(ae,"object")&&"h"in ae&&"s"in ae&&"l"in ae&&(Ce=ae.l,ye=ae.s,ae=ae.h),(ae>1||ye>1||Ce>1)&&(ae/=360,ye/=100,Ce/=100),we=(Ae=2*ye*(Ce<.5?Ce:1-Ce))*(1-e((ae=(ae*=360)%360/60)%2-1)),ze=Je=ge=Ce-Ae/2,je(ze+=[Ae,we,0,0,we,Ae][ae=~~ae],Je+=[we,Ae,Ae,we,0,0][ae],ge+=[0,0,we,Ae,Ae,we][ae],Pe)},A.rgb2hsb=function(ae,ye,Ce){var Pe,ze;return ae=(Ce=pe(ae,ye,Ce))[0],ye=Ce[1],Ce=Ce[2],{h:(((ze=(Pe=p(ae,ye,Ce))-b(ae,ye,Ce))==0?null:Pe==ae?(ye-Ce)/ze:Pe==ye?(Ce-ae)/ze+2:(ae-ye)/ze+4)+360)%6*60/360,s:ze==0?0:ze/Pe,b:Pe,toString:Lt}},A.rgb2hsl=function(ae,ye,Ce){var Pe,ze,Je,ge;return ae=(Ce=pe(ae,ye,Ce))[0],ye=Ce[1],Ce=Ce[2],Pe=((ze=p(ae,ye,Ce))+(Je=b(ae,ye,Ce)))/2,{h:(((ge=ze-Je)==0?null:ze==ae?(ye-Ce)/ge:ze==ye?(Ce-ae)/ge+2:(ae-ye)/ge+4)+360)%6*60/360,s:ge==0?0:Pe<.5?ge/(2*Pe):ge/(2-2*Pe),l:Pe,toString:xe}},A._path2string=function(){return this.join(",").replace(ue,"$1")},A._preload=function(ae,ye){var Ce=z.doc.createElement("img");Ce.style.cssText="position:absolute;left:-9999em;top:-9999em",Ce.onload=function(){ye.call(this),this.onload=null,z.doc.body.removeChild(this)},Ce.onerror=function(){z.doc.body.removeChild(this)},z.doc.body.appendChild(Ce),Ce.src=ae};function He(){return this.hex}function Fe(ae,ye){for(var Ce=[],Pe=0,ze=ae.length;ze-2*!ye>Pe;Pe+=2){var Je=[{x:+ae[Pe-2],y:+ae[Pe-1]},{x:+ae[Pe],y:+ae[Pe+1]},{x:+ae[Pe+2],y:+ae[Pe+3]},{x:+ae[Pe+4],y:+ae[Pe+5]}];ye?Pe?ze-4==Pe?Je[3]={x:+ae[0],y:+ae[1]}:ze-2==Pe&&(Je[2]={x:+ae[0],y:+ae[1]},Je[3]={x:+ae[2],y:+ae[3]}):Je[0]={x:+ae[ze-2],y:+ae[ze-1]}:ze-4==Pe?Je[3]=Je[2]:Pe||(Je[0]={x:+ae[Pe],y:+ae[Pe+1]}),Ce.push(["C",(-Je[0].x+6*Je[1].x+Je[2].x)/6,(-Je[0].y+6*Je[1].y+Je[2].y)/6,(Je[1].x+6*Je[2].x-Je[3].x)/6,(Je[1].y+6*Je[2].y-Je[3].y)/6,Je[2].x,Je[2].y])}return Ce}A.getRGB=$e(function(ae){if(!ae||(ae=Q(ae)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:He};if(ae=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:He};!fe[$](ae.toLowerCase().substring(0,2))&&ae.charAt()!="#"&&(ae=gt(ae));var ye,Ce,Pe,ze,Je,ge,we=ae.match(x);return we?(we[2]&&(Pe=Z(we[2].substring(5),16),Ce=Z(we[2].substring(3,5),16),ye=Z(we[2].substring(1,3),16)),we[3]&&(Pe=Z((Je=we[3].charAt(3))+Je,16),Ce=Z((Je=we[3].charAt(2))+Je,16),ye=Z((Je=we[3].charAt(1))+Je,16)),we[4]&&(ge=we[4][ve](oe),ye=Y(ge[0]),ge[0].slice(-1)=="%"&&(ye*=2.55),Ce=Y(ge[1]),ge[1].slice(-1)=="%"&&(Ce*=2.55),Pe=Y(ge[2]),ge[2].slice(-1)=="%"&&(Pe*=2.55),we[1].toLowerCase().slice(0,4)=="rgba"&&(ze=Y(ge[3])),ge[3]&&ge[3].slice(-1)=="%"&&(ze/=100)),we[5]?(ge=we[5][ve](oe),ye=Y(ge[0]),ge[0].slice(-1)=="%"&&(ye*=2.55),Ce=Y(ge[1]),ge[1].slice(-1)=="%"&&(Ce*=2.55),Pe=Y(ge[2]),ge[2].slice(-1)=="%"&&(Pe*=2.55),(ge[0].slice(-3)=="deg"||ge[0].slice(-1)=="°")&&(ye/=360),we[1].toLowerCase().slice(0,4)=="hsba"&&(ze=Y(ge[3])),ge[3]&&ge[3].slice(-1)=="%"&&(ze/=100),A.hsb2rgb(ye,Ce,Pe,ze)):we[6]?(ge=we[6][ve](oe),ye=Y(ge[0]),ge[0].slice(-1)=="%"&&(ye*=2.55),Ce=Y(ge[1]),ge[1].slice(-1)=="%"&&(Ce*=2.55),Pe=Y(ge[2]),ge[2].slice(-1)=="%"&&(Pe*=2.55),(ge[0].slice(-3)=="deg"||ge[0].slice(-1)=="°")&&(ye/=360),we[1].toLowerCase().slice(0,4)=="hsla"&&(ze=Y(ge[3])),ge[3]&&ge[3].slice(-1)=="%"&&(ze/=100),A.hsl2rgb(ye,Ce,Pe,ze)):((we={r:ye,g:Ce,b:Pe,toString:He}).hex="#"+(16777216|Pe|Ce<<8|ye<<16).toString(16).slice(1),A.is(ze,"finite")&&(we.opacity=ze),we)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:He}},A),A.hsb=$e(function(ae,ye,Ce){return A.hsb2rgb(ae,ye,Ce).hex}),A.hsl=$e(function(ae,ye,Ce){return A.hsl2rgb(ae,ye,Ce).hex}),A.rgb=$e(function(ae,ye,Ce){function Pe(ze){return ze+.5|0}return"#"+(16777216|Pe(Ce)|Pe(ye)<<8|Pe(ae)<<16).toString(16).slice(1)}),A.getColor=function(ae){var ye=this.getColor.start=this.getColor.start||{h:0,s:1,b:ae||.75},Ce=this.hsb2rgb(ye.h,ye.s,ye.b);return ye.h+=.075,ye.h>1&&(ye.h=0,ye.s-=.2,ye.s<=0&&(this.getColor.start={h:0,s:1,b:ye.b})),Ce.hex},A.getColor.reset=function(){delete this.start},A.parsePathString=function(ae){if(!ae)return null;var ye=Me(ae);if(ye.arr)return ot(ye.arr);var Ce={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Pe=[];return A.is(ae,v)&&A.is(ae[0],v)&&(Pe=ot(ae)),Pe.length||Q(ae).replace(qe,function(ze,Je,ge){var we=[],Ae=Je.toLowerCase();if(ge.replace(Ve,function(Ue,ht){ht&&we.push(+ht)}),Ae=="m"&&we.length>2&&(Pe.push([Je][J](we.splice(0,2))),Ae="l",Je=Je=="m"?"l":"L"),Ae=="r")Pe.push([Je][J](we));else for(;we.length>=Ce[Ae]&&(Pe.push([Je][J](we.splice(0,Ce[Ae]))),Ce[Ae]););}),Pe.toString=A._path2string,ye.arr=ot(Pe),Pe},A.parseTransformString=$e(function(ae){if(!ae)return null;var ye=[];return A.is(ae,v)&&A.is(ae[0],v)&&(ye=ot(ae)),ye.length||Q(ae).replace(rt,function(Ce,Pe,ze){var Je=[];T.call(Pe),ze.replace(Ve,function(ge,we){we&&Je.push(+we)}),ye.push([Pe][J](Je))}),ye.toString=A._path2string,ye},this,function(ae){if(!ae)return ae;for(var ye=[],Ce=0;Ce<ae.length;Ce++){for(var Pe=[],ze=0;ze<ae[Ce].length;ze++)Pe.push(ae[Ce][ze]);ye.push(Pe)}return ye});var Me=function(ae){var ye=Me.ps=Me.ps||{};return ye[ae]?ye[ae].sleep=100:ye[ae]={sleep:100},setTimeout(function(){for(var Ce in ye)ye[$](Ce)&&Ce!=ae&&(ye[Ce].sleep--,!ye[Ce].sleep&&delete ye[Ce])}),ye[ae]};function Rt(ae,ye,Ce,Pe,ze){return ae*(ae*(-3*ye+9*Ce-9*Pe+3*ze)+6*ye-12*Ce+6*Pe)-3*ye+3*Ce}function yt(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){Ae==null&&(Ae=1);for(var Ue=(Ae=Ae>1?1:Ae<0?0:Ae)/2,ht=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],_t=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],Ct=0,At=0;At<12;At++){var Qt=Ue*ht[At]+Ue,ir=Rt(Qt,ae,Ce,ze,ge),tr=Rt(Qt,ye,Pe,Je,we),Zt=ir*ir+tr*tr;Ct+=_t[At]*u.sqrt(Zt)}return Ue*Ct}function le(ae,ye,Ce,Pe,ze,Je,ge,we){if(!(p(ae,Ce)<b(ze,ge)||b(ae,Ce)>p(ze,ge)||p(ye,Pe)<b(Je,we)||b(ye,Pe)>p(Je,we))){var Ae=(ae-Ce)*(Je-we)-(ye-Pe)*(ze-ge);if(Ae){var Ue=((ae*Pe-ye*Ce)*(ze-ge)-(ae-Ce)*(ze*we-Je*ge))/Ae,ht=((ae*Pe-ye*Ce)*(Je-we)-(ye-Pe)*(ze*we-Je*ge))/Ae,_t=+Ue.toFixed(2),Ct=+ht.toFixed(2);if(!(_t<+b(ae,Ce).toFixed(2)||_t>+p(ae,Ce).toFixed(2)||_t<+b(ze,ge).toFixed(2)||_t>+p(ze,ge).toFixed(2)||Ct<+b(ye,Pe).toFixed(2)||Ct>+p(ye,Pe).toFixed(2)||Ct<+b(Je,we).toFixed(2)||Ct>+p(Je,we).toFixed(2)))return{x:Ue,y:ht}}}}function wt(ae,ye,Ce){var Pe=A.bezierBBox(ae),ze=A.bezierBBox(ye);if(!A.isBBoxIntersect(Pe,ze))return Ce?0:[];for(var Je=yt.apply(0,ae),ge=yt.apply(0,ye),we=p(~~(Je/5),1),Ae=p(~~(ge/5),1),Ue=[],ht=[],_t={},Ct=Ce?0:[],At=0;At<we+1;At++){var Qt=A.findDotsAtSegment.apply(A,ae.concat(At/we));Ue.push({x:Qt.x,y:Qt.y,t:At/we})}for(At=0;At<Ae+1;At++)Qt=A.findDotsAtSegment.apply(A,ye.concat(At/Ae)),ht.push({x:Qt.x,y:Qt.y,t:At/Ae});for(At=0;At<we;At++)for(var ir=0;ir<Ae;ir++){var tr=Ue[At],Zt=Ue[At+1],Br=ht[ir],pr=ht[ir+1],_r=e(Zt.x-tr.x)<.001?"y":"x",fr=e(pr.x-Br.x)<.001?"y":"x",Gr=le(tr.x,tr.y,Zt.x,Zt.y,Br.x,Br.y,pr.x,pr.y);if(Gr){if(_t[Gr.x.toFixed(4)]==Gr.y.toFixed(4))continue;_t[Gr.x.toFixed(4)]=Gr.y.toFixed(4);var Nr=tr.t+e((Gr[_r]-tr[_r])/(Zt[_r]-tr[_r]))*(Zt.t-tr.t),Zr=Br.t+e((Gr[fr]-Br[fr])/(pr[fr]-Br[fr]))*(pr.t-Br.t);Nr>=0&&Nr<=1.001&&Zr>=0&&Zr<=1.001&&(Ce?Ct++:Ct.push({x:Gr.x,y:Gr.y,t1:b(Nr,1),t2:b(Zr,1)}))}}return Ct}function at(ae,ye,Ce){ae=A._path2curve(ae),ye=A._path2curve(ye);for(var Pe,ze,Je,ge,we,Ae,Ue,ht,_t,Ct,At=Ce?0:[],Qt=0,ir=ae.length;Qt<ir;Qt++){var tr=ae[Qt];if(tr[0]=="M")Pe=we=tr[1],ze=Ae=tr[2];else{tr[0]=="C"?(_t=[Pe,ze].concat(tr.slice(1)),Pe=_t[6],ze=_t[7]):(_t=[Pe,ze,Pe,ze,we,Ae,we,Ae],Pe=we,ze=Ae);for(var Zt=0,Br=ye.length;Zt<Br;Zt++){var pr=ye[Zt];if(pr[0]=="M")Je=Ue=pr[1],ge=ht=pr[2];else{pr[0]=="C"?(Ct=[Je,ge].concat(pr.slice(1)),Je=Ct[6],ge=Ct[7]):(Ct=[Je,ge,Je,ge,Ue,ht,Ue,ht],Je=Ue,ge=ht);var _r=wt(_t,Ct,Ce);if(Ce)At+=_r;else{for(var fr=0,Gr=_r.length;fr<Gr;fr++)_r[fr].segment1=Qt,_r[fr].segment2=Zt,_r[fr].bez1=_t,_r[fr].bez2=Ct;At=At.concat(_r)}}}}}return At}A.findDotsAtSegment=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){var Ue=1-Ae,ht=c(Ue,3),_t=c(Ue,2),Ct=Ae*Ae,At=Ct*Ae,Qt=ht*ae+3*_t*Ae*Ce+3*Ue*Ae*Ae*ze+At*ge,ir=ht*ye+3*_t*Ae*Pe+3*Ue*Ae*Ae*Je+At*we,tr=ae+2*Ae*(Ce-ae)+Ct*(ze-2*Ce+ae),Zt=ye+2*Ae*(Pe-ye)+Ct*(Je-2*Pe+ye),Br=Ce+2*Ae*(ze-Ce)+Ct*(ge-2*ze+Ce),pr=Pe+2*Ae*(Je-Pe)+Ct*(we-2*Je+Pe),_r=Ue*ae+Ae*Ce,fr=Ue*ye+Ae*Pe,Gr=Ue*ze+Ae*ge,Nr=Ue*Je+Ae*we,Zr=90-180*u.atan2(tr-Br,Zt-pr)/y;return(tr>Br||Zt<pr)&&(Zr+=180),{x:Qt,y:ir,m:{x:tr,y:Zt},n:{x:Br,y:pr},start:{x:_r,y:fr},end:{x:Gr,y:Nr},alpha:Zr}},A.bezierBBox=function(ae,ye,Ce,Pe,ze,Je,ge,we){A.is(ae,"array")||(ae=[ae,ye,Ce,Pe,ze,Je,ge,we]);var Ae=Pt.apply(null,ae);return{x:Ae.min.x,y:Ae.min.y,x2:Ae.max.x,y2:Ae.max.y,width:Ae.max.x-Ae.min.x,height:Ae.max.y-Ae.min.y}},A.isPointInsideBBox=function(ae,ye,Ce){return ye>=ae.x&&ye<=ae.x2&&Ce>=ae.y&&Ce<=ae.y2},A.isBBoxIntersect=function(ae,ye){var Ce=A.isPointInsideBBox;return Ce(ye,ae.x,ae.y)||Ce(ye,ae.x2,ae.y)||Ce(ye,ae.x,ae.y2)||Ce(ye,ae.x2,ae.y2)||Ce(ae,ye.x,ye.y)||Ce(ae,ye.x2,ye.y)||Ce(ae,ye.x,ye.y2)||Ce(ae,ye.x2,ye.y2)||(ae.x<ye.x2&&ae.x>ye.x||ye.x<ae.x2&&ye.x>ae.x)&&(ae.y<ye.y2&&ae.y>ye.y||ye.y<ae.y2&&ye.y>ae.y)},A.pathIntersection=function(ae,ye){return at(ae,ye)},A.pathIntersectionNumber=function(ae,ye){return at(ae,ye,1)},A.isPointInsidePath=function(ae,ye,Ce){var Pe=A.pathBBox(ae);return A.isPointInsideBBox(Pe,ye,Ce)&&at(ae,[["M",ye,Ce],["H",Pe.x2+10]],1)%2==1},A._removedFactory=function(ae){return function(){k("raphael.log",null,"Raphaël: you are calling to method “"+ae+"” of removed object",ae)}};var Be=A.pathBBox=function(ae){var ye=Me(ae);if(ye.bbox)return Oe(ye.bbox);if(!ae)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var Ce,Pe=0,ze=0,Je=[],ge=[],we=0,Ae=(ae=Ot(ae)).length;we<Ae;we++)if((Ce=ae[we])[0]=="M")Pe=Ce[1],ze=Ce[2],Je.push(Pe),ge.push(ze);else{var Ue=Pt(Pe,ze,Ce[1],Ce[2],Ce[3],Ce[4],Ce[5],Ce[6]);Je=Je[J](Ue.min.x,Ue.max.x),ge=ge[J](Ue.min.y,Ue.max.y),Pe=Ce[5],ze=Ce[6]}var ht=b[U](0,Je),_t=b[U](0,ge),Ct=p[U](0,Je),At=p[U](0,ge),Qt=Ct-ht,ir=At-_t,tr={x:ht,y:_t,x2:Ct,y2:At,width:Qt,height:ir,cx:ht+Qt/2,cy:_t+ir/2};return ye.bbox=Oe(tr),tr},ot=function(ae){var ye=Oe(ae);return ye.toString=A._path2string,ye},tt=A._pathToRelative=function(ae){var ye=Me(ae);if(ye.rel)return ot(ye.rel);A.is(ae,v)&&A.is(ae&&ae[0],v)||(ae=A.parsePathString(ae));var Ce=[],Pe=0,ze=0,Je=0,ge=0,we=0;ae[0][0]=="M"&&(Je=Pe=ae[0][1],ge=ze=ae[0][2],we++,Ce.push(["M",Pe,ze]));for(var Ae=we,Ue=ae.length;Ae<Ue;Ae++){var ht=Ce[Ae]=[],_t=ae[Ae];if(_t[0]!=T.call(_t[0]))switch(ht[0]=T.call(_t[0]),ht[0]){case"a":ht[1]=_t[1],ht[2]=_t[2],ht[3]=_t[3],ht[4]=_t[4],ht[5]=_t[5],ht[6]=+(_t[6]-Pe).toFixed(3),ht[7]=+(_t[7]-ze).toFixed(3);break;case"v":ht[1]=+(_t[1]-ze).toFixed(3);break;case"m":Je=_t[1],ge=_t[2];default:for(var Ct=1,At=_t.length;Ct<At;Ct++)ht[Ct]=+(_t[Ct]-(Ct%2?Pe:ze)).toFixed(3)}else{ht=Ce[Ae]=[],_t[0]=="m"&&(Je=_t[1]+Pe,ge=_t[2]+ze);for(var Qt=0,ir=_t.length;Qt<ir;Qt++)Ce[Ae][Qt]=_t[Qt]}var tr=Ce[Ae].length;switch(Ce[Ae][0]){case"z":Pe=Je,ze=ge;break;case"h":Pe+=+Ce[Ae][tr-1];break;case"v":ze+=+Ce[Ae][tr-1];break;default:Pe+=+Ce[Ae][tr-2],ze+=+Ce[Ae][tr-1]}}return Ce.toString=A._path2string,ye.rel=ot(Ce),Ce},kt=A._pathToAbsolute=function(ae){var ye=Me(ae);if(ye.abs)return ot(ye.abs);if(A.is(ae,v)&&A.is(ae&&ae[0],v)||(ae=A.parsePathString(ae)),!ae||!ae.length)return[["M",0,0]];var Ce=[],Pe=0,ze=0,Je=0,ge=0,we=0;ae[0][0]=="M"&&(Je=Pe=+ae[0][1],ge=ze=+ae[0][2],we++,Ce[0]=["M",Pe,ze]);for(var Ae,Ue,ht=ae.length==3&&ae[0][0]=="M"&&ae[1][0].toUpperCase()=="R"&&ae[2][0].toUpperCase()=="Z",_t=we,Ct=ae.length;_t<Ct;_t++){if(Ce.push(Ae=[]),(Ue=ae[_t])[0]!=L.call(Ue[0]))switch(Ae[0]=L.call(Ue[0]),Ae[0]){case"A":Ae[1]=Ue[1],Ae[2]=Ue[2],Ae[3]=Ue[3],Ae[4]=Ue[4],Ae[5]=Ue[5],Ae[6]=+(Ue[6]+Pe),Ae[7]=+(Ue[7]+ze);break;case"V":Ae[1]=+Ue[1]+ze;break;case"H":Ae[1]=+Ue[1]+Pe;break;case"R":for(var At=[Pe,ze][J](Ue.slice(1)),Qt=2,ir=At.length;Qt<ir;Qt++)At[Qt]=+At[Qt]+Pe,At[++Qt]=+At[Qt]+ze;Ce.pop(),Ce=Ce[J](Fe(At,ht));break;case"M":Je=+Ue[1]+Pe,ge=+Ue[2]+ze;default:for(Qt=1,ir=Ue.length;Qt<ir;Qt++)Ae[Qt]=+Ue[Qt]+(Qt%2?Pe:ze)}else if(Ue[0]=="R")At=[Pe,ze][J](Ue.slice(1)),Ce.pop(),Ce=Ce[J](Fe(At,ht)),Ae=["R"][J](Ue.slice(-2));else for(var tr=0,Zt=Ue.length;tr<Zt;tr++)Ae[tr]=Ue[tr];switch(Ae[0]){case"Z":Pe=Je,ze=ge;break;case"H":Pe=Ae[1];break;case"V":ze=Ae[1];break;case"M":Je=Ae[Ae.length-2],ge=Ae[Ae.length-1];default:Pe=Ae[Ae.length-2],ze=Ae[Ae.length-1]}}return Ce.toString=A._path2string,ye.abs=ot(Ce),Ce},Yt=function(ae,ye,Ce,Pe){return[ae,ye,Ce,Pe,Ce,Pe]},pt=function(ae,ye,Ce,Pe,ze,Je){return[1/3*ae+2/3*Ce,1/3*ye+2/3*Pe,1/3*ze+2/3*Ce,1/3*Je+2/3*Pe,ze,Je]},It=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae,Ue){var ht,_t=120*y/180,Ct=y/180*(+ze||0),At=[],Qt=$e(function(V,ie,be){return{x:V*u.cos(be)-ie*u.sin(be),y:V*u.sin(be)+ie*u.cos(be)}});if(Ue)Nr=Ue[0],Zr=Ue[1],fr=Ue[2],Gr=Ue[3];else{ae=(ht=Qt(ae,ye,-Ct)).x,ye=ht.y,we=(ht=Qt(we,Ae,-Ct)).x,Ae=ht.y;var ir=(ae-we)/2,tr=(ye-Ae)/2,Zt=ir*ir/(Ce*Ce)+tr*tr/(Pe*Pe);Zt>1&&(Ce*=Zt=u.sqrt(Zt),Pe*=Zt);var Br=Ce*Ce,pr=Pe*Pe,_r=(Je==ge?-1:1)*u.sqrt(e((Br*pr-Br*tr*tr-pr*ir*ir)/(Br*tr*tr+pr*ir*ir))),fr=_r*Ce*tr/Pe+(ae+we)/2,Gr=_r*-Pe*ir/Ce+(ye+Ae)/2,Nr=u.asin(((ye-Gr)/Pe).toFixed(9)),Zr=u.asin(((Ae-Gr)/Pe).toFixed(9));(Nr=ae<fr?y-Nr:Nr)<0&&(Nr=2*y+Nr),(Zr=we<fr?y-Zr:Zr)<0&&(Zr=2*y+Zr),ge&&Nr>Zr&&(Nr-=2*y),!ge&&Zr>Nr&&(Zr-=2*y)}var Sn=Zr-Nr;if(e(Sn)>_t){var qn=Zr,ii=we,si=Ae;Zr=Nr+_t*(ge&&Zr>Nr?1:-1),we=fr+Ce*u.cos(Zr),Ae=Gr+Pe*u.sin(Zr),At=It(we,Ae,Ce,Pe,ze,0,ge,ii,si,[Zr,qn,fr,Gr])}Sn=Zr-Nr;var vn=u.cos(Nr),on=u.sin(Nr),Bn=u.cos(Zr),Hi=u.sin(Zr),Xi=u.tan(Sn/4),Kn=4/3*Ce*Xi,ta=4/3*Pe*Xi,ma=[ae,ye],yi=[ae+Kn*on,ye-ta*vn],Rn=[we+Kn*Hi,Ae-ta*Bn],Ui=[we,Ae];if(yi[0]=2*ma[0]-yi[0],yi[1]=2*ma[1]-yi[1],Ue)return[yi,Rn,Ui][J](At);for(var ra=[],Wi=0,Bi=(At=[yi,Rn,Ui][J](At).join()[ve](",")).length;Wi<Bi;Wi++)ra[Wi]=Wi%2?Qt(At[Wi-1],At[Wi],Ct).y:Qt(At[Wi],At[Wi+1],Ct).x;return ra},Fr=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){var Ue=1-Ae;return{x:c(Ue,3)*ae+3*c(Ue,2)*Ae*Ce+3*Ue*Ae*Ae*ze+c(Ae,3)*ge,y:c(Ue,3)*ye+3*c(Ue,2)*Ae*Pe+3*Ue*Ae*Ae*Je+c(Ae,3)*we}},Pt=$e(function(ae,ye,Ce,Pe,ze,Je,ge,we){var Ae,Ue=ze-2*Ce+ae-(ge-2*ze+Ce),ht=2*(Ce-ae)-2*(ze-Ce),_t=ae-Ce,Ct=(-ht+u.sqrt(ht*ht-4*Ue*_t))/2/Ue,At=(-ht-u.sqrt(ht*ht-4*Ue*_t))/2/Ue,Qt=[ye,we],ir=[ae,ge];return e(Ct)>"1e12"&&(Ct=.5),e(At)>"1e12"&&(At=.5),Ct>0&&Ct<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,Ct),ir.push(Ae.x),Qt.push(Ae.y)),At>0&&At<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,At),ir.push(Ae.x),Qt.push(Ae.y)),Ue=Je-2*Pe+ye-(we-2*Je+Pe),_t=ye-Pe,Ct=(-(ht=2*(Pe-ye)-2*(Je-Pe))+u.sqrt(ht*ht-4*Ue*_t))/2/Ue,At=(-ht-u.sqrt(ht*ht-4*Ue*_t))/2/Ue,e(Ct)>"1e12"&&(Ct=.5),e(At)>"1e12"&&(At=.5),Ct>0&&Ct<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,Ct),ir.push(Ae.x),Qt.push(Ae.y)),At>0&&At<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,At),ir.push(Ae.x),Qt.push(Ae.y)),{min:{x:b[U](0,ir),y:b[U](0,Qt)},max:{x:p[U](0,ir),y:p[U](0,Qt)}}}),Ot=A._path2curve=$e(function(ae,ye){var Ce=!ye&&Me(ae);if(!ye&&Ce.curve)return ot(Ce.curve);for(var Pe=kt(ae),ze=ye&&kt(ye),Je={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},ge={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},we=function(_r,fr,Gr){var Nr,Zr;if(!_r)return["C",fr.x,fr.y,fr.x,fr.y,fr.x,fr.y];switch(!(_r[0]in{T:1,Q:1})&&(fr.qx=fr.qy=null),_r[0]){case"M":fr.X=_r[1],fr.Y=_r[2];break;case"A":_r=["C"][J](It[U](0,[fr.x,fr.y][J](_r.slice(1))));break;case"S":Gr=="C"||Gr=="S"?(Nr=2*fr.x-fr.bx,Zr=2*fr.y-fr.by):(Nr=fr.x,Zr=fr.y),_r=["C",Nr,Zr][J](_r.slice(1));break;case"T":Gr=="Q"||Gr=="T"?(fr.qx=2*fr.x-fr.qx,fr.qy=2*fr.y-fr.qy):(fr.qx=fr.x,fr.qy=fr.y),_r=["C"][J](pt(fr.x,fr.y,fr.qx,fr.qy,_r[1],_r[2]));break;case"Q":fr.qx=_r[1],fr.qy=_r[2],_r=["C"][J](pt(fr.x,fr.y,_r[1],_r[2],_r[3],_r[4]));break;case"L":_r=["C"][J](Yt(fr.x,fr.y,_r[1],_r[2]));break;case"H":_r=["C"][J](Yt(fr.x,fr.y,_r[1],fr.y));break;case"V":_r=["C"][J](Yt(fr.x,fr.y,fr.x,_r[1]));break;case"Z":_r=["C"][J](Yt(fr.x,fr.y,fr.X,fr.Y))}return _r},Ae=function(_r,fr){if(_r[fr].length>7){_r[fr].shift();for(var Gr=_r[fr];Gr.length;)ht[fr]="A",ze&&(_t[fr]="A"),_r.splice(fr++,0,["C"][J](Gr.splice(0,6)));_r.splice(fr,1),ir=p(Pe.length,ze&&ze.length||0)}},Ue=function(_r,fr,Gr,Nr,Zr){_r&&fr&&_r[Zr][0]=="M"&&fr[Zr][0]!="M"&&(fr.splice(Zr,0,["M",Nr.x,Nr.y]),Gr.bx=0,Gr.by=0,Gr.x=_r[Zr][1],Gr.y=_r[Zr][2],ir=p(Pe.length,ze&&ze.length||0))},ht=[],_t=[],Ct="",At="",Qt=0,ir=p(Pe.length,ze&&ze.length||0);Qt<ir;Qt++){Pe[Qt]&&(Ct=Pe[Qt][0]),Ct!="C"&&(ht[Qt]=Ct,Qt&&(At=ht[Qt-1])),Pe[Qt]=we(Pe[Qt],Je,At),ht[Qt]!="A"&&Ct=="C"&&(ht[Qt]="C"),Ae(Pe,Qt),ze&&(ze[Qt]&&(Ct=ze[Qt][0]),Ct!="C"&&(_t[Qt]=Ct,Qt&&(At=_t[Qt-1])),ze[Qt]=we(ze[Qt],ge,At),_t[Qt]!="A"&&Ct=="C"&&(_t[Qt]="C"),Ae(ze,Qt)),Ue(Pe,ze,Je,ge,Qt),Ue(ze,Pe,ge,Je,Qt);var tr=Pe[Qt],Zt=ze&&ze[Qt],Br=tr.length,pr=ze&&Zt.length;Je.x=tr[Br-2],Je.y=tr[Br-1],Je.bx=Y(tr[Br-4])||Je.x,Je.by=Y(tr[Br-3])||Je.y,ge.bx=ze&&(Y(Zt[pr-4])||ge.x),ge.by=ze&&(Y(Zt[pr-3])||ge.y),ge.x=ze&&Zt[pr-2],ge.y=ze&&Zt[pr-1]}return ze||(Ce.curve=ot(Pe)),ze?[Pe,ze]:Pe},null,ot),Te=(A._parseDots=$e(function(ae){for(var ye=[],Ce=0,Pe=ae.length;Ce<Pe;Ce++){var ze={},Je=ae[Ce].match(/^([^:]*):?([\d\.]*)/);if(ze.color=A.getRGB(Je[1]),ze.color.error)return null;ze.opacity=ze.color.opacity,ze.color=ze.color.hex,Je[2]&&(ze.offset=Je[2]+"%"),ye.push(ze)}for(Ce=1,Pe=ye.length-1;Ce<Pe;Ce++)if(!ye[Ce].offset){for(var ge=Y(ye[Ce-1].offset||0),we=0,Ae=Ce+1;Ae<Pe;Ae++)if(ye[Ae].offset){we=ye[Ae].offset;break}we||(we=100,Ae=Pe);for(var Ue=((we=Y(we))-ge)/(Ae-Ce+1);Ce<Ae;Ce++)ge+=Ue,ye[Ce].offset=ge+"%"}return ye}),A._tear=function(ae,ye){ae==ye.top&&(ye.top=ae.prev),ae==ye.bottom&&(ye.bottom=ae.next),ae.next&&(ae.next.prev=ae.prev),ae.prev&&(ae.prev.next=ae.next)}),me=(A._tofront=function(ae,ye){ye.top!==ae&&(Te(ae,ye),ae.next=null,ae.prev=ye.top,ye.top.next=ae,ye.top=ae)},A._toback=function(ae,ye){ye.bottom!==ae&&(Te(ae,ye),ae.next=ye.bottom,ae.prev=null,ye.bottom.prev=ae,ye.bottom=ae)},A._insertafter=function(ae,ye,Ce){Te(ae,Ce),ye==Ce.top&&(Ce.top=ae),ye.next&&(ye.next.prev=ae),ae.next=ye.next,ae.prev=ye,ye.next=ae},A._insertbefore=function(ae,ye,Ce){Te(ae,Ce),ye==Ce.bottom&&(Ce.bottom=ae),ye.prev&&(ye.prev.next=ae),ae.prev=ye.prev,ye.prev=ae,ae.next=ye},A.toMatrix=function(ae,ye){var Ce=Be(ae),Pe={_:{transform:se},getBBox:function(){return Ce}};return ce(Pe,ye),Pe.matrix}),ce=(A.transformPath=function(ae,ye){return nt(ae,me(ae,ye))},A._extractTransform=function(ae,ye){if(ye==null)return ae._.transform;ye=Q(ye).replace(/\.{3}|\u2026/g,ae._.transform||se);var Ce,Pe,ze=A.parseTransformString(ye),Je=0,ge=1,we=1,Ae=ae._,Ue=new Re;if(Ae.transform=ze||[],ze)for(var ht=0,_t=ze.length;ht<_t;ht++){var Ct,At,Qt,ir,tr,Zt=ze[ht],Br=Zt.length,pr=Q(Zt[0]).toLowerCase(),_r=Zt[0]!=pr,fr=_r?Ue.invert():0;pr=="t"&&Br==3?_r?(Ct=fr.x(0,0),At=fr.y(0,0),Qt=fr.x(Zt[1],Zt[2]),ir=fr.y(Zt[1],Zt[2]),Ue.translate(Qt-Ct,ir-At)):Ue.translate(Zt[1],Zt[2]):pr=="r"?Br==2?(tr=tr||ae.getBBox(1),Ue.rotate(Zt[1],tr.x+tr.width/2,tr.y+tr.height/2),Je+=Zt[1]):Br==4&&(_r?(Qt=fr.x(Zt[2],Zt[3]),ir=fr.y(Zt[2],Zt[3]),Ue.rotate(Zt[1],Qt,ir)):Ue.rotate(Zt[1],Zt[2],Zt[3]),Je+=Zt[1]):pr=="s"?Br==2||Br==3?(tr=tr||ae.getBBox(1),Ue.scale(Zt[1],Zt[Br-1],tr.x+tr.width/2,tr.y+tr.height/2),ge*=Zt[1],we*=Zt[Br-1]):Br==5&&(_r?(Qt=fr.x(Zt[3],Zt[4]),ir=fr.y(Zt[3],Zt[4]),Ue.scale(Zt[1],Zt[2],Qt,ir)):Ue.scale(Zt[1],Zt[2],Zt[3],Zt[4]),ge*=Zt[1],we*=Zt[2]):pr=="m"&&Br==7&&Ue.add(Zt[1],Zt[2],Zt[3],Zt[4],Zt[5],Zt[6]),Ae.dirtyT=1,ae.matrix=Ue}ae.matrix=Ue,Ae.sx=ge,Ae.sy=we,Ae.deg=Je,Ae.dx=Ce=Ue.e,Ae.dy=Pe=Ue.f,ge==1&&we==1&&!Je&&Ae.bbox?(Ae.bbox.x+=+Ce,Ae.bbox.y+=+Pe):Ae.dirtyT=1}),ne=function(ae){var ye=ae[0];switch(ye.toLowerCase()){case"t":return[ye,0,0];case"m":return[ye,1,0,0,1,0,0];case"r":return ae.length==4?[ye,0,ae[2],ae[3]]:[ye,0];case"s":return ae.length==5?[ye,1,1,ae[3],ae[4]]:ae.length==3?[ye,1,1]:[ye,1]}},_e=A._equaliseTransform=function(ae,ye){ye=Q(ye).replace(/\.{3}|\u2026/g,ae),ae=A.parseTransformString(ae)||[],ye=A.parseTransformString(ye)||[];for(var Ce,Pe,ze,Je,ge=p(ae.length,ye.length),we=[],Ae=[],Ue=0;Ue<ge;Ue++){if(ze=ae[Ue]||ne(ye[Ue]),Je=ye[Ue]||ne(ze),ze[0]!=Je[0]||ze[0].toLowerCase()=="r"&&(ze[2]!=Je[2]||ze[3]!=Je[3])||ze[0].toLowerCase()=="s"&&(ze[3]!=Je[3]||ze[4]!=Je[4]))return;for(we[Ue]=[],Ae[Ue]=[],Ce=0,Pe=p(ze.length,Je.length);Ce<Pe;Ce++)Ce in ze&&(we[Ue][Ce]=ze[Ce]),Ce in Je&&(Ae[Ue][Ce]=Je[Ce])}return{from:we,to:Ae}};function Re(ae,ye,Ce,Pe,ze,Je){ae!=null?(this.a=+ae,this.b=+ye,this.c=+Ce,this.d=+Pe,this.e=+ze,this.f=+Je):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}A._getContainer=function(ae,ye,Ce,Pe){var ze;if((ze=Pe!=null||A.is(ae,"object")?ae:z.doc.getElementById(ae))!=null)return ze.tagName?ye==null?{container:ze,width:ze.style.pixelWidth||ze.offsetWidth,height:ze.style.pixelHeight||ze.offsetHeight}:{container:ze,width:ye,height:Ce}:{container:1,x:ae,y:ye,width:Ce,height:Pe}},A.pathToRelative=tt,A._engine={},A.path2curve=Ot,A.matrix=function(ae,ye,Ce,Pe,ze,Je){return new Re(ae,ye,Ce,Pe,ze,Je)},function(ae){function ye(Pe){return Pe[0]*Pe[0]+Pe[1]*Pe[1]}function Ce(Pe){var ze=u.sqrt(ye(Pe));Pe[0]&&(Pe[0]/=ze),Pe[1]&&(Pe[1]/=ze)}ae.add=function(Pe,ze,Je,ge,we,Ae){var Ue,ht,_t,Ct,At=[[],[],[]],Qt=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],ir=[[Pe,Je,we],[ze,ge,Ae],[0,0,1]];for(Pe&&Pe instanceof Re&&(ir=[[Pe.a,Pe.c,Pe.e],[Pe.b,Pe.d,Pe.f],[0,0,1]]),Ue=0;Ue<3;Ue++)for(ht=0;ht<3;ht++){for(Ct=0,_t=0;_t<3;_t++)Ct+=Qt[Ue][_t]*ir[_t][ht];At[Ue][ht]=Ct}this.a=At[0][0],this.b=At[1][0],this.c=At[0][1],this.d=At[1][1],this.e=At[0][2],this.f=At[1][2]},ae.invert=function(){var Pe=this,ze=Pe.a*Pe.d-Pe.b*Pe.c;return new Re(Pe.d/ze,-Pe.b/ze,-Pe.c/ze,Pe.a/ze,(Pe.c*Pe.f-Pe.d*Pe.e)/ze,(Pe.b*Pe.e-Pe.a*Pe.f)/ze)},ae.clone=function(){return new Re(this.a,this.b,this.c,this.d,this.e,this.f)},ae.translate=function(Pe,ze){this.add(1,0,0,1,Pe,ze)},ae.scale=function(Pe,ze,Je,ge){ze==null&&(ze=Pe),(Je||ge)&&this.add(1,0,0,1,Je,ge),this.add(Pe,0,0,ze,0,0),(Je||ge)&&this.add(1,0,0,1,-Je,-ge)},ae.rotate=function(Pe,ze,Je){Pe=A.rad(Pe),ze=ze||0,Je=Je||0;var ge=+u.cos(Pe).toFixed(9),we=+u.sin(Pe).toFixed(9);this.add(ge,we,-we,ge,ze,Je),this.add(1,0,0,1,-ze,-Je)},ae.x=function(Pe,ze){return Pe*this.a+ze*this.c+this.e},ae.y=function(Pe,ze){return Pe*this.b+ze*this.d+this.f},ae.get=function(Pe){return+this[Q.fromCharCode(97+Pe)].toFixed(4)},ae.toString=function(){return A.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},ae.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},ae.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},ae.split=function(){var Pe={};Pe.dx=this.e,Pe.dy=this.f;var ze=[[this.a,this.c],[this.b,this.d]];Pe.scalex=u.sqrt(ye(ze[0])),Ce(ze[0]),Pe.shear=ze[0][0]*ze[1][0]+ze[0][1]*ze[1][1],ze[1]=[ze[1][0]-ze[0][0]*Pe.shear,ze[1][1]-ze[0][1]*Pe.shear],Pe.scaley=u.sqrt(ye(ze[1])),Ce(ze[1]),Pe.shear/=Pe.scaley;var Je=-ze[0][1],ge=ze[1][1];return ge<0?(Pe.rotate=A.deg(u.acos(ge)),Je<0&&(Pe.rotate=360-Pe.rotate)):Pe.rotate=A.deg(u.asin(Je)),Pe.isSimple=!(+Pe.shear.toFixed(9)||Pe.scalex.toFixed(9)!=Pe.scaley.toFixed(9)&&Pe.rotate),Pe.isSuperSimple=!+Pe.shear.toFixed(9)&&Pe.scalex.toFixed(9)==Pe.scaley.toFixed(9)&&!Pe.rotate,Pe.noRotation=!+Pe.shear.toFixed(9)&&!Pe.rotate,Pe},ae.toTransformString=function(Pe){var ze=Pe||this[ve]();return ze.isSimple?(ze.scalex=+ze.scalex.toFixed(4),ze.scaley=+ze.scaley.toFixed(4),ze.rotate=+ze.rotate.toFixed(4),(ze.dx||ze.dy?"t"+[ze.dx,ze.dy]:se)+(ze.scalex!=1||ze.scaley!=1?"s"+[ze.scalex,ze.scaley,0,0]:se)+(ze.rotate?"r"+[ze.rotate,0,0]:se)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(Re.prototype);for(var lt=function(){this.returnValue=!1},Ze=function(){return this.originalEvent.preventDefault()},ct=function(){this.cancelBubble=!0},Nt=function(){return this.originalEvent.stopPropagation()},Ut=function(ae){var ye=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,Ce=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft;return{x:ae.clientX+Ce,y:ae.clientY+ye}},Mr=z.doc.addEventListener?function(ae,ye,Ce,Pe){var ze=function(ge){var we=Ut(ge);return Ce.call(Pe,ge,we.x,we.y)};if(ae.addEventListener(ye,ze,!1),te&&ke[ye]){var Je=function(ge){for(var we=Ut(ge),Ae=ge,Ue=0,ht=ge.targetTouches&&ge.targetTouches.length;Ue<ht;Ue++)if(ge.targetTouches[Ue].target==ae){(ge=ge.targetTouches[Ue]).originalEvent=Ae,ge.preventDefault=Ze,ge.stopPropagation=Nt;break}return Ce.call(Pe,ge,we.x,we.y)};ae.addEventListener(ke[ye],Je,!1)}return function(){return ae.removeEventListener(ye,ze,!1),te&&ke[ye]&&ae.removeEventListener(ke[ye],Je,!1),!0}}:z.doc.attachEvent?function(ae,ye,Ce,Pe){var ze=function(Je){Je=Je||z.win.event;var ge=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,we=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft,Ae=Je.clientX+we,Ue=Je.clientY+ge;return Je.preventDefault=Je.preventDefault||lt,Je.stopPropagation=Je.stopPropagation||ct,Ce.call(Pe,Je,Ae,Ue)};return ae.attachEvent("on"+ye,ze),function(){return ae.detachEvent("on"+ye,ze),!0}}:void 0,Xt=[],Sr=function(ae){for(var ye,Ce=ae.clientX,Pe=ae.clientY,ze=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,Je=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft,ge=Xt.length;ge--;){if(ye=Xt[ge],te&&ae.touches){for(var we,Ae=ae.touches.length;Ae--;)if((we=ae.touches[Ae]).identifier==ye.el._drag.id){Ce=we.clientX,Pe=we.clientY,(ae.originalEvent?ae.originalEvent:ae).preventDefault();break}}else ae.preventDefault();var Ue,ht=ye.el.node,_t=ht.nextSibling,Ct=ht.parentNode,At=ht.style.display;z.win.opera&&Ct.removeChild(ht),ht.style.display="none",Ue=ye.el.paper.getElementByPoint(Ce,Pe),ht.style.display=At,z.win.opera&&(_t?Ct.insertBefore(ht,_t):Ct.appendChild(ht)),Ue&&k("raphael.drag.over."+ye.el.id,ye.el,Ue),Ce+=Je,Pe+=ze,k("raphael.drag.move."+ye.el.id,ye.move_scope||ye.el,Ce-ye.el._drag.x,Pe-ye.el._drag.y,Ce,Pe,ae)}},rr=function(ae){A.unmousemove(Sr).unmouseup(rr);for(var ye,Ce=Xt.length;Ce--;)(ye=Xt[Ce]).el._drag={},k("raphael.drag.end."+ye.el.id,ye.end_scope||ye.start_scope||ye.move_scope||ye.el,ae);Xt=[]},er=A.el={},kr=he.length;kr--;)(function(ae){A[ae]=er[ae]=function(ye,Ce){return A.is(ye,"function")&&(this.events=this.events||[],this.events.push({name:ae,f:ye,unbind:Mr(this.shape||this.node||z.doc,ae,ye,Ce||this)})),this},A["un"+ae]=er["un"+ae]=function(ye){for(var Ce=this.events||[],Pe=Ce.length;Pe--;)Ce[Pe].name!=ae||!A.is(ye,"undefined")&&Ce[Pe].f!=ye||(Ce[Pe].unbind(),Ce.splice(Pe,1),!Ce.length&&delete this.events);return this}})(he[kr]);er.data=function(ae,ye){var Ce=et[this.id]=et[this.id]||{};if(arguments.length==0)return Ce;if(arguments.length==1){if(A.is(ae,"object")){for(var Pe in ae)ae[$](Pe)&&this.data(Pe,ae[Pe]);return this}return k("raphael.data.get."+this.id,this,Ce[ae],ae),Ce[ae]}return Ce[ae]=ye,k("raphael.data.set."+this.id,this,ye,ae),this},er.removeData=function(ae){return ae==null?delete et[this.id]:et[this.id]&&delete et[this.id][ae],this},er.getData=function(){return Oe(et[this.id]||{})},er.hover=function(ae,ye,Ce,Pe){return this.mouseover(ae,Ce).mouseout(ye,Pe||Ce)},er.unhover=function(ae,ye){return this.unmouseover(ae).unmouseout(ye)};var vr=[];er.drag=function(ae,ye,Ce,Pe,ze,Je){function ge(we){(we.originalEvent||we).preventDefault();var Ae=we.clientX,Ue=we.clientY,ht=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,_t=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft;if(this._drag.id=we.identifier,te&&we.touches){for(var Ct,At=we.touches.length;At--;)if(Ct=we.touches[At],this._drag.id=Ct.identifier,Ct.identifier==this._drag.id){Ae=Ct.clientX,Ue=Ct.clientY;break}}this._drag.x=Ae+_t,this._drag.y=Ue+ht,!Xt.length&&A.mousemove(Sr).mouseup(rr),Xt.push({el:this,move_scope:Pe,start_scope:ze,end_scope:Je}),ye&&k.on("raphael.drag.start."+this.id,ye),ae&&k.on("raphael.drag.move."+this.id,ae),Ce&&k.on("raphael.drag.end."+this.id,Ce),k("raphael.drag.start."+this.id,ze||Pe||this,this._drag.x,this._drag.y,we)}return this._drag={},vr.push({el:this,start:ge}),this.mousedown(ge),this},er.onDragOver=function(ae){ae?k.on("raphael.drag.over."+this.id,ae):k.unbind("raphael.drag.over."+this.id)},er.undrag=function(){for(var ae=vr.length;ae--;)vr[ae].el==this&&(this.unmousedown(vr[ae].start),vr.splice(ae,1),k.unbind("raphael.drag.*."+this.id));!vr.length&&A.unmousemove(Sr).unmouseup(rr),Xt=[]},M.circle=function(ae,ye,Ce){var Pe=A._engine.circle(this,ae||0,ye||0,Ce||0);return this.__set__&&this.__set__.push(Pe),Pe},M.rect=function(ae,ye,Ce,Pe,ze){var Je=A._engine.rect(this,ae||0,ye||0,Ce||0,Pe||0,ze||0);return this.__set__&&this.__set__.push(Je),Je},M.ellipse=function(ae,ye,Ce,Pe){var ze=A._engine.ellipse(this,ae||0,ye||0,Ce||0,Pe||0);return this.__set__&&this.__set__.push(ze),ze},M.path=function(ae){ae&&!A.is(ae,"string")&&!A.is(ae[0],v)&&(ae+=se);var ye=A._engine.path(A.format[U](A,arguments),this);return this.__set__&&this.__set__.push(ye),ye},M.image=function(ae,ye,Ce,Pe,ze){var Je=A._engine.image(this,ae||"about:blank",ye||0,Ce||0,Pe||0,ze||0);return this.__set__&&this.__set__.push(Je),Je},M.text=function(ae,ye,Ce){var Pe=A._engine.text(this,ae||0,ye||0,Q(Ce));return this.__set__&&this.__set__.push(Pe),Pe},M.set=function(ae){!A.is(ae,"array")&&(ae=Array.prototype.splice.call(arguments,0,arguments.length));var ye=new Kr(ae);return this.__set__&&this.__set__.push(ye),ye.paper=this,ye.type="set",ye},M.setStart=function(ae){this.__set__=ae||this.set()},M.setFinish=function(ae){var ye=this.__set__;return delete this.__set__,ye},M.getSize=function(){var ae=this.canvas.parentNode;return{width:ae.offsetWidth,height:ae.offsetHeight}},M.setSize=function(ae,ye){return A._engine.setSize.call(this,ae,ye)},M.setViewBox=function(ae,ye,Ce,Pe,ze){return A._engine.setViewBox.call(this,ae,ye,Ce,Pe,ze)},M.top=M.bottom=null,M.raphael=A;function Pr(){return this.x+de+this.y+de+this.width+" × "+this.height}M.getElementByPoint=function(ae,ye){var Ce,Pe,ze,Je,ge,we,Ae,Ue=this.canvas,ht=z.doc.elementFromPoint(ae,ye);if(z.win.opera&&ht.tagName=="svg"){var _t=(Pe=(Ce=Ue).getBoundingClientRect(),ze=Ce.ownerDocument,Je=ze.body,ge=ze.documentElement,we=ge.clientTop||Je.clientTop||0,Ae=ge.clientLeft||Je.clientLeft||0,{y:Pe.top+(z.win.pageYOffset||ge.scrollTop||Je.scrollTop)-we,x:Pe.left+(z.win.pageXOffset||ge.scrollLeft||Je.scrollLeft)-Ae}),Ct=Ue.createSVGRect();Ct.x=ae-_t.x,Ct.y=ye-_t.y,Ct.width=Ct.height=1;var At=Ue.getIntersectionList(Ct,null);At.length&&(ht=At[At.length-1])}if(!ht)return null;for(;ht.parentNode&&ht!=Ue.parentNode&&!ht.raphael;)ht=ht.parentNode;return ht==this.canvas.parentNode&&(ht=Ue),ht=ht&&ht.raphael?this.getById(ht.raphaelid):null},M.getElementsByBBox=function(ae){var ye=this.set();return this.forEach(function(Ce){A.isBBoxIntersect(Ce.getBBox(),ae)&&ye.push(Ce)}),ye},M.getById=function(ae){for(var ye=this.bottom;ye;){if(ye.id==ae)return ye;ye=ye.next}return null},M.forEach=function(ae,ye){for(var Ce=this.bottom;Ce;){if(ae.call(ye,Ce)===!1)return this;Ce=Ce.next}return this},M.getElementsByPoint=function(ae,ye){var Ce=this.set();return this.forEach(function(Pe){Pe.isPointInside(ae,ye)&&Ce.push(Pe)}),Ce},er.isPointInside=function(ae,ye){var Ce=this.realPath=Ge[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(Ce=A.transformPath(Ce,this.attr("transform"))),A.isPointInsidePath(Ce,ae,ye)},er.getBBox=function(ae){if(this.removed)return{};var ye=this._;return ae?(!ye.dirty&&ye.bboxwt||(this.realPath=Ge[this.type](this),ye.bboxwt=Be(this.realPath),ye.bboxwt.toString=Pr,ye.dirty=0),ye.bboxwt):((ye.dirty||ye.dirtyT||!ye.bbox)&&(!ye.dirty&&this.realPath||(ye.bboxwt=0,this.realPath=Ge[this.type](this)),ye.bbox=Be(nt(this.realPath,this.matrix)),ye.bbox.toString=Pr,ye.dirty=ye.dirtyT=0),ye.bbox)},er.clone=function(){if(this.removed)return null;var ae=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(ae),ae},er.glow=function(ae){if(this.type=="text")return null;var ye={width:((ae=ae||{}).width||10)+(+this.attr("stroke-width")||1),fill:ae.fill||!1,opacity:ae.opacity==null?.5:ae.opacity,offsetx:ae.offsetx||0,offsety:ae.offsety||0,color:ae.color||"#000"},Ce=ye.width/2,Pe=this.paper,ze=Pe.set(),Je=this.realPath||Ge[this.type](this);Je=this.matrix?nt(Je,this.matrix):Je;for(var ge=1;ge<Ce+1;ge++)ze.push(Pe.path(Je).attr({stroke:ye.color,fill:ye.fill?ye.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(ye.width/Ce*ge).toFixed(3),opacity:+(ye.opacity/Ce).toFixed(3)}));return ze.insertBefore(this).translate(ye.offsetx,ye.offsety)};var Tr=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){return Ae==null?yt(ae,ye,Ce,Pe,ze,Je,ge,we):A.findDotsAtSegment(ae,ye,Ce,Pe,ze,Je,ge,we,function(Ue,ht,_t,Ct,At,Qt,ir,tr,Zt){if(!(Zt<0||yt(Ue,ht,_t,Ct,At,Qt,ir,tr)<Zt)){var Br,pr=.5,_r=1-pr;for(Br=yt(Ue,ht,_t,Ct,At,Qt,ir,tr,_r);e(Br-Zt)>.01;)Br=yt(Ue,ht,_t,Ct,At,Qt,ir,tr,_r+=(Br<Zt?1:-1)*(pr/=2));return _r}}(ae,ye,Ce,Pe,ze,Je,ge,we,Ae))},br=function(ae,ye){return function(Ce,Pe,ze){for(var Je,ge,we,Ae,Ue,ht="",_t={},Ct=0,At=0,Qt=(Ce=Ot(Ce)).length;At<Qt;At++){if((we=Ce[At])[0]=="M")Je=+we[1],ge=+we[2];else{if(Ct+(Ae=Tr(Je,ge,we[1],we[2],we[3],we[4],we[5],we[6]))>Pe){if(ye&&!_t.start){if(ht+=["C"+(Ue=Tr(Je,ge,we[1],we[2],we[3],we[4],we[5],we[6],Pe-Ct)).start.x,Ue.start.y,Ue.m.x,Ue.m.y,Ue.x,Ue.y],ze)return ht;_t.start=ht,ht=["M"+Ue.x,Ue.y+"C"+Ue.n.x,Ue.n.y,Ue.end.x,Ue.end.y,we[5],we[6]].join(),Ct+=Ae,Je=+we[5],ge=+we[6];continue}if(!ae&&!ye)return{x:(Ue=Tr(Je,ge,we[1],we[2],we[3],we[4],we[5],we[6],Pe-Ct)).x,y:Ue.y,alpha:Ue.alpha}}Ct+=Ae,Je=+we[5],ge=+we[6]}ht+=we.shift()+we}return _t.end=ht,(Ue=ae?Ct:ye?_t:A.findDotsAtSegment(Je,ge,we[0],we[1],we[2],we[3],we[4],we[5],1)).alpha&&(Ue={x:Ue.x,y:Ue.y,alpha:Ue.alpha}),Ue}},Ar=br(1),gr=br(),dr=br(0,1);A.getTotalLength=Ar,A.getPointAtLength=gr,A.getSubpath=function(ae,ye,Ce){if(this.getTotalLength(ae)-Ce<1e-6)return dr(ae,ye).end;var Pe=dr(ae,Ce,1);return ye?dr(Pe,ye).end:Pe},er.getTotalLength=function(){var ae=this.getPath();if(ae)return this.node.getTotalLength?this.node.getTotalLength():Ar(ae)},er.getPointAtLength=function(ae){var ye=this.getPath();if(ye)return gr(ye,ae)},er.getPath=function(){var ae,ye=A._getPath[this.type];if(this.type!="text"&&this.type!="set")return ye&&(ae=ye(this)),ae},er.getSubpath=function(ae,ye){var Ce=this.getPath();if(Ce)return A.getSubpath(Ce,ae,ye)};var lr=A.easing_formulas={linear:function(ae){return ae},"<":function(ae){return c(ae,1.7)},">":function(ae){return c(ae,.48)},"<>":function(ae){var ye=.48-ae/1.04,Ce=u.sqrt(.1734+ye*ye),Pe=Ce-ye,ze=-Ce-ye,Je=c(e(Pe),1/3)*(Pe<0?-1:1)+c(e(ze),1/3)*(ze<0?-1:1)+.5;return 3*(1-Je)*Je*Je+Je*Je*Je},backIn:function(ae){var ye=1.70158;return ae*ae*((ye+1)*ae-ye)},backOut:function(ae){var ye=1.70158;return(ae-=1)*ae*((ye+1)*ae+ye)+1},elastic:function(ae){return ae==!!ae?ae:c(2,-10*ae)*u.sin(2*y*(ae-.075)/.3)+1},bounce:function(ae){var ye=7.5625,Ce=2.75;return ae<1/Ce?ye*ae*ae:ae<2/Ce?ye*(ae-=1.5/Ce)*ae+.75:ae<2.5/Ce?ye*(ae-=2.25/Ce)*ae+.9375:ye*(ae-=2.625/Ce)*ae+.984375}};lr.easeIn=lr["ease-in"]=lr["<"],lr.easeOut=lr["ease-out"]=lr[">"],lr.easeInOut=lr["ease-in-out"]=lr["<>"],lr["back-in"]=lr.backIn,lr["back-out"]=lr.backOut;var Kt=[],Bt=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(ae){setTimeout(ae,16)},Ft=function(){for(var ae=+new Date,ye=0;ye<Kt.length;ye++){var Ce=Kt[ye];if(!Ce.el.removed&&!Ce.paused){var Pe,ze,Je=ae-Ce.start,ge=Ce.ms,we=Ce.easing,Ae=Ce.from,Ue=Ce.diff,ht=Ce.to,_t=(Ce.t,Ce.el),Ct={},At={};if(Ce.initstatus?(Je=(Ce.initstatus*Ce.anim.top-Ce.prev)/(Ce.percent-Ce.prev)*ge,Ce.status=Ce.initstatus,delete Ce.initstatus,Ce.stop&&Kt.splice(ye--,1)):Ce.status=(Ce.prev+(Ce.percent-Ce.prev)*(Je/ge))/Ce.anim.top,!(Je<0))if(Je<ge){var Qt=we(Je/ge);for(var ir in Ae)if(Ae[$](ir)){switch(ee[ir]){case w:Pe=+Ae[ir]+Qt*ge*Ue[ir];break;case"colour":Pe="rgb("+[cr(H(Ae[ir].r+Qt*ge*Ue[ir].r)),cr(H(Ae[ir].g+Qt*ge*Ue[ir].g)),cr(H(Ae[ir].b+Qt*ge*Ue[ir].b))].join(",")+")";break;case"path":Pe=[];for(var tr=0,Zt=Ae[ir].length;tr<Zt;tr++){Pe[tr]=[Ae[ir][tr][0]];for(var Br=1,pr=Ae[ir][tr].length;Br<pr;Br++)Pe[tr][Br]=+Ae[ir][tr][Br]+Qt*ge*Ue[ir][tr][Br];Pe[tr]=Pe[tr].join(de)}Pe=Pe.join(de);break;case"transform":if(Ue[ir].real)for(Pe=[],tr=0,Zt=Ae[ir].length;tr<Zt;tr++)for(Pe[tr]=[Ae[ir][tr][0]],Br=1,pr=Ae[ir][tr].length;Br<pr;Br++)Pe[tr][Br]=Ae[ir][tr][Br]+Qt*ge*Ue[ir][tr][Br];else{var _r=function(Gr){return+Ae[ir][Gr]+Qt*ge*Ue[ir][Gr]};Pe=[["m",_r(0),_r(1),_r(2),_r(3),_r(4),_r(5)]]}break;case"csv":if(ir=="clip-rect")for(Pe=[],tr=4;tr--;)Pe[tr]=+Ae[ir][tr]+Qt*ge*Ue[ir][tr];break;default:var fr=[][J](Ae[ir]);for(Pe=[],tr=_t.paper.customAttributes[ir].length;tr--;)Pe[tr]=+fr[tr]+Qt*ge*Ue[ir][tr]}Ct[ir]=Pe}_t.attr(Ct),function(Gr,Nr,Zr){setTimeout(function(){k("raphael.anim.frame."+Gr,Nr,Zr)})}(_t.id,_t,Ce.anim)}else{if(function(Gr,Nr,Zr){setTimeout(function(){k("raphael.anim.frame."+Nr.id,Nr,Zr),k("raphael.anim.finish."+Nr.id,Nr,Zr),A.is(Gr,"function")&&Gr.call(Nr)})}(Ce.callback,_t,Ce.anim),_t.attr(ht),Kt.splice(ye--,1),Ce.repeat>1&&!Ce.next){for(ze in ht)ht[$](ze)&&(At[ze]=Ce.totalOrigin[ze]);Ce.el.attr(At),ar(Ce.anim,Ce.el,Ce.anim.percents[0],null,Ce.totalOrigin,Ce.repeat-1)}Ce.next&&!Ce.stop&&ar(Ce.anim,Ce.el,Ce.next,null,Ce.totalOrigin,Ce.repeat)}}}Kt.length&&Bt(Ft)},cr=function(ae){return ae>255?255:ae<0?0:ae};function nr(ae,ye,Ce,Pe,ze,Je){var ge=3*ye,we=3*(Pe-ye)-ge,Ae=1-ge-we,Ue=3*Ce,ht=3*(ze-Ce)-Ue,_t=1-Ue-ht;function Ct(At){return((Ae*At+we)*At+ge)*At}return function(At,Qt){var ir=function(tr,Zt){var Br,pr,_r,fr,Gr,Nr;for(_r=tr,Nr=0;Nr<8;Nr++){if(fr=Ct(_r)-tr,e(fr)<Zt)return _r;if(e(Gr=(3*Ae*_r+2*we)*_r+ge)<1e-6)break;_r-=fr/Gr}if(pr=1,(_r=tr)<(Br=0))return Br;if(_r>pr)return pr;for(;Br<pr;){if(fr=Ct(_r),e(fr-tr)<Zt)return _r;tr>fr?Br=_r:pr=_r,_r=(pr-Br)/2+Br}return _r}(At,Qt);return((_t*ir+ht)*ir+Ue)*ir}(ae,1/(200*Je))}function Vt(ae,ye){var Ce=[],Pe={};if(this.ms=ye,this.times=1,ae){for(var ze in ae)ae[$](ze)&&(Pe[Y(ze)]=ae[ze],Ce.push(Y(ze)));Ce.sort(mt)}this.anim=Pe,this.top=Ce[Ce.length-1],this.percents=Ce}function ar(ae,ye,Ce,Pe,ze,Je){Ce=Y(Ce);var ge,we,Ae,Ue,ht,_t,Ct=ae.ms,At={},Qt={},ir={};if(Pe)for(Zt=0,Br=Kt.length;Zt<Br;Zt++){var tr=Kt[Zt];if(tr.el.id==ye.id&&tr.anim==ae){tr.percent!=Ce?(Kt.splice(Zt,1),Ae=1):we=tr,ye.attr(tr.totalOrigin);break}}else Pe=+Qt;for(var Zt=0,Br=ae.percents.length;Zt<Br;Zt++){if(ae.percents[Zt]==Ce||ae.percents[Zt]>Pe*ae.top){Ce=ae.percents[Zt],ht=ae.percents[Zt-1]||0,Ct=Ct/ae.top*(Ce-ht),Ue=ae.percents[Zt+1],ge=ae.anim[Ce];break}Pe&&ye.attr(ae.anim[ae.percents[Zt]])}if(ge){if(we)we.initstatus=Pe,we.start=new Date-we.ms*Pe;else{for(var pr in ge)if(ge[$](pr)&&(ee[$](pr)||ye.paper.customAttributes[$](pr)))switch(At[pr]=ye.attr(pr),At[pr]==null&&(At[pr]=D[pr]),Qt[pr]=ge[pr],ee[pr]){case w:ir[pr]=(Qt[pr]-At[pr])/Ct;break;case"colour":At[pr]=A.getRGB(At[pr]);var _r=A.getRGB(Qt[pr]);ir[pr]={r:(_r.r-At[pr].r)/Ct,g:(_r.g-At[pr].g)/Ct,b:(_r.b-At[pr].b)/Ct};break;case"path":var fr=Ot(At[pr],Qt[pr]),Gr=fr[1];for(At[pr]=fr[0],ir[pr]=[],Zt=0,Br=At[pr].length;Zt<Br;Zt++){ir[pr][Zt]=[0];for(var Nr=1,Zr=At[pr][Zt].length;Nr<Zr;Nr++)ir[pr][Zt][Nr]=(Gr[Zt][Nr]-At[pr][Zt][Nr])/Ct}break;case"transform":var Sn=ye._,qn=_e(Sn[pr],Qt[pr]);if(qn)for(At[pr]=qn.from,Qt[pr]=qn.to,ir[pr]=[],ir[pr].real=!0,Zt=0,Br=At[pr].length;Zt<Br;Zt++)for(ir[pr][Zt]=[At[pr][Zt][0]],Nr=1,Zr=At[pr][Zt].length;Nr<Zr;Nr++)ir[pr][Zt][Nr]=(Qt[pr][Zt][Nr]-At[pr][Zt][Nr])/Ct;else{var ii=ye.matrix||new Re,si={_:{transform:Sn.transform},getBBox:function(){return ye.getBBox(1)}};At[pr]=[ii.a,ii.b,ii.c,ii.d,ii.e,ii.f],ce(si,Qt[pr]),Qt[pr]=si._.transform,ir[pr]=[(si.matrix.a-ii.a)/Ct,(si.matrix.b-ii.b)/Ct,(si.matrix.c-ii.c)/Ct,(si.matrix.d-ii.d)/Ct,(si.matrix.e-ii.e)/Ct,(si.matrix.f-ii.f)/Ct]}break;case"csv":var vn=Q(ge[pr])[ve](j),on=Q(At[pr])[ve](j);if(pr=="clip-rect")for(At[pr]=on,ir[pr]=[],Zt=on.length;Zt--;)ir[pr][Zt]=(vn[Zt]-At[pr][Zt])/Ct;Qt[pr]=vn;break;default:for(vn=[][J](ge[pr]),on=[][J](At[pr]),ir[pr]=[],Zt=ye.paper.customAttributes[pr].length;Zt--;)ir[pr][Zt]=((vn[Zt]||0)-(on[Zt]||0))/Ct}var Bn=ge.easing,Hi=A.easing_formulas[Bn];if(!Hi)if((Hi=Q(Bn).match(R))&&Hi.length==5){var Xi=Hi;Hi=function(Kn){return nr(Kn,+Xi[1],+Xi[2],+Xi[3],+Xi[4],Ct)}}else Hi=Ye;if(tr={anim:ae,percent:Ce,timestamp:_t=ge.start||ae.start||+new Date,start:_t+(ae.del||0),status:0,initstatus:Pe||0,stop:!1,ms:Ct,easing:Hi,from:At,diff:ir,to:Qt,el:ye,callback:ge.callback,prev:ht,next:Ue,repeat:Je||ae.times,origin:ye.attr(),totalOrigin:ze},Kt.push(tr),Pe&&!we&&!Ae&&(tr.stop=!0,tr.start=new Date-Ct*Pe,Kt.length==1))return Ft();Ae&&(tr.start=new Date-tr.ms*Pe),Kt.length==1&&Bt(Ft)}k("raphael.anim.start."+ye.id,ye,ae)}}function qr(ae){for(var ye=0;ye<Kt.length;ye++)Kt[ye].el.paper==ae&&Kt.splice(ye--,1)}er.animateWith=function(ae,ye,Ce,Pe,ze,Je){if(this.removed)return Je&&Je.call(this),this;var ge=Ce instanceof Vt?Ce:A.animation(Ce,Pe,ze,Je);ar(ge,this,ge.percents[0],null,this.attr());for(var we=0,Ae=Kt.length;we<Ae;we++)if(Kt[we].anim==ye&&Kt[we].el==ae){Kt[Ae-1].start=Kt[we].start;break}return this},er.onAnimation=function(ae){return ae?k.on("raphael.anim.frame."+this.id,ae):k.unbind("raphael.anim.frame."+this.id),this},Vt.prototype.delay=function(ae){var ye=new Vt(this.anim,this.ms);return ye.times=this.times,ye.del=+ae||0,ye},Vt.prototype.repeat=function(ae){var ye=new Vt(this.anim,this.ms);return ye.del=this.del,ye.times=u.floor(p(ae,0))||1,ye},A.animation=function(ae,ye,Ce,Pe){if(ae instanceof Vt)return ae;!A.is(Ce,"function")&&Ce||(Pe=Pe||Ce||null,Ce=null),ae=Object(ae),ye=+ye||0;var ze,Je,ge={};for(Je in ae)ae[$](Je)&&Y(Je)!=Je&&Y(Je)+"%"!=Je&&(ze=!0,ge[Je]=ae[Je]);if(ze)return Ce&&(ge.easing=Ce),Pe&&(ge.callback=Pe),new Vt({100:ge},ye);if(Pe){var we=0;for(var Ae in ae){var Ue=Z(Ae);ae[$](Ae)&&Ue>we&&(we=Ue)}!ae[we+="%"].callback&&(ae[we].callback=Pe)}return new Vt(ae,ye)},er.animate=function(ae,ye,Ce,Pe){if(this.removed)return Pe&&Pe.call(this),this;var ze=ae instanceof Vt?ae:A.animation(ae,ye,Ce,Pe);return ar(ze,this,ze.percents[0],null,this.attr()),this},er.setTime=function(ae,ye){return ae&&ye!=null&&this.status(ae,b(ye,ae.ms)/ae.ms),this},er.status=function(ae,ye){var Ce,Pe,ze=[],Je=0;if(ye!=null)return ar(ae,this,-1,b(ye,1)),this;for(Ce=Kt.length;Je<Ce;Je++)if((Pe=Kt[Je]).el.id==this.id&&(!ae||Pe.anim==ae)){if(ae)return Pe.status;ze.push({anim:Pe.anim,status:Pe.status})}return ae?0:ze},er.pause=function(ae){for(var ye=0;ye<Kt.length;ye++)Kt[ye].el.id!=this.id||ae&&Kt[ye].anim!=ae||k("raphael.anim.pause."+this.id,this,Kt[ye].anim)!==!1&&(Kt[ye].paused=!0);return this},er.resume=function(ae){for(var ye=0;ye<Kt.length;ye++)if(Kt[ye].el.id==this.id&&(!ae||Kt[ye].anim==ae)){var Ce=Kt[ye];k("raphael.anim.resume."+this.id,this,Ce.anim)!==!1&&(delete Ce.paused,this.status(Ce.anim,Ce.status))}return this},er.stop=function(ae){for(var ye=0;ye<Kt.length;ye++)Kt[ye].el.id!=this.id||ae&&Kt[ye].anim!=ae||k("raphael.anim.stop."+this.id,this,Kt[ye].anim)!==!1&&Kt.splice(ye--,1);return this},k.on("raphael.remove",qr),k.on("raphael.clear",qr),er.toString=function(){return"Raphaël’s object"};var Vr,Wr,Rr,bt,Kr=function(ae){if(this.items=[],this.length=0,this.type="set",ae)for(var ye=0,Ce=ae.length;ye<Ce;ye++)!ae[ye]||ae[ye].constructor!=er.constructor&&ae[ye].constructor!=Kr||(this[this.items.length]=this.items[this.items.length]=ae[ye],this.length++)},Ur=Kr.prototype;for(var ti in Ur.push=function(){for(var ae,ye,Ce=0,Pe=arguments.length;Ce<Pe;Ce++)!(ae=arguments[Ce])||ae.constructor!=er.constructor&&ae.constructor!=Kr||(this[ye=this.items.length]=this.items[ye]=ae,this.length++);return this},Ur.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Ur.forEach=function(ae,ye){for(var Ce=0,Pe=this.items.length;Ce<Pe;Ce++)if(ae.call(ye,this.items[Ce],Ce)===!1)return this;return this},er)er[$](ti)&&(Ur[ti]=function(ae){return function(){var ye=arguments;return this.forEach(function(Ce){Ce[ae][U](Ce,ye)})}}(ti));return Ur.attr=function(ae,ye){if(ae&&A.is(ae,v)&&A.is(ae[0],"object"))for(var Ce=0,Pe=ae.length;Ce<Pe;Ce++)this.items[Ce].attr(ae[Ce]);else for(var ze=0,Je=this.items.length;ze<Je;ze++)this.items[ze].attr(ae,ye);return this},Ur.clear=function(){for(;this.length;)this.pop()},Ur.splice=function(ae,ye,Ce){ae=ae<0?p(this.length+ae,0):ae,ye=p(0,b(this.length-ae,ye));var Pe,ze=[],Je=[],ge=[];for(Pe=2;Pe<arguments.length;Pe++)ge.push(arguments[Pe]);for(Pe=0;Pe<ye;Pe++)Je.push(this[ae+Pe]);for(;Pe<this.length-ae;Pe++)ze.push(this[ae+Pe]);var we=ge.length;for(Pe=0;Pe<we+ze.length;Pe++)this.items[ae+Pe]=this[ae+Pe]=Pe<we?ge[Pe]:ze[Pe-we];for(Pe=this.items.length=this.length-=ye-we;this[Pe];)delete this[Pe++];return new Kr(Je)},Ur.exclude=function(ae){for(var ye=0,Ce=this.length;ye<Ce;ye++)if(this[ye]==ae)return this.splice(ye,1),!0},Ur.animate=function(ae,ye,Ce,Pe){(A.is(Ce,"function")||!Ce)&&(Pe=Ce||null);var ze,Je,ge=this.items.length,we=ge,Ae=this;if(!ge)return this;Pe&&(Je=function(){!--ge&&Pe.call(Ae)}),Ce=A.is(Ce,"string")?Ce:Je;var Ue=A.animation(ae,ye,Ce,Je);for(ze=this.items[--we].animate(Ue);we--;)this.items[we]&&!this.items[we].removed&&this.items[we].animateWith(ze,Ue,Ue),this.items[we]&&!this.items[we].removed||ge--;return this},Ur.insertAfter=function(ae){for(var ye=this.items.length;ye--;)this.items[ye].insertAfter(ae);return this},Ur.getBBox=function(){for(var ae=[],ye=[],Ce=[],Pe=[],ze=this.items.length;ze--;)if(!this.items[ze].removed){var Je=this.items[ze].getBBox();ae.push(Je.x),ye.push(Je.y),Ce.push(Je.x+Je.width),Pe.push(Je.y+Je.height)}return{x:ae=b[U](0,ae),y:ye=b[U](0,ye),x2:Ce=p[U](0,Ce),y2:Pe=p[U](0,Pe),width:Ce-ae,height:Pe-ye}},Ur.clone=function(ae){ae=this.paper.set();for(var ye=0,Ce=this.items.length;ye<Ce;ye++)ae.push(this.items[ye].clone());return ae},Ur.toString=function(){return"Raphaël‘s set"},Ur.glow=function(ae){var ye=this.paper.set();return this.forEach(function(Ce,Pe){var ze=Ce.glow(ae);ze!=null&&ze.forEach(function(Je,ge){ye.push(Je)})}),ye},Ur.isPointInside=function(ae,ye){var Ce=!1;return this.forEach(function(Pe){if(Pe.isPointInside(ae,ye))return Ce=!0,!1}),Ce},A.registerFont=function(ae){if(!ae.face)return ae;this.fonts=this.fonts||{};var ye={w:ae.w,face:{},glyphs:{}},Ce=ae.face["font-family"];for(var Pe in ae.face)ae.face[$](Pe)&&(ye.face[Pe]=ae.face[Pe]);if(this.fonts[Ce]?this.fonts[Ce].push(ye):this.fonts[Ce]=[ye],!ae.svg){for(var ze in ye.face["units-per-em"]=Z(ae.face["units-per-em"],10),ae.glyphs)if(ae.glyphs[$](ze)){var Je=ae.glyphs[ze];if(ye.glyphs[ze]={w:Je.w,k:{},d:Je.d&&"M"+Je.d.replace(/[mlcxtrv]/g,function(we){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[we]||"M"})+"z"},Je.k)for(var ge in Je.k)Je[$](ge)&&(ye.glyphs[ze].k[ge]=Je.k[ge])}}return ae},M.getFont=function(ae,ye,Ce,Pe){if(Pe=Pe||"normal",Ce=Ce||"normal",ye=+ye||{normal:400,bold:700,lighter:300,bolder:800}[ye]||400,A.fonts){var ze,Je=A.fonts[ae];if(!Je){var ge=new RegExp("(^|\\s)"+ae.replace(/[^\w\d\s+!~.:_-]/g,se)+"(\\s|$)","i");for(var we in A.fonts)if(A.fonts[$](we)&&ge.test(we)){Je=A.fonts[we];break}}if(Je)for(var Ae=0,Ue=Je.length;Ae<Ue&&((ze=Je[Ae]).face["font-weight"]!=ye||ze.face["font-style"]!=Ce&&ze.face["font-style"]||ze.face["font-stretch"]!=Pe);Ae++);return ze}},M.print=function(ae,ye,Ce,Pe,ze,Je,ge,we){Je=Je||"middle",ge=p(b(ge||0,1),-1),we=p(b(we||1,3),1);var Ae,Ue=Q(Ce)[ve](se),ht=0,_t=0,Ct=se;if(A.is(Pe,"string")&&(Pe=this.getFont(Pe)),Pe){Ae=(ze||16)/Pe.face["units-per-em"];for(var At=Pe.face.bbox[ve](j),Qt=+At[0],ir=At[3]-At[1],tr=0,Zt=+At[1]+(Je=="baseline"?ir+ +Pe.face.descent:ir/2),Br=0,pr=Ue.length;Br<pr;Br++){if(Ue[Br]==`
+`);h("<pre>").addClass("exportContainer").text(S).dialog({title:"Annotation export",open:function(k,A){var B;document.selection?(B=document.body.createTextRange(),B.moveToElementText(this[0]),B.select()):window.getSelection&&(B=document.createRange(),B.selectNode(this[0]),window.getSelection().addRange(B))},autoOpen:!0,width:"80%",minHeight:"400",height:400,buttons:[{text:"Close",click:function(){h(this).dialog("close")}},{text:"Download",click:function(){a=document.createElement("a"),a.setAttribute("href","data:text/plain;base64,"+btoa(S)),a.setAttribute("download","Annotations - "+m.media.title.replace(/[^ \w]/g,"")+".txt"),a.click()}}]})}draw(){}generateUid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(d){var m=Math.random()*16|0,h=d==="x"?m:m&3|8;return h.toString(16)})}},Cr(l,"defaults",{}),Cr(l,"template",""),Cr(l,"messages",{en:{}}),l),n}const AdaptivePlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){typeof this.video>"u"&&(this.video=this.media.video);var l=["autostart","video","height","width","url_transform"],d={},m=document.createElement("video").canPlayType(this.mime_type);d.type=m!=="no"?this.normal_player:this.fallback_player;for(var h=0;h<l.length;h++)typeof this[l[h]]<"u"&&(d[l[h]]=this[l[h]]);this.insertSubwidget(this.$,d)}},Cr(n,"defaults",{mime_type:'video/mp4; codecs="avc1.42E01E"',normal_player:"HtmlPlayer",fallback_player:"HtmlPlayer"}),n},helloWorldStyles={},HelloWorld=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"draw",function(){this.renderTemplate(),console.log("HelloWorldWidget was drawn")});console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget")}},Cr(n,"defaults",{text:"world"}),Cr(n,"template",'<div class="Ldt-HelloWorld"><p>{{l10n.Hello}} {{text}}</p><p>Looks like we have <span class="Ldt-HelloWorld-annotations">{{source.contents.annotation.length}} annotations</span> in this feed</p></div>'),Cr(n,"messages",{fr:{Hello:"Bonjour,"},en:{Hello:"Hello,"}}),n},annotationStyles={},Annotation=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastAnnotation=!1,this.minimized=this.start_minimized||!1,this.bounds=[0,0]}draw(){var l=this,d;function m(k){var A=l.getWidgetAnnotationsAtTime();A.length||(l.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-Empty"),l.arrow&&l.arrow.moveToTime(k),l.bounds=[k,k],l.sendBounds())}function h(){if(d){var k=d.title,A=d.description.replace(/(^\s+|\s+$)/g,""),B=d.found&&l.source.getAnnotations().regexp||!1;l.$.find(".Ldt-Annotation-Title").html(IriSP.textFieldHtml(k,B)||"("+l.l10n.untitled+")"),A?(l.$.find(".Ldt-Annotation-Description-Block").removeClass("Ldt-Annotation-EmptyBlock"),l.$.find(".Ldt-Annotation-Description").html(IriSP.textFieldHtml(A,B))):l.$.find(".Ldt-Annotation-Description-Block").addClass("Ldt-Annotation-EmptyBlock")}}function S(k){d=k;var A=typeof k.url<"u"?k.url:document.location.href.replace(/#.*$/,"")+"#id="+k.id,B=l.l10n.watching+k.title+(l.site_name?l.l10n.on_site+l.site_name:""),M=k.getTags(),j=l.$.find(".Ldt-Annotation-Tags");j.empty(),M.length?(l.$.find(".Ldt-Annotation-Tags-Block").removeClass("Ldt-Annotation-EmptyBlock"),M.forEach(function(I){var P=I.title.replace(/(^\s+|\s+$)/g,"");if(P){var $=IriSP.jQuery('<li class="Ldt-Annotation-TagLabel"></li>').append(IriSP.jQuery("<span>").text(P));$.click(function(){l.search_on_tag_click&&l.source.getAnnotations().search(P),I.trigger("click")}),j.append($)}})):l.$.find(".Ldt-Annotation-Tags-Block").addClass("Ldt-Annotation-EmptyBlock"),h(),l.show_creator&&l.$.find(".Ldt-Annotation-Creator").text(k.creator),l.show_annotation_type&&(l.$.find(".Ldt-Annotation-Type").text(k.getAnnotationType().title),l.$.find(".Ldt-Annotation-Type").attr("title",k.getAnnotationType().description)),l.$.find(".Ldt-Annotation-Begin").text(k.begin.toString()),l.$.find(".Ldt-Annotation-End").text(k.end.toString()),k.elementType==="mashedAnnotation"?(l.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-isMashup"),l.$.find(".Ldt-Annotation-MashupMedia").text(k.getMedia().title),l.$.find(".Ldt-Annotation-MashupBegin").text(k.annotation.begin.toString()),l.$.find(".Ldt-Annotation-MashupEnd").text(k.annotation.end.toString())):l.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-isMashup"),typeof l.socialWidget<"u"?l.socialWidget.updateUrls(A,B):setTimeout(function(){typeof l.socialWidget<"u"&&l.socialWidget.updateUrls(A,B)},800),l.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Empty"),l.bounds=[k.begin,k.end],l.arrow&&l.arrow.moveToTime((1-l.arrow_position)*k.begin+l.arrow_position*k.end),l.sendBounds()}this.renderTemplate(),this.$.find(".Ldt-Annotation-Title").click(function(){return d&&l.media.setCurrentTime(d.begin),!1}),this.show_social&&this.insertSubwidget(this.$.find(".Ldt-Annotation-Social"),{type:"Social"},"socialWidget"),this.show_arrow&&this.insertSubwidget(this.$.find(".Ldt-Annotation-Arrow"),{type:"Arrow",width:this.width},"arrow"),this.onMediaEvent("timeupdate",m),this.onMdpEvent("Annotation.hide","hide"),this.onMdpEvent("Annotation.show","show"),this.onMdpEvent("Annotation.minimize","minimize"),this.onMdpEvent("Annotation.maximize","maximize"),this.onMdpEvent("Annotation.getBounds","sendBounds"),this.$.find(".Ldt-Annotation-MaxMinButton").click(this.functionWrapper("toggleSize")),this.$.on("resize",function(){l.width=l.$.parent().width(),l.$.css({width:l.width})}),this.getWidgetAnnotations().forEach(function(k){k.on("enter",function(){S(k)})}),this.source.getAnnotations().on("found",h),this.source.getAnnotations().on("not-found",h),this.source.getAnnotations().on("search-cleared",h),IriSP.attachDndData(this.$.find("h3"),function(){return{title:d.title,description:d.description,image:d.thumbnail,uri:typeof d.url<"u"?d.url:document.location.href.replace(/#.*$/,"")+"#id="+d.id,text:"["+d.begin.toString()+"] "+d.title}})}sendBounds(){this.player.trigger("Annotation.boundsChanged",this.bounds)}drawAnnotation(l){this.lastAnnotation=l.id}hide(){this.$.slideUp()}show(){this.$.slideDown()}toggleSize(){this.minimized?this.maximize():this.minimize()}minimize(){this.minimized=!0,this.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-Minimized")}maximize(){this.minimized=!1,this.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Minimized")}},Cr(n,"messages",{fr:{watching:"Je regarde ",on_site:" sur ",tags_:"Mots-clés :",description_:"Description :",creator_:"Créé par :",excerpt_from:"Extrait de :",untitled:"Segment sans titre"},en:{watching:"I'm watching ",on_site:" on ",tags_:"Keywords:",description_:"Description:",creator_:"Created by :",excerpt_from:"Excerpt from:",untitled:"Untitled segment"}}),Cr(n,"template",'{{#show_arrow}}<div class="Ldt-Annotation-Arrow"></div>{{/show_arrow}}<div class="Ldt-Annotation-Widget {{^show_arrow}}Ldt-Annotation-ShowTop{{/show_arrow}}"><div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}"><div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>{{#show_social}}<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"></div>{{/show_social}}<h3 class="Ldt-Annotation-HiddenWhenEmpty">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<a class="Ldt-Annotation-Title" href="#"></a> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">(<span class="Ldt-Annotation-Begin"></span> - <span class="Ldt-Annotation-End"></span>)</span></h3><h3 class="Ldt-Annotation-MashupOrigin Ldt-Annotation-HiddenWhenEmpty">{{l10n.excerpt_from}} <span class="Ldt-Annotation-MashupMedia"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">(<span class="Ldt-Annotation-MashupBegin"></span> - <span class="Ldt-Annotation-MashupEnd"></span>)</span></h3><div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Creator-Block"><div class="Ldt-Annotation-Label">{{l10n.creator_}}</div>{{#show_creator}}<p class="Ldt-Annotation-Labelled Ldt-Annotation-Creator"></p></div>{{/show_creator}}{{#show_description}}<div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Description-Block"><div class="Ldt-Annotation-Label">{{l10n.description_}}</div><p class="Ldt-Annotation-Labelled Ldt-Annotation-Description"></p></div>{{/show_description}}<div class="Ldt-Annotation-Tags-Block Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Cleared"><div class="Ldt-Annotation-Label">{{l10n.tags_}}</div><ul class="Ldt-Annotation-Labelled Ldt-Annotation-Tags"></ul></div></div></div></div>'),Cr(n,"defaults",{annotation_type:"chap",start_minimized:!1,show_arrow:!0,show_creator:!0,show_description:!0,arrow_position:.5,site_name:"Lignes de Temps",search_on_tag_click:!0,show_social:!0,show_annotation_type:!1}),n},annotationsControllerStyles={},AnnotationsController=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate();var l=this;this.element_$=this.$.find(".Ldt-AnnotationsController"),this.displayButton_$=this.$.find(".Ldt-AnnotationsController-ShowAnnotationsListButton"),this.writeButton_$=this.$.find(".Ldt-AnnotationsController-ShowCreateAnnotationButton"),this.writeButton_$.click(function(){l.writeButton_$.hasClass("selected")?(l.player.trigger("CreateAnnotation.hide"),l.toggle_widgets?l.player.trigger("AnnotationsList.show"):l.display_or_write&&l.player.trigger("AnnotationsList.hide")):(l.player.trigger("CreateAnnotation.show"),l.display_or_write&&l.player.trigger("AnnotationsList.hide"))}),this.displayButton_$.click(function(){l.displayButton_$.hasClass("selected")?(l.player.trigger("AnnotationsList.hide"),l.toggle_widgets?l.player.trigger("CreateAnnotation.show"):l.display_or_write&&l.player.trigger("CreateAnnotation.hide")):(l.player.trigger("AnnotationsList.show"),l.display_or_write&&l.player.trigger("CreateAnnotation.hide"))}),this.hide_without_segment&&(this.onMediaEvent("timeupdate",function(){l.refresh()}),this.onMediaEvent("settimerange",function(d){l.refresh(d)}),this.segments=this.source.getAnnotationsByTypeTitle(this.segments_annotation_type),this.currentSegment=!1),this.createAnnotationEnabled=!1,this.onMdpEvent("CreateAnnotation.hide",function(){l.hide_when_writing&&l.show(),l.createAnnotationEnabled=!1,l.writeButton_$.toggleClass("selected",!1)}),this.onMdpEvent("CreateAnnotation.show",function(){l.hide_when_writing&&l.hide(),l.createAnnotationEnabled=!0,l.writeButton_$.toggleClass("selected",!0)}),this.onMdpEvent("AnnotationsList.hide",function(){l.displayButton_$.toggleClass("selected",!1)}),this.onMdpEvent("AnnotationsList.show",function(){l.displayButton_$.toggleClass("selected",!0)}),this.starts_hidden?(this.visible=!0,this.hide()):(this.visible=!1,this.show()),this.starting_widget&&this.visible&&(this.starting_widget=="AnnotationsList"?this.player.trigger("AnnotationsList.show"):this.starting_widget=="CreateAnnotation"&&this.player.trigger("CreateAnnotation.show"))}refresh(l){if(l=typeof l<"u"?l:!1,l||this.media.getTimeRange()&&(l=this.media.getTimeRange()),this.hide_without_segment){if(!l&&!this.media.getTimeRange())_currentTime=this.media.getCurrentTime(),_currentSegments=this.segments.filter(function(h){return _currentTime>=h.begin&&_currentTime<=h.end}),_currentSegments.length>0?currentSegment=!0:currentSegment=!1;else{var d=l[0],m=l[1];_currentSegments=this.segments.filter(function(h){return d==h.begin&&m==h.end}),_currentSegments.length>0?currentSegment=!0:currentSegment=!1}!currentSegment&&_currentSegments.length==0?(this.visible||this.hide_when_writing)&&(this.writeButton_$.toggleClass("selected",!1),this.displayButton_$.toggleClass("selected",!1),this.player.trigger("CreateAnnotation.hide"),this.player.trigger("AnnotationsList.hide"),this.hide()):this.visible||(this.createAnnotationEnabled||this.show(),this.writeButton_$.toggleClass("selected",!1),this.displayButton_$.toggleClass("selected",!1),this.starting_widget=="AnnotationsList"&&this.player.trigger("AnnotationsList.show"),this.starting_widget=="CreateAnnotation"&&this.player.trigger("CreateAnnotation.show"))}}hide(){this.visible&&(this.visible=!1,this.element_$.hide())}show(){this.visible||(this.visible=!0,this.element_$.show())}},Cr(n,"defaults",{display_or_write:!1,toggle_widgets:!1,starts_hidden:!1,hide_without_segment:!1,hide_when_writing:!0,starting_widget:!1,always_show_widget:!1,segments_annotation_type:"chap",custom_write_text:!1,custom_display_text:!1}),Cr(n,"template","<div class='Ldt-AnnotationsController'><div class='Ldt-AnnotationsController-ButtonsContainer'> <div class='Ldt-AnnotationsController-Button Ldt-AnnotationsController-ShowCreateAnnotationButton'>{{#custom_write_text}}{{/custom_write_text}}{{custom_write_text}}{{^custom_write_text}}{{l10n.write}}{{/custom_write_text}}</div> <div class='Ldt-AnnotationsController-Button Ldt-AnnotationsController-ShowAnnotationsListButton'>{{#custom_display_text}}{{/custom_display_text}}{{custom_display_text}}{{^custom_display_text}}{{l10n.display}}{{/custom_display_text}}</div></div></div>"),Cr(n,"messages",{en:{write:"Write",display:"Display"},fr:{write:"Ecrire",display:"Voir"}}),n},annotationsListStyles={},AnnotationsList=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastIds=[];var m=this;this.throttledRefresh=_$1.throttle(function(h){m.refresh(h)},800),this.searchString=!1,this.lastSearch=!1,this.localSource=void 0}importUsers(){if(!this.source.users_data&&this.api_users_endpoint){this.usernames=Array();var l=this,d=this.getWidgetAnnotations(),m="";return d.forEach(function(h){l.usernames.indexOf(h.creator)==-1&&l.usernames.push(h.creator)}),this.usernames.forEach(function(h){m+=h+","}),m=m.substring(0,m.length-1),_url=mustache.render(this.api_users_endpoint,{usernames_list_string:encodeURIComponent(m),usernames_list_length:this.usernames.length}),jQuery.ajax({async:!1,url:_url,type:"GET",success:function(h){l.source.users_data=h.objects},error:function(h,S,k){console.log(h),console.log(S),console.log(k)}})}}ajaxSource(){var l=this.media.getCurrentTime(),d=this.media.duration;this.lastAjaxQuery=l;var m=mustache.render(this.ajax_url,{media:this.source.currentMedia.id,begin:Math.max(0,l-this.ajax_granularity),end:Math.min(d.milliseconds,l+this.ajax_granularity)});this.currentSource=this.player.loadMetadata(_$1.defaults({url:m},this.metadata))}showScreen(l){this.$.find(".Ldt-AnnotationsList-Screen"+l).show().siblings().hide()}ajaxMashup(){var l=this.media.getCurrentTime(),d=this.source.currentMedia.getAnnotationAtTime(l);if(typeof d<"u"&&d.id!==this.lastMashupAnnotation){this.lastMashupAnnotation=d.id;var m=d.getMedia(),h=mustache.render(this.ajax_url,{media:m.id,begin:Math.max(0,d.annotation.begin.milliseconds-this.ajax_granularity),end:Math.min(m.duration.milliseconds,d.annotation.end.milliseconds+this.ajax_granularity)});this.currentSource=this.player.loadMetadata(_$1.defaults({url:h},this.metadata))}}importAnnotations(){var l=this,d=jQuery,m=d("<textarea>");d("<div>").append(d("<span>").addClass("importAnnotationsLabel").text(l.messages.import_annotations)).addClass("importContainer").dialog({title:"Annotation import",autoOpen:!0,width:"80%",minHeight:"400",height:400,buttons:[{text:"Close",click:function(){d(this).dialog("close")}},{text:"Import",click:function(){for(var h=/(\[[\d:]+\])/,S=m[0].value.split(h).filter(function(P){return!P.match(/^\s*$/)}),k=null,A=null,B=null,M=null,j=0;j<S.length;j++){var I=S[j];I.match(h)?(M=="text"?(A=t.timestamp2ms(I.slice(1,-1)),TODO.createAnnotation(k,A,B),k=A,A=null,B=null):(B=null,k=t.timestamp2ms(I.slice(1,-1)),A=null),M="timestamp"):(B=I,M="text"),M=="text"&&k!==null&&TODO.createAnnotation(k,k,B)}}}]})}refresh(l){if(l=typeof l<"u"&&l,this.currentSource.status!==t.Model._SOURCE_STATUS_READY)return 0;var d=this,m=this.media.getCurrentTime(),h=this.annotation_type?this.currentSource.getAnnotationsByTypeTitle(this.annotation_type):this.currentSource.getAnnotations();if(this.mashupMode){var S=this.source.currentMedia.getAnnotationAtTime(m);if(typeof S<"u"){m=m-S.begin+S.annotation.begin;var k=S.getMedia().id;h=h.filter(function(N){return N.getMedia().id===k})}}h=h.filter(function(N){return N.found!==!1}),this.filter_by_segments&&!(this.show_filters&&this.segment_filter&&this.ignoresegmentcheckbox_$[0].checked)&&(_segmentsAnnotation=this.currentSource.getAnnotationsByTypeTitle(this.segments_annotation_type),this.media.getTimeRange()?_currentSegments=_segmentsAnnotation.filter(function(N){return d.media.getTimeRange()[0]==N.begin&&d.media.getTimeRange()[1]==N.end}):_currentSegments=_segmentsAnnotation.filter(function(N){return m>=N.begin&&m<=N.end}),_currentSegments.length==0?h=h.filter(function(N){return!1}):h=h.filter(function(N){return _annotation_time=(N.begin+N.end)/2,_currentSegments[0].begin<=_annotation_time&&_currentSegments[0].end>=_annotation_time}),this.annotations_count_header&&this.annotations_count!=h.length&&(this.annotations_count=h.length,this.refreshHeader())),this.show_only_annotation_from_user&&(h=h.filter(function(N){return N.creator==d.show_only_annotation_from_user})),this.limit_count&&(h=h.sortBy(function(N){return Math.abs((N.begin+N.end)/2-m)}).slice(0,this.limit_count)),this.newest_first?h=h.sortBy(function(N){return-N.created.valueOf()}):h=h.sortBy(function(N){return N.begin}),this.show_filters&&(this.user_filter&&(_username=this.userselect_$[0].options[this.userselect_$[0].selectedIndex].value,_username!="false"&&(h=h.filter(function(N){return N.creator==_username}))),this.keyword_filter&&(_keyword=this.keywordinput_$[0].value,_keyword!=""&&(h=h.filter(function(N){return N.description.toLowerCase().match(_keyword.toLowerCase())}))),this.date_filter&&this.datefilterinput_$[0].value!=""&&(_date=this.datefilterinput_$.datepicker("getDate"),h=h.filter(function(N){return N.created.getDate()==_date.getDate()&&N.created.getMonth()==_date.getMonth()&&N.created.getFullYear()==_date.getFullYear()})),this.latest_contributions_filter&&this.latestcontributionscheckbox_$[0].checked&&(h=h.sortBy(function(N){return-N.created.valueOf()}),this.usernames.forEach(function(N){latest_ann=h.filter(function(F){return F.creator==N})[0],h=h.filter(function(F){return F.id==(latest_ann?latest_ann.id:!1)||F.creator!=N})})));var A=h.idIndex;if(l||!_$1.isEqual(A,this.lastIds)||this.searchString!==this.lastSearch){if(this.lastSearch=this.searchString,this.lastIds=A,this.list_$.html(""),h.forEach(function(N){var F=typeof N.url<"u"&&N.url?N.url:typeof d.source.projectId<"u"&&typeof N.project<"u"&&N.project&&d.source.projectId!==N.project?mustache.render(d.foreign_url,{project:N.project,media:N.media.id,annotation:N.id,annotationType:N.annotationType.id}):document.location.href.replace(/#.*$/,"")+"#id="+N.id+"&t="+N.begin/1e3,U=N.project!=d.source.projectId,J="",te=N.description,se=typeof N.thumbnail<"u"&&N.thumbnail?N.thumbnail:d.default_thumbnail;if(d.show_creator&&N.creator){var de=[],Q={},ve="";d.source.users_data&&(de=d.source.users_data.filter(function(y){return y.username==N.creator})),de.length==0?Q.username=N.creator:Q=de[0],ve=d.make_name_string_function(Q)}if(d.show_title&&N.title)var J=N.title;var he;_$1(d.polemics).each(function(y){var w=t.Model.regexpFromTextOrArray(y.keyword,!0);w.test(J+" "+te)&&(he=y.background_color)});var ke=!1;if(d.show_creation_date&&(ke=N.created.toLocaleDateString()+", "+N.created.toLocaleTimeString().replace(/\u200E/g,"").replace(/^([^\d]*\d{1,2}:\d{1,2}):\d{1,2}([^\d]*)$/,"$1$2")),d.tags==!0)var T=N.getTagTexts();else var T=!1;var u={id:N.id,media_id:N.getMedia().id,htitle:t.textFieldHtml(J),title:J,creator:ve,hdescription:t.textFieldHtml(te),description:te,begin:N.begin.toString(),end:N.end.toString(),created:ke,show_timecode:d.show_timecode,show_end_time:d.show_end_time,show_title:d.show_title&&J,thumbnail:se,url:F,tags:T,specific_style:typeof he<"u"?"background-color: "+he:"",l10n:d.l10n,editable:d.editable,external:U,show_publish:d.show_publish,show_creator:d.show_creator,show_twitter:d.show_twitter,twitter_param:jQuery.param({url:F,text:t.textFieldHtml(J)+(d.twitter_hashtag?" #"+d.twitter_hashtag:"")}),allow_annotations_deletion:d.allow_annotations_deletion},p=mustache.render(d.constructor.annotationTemplate,u),b=jQuery(p),e=function(){d.$.find(".Ldt-AnnotationsList-li").removeClass("selected"),b.addClass("selected")},c=function(){d.$.find(".Ldt-AnnotationsList-li").removeClass("selected")};b.mouseover(function(){N.trigger("select")}).mouseout(function(){N.trigger("unselect")}).click(function(){d.filter_by_segments&&d.media.getTimeRange()&&(_ann_time=(N.begin+N.end)/2,(_ann_time<=d.media.getTimeRange()[0]||_ann_time>=d.media.getTimeRange()[1])&&d.media.resetTimeRange()),N.trigger("click")}).appendTo(d.list_$),t.attachDndData(b.find("[draggable]"),{title:J,description:te,uri:F,image:N.thumbnail,text:"["+N.begin.toString()+"] "+J}),b.on("remove",function(){N.off("select",e),N.off("unselect",c)}),N.on("select",e),N.on("unselect",c)}),this.$.find(".Ldt-AnnotationsList-Tag-Li").each(function(){var N=jQuery(this);N.text().replace(/(^\s+|\s+$)/g,"")||N.remove()}),this.editable){var B=d,M=jQuery,j=function(N,F){var U="#FF9999",J="#99FF99";F===void 0&&(F=N);var te=M(N.dataset.editable_type==="multiline"?"<textarea>":"<input>").addClass("editableInput").insertBefore(M(F));te[0].value=N.dataset.editable_value,M(te).show().focus(),M(N).addClass("editing");function se(ve){M(N).removeClass("editing"),te.remove();var he=M(N).css("background-color");M(N).stop().css("background-color",ve).animate({backgroundColor:he},1e3)}function de(ve){se(U)}function Q(){var ve=te[0].value;if(ve==N.dataset.editable_value){se(J);return}if(ve==""){$(N.dataset.editable_id),B.player.trigger("Annotation.delete",N.dataset.editable_id);return}else{var he=ve;if(N.dataset.editable_type=="timestamp"&&(he=t.timestamp2ms(ve),Number.isNaN(he))){de();return}N.dataset.editable_value=ve,ve=he,M(N).text(he)}var ke=I(N.dataset.editable_id);ke===void 0?(console.log("Strange error: cannot find edited annotation"),se(U)):(N.dataset.editable_value=ve,N.dataset.editable_field=="begin"?ke.setBegin(ve):N.dataset.editable_field=="end"?ke.setEnd(ve):ke[N.dataset.editable_field]=ve,ke.modified=new Date,ke.contributor=B.player.config.username||"COCo User",B.player.addLocalAnnotation(ke),B.player.trigger("Annotation.update",ke),se(J))}M(te).bind("keydown",function(ve){ve.which==13?(ve.preventDefault(),Q()):ve.which==27&&(ve.preventDefault(),de())}).bind("blur",function(ve){Q()})},I=function(N){return B.player.getLocalAnnotation(N)},P=function(){B.player.saveLocalAnnotations(),B.source.merge(B.player.localSource)},$=function(N){B.source.getAnnotations().removeId(N,!0),B.player.deleteLocalAnnotation(N),B.refresh(!0)};this.$.find(".Ldt-AnnotationsList-Delete").click(function(N){var F=I(this.dataset.editable_id);confirm(mustache.render(B.l10n.confirm_delete_message,{annotation:F}))&&$(this.dataset.editable_id),B.refresh(!0)}),this.$.find(".Ldt-AnnotationsList-Edit").click(function(N){if(B.on_edit){var F=I(this.dataset.editable_id);B.on_edit(F)}else{var U=M(this).parents(".Ldt-AnnotationsList-li").find(".Ldt-AnnotationsList-TitleContent.Ldt-live-editable");j(U[0])}}),this.$.find(".Ldt-AnnotationsList-PublishAnnotation").click(function(N){var F=I(this.dataset.editable_id);if(confirm(mustache.render(B.l10n.confirm_publish_message,{annotation:F}))){var U=mustache.render(B.api_endpoint_template,{id:B.source.projectId});if(U!==""){var J=B.player.sourceManager.newLocalSource({serializer:t.serializers[B.api_serializer]});if(B.publish_type){var te=B.source.getAnnotationTypes().filter(function(de){return de.title==B.publish_type});te.length==1&&F.setAnnotationType(te[0].id)}var se=new t.Model.List(B.player.sourceManager);se.push(F),J.addList("annotation",se),jQuery.ajax({url:U,type:B.api_method,contentType:"application/json",data:J.serialize(),success:function(de){M(this).addClass("published");var Q=I(F.id);Q.setTags(["published"]),P(),B.player.trigger("Annotation.publish",F)},error:function(de,Q,ve){t.log("Error when sending annotation",ve)}})}}}),this.$.find(".Ldt-AnnotationsList-TimeEdit").dblclick(function(N){var F=this,U=I(F.dataset.editable_id);U!==void 0&&(U.setBegin(B.media.getCurrentTime().milliseconds),P(),B.player.trigger("Annotation.update",U),B.refresh(!0))})}if(this.$.find(".Ldt-AnnotationsList-Tag-Li").click(function(){d.source.getAnnotations().search(jQuery(this).text().replace(/(^\s+|\s+$)/g,""))}),this.$.find(".Ldt-Annotation-Timecode").click(function(){d.media.setCurrentTime(Number(this.dataset.timecode))}),this.$.find(".Ldt-AnnotationsList-Play").click(function(){var N=jQuery(this),F=N.attr("data-annotation-id");d.jwplayers[F]&&jwplayer(d.jwplayers[F]).play(),d.media.pause()}),this.source.getAnnotations().searching){var z=d.source.getAnnotations().regexp||!1;this.$.find(".Ldt-AnnotationsList-Title a, .Ldt-AnnotationsList-Description").each(function(){var N=jQuery(this);N.html(t.textFieldHtml(N.text(),z))})}this.$.find(".Ldt-AnnotationsList-DeleteButton").click(d.functionWrapper("onDeleteClick"))}return this.ajax_url&&(this.mashupMode?this.ajaxMashup():Math.abs(m-this.lastAjaxQuery)>this.ajax_granularity&&this.ajaxSource()),h.length}onDeleteClick(l){_list=this.getWidgetAnnotations(),ann_id=l.target.dataset.annotation,delete_preview_$=this.$.find(".Ldt-AnnotationsList-ul-ToDelete"),delete_preview_$.html(""),_list=_list.filter(function(I){return I.id==ann_id});var d=_list[0],m="",h="",S=this;if(d.creator){var k=[],A={};S.source.users_data&&(k=S.source.users_data.filter(function(I){return I.username==d.creator})),k.length==0?A.username=d.creator:A=k[0],h=S.make_name_string_function(A)}if(d.title){var B=d.title;B.substr(0,m.length+1)==m+":"&&(m=""),m=m+(m==""?"":": ")+d.title}var M=!1;this.show_creation_date&&(M=d.created.toLocaleDateString()+", "+d.created.toLocaleTimeString());var j={id:d.id,media_id:d.getMedia().id,htitle:t.textFieldHtml(m),hdescription:t.textFieldHtml(d.description),begin:d.begin.toString(),end:d.end.toString(),created:M,show_timecode:this.show_timecode,show_creator:this.show_creator,creator:h,tags:!1,l10n:this.l10n,allow_annotations_deletion:!1};_html=mustache.render(this.constructor.annotationTemplate,j),delete_preview_$.html(_html),this.$.find(".Ldt-AnnotationsList-ConfirmDelete").click(function(){S.sendDelete(ann_id)}),this.showScreen("Delete")}refreshHeader(){var l=" ("+this.annotations_count+" "+this.annotations_count_header_string+")";this.$.find(".Ldt-AnnotationsList-header").html(""),this.$.find(".Ldt-AnnotationsList-header").html(this.custom_header&&typeof this.custom_header=="string"?this.custom_header+l:this.l10n.header+l)}hide(){var l=this;this.visible&&(this.visible=!1,this.widget_$.slideUp(function(){l.$.find(".Ldt-AnnotationsList-header").hide()}),this.showScreen("Main"))}show(){this.visible||(this.visible=!0,this.$.find(".Ldt-AnnotationsList-header").show(),this.widget_$.slideDown(),this.showScreen("Main"))}toggle(){this.always_visible||(this.visible?this.hide():this.show())}revertToMainScreen(){this.$.find(".Ldt-AnnotationsList-ScreenMain").is(":hidden")&&this.showScreen("Main")}sendDelete(l){var d=this,m=mustache.render(this.api_delete_endpoint,{annotation_id:l,project_id:this.project_id});jQuery.ajax({url:m,type:this.api_delete_method,contentType:"application/json",success:function(h){d.showScreen("Success"),window.setTimeout(d.functionWrapper("revertToMainScreen"),d.after_send_timeout||2e3),d.currentSource.getAnnotations().removeId(l),d.player.trigger("AnnotationsList.refresh")},error:function(h,S,k){t.log("Error when sending annotation",k),d.showScreen("Error"),window.setTimeout(d.functionWrapper("revertToMainScreen"),d.after_send_timeout||2e3)}}),this.showScreen("Sending")}draw(){this.jwplayers={},this.mashupMode=this.media.elementType==="mashup",this.renderTemplate();var l=this;this.list_$=this.$.find(".Ldt-AnnotationsList-ul"),this.widget_$=this.$.find(".Ldt-AnnotationsListWidget"),this.widget_max_height&&this.widget_$.css("max-height",this.widget_max_height),this.show_filters&&(this.user_filter&&(this.userselect_$=this.$.find("#Ldt-AnnotationsList-userFilter"),this.userselect_$.change(function(){l.player.trigger("AnnotationsList.refresh")}),this.userselect_$.html("<option selected value='false'>"+this.l10n.everyone+"</option>"),this.usernames.forEach(function(h){var S=l.source.users_data.filter(function(A){return A.username==h}),k={};S.length==0?k.username=h:k=S[0],l.userselect_$.append("<option value='"+h+"'>"+l.make_name_string_function(k)+"</option>")})),this.keyword_filter&&(this.keywordinput_$=this.$.find("#Ldt-AnnotationsList-keywordsFilter"),this.keywordinput_$.keyup(function(){l.player.trigger("AnnotationsList.refresh")})),this.segment_filter&&(this.ignoresegmentcheckbox_$=this.$.find("#Ldt-AnnotationsList-ignoreSegmentsFilter"),this.ignoresegmentcheckbox_$.click(function(){l.player.trigger("AnnotationsList.refresh")})),this.date_filter&&(this.datefilterinput_$=this.$.find("#Ldt-AnnotationsList-dateFilter"),this.datefilterinput_$.datepicker({dateFormat:"dd/mm/yy"}),this.datefilterinput_$.change(function(){l.player.trigger("AnnotationsList.refresh")}),this.current_day_filter&&(currentDate=new Date,this.datefilterinput_$.datepicker("setDate",currentDate))),this.latest_contributions_filter&&(this.latestcontributionscheckbox_$=this.$.find("#Ldt-AnnotationsList-latestContributionsFilter"),this.latestcontributionscheckbox_$.click(function(){l.player.trigger("AnnotationsList.refresh")}))),this.source.getAnnotations().on("search",function(h){l.searchString=h,l.source!==l.currentSource&&(l.currentSource.getAnnotations().search(h),l.throttledRefresh())}),this.source.getAnnotations().on("found",function(){l.throttledRefresh()}),this.source.getAnnotations().on("not-found",function(){l.throttledRefresh()}),this.source.getAnnotations().on("clear-search",function(){l.searchString=!1,l.source!==l.currentSource&&l.currentSource.getAnnotations().trigger("clear-search")}),this.$.find(".Ldt-AnnotationsList-Close").click(function(){l.showScreen("Main")}),this.source.getAnnotations().on("search-cleared",function(){l.throttledRefresh()}),this.onMdpEvent("AnnotationsList.refresh",function(){l.ajax_url&&(l.mashupMode?l.ajaxMashup():l.ajaxSource()),l.throttledRefresh(!1)}),this.onMdpEvent("AnnotationsList.update",function(){l.ajax_url&&(l.mashupMode?l.ajaxMashup():l.ajaxSource()),l.throttledRefresh(!0)}),this.ajax_url?this.mashupMode?this.ajaxMashup():this.ajaxSource():this.currentSource=this.source,this.refresh_interval&&window.setInterval(function(){l.currentSource.get()},this.refresh_interval),this.annotations_count_header&&(this.annotations_count=!1),this.onMdpEvent("AnnotationsList.toggle","toggle"),this.onMdpEvent("AnnotationsList.hide","hide"),this.onMdpEvent("AnnotationsList.show","show"),this.onMdpEvent("createAnnotationWidget.addedAnnotation",this.throttledRefresh);for(var d=["timeupdate","seeked","loadedmetadata","settimerange"],m=0;m<d.length;m++)this.onMediaEvent(d[m],this.throttledRefresh);this.throttledRefresh(),this.showScreen("Main"),this.$.find(".Ldt-AnnotationsList-CancelDelete").click(function(){l.showScreen("Main")}),this.visible=!0,this.start_visible||this.hide()}},Cr(n,"defaults",{pre_draw_callback:function(){return this.importUsers()},ajax_url:!1,ajax_granularity:6e5,default_thumbnail:"",custom_external_icon:"",foreign_url:"",annotation_type:!1,refresh_interval:0,limit_count:20,newest_first:!1,show_title:!0,show_audio:!0,show_creator:!0,show_controls:!1,show_end_time:!0,show_publish:!1,show_twitter:!1,twitter_hashtag:"",on_edit:void 0,publish_type:"PublicContribution",api_endpoint_template:"",api_serializer:"ldt_annotate",api_method:"POST",editable:!1,editable_storage:"",widget_max_height:680,always_visible:!1,start_visible:!0,show_audio:!0,show_filters:!1,keyword_filter:!0,date_filter:!0,user_filter:!0,segment_filter:!0,latest_contributions_filter:!1,current_day_filter:!0,show_header:!1,custom_header:!1,annotations_count_header:!0,annotations_count_header_string:"annotations",show_creation_date:!1,show_timecode:!0,show_end_time:!0,project_id:"",allow_annotations_deletion:!1,api_delete_endpoint:"",api_delete_method:"DELETE",api_users_endpoint:"",api_users_method:"GET",make_name_string_function:function(l){return l.username?l.username:"Anonymous"},filter_by_segments:!1,segment_filter:!0,segments_annotation_type:"chap",show_only_annotation_from_user:!1,tags:!0,polemics:[{keyword:"++",background_color:"#c9ecc6"},{keyword:"--",background_color:"#f9c5c6"},{keyword:"??",background_color:"#cec5f9"},{keyword:"==",background_color:"#f9f4c6"}]}),Cr(n,"messages",{en:{voice_annotation:"Voice Annotation",now_playing:"Now playing...",previous:"Previous",next:"Next",set_time:"Double-click to update to current player time",edit_annotation:"Edit note",delete_annotation:"Delete note",publish_annotation:"Make note public",import_annotations:"Paste or load notes in this field and press Import.",confirm_delete_message:"You are about to delete {{ annotation.title }}. Are you sure you want to delete it?",confirm_publish_message:"You are about to publish {{ annotation.title }}. Are you sure you want to make it public?",tweet_annotation:"Tweet annotation",external_annotation:"This annotation was submitted to another project",everyone:"Everyone",header:"Annotations for this content",segment_filter:"All cuttings",latest_contributions:"Latest contributions",close_widget:"Close",confirm:"Confirm",cancel:"Cancel",annotation_deletion_delete:"You will delete this annotation",annotation_deletion_sending:"Your deletion request is being sent ... ",annotation_deletion_success:"The annotation has been deleted.",annotation_deletion_error:"There was an error contacting the server. The annotation has not been deleted."},fr:{voice_annotation:"Annotation Vocale",now_playing:"Lecture en cours...",previous:"Précédent",next:"Suivant",set_time:"Double-cliquer pour fixer au temps du lecteur",edit_annotation:"Éditer la note",delete_annotation:"Supprimer la note",publish_annotation:"Rendre la note publique",import_annotations:"Copiez ou chargez des notes dans ce champ et appuyez sur Import",confirm_delete_message:"Vous allez supprimer {{ annotation.title }}. Êtes-vous certain(e) ?",confirm_publish_message:"Vous allez publier {{ annotation.title }}. Êtes-vous certain(e) ?",tweet_annotation:"Tweeter l'annotation",external_annotation:"Cette annotation a été postée sur un autre projet",everyone:"Tous",header:"Annotations sur ce contenu",segment_filter:"Tous les segments",latest_contributions:"Dernières contributions",close_widget:"Fermer",confirm:"Confirmer",cancel:"Annuler",annotation_deletion_delete:"Vous allez supprimer cette annotation",annotation_deletion_sending:"Votre demande de suppression est en cours d'envoi ... ",annotation_deletion_success:"L'annotation a été supprimée.",annotation_deletion_error:"Une erreur s'est produite en contactant le serveur. L'annotation n'a pas été supprimée."}}),Cr(n,"template",'{{#show_header}}<p class="Ldt-AnnotationsList-header">{{#custom_header}}{{custom_header}}{{/custom_header}}{{^custom_header}}{{l10n.header}}{{/custom_header}}</p>{{/show_header}}<div class="Ldt-AnnotationsListWidget"><div class="Ldt-AnnotationsList-ScreenMain">{{#show_filters}}<div class="Ldt-AnnotationsList-Filters">{{#keyword_filter}}<input class="Ldt-AnnotationsList-filter-text" id="Ldt-AnnotationsList-keywordsFilter" type="text" value=""></input>{{/keyword_filter}}{{#user_filter}}<select class="Ldt-AnnotationsList-filter-dropdown" id="Ldt-AnnotationsList-userFilter"><option selected value="">{{l10n.everyone}}</option></select>{{/user_filter}}{{#date_filter}}<label class="Ldt-AnnotationsList-filter-date">Date: <input id="Ldt-AnnotationsList-dateFilter" type="text"></input></label>{{/date_filter}}{{#segment_filter}}<label class="Ldt-AnnotationsList-filter-checkbox"><input type="checkbox" id="Ldt-AnnotationsList-ignoreSegmentsFilter">{{l10n.segment_filter}}</label>{{/segment_filter}}{{#latest_contributions_filter}}<label class="Ldt-AnnotationsList-filter-checkbox"><input type="checkbox" id="Ldt-AnnotationsList-latestContributionsFilter">{{l10n.latest_contributions}}</label>{{/latest_contributions_filter}}</div>{{/show_filters}}{{#show_controls}}<div class="Ldt-AnnotationsList-Controls"><span class="Ldt-AnnotationsList-Control-Prev">{{ l10n.previous }}</span> | <span class="Ldt-AnnotationsList-Control-Next">{{ l10n.next }}</span></div>{{/show_controls}}{{#show_audio}}<div class="Ldt-AnnotationsList-Audio"></div>{{/show_audio}}<ul class="Ldt-AnnotationsList-ul"></ul></div>{{#allow_annotations_deletion}}<div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenDelete"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_delete}}<ul class="Ldt-AnnotationsList-ul-ToDelete"></ul><a class="Ldt-AnnotationsList-ConfirmDelete">{{l10n.confirm}}</a> <a class="Ldt-AnnotationsList-CancelDelete">{{l10n.cancel}}</a></div><div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenSending"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_sending}}</div><div data-annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenSuccess"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_success}}</div><div data.annotation="{{id}}" class="Ldt-AnnotationsList-Screen Ldt-AnnotationsList-ScreenError"><a title="{{l10n.close_widget}}" class="Ldt-AnnotationsList-Close" href="#"></a>{{l10n.annotation_deletion_error}}</div>{{/allow_annotations_deletion}}</div>'),Cr(n,"annotationTemplate",'<li class="Ldt-AnnotationsList-li Ldt-Highlighter-Annotation Ldt-TraceMe" data-annotation="{{ id }}" data-begin="{{ begin_ms }}" data-end="{{ end_ms }}" trace-info="annotation-id:{{id}}, media-id:{{media_id}}" style="{{specific_style}}"><div data-annotation="{{ id }}" class="Ldt-AnnotationsList-ThumbContainer Ldt-AnnotationsList-Annotation-Screen Ldt-AnnotationsList-Annotation-ScreenMain"><a {{#url}}href="{{url}}"{{/url}} draggable="true"><img title="{{^external}}{{ begin }} - {{ end }}{{/external}}{{#external}}{{l10n.external_annotation}}{{/external}}" class="Ldt-AnnotationsList-Thumbnail" src="{{thumbnail}}" />{{#external}}<div title="{{l10n.external_annotation}}" class="Ldt-AnnotationsList-External-Icon"></div>{{/external}}</a></div>{{#allow_annotations_deletion}}<div data-annotation="{{ id }}" class="Ldt-AnnotationsList-DeleteButton">✖</div>{{/allow_annotations_deletion}}{{#show_timecode}}<div title="{{l10n.set_time}}" class="Ldt-AnnotationsList-Duration"><span class="Ldt-AnnotationsList-Begin Ldt-live-editable Ldt-AnnotationsList-TimeEdit" data-editable_value="{{begin}}" data-editable_id="{{id}}" data-editable_field="begin" data-editable_type="timestamp">{{begin}}</span>{{#show_end_time}} - <span class="Ldt-AnnotationsList-End Ldt-live-editable" data-editable_value="{{end}}" data-editable_id="{{id}}" data-editable_field="end" data-editable_type="timestamp">{{end}}</span>{{/show_end_time}}</div>{{/show_timecode}}<h3 class="Ldt-AnnotationsList-Title Ldt-Annotation-Timecode" data-timecode="{{ begin_ms }}" draggable="true">{{#show_title}}<span class="Ldt-AnnotationsList-TitleContent Ldt-live-editable" data-editable_value="{{title}}" data-editable_type="multiline" data-editable_id="{{id}}" data-editable_field="title">{{{htitle}}}</span>{{/show_title}}{{#show_creator}}<span class="Ldt-AnnotationsList-Creator">{{ creator }}</span>{{/show_creator}}</h3><p class="Ldt-AnnotationsList-Description Ldt-live-editable" data-editable_type="multiline" data-editable_value="{{description}}" data-editable_id="{{id}}" data-editable_field="description">{{{hdescription}}}</p>{{#created}}<div class="Ldt-AnnotationsList-CreationDate">{{{created}}}</div>{{/created}}{{#tags.length}}<ul class="Ldt-AnnotationsList-Tags">{{#tags}}{{#.}}<li class="Ldt-AnnotationsList-Tag-Li"><span>{{.}}</span></li>{{/.}}{{/tags}}</ul>{{/tags.length}}{{#audio}}<div class="Ldt-AnnotationsList-Play" data-annotation-id="{{id}}">{{l10n.voice_annotation}}</div>{{/audio}}<div class="Ldt-AnnotationsList-EditControls">{{#show_twitter}}<a title="{{l10n.tweet_annotation}}" target="_blank" href="https://twitter.com/intent/tweet?{{twitter_param}}"><img width="16" height="16" src="metadataplayer/img/twitter.svg"></a>{{/show_twitter}}{{#show_publish}}<div title="{{l10n.publish_annotation}}" class="Ldt-AnnotationsList-PublishAnnotation" data-editable_id="{{id}}"></div>{{/show_publish}}{{#editable}}<div title="{{l10n.edit_annotation}}" class="Ldt-AnnotationsList-Edit" data-editable_id="{{id}}"></div><div title="{{l10n.delete_annotation}}" class="Ldt-AnnotationsList-Delete" data-editable_id="{{id}}"></div>{{/editable}}</div></li>'),n};var raphael_min={exports:{}};(function(t,n){(function(l,d){t.exports=d()})(window,function(){return function(l){var d={};function m(h){if(d[h])return d[h].exports;var S=d[h]={i:h,l:!1,exports:{}};return l[h].call(S.exports,S,S.exports,m),S.l=!0,S.exports}return m.m=l,m.c=d,m.d=function(h,S,k){m.o(h,S)||Object.defineProperty(h,S,{enumerable:!0,get:k})},m.r=function(h){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})},m.t=function(h,S){if(1&S&&(h=m(h)),8&S||4&S&&typeof h=="object"&&h&&h.__esModule)return h;var k=Object.create(null);if(m.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:h}),2&S&&typeof h!="string")for(var A in h)m.d(k,A,(function(B){return h[B]}).bind(null,A));return k},m.n=function(h){var S=h&&h.__esModule?function(){return h.default}:function(){return h};return m.d(S,"a",S),S},m.o=function(h,S){return Object.prototype.hasOwnProperty.call(h,S)},m.p="",m(m.s=1)}([function(l,d,m){var h,S;h=[m(2)],(S=(function(k){function A(ae){if(A.is(ae,"function"))return B?ae():k.on("raphael.DOMload",ae);if(A.is(ae,v))return A._engine.create[U](A,ae.splice(0,3+A.is(ae[0],w))).add(ae);var ye=Array.prototype.slice.call(arguments,0);if(A.is(ye[ye.length-1],"function")){var Ce=ye.pop();return B?Ce.call(A._engine.create[U](A,ye)):k.on("raphael.DOMload",function(){Ce.call(A._engine.create[U](A,ye))})}return A._engine.create[U](A,arguments)}A.version="2.3.0",A.eve=k;var B,M,j=/[, ]+/,I={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},P=/\{(\d+)\}/g,$="hasOwnProperty",z={doc:document,win:window},N={was:Object.prototype[$].call(z.win,"Raphael"),is:z.win.Raphael},F=function(){this.ca=this.customAttributes={}},U="apply",J="concat",te="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,se="",de=" ",Q=String,ve="split",he="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[ve](de),ke={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},T=Q.prototype.toLowerCase,u=Math,p=u.max,b=u.min,e=u.abs,c=u.pow,y=u.PI,w="number",v="array",o=Object.prototype.toString,x=(A._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),E={NaN:1,Infinity:1,"-Infinity":1},R=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,H=u.round,Y=parseFloat,Z=parseInt,L=Q.prototype.toUpperCase,D=A._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},ee=A._availableAnimAttrs={blur:w,"clip-rect":"csv",cx:w,cy:w,fill:"colour","fill-opacity":w,"font-size":w,height:w,opacity:w,path:"path",r:w,rx:w,ry:w,stroke:"colour","stroke-opacity":w,"stroke-width":w,transform:"transform",width:w,x:w,y:w},oe=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,fe={hs:1,rg:1},ue=/,?([achlmqrstvxz]),?/gi,qe=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,rt=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,Ve=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,et=(A._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),mt=function(ae,ye){return Y(ae)-Y(ye)},Ye=function(ae){return ae},We=A._rectPath=function(ae,ye,Ce,Pe,ze){return ze?[["M",ae+ze,ye],["l",Ce-2*ze,0],["a",ze,ze,0,0,1,ze,ze],["l",0,Pe-2*ze],["a",ze,ze,0,0,1,-ze,ze],["l",2*ze-Ce,0],["a",ze,ze,0,0,1,-ze,-ze],["l",0,2*ze-Pe],["a",ze,ze,0,0,1,ze,-ze],["z"]]:[["M",ae,ye],["l",Ce,0],["l",0,Pe],["l",-Ce,0],["z"]]},Xe=function(ae,ye,Ce,Pe){return Pe==null&&(Pe=Ce),[["M",ae,ye],["m",0,-Pe],["a",Ce,Pe,0,1,1,0,2*Pe],["a",Ce,Pe,0,1,1,0,-2*Pe],["z"]]},Ge=A._getPath={path:function(ae){return ae.attr("path")},circle:function(ae){var ye=ae.attrs;return Xe(ye.cx,ye.cy,ye.r)},ellipse:function(ae){var ye=ae.attrs;return Xe(ye.cx,ye.cy,ye.rx,ye.ry)},rect:function(ae){var ye=ae.attrs;return We(ye.x,ye.y,ye.width,ye.height,ye.r)},image:function(ae){var ye=ae.attrs;return We(ye.x,ye.y,ye.width,ye.height)},text:function(ae){var ye=ae._getBBox();return We(ye.x,ye.y,ye.width,ye.height)},set:function(ae){var ye=ae._getBBox();return We(ye.x,ye.y,ye.width,ye.height)}},nt=A.mapPath=function(ae,ye){if(!ye)return ae;var Ce,Pe,ze,Je,ge,we,Ae;for(ze=0,ge=(ae=Ot(ae)).length;ze<ge;ze++)for(Je=1,we=(Ae=ae[ze]).length;Je<we;Je+=2)Ce=ye.x(Ae[Je],Ae[Je+1]),Pe=ye.y(Ae[Je],Ae[Je+1]),Ae[Je]=Ce,Ae[Je+1]=Pe;return ae};if(A._g=z,A.type=z.win.SVGAngle||z.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML",A.type=="VML"){var Et,Le=z.doc.createElement("div");if(Le.innerHTML='<v:shape adj="1"/>',(Et=Le.firstChild).style.behavior="url(#default#VML)",!Et||typeof Et.adj!="object")return A.type=se;Le=null}function Oe(ae){if(typeof ae=="function"||Object(ae)!==ae)return ae;var ye=new ae.constructor;for(var Ce in ae)ae[$](Ce)&&(ye[Ce]=Oe(ae[Ce]));return ye}A.svg=!(A.vml=A.type=="VML"),A._Paper=F,A.fn=M=F.prototype=A.prototype,A._id=0,A.is=function(ae,ye){return(ye=T.call(ye))=="finite"?!E[$](+ae):ye=="array"?ae instanceof Array:ye=="null"&&ae===null||ye==typeof ae&&ae!==null||ye=="object"&&ae===Object(ae)||ye=="array"&&Array.isArray&&Array.isArray(ae)||o.call(ae).slice(8,-1).toLowerCase()==ye},A.angle=function(ae,ye,Ce,Pe,ze,Je){if(ze==null){var ge=ae-Ce,we=ye-Pe;return ge||we?(180+180*u.atan2(-we,-ge)/y+360)%360:0}return A.angle(ae,ye,ze,Je)-A.angle(Ce,Pe,ze,Je)},A.rad=function(ae){return ae%360*y/180},A.deg=function(ae){return Math.round(180*ae/y%360*1e3)/1e3},A.snapTo=function(ae,ye,Ce){if(Ce=A.is(Ce,"finite")?Ce:10,A.is(ae,v)){for(var Pe=ae.length;Pe--;)if(e(ae[Pe]-ye)<=Ce)return ae[Pe]}else{var ze=ye%(ae=+ae);if(ze<Ce)return ye-ze;if(ze>ae-Ce)return ye-ze+ae}return ye};var $t,dt;A.createUUID=($t=/[xy]/g,dt=function(ae){var ye=16*u.random()|0;return(ae=="x"?ye:3&ye|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace($t,dt).toUpperCase()}),A.setWindow=function(ae){k("raphael.setWindow",A,z.win,ae),z.win=ae,z.doc=z.win.document,A._engine.initWin&&A._engine.initWin(z.win)};var gt=function(ae){if(A.vml){var ye,Ce=/^\s+|\s+$/g;try{var Pe=new ActiveXObject("htmlfile");Pe.write("<body>"),Pe.close(),ye=Pe.body}catch{ye=createPopup().document.body}var ze=ye.createTextRange();gt=$e(function(ge){try{ye.style.color=Q(ge).replace(Ce,se);var we=ze.queryCommandValue("ForeColor");return"#"+("000000"+(we=(255&we)<<16|65280&we|(16711680&we)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var Je=z.doc.createElement("i");Je.title="Raphaël Colour Picker",Je.style.display="none",z.doc.body.appendChild(Je),gt=$e(function(ge){return Je.style.color=ge,z.doc.defaultView.getComputedStyle(Je,se).getPropertyValue("color")})}return gt(ae)},Lt=function(){return"hsb("+[this.h,this.s,this.b]+")"},xe=function(){return"hsl("+[this.h,this.s,this.l]+")"},X=function(){return this.hex},pe=function(ae,ye,Ce){if(ye==null&&A.is(ae,"object")&&"r"in ae&&"g"in ae&&"b"in ae&&(Ce=ae.b,ye=ae.g,ae=ae.r),ye==null&&A.is(ae,"string")){var Pe=A.getRGB(ae);ae=Pe.r,ye=Pe.g,Ce=Pe.b}return(ae>1||ye>1||Ce>1)&&(ae/=255,ye/=255,Ce/=255),[ae,ye,Ce]},je=function(ae,ye,Ce,Pe){var ze={r:ae*=255,g:ye*=255,b:Ce*=255,hex:A.rgb(ae,ye,Ce),toString:X};return A.is(Pe,"finite")&&(ze.opacity=Pe),ze};function $e(ae,ye,Ce){return function Pe(){var ze=Array.prototype.slice.call(arguments,0),Je=ze.join("␀"),ge=Pe.cache=Pe.cache||{},we=Pe.count=Pe.count||[];return ge[$](Je)?(function(Ae,Ue){for(var ht=0,_t=Ae.length;ht<_t;ht++)if(Ae[ht]===Ue)return Ae.push(Ae.splice(ht,1)[0])}(we,Je),Ce?Ce(ge[Je]):ge[Je]):(we.length>=1e3&&delete ge[we.shift()],we.push(Je),ge[Je]=ae[U](ye,ze),Ce?Ce(ge[Je]):ge[Je])}}A.color=function(ae){var ye;return A.is(ae,"object")&&"h"in ae&&"s"in ae&&"b"in ae?(ye=A.hsb2rgb(ae),ae.r=ye.r,ae.g=ye.g,ae.b=ye.b,ae.hex=ye.hex):A.is(ae,"object")&&"h"in ae&&"s"in ae&&"l"in ae?(ye=A.hsl2rgb(ae),ae.r=ye.r,ae.g=ye.g,ae.b=ye.b,ae.hex=ye.hex):(A.is(ae,"string")&&(ae=A.getRGB(ae)),A.is(ae,"object")&&"r"in ae&&"g"in ae&&"b"in ae?(ye=A.rgb2hsl(ae),ae.h=ye.h,ae.s=ye.s,ae.l=ye.l,ye=A.rgb2hsb(ae),ae.v=ye.b):(ae={hex:"none"}).r=ae.g=ae.b=ae.h=ae.s=ae.v=ae.l=-1),ae.toString=X,ae},A.hsb2rgb=function(ae,ye,Ce,Pe){var ze,Je,ge,we,Ae;return this.is(ae,"object")&&"h"in ae&&"s"in ae&&"b"in ae&&(Ce=ae.b,ye=ae.s,Pe=ae.o,ae=ae.h),we=(Ae=Ce*ye)*(1-e((ae=(ae*=360)%360/60)%2-1)),ze=Je=ge=Ce-Ae,je(ze+=[Ae,we,0,0,we,Ae][ae=~~ae],Je+=[we,Ae,Ae,we,0,0][ae],ge+=[0,0,we,Ae,Ae,we][ae],Pe)},A.hsl2rgb=function(ae,ye,Ce,Pe){var ze,Je,ge,we,Ae;return this.is(ae,"object")&&"h"in ae&&"s"in ae&&"l"in ae&&(Ce=ae.l,ye=ae.s,ae=ae.h),(ae>1||ye>1||Ce>1)&&(ae/=360,ye/=100,Ce/=100),we=(Ae=2*ye*(Ce<.5?Ce:1-Ce))*(1-e((ae=(ae*=360)%360/60)%2-1)),ze=Je=ge=Ce-Ae/2,je(ze+=[Ae,we,0,0,we,Ae][ae=~~ae],Je+=[we,Ae,Ae,we,0,0][ae],ge+=[0,0,we,Ae,Ae,we][ae],Pe)},A.rgb2hsb=function(ae,ye,Ce){var Pe,ze;return ae=(Ce=pe(ae,ye,Ce))[0],ye=Ce[1],Ce=Ce[2],{h:(((ze=(Pe=p(ae,ye,Ce))-b(ae,ye,Ce))==0?null:Pe==ae?(ye-Ce)/ze:Pe==ye?(Ce-ae)/ze+2:(ae-ye)/ze+4)+360)%6*60/360,s:ze==0?0:ze/Pe,b:Pe,toString:Lt}},A.rgb2hsl=function(ae,ye,Ce){var Pe,ze,Je,ge;return ae=(Ce=pe(ae,ye,Ce))[0],ye=Ce[1],Ce=Ce[2],Pe=((ze=p(ae,ye,Ce))+(Je=b(ae,ye,Ce)))/2,{h:(((ge=ze-Je)==0?null:ze==ae?(ye-Ce)/ge:ze==ye?(Ce-ae)/ge+2:(ae-ye)/ge+4)+360)%6*60/360,s:ge==0?0:Pe<.5?ge/(2*Pe):ge/(2-2*Pe),l:Pe,toString:xe}},A._path2string=function(){return this.join(",").replace(ue,"$1")},A._preload=function(ae,ye){var Ce=z.doc.createElement("img");Ce.style.cssText="position:absolute;left:-9999em;top:-9999em",Ce.onload=function(){ye.call(this),this.onload=null,z.doc.body.removeChild(this)},Ce.onerror=function(){z.doc.body.removeChild(this)},z.doc.body.appendChild(Ce),Ce.src=ae};function He(){return this.hex}function Fe(ae,ye){for(var Ce=[],Pe=0,ze=ae.length;ze-2*!ye>Pe;Pe+=2){var Je=[{x:+ae[Pe-2],y:+ae[Pe-1]},{x:+ae[Pe],y:+ae[Pe+1]},{x:+ae[Pe+2],y:+ae[Pe+3]},{x:+ae[Pe+4],y:+ae[Pe+5]}];ye?Pe?ze-4==Pe?Je[3]={x:+ae[0],y:+ae[1]}:ze-2==Pe&&(Je[2]={x:+ae[0],y:+ae[1]},Je[3]={x:+ae[2],y:+ae[3]}):Je[0]={x:+ae[ze-2],y:+ae[ze-1]}:ze-4==Pe?Je[3]=Je[2]:Pe||(Je[0]={x:+ae[Pe],y:+ae[Pe+1]}),Ce.push(["C",(-Je[0].x+6*Je[1].x+Je[2].x)/6,(-Je[0].y+6*Je[1].y+Je[2].y)/6,(Je[1].x+6*Je[2].x-Je[3].x)/6,(Je[1].y+6*Je[2].y-Je[3].y)/6,Je[2].x,Je[2].y])}return Ce}A.getRGB=$e(function(ae){if(!ae||(ae=Q(ae)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:He};if(ae=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:He};!fe[$](ae.toLowerCase().substring(0,2))&&ae.charAt()!="#"&&(ae=gt(ae));var ye,Ce,Pe,ze,Je,ge,we=ae.match(x);return we?(we[2]&&(Pe=Z(we[2].substring(5),16),Ce=Z(we[2].substring(3,5),16),ye=Z(we[2].substring(1,3),16)),we[3]&&(Pe=Z((Je=we[3].charAt(3))+Je,16),Ce=Z((Je=we[3].charAt(2))+Je,16),ye=Z((Je=we[3].charAt(1))+Je,16)),we[4]&&(ge=we[4][ve](oe),ye=Y(ge[0]),ge[0].slice(-1)=="%"&&(ye*=2.55),Ce=Y(ge[1]),ge[1].slice(-1)=="%"&&(Ce*=2.55),Pe=Y(ge[2]),ge[2].slice(-1)=="%"&&(Pe*=2.55),we[1].toLowerCase().slice(0,4)=="rgba"&&(ze=Y(ge[3])),ge[3]&&ge[3].slice(-1)=="%"&&(ze/=100)),we[5]?(ge=we[5][ve](oe),ye=Y(ge[0]),ge[0].slice(-1)=="%"&&(ye*=2.55),Ce=Y(ge[1]),ge[1].slice(-1)=="%"&&(Ce*=2.55),Pe=Y(ge[2]),ge[2].slice(-1)=="%"&&(Pe*=2.55),(ge[0].slice(-3)=="deg"||ge[0].slice(-1)=="°")&&(ye/=360),we[1].toLowerCase().slice(0,4)=="hsba"&&(ze=Y(ge[3])),ge[3]&&ge[3].slice(-1)=="%"&&(ze/=100),A.hsb2rgb(ye,Ce,Pe,ze)):we[6]?(ge=we[6][ve](oe),ye=Y(ge[0]),ge[0].slice(-1)=="%"&&(ye*=2.55),Ce=Y(ge[1]),ge[1].slice(-1)=="%"&&(Ce*=2.55),Pe=Y(ge[2]),ge[2].slice(-1)=="%"&&(Pe*=2.55),(ge[0].slice(-3)=="deg"||ge[0].slice(-1)=="°")&&(ye/=360),we[1].toLowerCase().slice(0,4)=="hsla"&&(ze=Y(ge[3])),ge[3]&&ge[3].slice(-1)=="%"&&(ze/=100),A.hsl2rgb(ye,Ce,Pe,ze)):((we={r:ye,g:Ce,b:Pe,toString:He}).hex="#"+(16777216|Pe|Ce<<8|ye<<16).toString(16).slice(1),A.is(ze,"finite")&&(we.opacity=ze),we)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:He}},A),A.hsb=$e(function(ae,ye,Ce){return A.hsb2rgb(ae,ye,Ce).hex}),A.hsl=$e(function(ae,ye,Ce){return A.hsl2rgb(ae,ye,Ce).hex}),A.rgb=$e(function(ae,ye,Ce){function Pe(ze){return ze+.5|0}return"#"+(16777216|Pe(Ce)|Pe(ye)<<8|Pe(ae)<<16).toString(16).slice(1)}),A.getColor=function(ae){var ye=this.getColor.start=this.getColor.start||{h:0,s:1,b:ae||.75},Ce=this.hsb2rgb(ye.h,ye.s,ye.b);return ye.h+=.075,ye.h>1&&(ye.h=0,ye.s-=.2,ye.s<=0&&(this.getColor.start={h:0,s:1,b:ye.b})),Ce.hex},A.getColor.reset=function(){delete this.start},A.parsePathString=function(ae){if(!ae)return null;var ye=Me(ae);if(ye.arr)return ot(ye.arr);var Ce={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},Pe=[];return A.is(ae,v)&&A.is(ae[0],v)&&(Pe=ot(ae)),Pe.length||Q(ae).replace(qe,function(ze,Je,ge){var we=[],Ae=Je.toLowerCase();if(ge.replace(Ve,function(Ue,ht){ht&&we.push(+ht)}),Ae=="m"&&we.length>2&&(Pe.push([Je][J](we.splice(0,2))),Ae="l",Je=Je=="m"?"l":"L"),Ae=="r")Pe.push([Je][J](we));else for(;we.length>=Ce[Ae]&&(Pe.push([Je][J](we.splice(0,Ce[Ae]))),Ce[Ae]););}),Pe.toString=A._path2string,ye.arr=ot(Pe),Pe},A.parseTransformString=$e(function(ae){if(!ae)return null;var ye=[];return A.is(ae,v)&&A.is(ae[0],v)&&(ye=ot(ae)),ye.length||Q(ae).replace(rt,function(Ce,Pe,ze){var Je=[];T.call(Pe),ze.replace(Ve,function(ge,we){we&&Je.push(+we)}),ye.push([Pe][J](Je))}),ye.toString=A._path2string,ye},this,function(ae){if(!ae)return ae;for(var ye=[],Ce=0;Ce<ae.length;Ce++){for(var Pe=[],ze=0;ze<ae[Ce].length;ze++)Pe.push(ae[Ce][ze]);ye.push(Pe)}return ye});var Me=function(ae){var ye=Me.ps=Me.ps||{};return ye[ae]?ye[ae].sleep=100:ye[ae]={sleep:100},setTimeout(function(){for(var Ce in ye)ye[$](Ce)&&Ce!=ae&&(ye[Ce].sleep--,!ye[Ce].sleep&&delete ye[Ce])}),ye[ae]};function Rt(ae,ye,Ce,Pe,ze){return ae*(ae*(-3*ye+9*Ce-9*Pe+3*ze)+6*ye-12*Ce+6*Pe)-3*ye+3*Ce}function yt(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){Ae==null&&(Ae=1);for(var Ue=(Ae=Ae>1?1:Ae<0?0:Ae)/2,ht=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],_t=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],Ct=0,At=0;At<12;At++){var Qt=Ue*ht[At]+Ue,ir=Rt(Qt,ae,Ce,ze,ge),tr=Rt(Qt,ye,Pe,Je,we),Zt=ir*ir+tr*tr;Ct+=_t[At]*u.sqrt(Zt)}return Ue*Ct}function le(ae,ye,Ce,Pe,ze,Je,ge,we){if(!(p(ae,Ce)<b(ze,ge)||b(ae,Ce)>p(ze,ge)||p(ye,Pe)<b(Je,we)||b(ye,Pe)>p(Je,we))){var Ae=(ae-Ce)*(Je-we)-(ye-Pe)*(ze-ge);if(Ae){var Ue=((ae*Pe-ye*Ce)*(ze-ge)-(ae-Ce)*(ze*we-Je*ge))/Ae,ht=((ae*Pe-ye*Ce)*(Je-we)-(ye-Pe)*(ze*we-Je*ge))/Ae,_t=+Ue.toFixed(2),Ct=+ht.toFixed(2);if(!(_t<+b(ae,Ce).toFixed(2)||_t>+p(ae,Ce).toFixed(2)||_t<+b(ze,ge).toFixed(2)||_t>+p(ze,ge).toFixed(2)||Ct<+b(ye,Pe).toFixed(2)||Ct>+p(ye,Pe).toFixed(2)||Ct<+b(Je,we).toFixed(2)||Ct>+p(Je,we).toFixed(2)))return{x:Ue,y:ht}}}}function wt(ae,ye,Ce){var Pe=A.bezierBBox(ae),ze=A.bezierBBox(ye);if(!A.isBBoxIntersect(Pe,ze))return Ce?0:[];for(var Je=yt.apply(0,ae),ge=yt.apply(0,ye),we=p(~~(Je/5),1),Ae=p(~~(ge/5),1),Ue=[],ht=[],_t={},Ct=Ce?0:[],At=0;At<we+1;At++){var Qt=A.findDotsAtSegment.apply(A,ae.concat(At/we));Ue.push({x:Qt.x,y:Qt.y,t:At/we})}for(At=0;At<Ae+1;At++)Qt=A.findDotsAtSegment.apply(A,ye.concat(At/Ae)),ht.push({x:Qt.x,y:Qt.y,t:At/Ae});for(At=0;At<we;At++)for(var ir=0;ir<Ae;ir++){var tr=Ue[At],Zt=Ue[At+1],Br=ht[ir],pr=ht[ir+1],_r=e(Zt.x-tr.x)<.001?"y":"x",fr=e(pr.x-Br.x)<.001?"y":"x",Gr=le(tr.x,tr.y,Zt.x,Zt.y,Br.x,Br.y,pr.x,pr.y);if(Gr){if(_t[Gr.x.toFixed(4)]==Gr.y.toFixed(4))continue;_t[Gr.x.toFixed(4)]=Gr.y.toFixed(4);var Nr=tr.t+e((Gr[_r]-tr[_r])/(Zt[_r]-tr[_r]))*(Zt.t-tr.t),Zr=Br.t+e((Gr[fr]-Br[fr])/(pr[fr]-Br[fr]))*(pr.t-Br.t);Nr>=0&&Nr<=1.001&&Zr>=0&&Zr<=1.001&&(Ce?Ct++:Ct.push({x:Gr.x,y:Gr.y,t1:b(Nr,1),t2:b(Zr,1)}))}}return Ct}function at(ae,ye,Ce){ae=A._path2curve(ae),ye=A._path2curve(ye);for(var Pe,ze,Je,ge,we,Ae,Ue,ht,_t,Ct,At=Ce?0:[],Qt=0,ir=ae.length;Qt<ir;Qt++){var tr=ae[Qt];if(tr[0]=="M")Pe=we=tr[1],ze=Ae=tr[2];else{tr[0]=="C"?(_t=[Pe,ze].concat(tr.slice(1)),Pe=_t[6],ze=_t[7]):(_t=[Pe,ze,Pe,ze,we,Ae,we,Ae],Pe=we,ze=Ae);for(var Zt=0,Br=ye.length;Zt<Br;Zt++){var pr=ye[Zt];if(pr[0]=="M")Je=Ue=pr[1],ge=ht=pr[2];else{pr[0]=="C"?(Ct=[Je,ge].concat(pr.slice(1)),Je=Ct[6],ge=Ct[7]):(Ct=[Je,ge,Je,ge,Ue,ht,Ue,ht],Je=Ue,ge=ht);var _r=wt(_t,Ct,Ce);if(Ce)At+=_r;else{for(var fr=0,Gr=_r.length;fr<Gr;fr++)_r[fr].segment1=Qt,_r[fr].segment2=Zt,_r[fr].bez1=_t,_r[fr].bez2=Ct;At=At.concat(_r)}}}}}return At}A.findDotsAtSegment=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){var Ue=1-Ae,ht=c(Ue,3),_t=c(Ue,2),Ct=Ae*Ae,At=Ct*Ae,Qt=ht*ae+3*_t*Ae*Ce+3*Ue*Ae*Ae*ze+At*ge,ir=ht*ye+3*_t*Ae*Pe+3*Ue*Ae*Ae*Je+At*we,tr=ae+2*Ae*(Ce-ae)+Ct*(ze-2*Ce+ae),Zt=ye+2*Ae*(Pe-ye)+Ct*(Je-2*Pe+ye),Br=Ce+2*Ae*(ze-Ce)+Ct*(ge-2*ze+Ce),pr=Pe+2*Ae*(Je-Pe)+Ct*(we-2*Je+Pe),_r=Ue*ae+Ae*Ce,fr=Ue*ye+Ae*Pe,Gr=Ue*ze+Ae*ge,Nr=Ue*Je+Ae*we,Zr=90-180*u.atan2(tr-Br,Zt-pr)/y;return(tr>Br||Zt<pr)&&(Zr+=180),{x:Qt,y:ir,m:{x:tr,y:Zt},n:{x:Br,y:pr},start:{x:_r,y:fr},end:{x:Gr,y:Nr},alpha:Zr}},A.bezierBBox=function(ae,ye,Ce,Pe,ze,Je,ge,we){A.is(ae,"array")||(ae=[ae,ye,Ce,Pe,ze,Je,ge,we]);var Ae=Pt.apply(null,ae);return{x:Ae.min.x,y:Ae.min.y,x2:Ae.max.x,y2:Ae.max.y,width:Ae.max.x-Ae.min.x,height:Ae.max.y-Ae.min.y}},A.isPointInsideBBox=function(ae,ye,Ce){return ye>=ae.x&&ye<=ae.x2&&Ce>=ae.y&&Ce<=ae.y2},A.isBBoxIntersect=function(ae,ye){var Ce=A.isPointInsideBBox;return Ce(ye,ae.x,ae.y)||Ce(ye,ae.x2,ae.y)||Ce(ye,ae.x,ae.y2)||Ce(ye,ae.x2,ae.y2)||Ce(ae,ye.x,ye.y)||Ce(ae,ye.x2,ye.y)||Ce(ae,ye.x,ye.y2)||Ce(ae,ye.x2,ye.y2)||(ae.x<ye.x2&&ae.x>ye.x||ye.x<ae.x2&&ye.x>ae.x)&&(ae.y<ye.y2&&ae.y>ye.y||ye.y<ae.y2&&ye.y>ae.y)},A.pathIntersection=function(ae,ye){return at(ae,ye)},A.pathIntersectionNumber=function(ae,ye){return at(ae,ye,1)},A.isPointInsidePath=function(ae,ye,Ce){var Pe=A.pathBBox(ae);return A.isPointInsideBBox(Pe,ye,Ce)&&at(ae,[["M",ye,Ce],["H",Pe.x2+10]],1)%2==1},A._removedFactory=function(ae){return function(){k("raphael.log",null,"Raphaël: you are calling to method “"+ae+"” of removed object",ae)}};var Be=A.pathBBox=function(ae){var ye=Me(ae);if(ye.bbox)return Oe(ye.bbox);if(!ae)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var Ce,Pe=0,ze=0,Je=[],ge=[],we=0,Ae=(ae=Ot(ae)).length;we<Ae;we++)if((Ce=ae[we])[0]=="M")Pe=Ce[1],ze=Ce[2],Je.push(Pe),ge.push(ze);else{var Ue=Pt(Pe,ze,Ce[1],Ce[2],Ce[3],Ce[4],Ce[5],Ce[6]);Je=Je[J](Ue.min.x,Ue.max.x),ge=ge[J](Ue.min.y,Ue.max.y),Pe=Ce[5],ze=Ce[6]}var ht=b[U](0,Je),_t=b[U](0,ge),Ct=p[U](0,Je),At=p[U](0,ge),Qt=Ct-ht,ir=At-_t,tr={x:ht,y:_t,x2:Ct,y2:At,width:Qt,height:ir,cx:ht+Qt/2,cy:_t+ir/2};return ye.bbox=Oe(tr),tr},ot=function(ae){var ye=Oe(ae);return ye.toString=A._path2string,ye},tt=A._pathToRelative=function(ae){var ye=Me(ae);if(ye.rel)return ot(ye.rel);A.is(ae,v)&&A.is(ae&&ae[0],v)||(ae=A.parsePathString(ae));var Ce=[],Pe=0,ze=0,Je=0,ge=0,we=0;ae[0][0]=="M"&&(Je=Pe=ae[0][1],ge=ze=ae[0][2],we++,Ce.push(["M",Pe,ze]));for(var Ae=we,Ue=ae.length;Ae<Ue;Ae++){var ht=Ce[Ae]=[],_t=ae[Ae];if(_t[0]!=T.call(_t[0]))switch(ht[0]=T.call(_t[0]),ht[0]){case"a":ht[1]=_t[1],ht[2]=_t[2],ht[3]=_t[3],ht[4]=_t[4],ht[5]=_t[5],ht[6]=+(_t[6]-Pe).toFixed(3),ht[7]=+(_t[7]-ze).toFixed(3);break;case"v":ht[1]=+(_t[1]-ze).toFixed(3);break;case"m":Je=_t[1],ge=_t[2];default:for(var Ct=1,At=_t.length;Ct<At;Ct++)ht[Ct]=+(_t[Ct]-(Ct%2?Pe:ze)).toFixed(3)}else{ht=Ce[Ae]=[],_t[0]=="m"&&(Je=_t[1]+Pe,ge=_t[2]+ze);for(var Qt=0,ir=_t.length;Qt<ir;Qt++)Ce[Ae][Qt]=_t[Qt]}var tr=Ce[Ae].length;switch(Ce[Ae][0]){case"z":Pe=Je,ze=ge;break;case"h":Pe+=+Ce[Ae][tr-1];break;case"v":ze+=+Ce[Ae][tr-1];break;default:Pe+=+Ce[Ae][tr-2],ze+=+Ce[Ae][tr-1]}}return Ce.toString=A._path2string,ye.rel=ot(Ce),Ce},kt=A._pathToAbsolute=function(ae){var ye=Me(ae);if(ye.abs)return ot(ye.abs);if(A.is(ae,v)&&A.is(ae&&ae[0],v)||(ae=A.parsePathString(ae)),!ae||!ae.length)return[["M",0,0]];var Ce=[],Pe=0,ze=0,Je=0,ge=0,we=0;ae[0][0]=="M"&&(Je=Pe=+ae[0][1],ge=ze=+ae[0][2],we++,Ce[0]=["M",Pe,ze]);for(var Ae,Ue,ht=ae.length==3&&ae[0][0]=="M"&&ae[1][0].toUpperCase()=="R"&&ae[2][0].toUpperCase()=="Z",_t=we,Ct=ae.length;_t<Ct;_t++){if(Ce.push(Ae=[]),(Ue=ae[_t])[0]!=L.call(Ue[0]))switch(Ae[0]=L.call(Ue[0]),Ae[0]){case"A":Ae[1]=Ue[1],Ae[2]=Ue[2],Ae[3]=Ue[3],Ae[4]=Ue[4],Ae[5]=Ue[5],Ae[6]=+(Ue[6]+Pe),Ae[7]=+(Ue[7]+ze);break;case"V":Ae[1]=+Ue[1]+ze;break;case"H":Ae[1]=+Ue[1]+Pe;break;case"R":for(var At=[Pe,ze][J](Ue.slice(1)),Qt=2,ir=At.length;Qt<ir;Qt++)At[Qt]=+At[Qt]+Pe,At[++Qt]=+At[Qt]+ze;Ce.pop(),Ce=Ce[J](Fe(At,ht));break;case"M":Je=+Ue[1]+Pe,ge=+Ue[2]+ze;default:for(Qt=1,ir=Ue.length;Qt<ir;Qt++)Ae[Qt]=+Ue[Qt]+(Qt%2?Pe:ze)}else if(Ue[0]=="R")At=[Pe,ze][J](Ue.slice(1)),Ce.pop(),Ce=Ce[J](Fe(At,ht)),Ae=["R"][J](Ue.slice(-2));else for(var tr=0,Zt=Ue.length;tr<Zt;tr++)Ae[tr]=Ue[tr];switch(Ae[0]){case"Z":Pe=Je,ze=ge;break;case"H":Pe=Ae[1];break;case"V":ze=Ae[1];break;case"M":Je=Ae[Ae.length-2],ge=Ae[Ae.length-1];default:Pe=Ae[Ae.length-2],ze=Ae[Ae.length-1]}}return Ce.toString=A._path2string,ye.abs=ot(Ce),Ce},Yt=function(ae,ye,Ce,Pe){return[ae,ye,Ce,Pe,Ce,Pe]},pt=function(ae,ye,Ce,Pe,ze,Je){return[1/3*ae+2/3*Ce,1/3*ye+2/3*Pe,1/3*ze+2/3*Ce,1/3*Je+2/3*Pe,ze,Je]},It=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae,Ue){var ht,_t=120*y/180,Ct=y/180*(+ze||0),At=[],Qt=$e(function(V,ie,be){return{x:V*u.cos(be)-ie*u.sin(be),y:V*u.sin(be)+ie*u.cos(be)}});if(Ue)Nr=Ue[0],Zr=Ue[1],fr=Ue[2],Gr=Ue[3];else{ae=(ht=Qt(ae,ye,-Ct)).x,ye=ht.y,we=(ht=Qt(we,Ae,-Ct)).x,Ae=ht.y;var ir=(ae-we)/2,tr=(ye-Ae)/2,Zt=ir*ir/(Ce*Ce)+tr*tr/(Pe*Pe);Zt>1&&(Ce*=Zt=u.sqrt(Zt),Pe*=Zt);var Br=Ce*Ce,pr=Pe*Pe,_r=(Je==ge?-1:1)*u.sqrt(e((Br*pr-Br*tr*tr-pr*ir*ir)/(Br*tr*tr+pr*ir*ir))),fr=_r*Ce*tr/Pe+(ae+we)/2,Gr=_r*-Pe*ir/Ce+(ye+Ae)/2,Nr=u.asin(((ye-Gr)/Pe).toFixed(9)),Zr=u.asin(((Ae-Gr)/Pe).toFixed(9));(Nr=ae<fr?y-Nr:Nr)<0&&(Nr=2*y+Nr),(Zr=we<fr?y-Zr:Zr)<0&&(Zr=2*y+Zr),ge&&Nr>Zr&&(Nr-=2*y),!ge&&Zr>Nr&&(Zr-=2*y)}var Sn=Zr-Nr;if(e(Sn)>_t){var qn=Zr,ii=we,si=Ae;Zr=Nr+_t*(ge&&Zr>Nr?1:-1),we=fr+Ce*u.cos(Zr),Ae=Gr+Pe*u.sin(Zr),At=It(we,Ae,Ce,Pe,ze,0,ge,ii,si,[Zr,qn,fr,Gr])}Sn=Zr-Nr;var vn=u.cos(Nr),on=u.sin(Nr),Bn=u.cos(Zr),Hi=u.sin(Zr),Xi=u.tan(Sn/4),Kn=4/3*Ce*Xi,ta=4/3*Pe*Xi,ma=[ae,ye],yi=[ae+Kn*on,ye-ta*vn],Rn=[we+Kn*Hi,Ae-ta*Bn],Ui=[we,Ae];if(yi[0]=2*ma[0]-yi[0],yi[1]=2*ma[1]-yi[1],Ue)return[yi,Rn,Ui][J](At);for(var ra=[],Wi=0,Bi=(At=[yi,Rn,Ui][J](At).join()[ve](",")).length;Wi<Bi;Wi++)ra[Wi]=Wi%2?Qt(At[Wi-1],At[Wi],Ct).y:Qt(At[Wi],At[Wi+1],Ct).x;return ra},Fr=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){var Ue=1-Ae;return{x:c(Ue,3)*ae+3*c(Ue,2)*Ae*Ce+3*Ue*Ae*Ae*ze+c(Ae,3)*ge,y:c(Ue,3)*ye+3*c(Ue,2)*Ae*Pe+3*Ue*Ae*Ae*Je+c(Ae,3)*we}},Pt=$e(function(ae,ye,Ce,Pe,ze,Je,ge,we){var Ae,Ue=ze-2*Ce+ae-(ge-2*ze+Ce),ht=2*(Ce-ae)-2*(ze-Ce),_t=ae-Ce,Ct=(-ht+u.sqrt(ht*ht-4*Ue*_t))/2/Ue,At=(-ht-u.sqrt(ht*ht-4*Ue*_t))/2/Ue,Qt=[ye,we],ir=[ae,ge];return e(Ct)>"1e12"&&(Ct=.5),e(At)>"1e12"&&(At=.5),Ct>0&&Ct<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,Ct),ir.push(Ae.x),Qt.push(Ae.y)),At>0&&At<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,At),ir.push(Ae.x),Qt.push(Ae.y)),Ue=Je-2*Pe+ye-(we-2*Je+Pe),_t=ye-Pe,Ct=(-(ht=2*(Pe-ye)-2*(Je-Pe))+u.sqrt(ht*ht-4*Ue*_t))/2/Ue,At=(-ht-u.sqrt(ht*ht-4*Ue*_t))/2/Ue,e(Ct)>"1e12"&&(Ct=.5),e(At)>"1e12"&&(At=.5),Ct>0&&Ct<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,Ct),ir.push(Ae.x),Qt.push(Ae.y)),At>0&&At<1&&(Ae=Fr(ae,ye,Ce,Pe,ze,Je,ge,we,At),ir.push(Ae.x),Qt.push(Ae.y)),{min:{x:b[U](0,ir),y:b[U](0,Qt)},max:{x:p[U](0,ir),y:p[U](0,Qt)}}}),Ot=A._path2curve=$e(function(ae,ye){var Ce=!ye&&Me(ae);if(!ye&&Ce.curve)return ot(Ce.curve);for(var Pe=kt(ae),ze=ye&&kt(ye),Je={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},ge={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},we=function(_r,fr,Gr){var Nr,Zr;if(!_r)return["C",fr.x,fr.y,fr.x,fr.y,fr.x,fr.y];switch(!(_r[0]in{T:1,Q:1})&&(fr.qx=fr.qy=null),_r[0]){case"M":fr.X=_r[1],fr.Y=_r[2];break;case"A":_r=["C"][J](It[U](0,[fr.x,fr.y][J](_r.slice(1))));break;case"S":Gr=="C"||Gr=="S"?(Nr=2*fr.x-fr.bx,Zr=2*fr.y-fr.by):(Nr=fr.x,Zr=fr.y),_r=["C",Nr,Zr][J](_r.slice(1));break;case"T":Gr=="Q"||Gr=="T"?(fr.qx=2*fr.x-fr.qx,fr.qy=2*fr.y-fr.qy):(fr.qx=fr.x,fr.qy=fr.y),_r=["C"][J](pt(fr.x,fr.y,fr.qx,fr.qy,_r[1],_r[2]));break;case"Q":fr.qx=_r[1],fr.qy=_r[2],_r=["C"][J](pt(fr.x,fr.y,_r[1],_r[2],_r[3],_r[4]));break;case"L":_r=["C"][J](Yt(fr.x,fr.y,_r[1],_r[2]));break;case"H":_r=["C"][J](Yt(fr.x,fr.y,_r[1],fr.y));break;case"V":_r=["C"][J](Yt(fr.x,fr.y,fr.x,_r[1]));break;case"Z":_r=["C"][J](Yt(fr.x,fr.y,fr.X,fr.Y))}return _r},Ae=function(_r,fr){if(_r[fr].length>7){_r[fr].shift();for(var Gr=_r[fr];Gr.length;)ht[fr]="A",ze&&(_t[fr]="A"),_r.splice(fr++,0,["C"][J](Gr.splice(0,6)));_r.splice(fr,1),ir=p(Pe.length,ze&&ze.length||0)}},Ue=function(_r,fr,Gr,Nr,Zr){_r&&fr&&_r[Zr][0]=="M"&&fr[Zr][0]!="M"&&(fr.splice(Zr,0,["M",Nr.x,Nr.y]),Gr.bx=0,Gr.by=0,Gr.x=_r[Zr][1],Gr.y=_r[Zr][2],ir=p(Pe.length,ze&&ze.length||0))},ht=[],_t=[],Ct="",At="",Qt=0,ir=p(Pe.length,ze&&ze.length||0);Qt<ir;Qt++){Pe[Qt]&&(Ct=Pe[Qt][0]),Ct!="C"&&(ht[Qt]=Ct,Qt&&(At=ht[Qt-1])),Pe[Qt]=we(Pe[Qt],Je,At),ht[Qt]!="A"&&Ct=="C"&&(ht[Qt]="C"),Ae(Pe,Qt),ze&&(ze[Qt]&&(Ct=ze[Qt][0]),Ct!="C"&&(_t[Qt]=Ct,Qt&&(At=_t[Qt-1])),ze[Qt]=we(ze[Qt],ge,At),_t[Qt]!="A"&&Ct=="C"&&(_t[Qt]="C"),Ae(ze,Qt)),Ue(Pe,ze,Je,ge,Qt),Ue(ze,Pe,ge,Je,Qt);var tr=Pe[Qt],Zt=ze&&ze[Qt],Br=tr.length,pr=ze&&Zt.length;Je.x=tr[Br-2],Je.y=tr[Br-1],Je.bx=Y(tr[Br-4])||Je.x,Je.by=Y(tr[Br-3])||Je.y,ge.bx=ze&&(Y(Zt[pr-4])||ge.x),ge.by=ze&&(Y(Zt[pr-3])||ge.y),ge.x=ze&&Zt[pr-2],ge.y=ze&&Zt[pr-1]}return ze||(Ce.curve=ot(Pe)),ze?[Pe,ze]:Pe},null,ot),Te=(A._parseDots=$e(function(ae){for(var ye=[],Ce=0,Pe=ae.length;Ce<Pe;Ce++){var ze={},Je=ae[Ce].match(/^([^:]*):?([\d\.]*)/);if(ze.color=A.getRGB(Je[1]),ze.color.error)return null;ze.opacity=ze.color.opacity,ze.color=ze.color.hex,Je[2]&&(ze.offset=Je[2]+"%"),ye.push(ze)}for(Ce=1,Pe=ye.length-1;Ce<Pe;Ce++)if(!ye[Ce].offset){for(var ge=Y(ye[Ce-1].offset||0),we=0,Ae=Ce+1;Ae<Pe;Ae++)if(ye[Ae].offset){we=ye[Ae].offset;break}we||(we=100,Ae=Pe);for(var Ue=((we=Y(we))-ge)/(Ae-Ce+1);Ce<Ae;Ce++)ge+=Ue,ye[Ce].offset=ge+"%"}return ye}),A._tear=function(ae,ye){ae==ye.top&&(ye.top=ae.prev),ae==ye.bottom&&(ye.bottom=ae.next),ae.next&&(ae.next.prev=ae.prev),ae.prev&&(ae.prev.next=ae.next)}),me=(A._tofront=function(ae,ye){ye.top!==ae&&(Te(ae,ye),ae.next=null,ae.prev=ye.top,ye.top.next=ae,ye.top=ae)},A._toback=function(ae,ye){ye.bottom!==ae&&(Te(ae,ye),ae.next=ye.bottom,ae.prev=null,ye.bottom.prev=ae,ye.bottom=ae)},A._insertafter=function(ae,ye,Ce){Te(ae,Ce),ye==Ce.top&&(Ce.top=ae),ye.next&&(ye.next.prev=ae),ae.next=ye.next,ae.prev=ye,ye.next=ae},A._insertbefore=function(ae,ye,Ce){Te(ae,Ce),ye==Ce.bottom&&(Ce.bottom=ae),ye.prev&&(ye.prev.next=ae),ae.prev=ye.prev,ye.prev=ae,ae.next=ye},A.toMatrix=function(ae,ye){var Ce=Be(ae),Pe={_:{transform:se},getBBox:function(){return Ce}};return ce(Pe,ye),Pe.matrix}),ce=(A.transformPath=function(ae,ye){return nt(ae,me(ae,ye))},A._extractTransform=function(ae,ye){if(ye==null)return ae._.transform;ye=Q(ye).replace(/\.{3}|\u2026/g,ae._.transform||se);var Ce,Pe,ze=A.parseTransformString(ye),Je=0,ge=1,we=1,Ae=ae._,Ue=new Re;if(Ae.transform=ze||[],ze)for(var ht=0,_t=ze.length;ht<_t;ht++){var Ct,At,Qt,ir,tr,Zt=ze[ht],Br=Zt.length,pr=Q(Zt[0]).toLowerCase(),_r=Zt[0]!=pr,fr=_r?Ue.invert():0;pr=="t"&&Br==3?_r?(Ct=fr.x(0,0),At=fr.y(0,0),Qt=fr.x(Zt[1],Zt[2]),ir=fr.y(Zt[1],Zt[2]),Ue.translate(Qt-Ct,ir-At)):Ue.translate(Zt[1],Zt[2]):pr=="r"?Br==2?(tr=tr||ae.getBBox(1),Ue.rotate(Zt[1],tr.x+tr.width/2,tr.y+tr.height/2),Je+=Zt[1]):Br==4&&(_r?(Qt=fr.x(Zt[2],Zt[3]),ir=fr.y(Zt[2],Zt[3]),Ue.rotate(Zt[1],Qt,ir)):Ue.rotate(Zt[1],Zt[2],Zt[3]),Je+=Zt[1]):pr=="s"?Br==2||Br==3?(tr=tr||ae.getBBox(1),Ue.scale(Zt[1],Zt[Br-1],tr.x+tr.width/2,tr.y+tr.height/2),ge*=Zt[1],we*=Zt[Br-1]):Br==5&&(_r?(Qt=fr.x(Zt[3],Zt[4]),ir=fr.y(Zt[3],Zt[4]),Ue.scale(Zt[1],Zt[2],Qt,ir)):Ue.scale(Zt[1],Zt[2],Zt[3],Zt[4]),ge*=Zt[1],we*=Zt[2]):pr=="m"&&Br==7&&Ue.add(Zt[1],Zt[2],Zt[3],Zt[4],Zt[5],Zt[6]),Ae.dirtyT=1,ae.matrix=Ue}ae.matrix=Ue,Ae.sx=ge,Ae.sy=we,Ae.deg=Je,Ae.dx=Ce=Ue.e,Ae.dy=Pe=Ue.f,ge==1&&we==1&&!Je&&Ae.bbox?(Ae.bbox.x+=+Ce,Ae.bbox.y+=+Pe):Ae.dirtyT=1}),ne=function(ae){var ye=ae[0];switch(ye.toLowerCase()){case"t":return[ye,0,0];case"m":return[ye,1,0,0,1,0,0];case"r":return ae.length==4?[ye,0,ae[2],ae[3]]:[ye,0];case"s":return ae.length==5?[ye,1,1,ae[3],ae[4]]:ae.length==3?[ye,1,1]:[ye,1]}},_e=A._equaliseTransform=function(ae,ye){ye=Q(ye).replace(/\.{3}|\u2026/g,ae),ae=A.parseTransformString(ae)||[],ye=A.parseTransformString(ye)||[];for(var Ce,Pe,ze,Je,ge=p(ae.length,ye.length),we=[],Ae=[],Ue=0;Ue<ge;Ue++){if(ze=ae[Ue]||ne(ye[Ue]),Je=ye[Ue]||ne(ze),ze[0]!=Je[0]||ze[0].toLowerCase()=="r"&&(ze[2]!=Je[2]||ze[3]!=Je[3])||ze[0].toLowerCase()=="s"&&(ze[3]!=Je[3]||ze[4]!=Je[4]))return;for(we[Ue]=[],Ae[Ue]=[],Ce=0,Pe=p(ze.length,Je.length);Ce<Pe;Ce++)Ce in ze&&(we[Ue][Ce]=ze[Ce]),Ce in Je&&(Ae[Ue][Ce]=Je[Ce])}return{from:we,to:Ae}};function Re(ae,ye,Ce,Pe,ze,Je){ae!=null?(this.a=+ae,this.b=+ye,this.c=+Ce,this.d=+Pe,this.e=+ze,this.f=+Je):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}A._getContainer=function(ae,ye,Ce,Pe){var ze;if((ze=Pe!=null||A.is(ae,"object")?ae:z.doc.getElementById(ae))!=null)return ze.tagName?ye==null?{container:ze,width:ze.style.pixelWidth||ze.offsetWidth,height:ze.style.pixelHeight||ze.offsetHeight}:{container:ze,width:ye,height:Ce}:{container:1,x:ae,y:ye,width:Ce,height:Pe}},A.pathToRelative=tt,A._engine={},A.path2curve=Ot,A.matrix=function(ae,ye,Ce,Pe,ze,Je){return new Re(ae,ye,Ce,Pe,ze,Je)},function(ae){function ye(Pe){return Pe[0]*Pe[0]+Pe[1]*Pe[1]}function Ce(Pe){var ze=u.sqrt(ye(Pe));Pe[0]&&(Pe[0]/=ze),Pe[1]&&(Pe[1]/=ze)}ae.add=function(Pe,ze,Je,ge,we,Ae){var Ue,ht,_t,Ct,At=[[],[],[]],Qt=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],ir=[[Pe,Je,we],[ze,ge,Ae],[0,0,1]];for(Pe&&Pe instanceof Re&&(ir=[[Pe.a,Pe.c,Pe.e],[Pe.b,Pe.d,Pe.f],[0,0,1]]),Ue=0;Ue<3;Ue++)for(ht=0;ht<3;ht++){for(Ct=0,_t=0;_t<3;_t++)Ct+=Qt[Ue][_t]*ir[_t][ht];At[Ue][ht]=Ct}this.a=At[0][0],this.b=At[1][0],this.c=At[0][1],this.d=At[1][1],this.e=At[0][2],this.f=At[1][2]},ae.invert=function(){var Pe=this,ze=Pe.a*Pe.d-Pe.b*Pe.c;return new Re(Pe.d/ze,-Pe.b/ze,-Pe.c/ze,Pe.a/ze,(Pe.c*Pe.f-Pe.d*Pe.e)/ze,(Pe.b*Pe.e-Pe.a*Pe.f)/ze)},ae.clone=function(){return new Re(this.a,this.b,this.c,this.d,this.e,this.f)},ae.translate=function(Pe,ze){this.add(1,0,0,1,Pe,ze)},ae.scale=function(Pe,ze,Je,ge){ze==null&&(ze=Pe),(Je||ge)&&this.add(1,0,0,1,Je,ge),this.add(Pe,0,0,ze,0,0),(Je||ge)&&this.add(1,0,0,1,-Je,-ge)},ae.rotate=function(Pe,ze,Je){Pe=A.rad(Pe),ze=ze||0,Je=Je||0;var ge=+u.cos(Pe).toFixed(9),we=+u.sin(Pe).toFixed(9);this.add(ge,we,-we,ge,ze,Je),this.add(1,0,0,1,-ze,-Je)},ae.x=function(Pe,ze){return Pe*this.a+ze*this.c+this.e},ae.y=function(Pe,ze){return Pe*this.b+ze*this.d+this.f},ae.get=function(Pe){return+this[Q.fromCharCode(97+Pe)].toFixed(4)},ae.toString=function(){return A.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},ae.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},ae.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},ae.split=function(){var Pe={};Pe.dx=this.e,Pe.dy=this.f;var ze=[[this.a,this.c],[this.b,this.d]];Pe.scalex=u.sqrt(ye(ze[0])),Ce(ze[0]),Pe.shear=ze[0][0]*ze[1][0]+ze[0][1]*ze[1][1],ze[1]=[ze[1][0]-ze[0][0]*Pe.shear,ze[1][1]-ze[0][1]*Pe.shear],Pe.scaley=u.sqrt(ye(ze[1])),Ce(ze[1]),Pe.shear/=Pe.scaley;var Je=-ze[0][1],ge=ze[1][1];return ge<0?(Pe.rotate=A.deg(u.acos(ge)),Je<0&&(Pe.rotate=360-Pe.rotate)):Pe.rotate=A.deg(u.asin(Je)),Pe.isSimple=!(+Pe.shear.toFixed(9)||Pe.scalex.toFixed(9)!=Pe.scaley.toFixed(9)&&Pe.rotate),Pe.isSuperSimple=!+Pe.shear.toFixed(9)&&Pe.scalex.toFixed(9)==Pe.scaley.toFixed(9)&&!Pe.rotate,Pe.noRotation=!+Pe.shear.toFixed(9)&&!Pe.rotate,Pe},ae.toTransformString=function(Pe){var ze=Pe||this[ve]();return ze.isSimple?(ze.scalex=+ze.scalex.toFixed(4),ze.scaley=+ze.scaley.toFixed(4),ze.rotate=+ze.rotate.toFixed(4),(ze.dx||ze.dy?"t"+[ze.dx,ze.dy]:se)+(ze.scalex!=1||ze.scaley!=1?"s"+[ze.scalex,ze.scaley,0,0]:se)+(ze.rotate?"r"+[ze.rotate,0,0]:se)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(Re.prototype);for(var lt=function(){this.returnValue=!1},Ze=function(){return this.originalEvent.preventDefault()},ct=function(){this.cancelBubble=!0},Nt=function(){return this.originalEvent.stopPropagation()},Ut=function(ae){var ye=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,Ce=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft;return{x:ae.clientX+Ce,y:ae.clientY+ye}},Mr=z.doc.addEventListener?function(ae,ye,Ce,Pe){var ze=function(ge){var we=Ut(ge);return Ce.call(Pe,ge,we.x,we.y)};if(ae.addEventListener(ye,ze,!1),te&&ke[ye]){var Je=function(ge){for(var we=Ut(ge),Ae=ge,Ue=0,ht=ge.targetTouches&&ge.targetTouches.length;Ue<ht;Ue++)if(ge.targetTouches[Ue].target==ae){(ge=ge.targetTouches[Ue]).originalEvent=Ae,ge.preventDefault=Ze,ge.stopPropagation=Nt;break}return Ce.call(Pe,ge,we.x,we.y)};ae.addEventListener(ke[ye],Je,!1)}return function(){return ae.removeEventListener(ye,ze,!1),te&&ke[ye]&&ae.removeEventListener(ke[ye],Je,!1),!0}}:z.doc.attachEvent?function(ae,ye,Ce,Pe){var ze=function(Je){Je=Je||z.win.event;var ge=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,we=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft,Ae=Je.clientX+we,Ue=Je.clientY+ge;return Je.preventDefault=Je.preventDefault||lt,Je.stopPropagation=Je.stopPropagation||ct,Ce.call(Pe,Je,Ae,Ue)};return ae.attachEvent("on"+ye,ze),function(){return ae.detachEvent("on"+ye,ze),!0}}:void 0,Xt=[],Sr=function(ae){for(var ye,Ce=ae.clientX,Pe=ae.clientY,ze=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,Je=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft,ge=Xt.length;ge--;){if(ye=Xt[ge],te&&ae.touches){for(var we,Ae=ae.touches.length;Ae--;)if((we=ae.touches[Ae]).identifier==ye.el._drag.id){Ce=we.clientX,Pe=we.clientY,(ae.originalEvent?ae.originalEvent:ae).preventDefault();break}}else ae.preventDefault();var Ue,ht=ye.el.node,_t=ht.nextSibling,Ct=ht.parentNode,At=ht.style.display;z.win.opera&&Ct.removeChild(ht),ht.style.display="none",Ue=ye.el.paper.getElementByPoint(Ce,Pe),ht.style.display=At,z.win.opera&&(_t?Ct.insertBefore(ht,_t):Ct.appendChild(ht)),Ue&&k("raphael.drag.over."+ye.el.id,ye.el,Ue),Ce+=Je,Pe+=ze,k("raphael.drag.move."+ye.el.id,ye.move_scope||ye.el,Ce-ye.el._drag.x,Pe-ye.el._drag.y,Ce,Pe,ae)}},rr=function(ae){A.unmousemove(Sr).unmouseup(rr);for(var ye,Ce=Xt.length;Ce--;)(ye=Xt[Ce]).el._drag={},k("raphael.drag.end."+ye.el.id,ye.end_scope||ye.start_scope||ye.move_scope||ye.el,ae);Xt=[]},er=A.el={},kr=he.length;kr--;)(function(ae){A[ae]=er[ae]=function(ye,Ce){return A.is(ye,"function")&&(this.events=this.events||[],this.events.push({name:ae,f:ye,unbind:Mr(this.shape||this.node||z.doc,ae,ye,Ce||this)})),this},A["un"+ae]=er["un"+ae]=function(ye){for(var Ce=this.events||[],Pe=Ce.length;Pe--;)Ce[Pe].name!=ae||!A.is(ye,"undefined")&&Ce[Pe].f!=ye||(Ce[Pe].unbind(),Ce.splice(Pe,1),!Ce.length&&delete this.events);return this}})(he[kr]);er.data=function(ae,ye){var Ce=et[this.id]=et[this.id]||{};if(arguments.length==0)return Ce;if(arguments.length==1){if(A.is(ae,"object")){for(var Pe in ae)ae[$](Pe)&&this.data(Pe,ae[Pe]);return this}return k("raphael.data.get."+this.id,this,Ce[ae],ae),Ce[ae]}return Ce[ae]=ye,k("raphael.data.set."+this.id,this,ye,ae),this},er.removeData=function(ae){return ae==null?delete et[this.id]:et[this.id]&&delete et[this.id][ae],this},er.getData=function(){return Oe(et[this.id]||{})},er.hover=function(ae,ye,Ce,Pe){return this.mouseover(ae,Ce).mouseout(ye,Pe||Ce)},er.unhover=function(ae,ye){return this.unmouseover(ae).unmouseout(ye)};var vr=[];er.drag=function(ae,ye,Ce,Pe,ze,Je){function ge(we){(we.originalEvent||we).preventDefault();var Ae=we.clientX,Ue=we.clientY,ht=z.doc.documentElement.scrollTop||z.doc.body.scrollTop,_t=z.doc.documentElement.scrollLeft||z.doc.body.scrollLeft;if(this._drag.id=we.identifier,te&&we.touches){for(var Ct,At=we.touches.length;At--;)if(Ct=we.touches[At],this._drag.id=Ct.identifier,Ct.identifier==this._drag.id){Ae=Ct.clientX,Ue=Ct.clientY;break}}this._drag.x=Ae+_t,this._drag.y=Ue+ht,!Xt.length&&A.mousemove(Sr).mouseup(rr),Xt.push({el:this,move_scope:Pe,start_scope:ze,end_scope:Je}),ye&&k.on("raphael.drag.start."+this.id,ye),ae&&k.on("raphael.drag.move."+this.id,ae),Ce&&k.on("raphael.drag.end."+this.id,Ce),k("raphael.drag.start."+this.id,ze||Pe||this,this._drag.x,this._drag.y,we)}return this._drag={},vr.push({el:this,start:ge}),this.mousedown(ge),this},er.onDragOver=function(ae){ae?k.on("raphael.drag.over."+this.id,ae):k.unbind("raphael.drag.over."+this.id)},er.undrag=function(){for(var ae=vr.length;ae--;)vr[ae].el==this&&(this.unmousedown(vr[ae].start),vr.splice(ae,1),k.unbind("raphael.drag.*."+this.id));!vr.length&&A.unmousemove(Sr).unmouseup(rr),Xt=[]},M.circle=function(ae,ye,Ce){var Pe=A._engine.circle(this,ae||0,ye||0,Ce||0);return this.__set__&&this.__set__.push(Pe),Pe},M.rect=function(ae,ye,Ce,Pe,ze){var Je=A._engine.rect(this,ae||0,ye||0,Ce||0,Pe||0,ze||0);return this.__set__&&this.__set__.push(Je),Je},M.ellipse=function(ae,ye,Ce,Pe){var ze=A._engine.ellipse(this,ae||0,ye||0,Ce||0,Pe||0);return this.__set__&&this.__set__.push(ze),ze},M.path=function(ae){ae&&!A.is(ae,"string")&&!A.is(ae[0],v)&&(ae+=se);var ye=A._engine.path(A.format[U](A,arguments),this);return this.__set__&&this.__set__.push(ye),ye},M.image=function(ae,ye,Ce,Pe,ze){var Je=A._engine.image(this,ae||"about:blank",ye||0,Ce||0,Pe||0,ze||0);return this.__set__&&this.__set__.push(Je),Je},M.text=function(ae,ye,Ce){var Pe=A._engine.text(this,ae||0,ye||0,Q(Ce));return this.__set__&&this.__set__.push(Pe),Pe},M.set=function(ae){!A.is(ae,"array")&&(ae=Array.prototype.splice.call(arguments,0,arguments.length));var ye=new Kr(ae);return this.__set__&&this.__set__.push(ye),ye.paper=this,ye.type="set",ye},M.setStart=function(ae){this.__set__=ae||this.set()},M.setFinish=function(ae){var ye=this.__set__;return delete this.__set__,ye},M.getSize=function(){var ae=this.canvas.parentNode;return{width:ae.offsetWidth,height:ae.offsetHeight}},M.setSize=function(ae,ye){return A._engine.setSize.call(this,ae,ye)},M.setViewBox=function(ae,ye,Ce,Pe,ze){return A._engine.setViewBox.call(this,ae,ye,Ce,Pe,ze)},M.top=M.bottom=null,M.raphael=A;function Pr(){return this.x+de+this.y+de+this.width+" × "+this.height}M.getElementByPoint=function(ae,ye){var Ce,Pe,ze,Je,ge,we,Ae,Ue=this.canvas,ht=z.doc.elementFromPoint(ae,ye);if(z.win.opera&&ht.tagName=="svg"){var _t=(Pe=(Ce=Ue).getBoundingClientRect(),ze=Ce.ownerDocument,Je=ze.body,ge=ze.documentElement,we=ge.clientTop||Je.clientTop||0,Ae=ge.clientLeft||Je.clientLeft||0,{y:Pe.top+(z.win.pageYOffset||ge.scrollTop||Je.scrollTop)-we,x:Pe.left+(z.win.pageXOffset||ge.scrollLeft||Je.scrollLeft)-Ae}),Ct=Ue.createSVGRect();Ct.x=ae-_t.x,Ct.y=ye-_t.y,Ct.width=Ct.height=1;var At=Ue.getIntersectionList(Ct,null);At.length&&(ht=At[At.length-1])}if(!ht)return null;for(;ht.parentNode&&ht!=Ue.parentNode&&!ht.raphael;)ht=ht.parentNode;return ht==this.canvas.parentNode&&(ht=Ue),ht=ht&&ht.raphael?this.getById(ht.raphaelid):null},M.getElementsByBBox=function(ae){var ye=this.set();return this.forEach(function(Ce){A.isBBoxIntersect(Ce.getBBox(),ae)&&ye.push(Ce)}),ye},M.getById=function(ae){for(var ye=this.bottom;ye;){if(ye.id==ae)return ye;ye=ye.next}return null},M.forEach=function(ae,ye){for(var Ce=this.bottom;Ce;){if(ae.call(ye,Ce)===!1)return this;Ce=Ce.next}return this},M.getElementsByPoint=function(ae,ye){var Ce=this.set();return this.forEach(function(Pe){Pe.isPointInside(ae,ye)&&Ce.push(Pe)}),Ce},er.isPointInside=function(ae,ye){var Ce=this.realPath=Ge[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(Ce=A.transformPath(Ce,this.attr("transform"))),A.isPointInsidePath(Ce,ae,ye)},er.getBBox=function(ae){if(this.removed)return{};var ye=this._;return ae?(!ye.dirty&&ye.bboxwt||(this.realPath=Ge[this.type](this),ye.bboxwt=Be(this.realPath),ye.bboxwt.toString=Pr,ye.dirty=0),ye.bboxwt):((ye.dirty||ye.dirtyT||!ye.bbox)&&(!ye.dirty&&this.realPath||(ye.bboxwt=0,this.realPath=Ge[this.type](this)),ye.bbox=Be(nt(this.realPath,this.matrix)),ye.bbox.toString=Pr,ye.dirty=ye.dirtyT=0),ye.bbox)},er.clone=function(){if(this.removed)return null;var ae=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(ae),ae},er.glow=function(ae){if(this.type=="text")return null;var ye={width:((ae=ae||{}).width||10)+(+this.attr("stroke-width")||1),fill:ae.fill||!1,opacity:ae.opacity==null?.5:ae.opacity,offsetx:ae.offsetx||0,offsety:ae.offsety||0,color:ae.color||"#000"},Ce=ye.width/2,Pe=this.paper,ze=Pe.set(),Je=this.realPath||Ge[this.type](this);Je=this.matrix?nt(Je,this.matrix):Je;for(var ge=1;ge<Ce+1;ge++)ze.push(Pe.path(Je).attr({stroke:ye.color,fill:ye.fill?ye.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(ye.width/Ce*ge).toFixed(3),opacity:+(ye.opacity/Ce).toFixed(3)}));return ze.insertBefore(this).translate(ye.offsetx,ye.offsety)};var Tr=function(ae,ye,Ce,Pe,ze,Je,ge,we,Ae){return Ae==null?yt(ae,ye,Ce,Pe,ze,Je,ge,we):A.findDotsAtSegment(ae,ye,Ce,Pe,ze,Je,ge,we,function(Ue,ht,_t,Ct,At,Qt,ir,tr,Zt){if(!(Zt<0||yt(Ue,ht,_t,Ct,At,Qt,ir,tr)<Zt)){var Br,pr=.5,_r=1-pr;for(Br=yt(Ue,ht,_t,Ct,At,Qt,ir,tr,_r);e(Br-Zt)>.01;)Br=yt(Ue,ht,_t,Ct,At,Qt,ir,tr,_r+=(Br<Zt?1:-1)*(pr/=2));return _r}}(ae,ye,Ce,Pe,ze,Je,ge,we,Ae))},br=function(ae,ye){return function(Ce,Pe,ze){for(var Je,ge,we,Ae,Ue,ht="",_t={},Ct=0,At=0,Qt=(Ce=Ot(Ce)).length;At<Qt;At++){if((we=Ce[At])[0]=="M")Je=+we[1],ge=+we[2];else{if(Ct+(Ae=Tr(Je,ge,we[1],we[2],we[3],we[4],we[5],we[6]))>Pe){if(ye&&!_t.start){if(ht+=["C"+(Ue=Tr(Je,ge,we[1],we[2],we[3],we[4],we[5],we[6],Pe-Ct)).start.x,Ue.start.y,Ue.m.x,Ue.m.y,Ue.x,Ue.y],ze)return ht;_t.start=ht,ht=["M"+Ue.x,Ue.y+"C"+Ue.n.x,Ue.n.y,Ue.end.x,Ue.end.y,we[5],we[6]].join(),Ct+=Ae,Je=+we[5],ge=+we[6];continue}if(!ae&&!ye)return{x:(Ue=Tr(Je,ge,we[1],we[2],we[3],we[4],we[5],we[6],Pe-Ct)).x,y:Ue.y,alpha:Ue.alpha}}Ct+=Ae,Je=+we[5],ge=+we[6]}ht+=we.shift()+we}return _t.end=ht,(Ue=ae?Ct:ye?_t:A.findDotsAtSegment(Je,ge,we[0],we[1],we[2],we[3],we[4],we[5],1)).alpha&&(Ue={x:Ue.x,y:Ue.y,alpha:Ue.alpha}),Ue}},Ar=br(1),gr=br(),dr=br(0,1);A.getTotalLength=Ar,A.getPointAtLength=gr,A.getSubpath=function(ae,ye,Ce){if(this.getTotalLength(ae)-Ce<1e-6)return dr(ae,ye).end;var Pe=dr(ae,Ce,1);return ye?dr(Pe,ye).end:Pe},er.getTotalLength=function(){var ae=this.getPath();if(ae)return this.node.getTotalLength?this.node.getTotalLength():Ar(ae)},er.getPointAtLength=function(ae){var ye=this.getPath();if(ye)return gr(ye,ae)},er.getPath=function(){var ae,ye=A._getPath[this.type];if(this.type!="text"&&this.type!="set")return ye&&(ae=ye(this)),ae},er.getSubpath=function(ae,ye){var Ce=this.getPath();if(Ce)return A.getSubpath(Ce,ae,ye)};var lr=A.easing_formulas={linear:function(ae){return ae},"<":function(ae){return c(ae,1.7)},">":function(ae){return c(ae,.48)},"<>":function(ae){var ye=.48-ae/1.04,Ce=u.sqrt(.1734+ye*ye),Pe=Ce-ye,ze=-Ce-ye,Je=c(e(Pe),1/3)*(Pe<0?-1:1)+c(e(ze),1/3)*(ze<0?-1:1)+.5;return 3*(1-Je)*Je*Je+Je*Je*Je},backIn:function(ae){var ye=1.70158;return ae*ae*((ye+1)*ae-ye)},backOut:function(ae){var ye=1.70158;return(ae-=1)*ae*((ye+1)*ae+ye)+1},elastic:function(ae){return ae==!!ae?ae:c(2,-10*ae)*u.sin(2*y*(ae-.075)/.3)+1},bounce:function(ae){var ye=7.5625,Ce=2.75;return ae<1/Ce?ye*ae*ae:ae<2/Ce?ye*(ae-=1.5/Ce)*ae+.75:ae<2.5/Ce?ye*(ae-=2.25/Ce)*ae+.9375:ye*(ae-=2.625/Ce)*ae+.984375}};lr.easeIn=lr["ease-in"]=lr["<"],lr.easeOut=lr["ease-out"]=lr[">"],lr.easeInOut=lr["ease-in-out"]=lr["<>"],lr["back-in"]=lr.backIn,lr["back-out"]=lr.backOut;var Kt=[],Bt=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(ae){setTimeout(ae,16)},Ft=function(){for(var ae=+new Date,ye=0;ye<Kt.length;ye++){var Ce=Kt[ye];if(!Ce.el.removed&&!Ce.paused){var Pe,ze,Je=ae-Ce.start,ge=Ce.ms,we=Ce.easing,Ae=Ce.from,Ue=Ce.diff,ht=Ce.to,_t=(Ce.t,Ce.el),Ct={},At={};if(Ce.initstatus?(Je=(Ce.initstatus*Ce.anim.top-Ce.prev)/(Ce.percent-Ce.prev)*ge,Ce.status=Ce.initstatus,delete Ce.initstatus,Ce.stop&&Kt.splice(ye--,1)):Ce.status=(Ce.prev+(Ce.percent-Ce.prev)*(Je/ge))/Ce.anim.top,!(Je<0))if(Je<ge){var Qt=we(Je/ge);for(var ir in Ae)if(Ae[$](ir)){switch(ee[ir]){case w:Pe=+Ae[ir]+Qt*ge*Ue[ir];break;case"colour":Pe="rgb("+[cr(H(Ae[ir].r+Qt*ge*Ue[ir].r)),cr(H(Ae[ir].g+Qt*ge*Ue[ir].g)),cr(H(Ae[ir].b+Qt*ge*Ue[ir].b))].join(",")+")";break;case"path":Pe=[];for(var tr=0,Zt=Ae[ir].length;tr<Zt;tr++){Pe[tr]=[Ae[ir][tr][0]];for(var Br=1,pr=Ae[ir][tr].length;Br<pr;Br++)Pe[tr][Br]=+Ae[ir][tr][Br]+Qt*ge*Ue[ir][tr][Br];Pe[tr]=Pe[tr].join(de)}Pe=Pe.join(de);break;case"transform":if(Ue[ir].real)for(Pe=[],tr=0,Zt=Ae[ir].length;tr<Zt;tr++)for(Pe[tr]=[Ae[ir][tr][0]],Br=1,pr=Ae[ir][tr].length;Br<pr;Br++)Pe[tr][Br]=Ae[ir][tr][Br]+Qt*ge*Ue[ir][tr][Br];else{var _r=function(Gr){return+Ae[ir][Gr]+Qt*ge*Ue[ir][Gr]};Pe=[["m",_r(0),_r(1),_r(2),_r(3),_r(4),_r(5)]]}break;case"csv":if(ir=="clip-rect")for(Pe=[],tr=4;tr--;)Pe[tr]=+Ae[ir][tr]+Qt*ge*Ue[ir][tr];break;default:var fr=[][J](Ae[ir]);for(Pe=[],tr=_t.paper.customAttributes[ir].length;tr--;)Pe[tr]=+fr[tr]+Qt*ge*Ue[ir][tr]}Ct[ir]=Pe}_t.attr(Ct),function(Gr,Nr,Zr){setTimeout(function(){k("raphael.anim.frame."+Gr,Nr,Zr)})}(_t.id,_t,Ce.anim)}else{if(function(Gr,Nr,Zr){setTimeout(function(){k("raphael.anim.frame."+Nr.id,Nr,Zr),k("raphael.anim.finish."+Nr.id,Nr,Zr),A.is(Gr,"function")&&Gr.call(Nr)})}(Ce.callback,_t,Ce.anim),_t.attr(ht),Kt.splice(ye--,1),Ce.repeat>1&&!Ce.next){for(ze in ht)ht[$](ze)&&(At[ze]=Ce.totalOrigin[ze]);Ce.el.attr(At),ar(Ce.anim,Ce.el,Ce.anim.percents[0],null,Ce.totalOrigin,Ce.repeat-1)}Ce.next&&!Ce.stop&&ar(Ce.anim,Ce.el,Ce.next,null,Ce.totalOrigin,Ce.repeat)}}}Kt.length&&Bt(Ft)},cr=function(ae){return ae>255?255:ae<0?0:ae};function nr(ae,ye,Ce,Pe,ze,Je){var ge=3*ye,we=3*(Pe-ye)-ge,Ae=1-ge-we,Ue=3*Ce,ht=3*(ze-Ce)-Ue,_t=1-Ue-ht;function Ct(At){return((Ae*At+we)*At+ge)*At}return function(At,Qt){var ir=function(tr,Zt){var Br,pr,_r,fr,Gr,Nr;for(_r=tr,Nr=0;Nr<8;Nr++){if(fr=Ct(_r)-tr,e(fr)<Zt)return _r;if(e(Gr=(3*Ae*_r+2*we)*_r+ge)<1e-6)break;_r-=fr/Gr}if(pr=1,(_r=tr)<(Br=0))return Br;if(_r>pr)return pr;for(;Br<pr;){if(fr=Ct(_r),e(fr-tr)<Zt)return _r;tr>fr?Br=_r:pr=_r,_r=(pr-Br)/2+Br}return _r}(At,Qt);return((_t*ir+ht)*ir+Ue)*ir}(ae,1/(200*Je))}function Vt(ae,ye){var Ce=[],Pe={};if(this.ms=ye,this.times=1,ae){for(var ze in ae)ae[$](ze)&&(Pe[Y(ze)]=ae[ze],Ce.push(Y(ze)));Ce.sort(mt)}this.anim=Pe,this.top=Ce[Ce.length-1],this.percents=Ce}function ar(ae,ye,Ce,Pe,ze,Je){Ce=Y(Ce);var ge,we,Ae,Ue,ht,_t,Ct=ae.ms,At={},Qt={},ir={};if(Pe)for(Zt=0,Br=Kt.length;Zt<Br;Zt++){var tr=Kt[Zt];if(tr.el.id==ye.id&&tr.anim==ae){tr.percent!=Ce?(Kt.splice(Zt,1),Ae=1):we=tr,ye.attr(tr.totalOrigin);break}}else Pe=+Qt;for(var Zt=0,Br=ae.percents.length;Zt<Br;Zt++){if(ae.percents[Zt]==Ce||ae.percents[Zt]>Pe*ae.top){Ce=ae.percents[Zt],ht=ae.percents[Zt-1]||0,Ct=Ct/ae.top*(Ce-ht),Ue=ae.percents[Zt+1],ge=ae.anim[Ce];break}Pe&&ye.attr(ae.anim[ae.percents[Zt]])}if(ge){if(we)we.initstatus=Pe,we.start=new Date-we.ms*Pe;else{for(var pr in ge)if(ge[$](pr)&&(ee[$](pr)||ye.paper.customAttributes[$](pr)))switch(At[pr]=ye.attr(pr),At[pr]==null&&(At[pr]=D[pr]),Qt[pr]=ge[pr],ee[pr]){case w:ir[pr]=(Qt[pr]-At[pr])/Ct;break;case"colour":At[pr]=A.getRGB(At[pr]);var _r=A.getRGB(Qt[pr]);ir[pr]={r:(_r.r-At[pr].r)/Ct,g:(_r.g-At[pr].g)/Ct,b:(_r.b-At[pr].b)/Ct};break;case"path":var fr=Ot(At[pr],Qt[pr]),Gr=fr[1];for(At[pr]=fr[0],ir[pr]=[],Zt=0,Br=At[pr].length;Zt<Br;Zt++){ir[pr][Zt]=[0];for(var Nr=1,Zr=At[pr][Zt].length;Nr<Zr;Nr++)ir[pr][Zt][Nr]=(Gr[Zt][Nr]-At[pr][Zt][Nr])/Ct}break;case"transform":var Sn=ye._,qn=_e(Sn[pr],Qt[pr]);if(qn)for(At[pr]=qn.from,Qt[pr]=qn.to,ir[pr]=[],ir[pr].real=!0,Zt=0,Br=At[pr].length;Zt<Br;Zt++)for(ir[pr][Zt]=[At[pr][Zt][0]],Nr=1,Zr=At[pr][Zt].length;Nr<Zr;Nr++)ir[pr][Zt][Nr]=(Qt[pr][Zt][Nr]-At[pr][Zt][Nr])/Ct;else{var ii=ye.matrix||new Re,si={_:{transform:Sn.transform},getBBox:function(){return ye.getBBox(1)}};At[pr]=[ii.a,ii.b,ii.c,ii.d,ii.e,ii.f],ce(si,Qt[pr]),Qt[pr]=si._.transform,ir[pr]=[(si.matrix.a-ii.a)/Ct,(si.matrix.b-ii.b)/Ct,(si.matrix.c-ii.c)/Ct,(si.matrix.d-ii.d)/Ct,(si.matrix.e-ii.e)/Ct,(si.matrix.f-ii.f)/Ct]}break;case"csv":var vn=Q(ge[pr])[ve](j),on=Q(At[pr])[ve](j);if(pr=="clip-rect")for(At[pr]=on,ir[pr]=[],Zt=on.length;Zt--;)ir[pr][Zt]=(vn[Zt]-At[pr][Zt])/Ct;Qt[pr]=vn;break;default:for(vn=[][J](ge[pr]),on=[][J](At[pr]),ir[pr]=[],Zt=ye.paper.customAttributes[pr].length;Zt--;)ir[pr][Zt]=((vn[Zt]||0)-(on[Zt]||0))/Ct}var Bn=ge.easing,Hi=A.easing_formulas[Bn];if(!Hi)if((Hi=Q(Bn).match(R))&&Hi.length==5){var Xi=Hi;Hi=function(Kn){return nr(Kn,+Xi[1],+Xi[2],+Xi[3],+Xi[4],Ct)}}else Hi=Ye;if(tr={anim:ae,percent:Ce,timestamp:_t=ge.start||ae.start||+new Date,start:_t+(ae.del||0),status:0,initstatus:Pe||0,stop:!1,ms:Ct,easing:Hi,from:At,diff:ir,to:Qt,el:ye,callback:ge.callback,prev:ht,next:Ue,repeat:Je||ae.times,origin:ye.attr(),totalOrigin:ze},Kt.push(tr),Pe&&!we&&!Ae&&(tr.stop=!0,tr.start=new Date-Ct*Pe,Kt.length==1))return Ft();Ae&&(tr.start=new Date-tr.ms*Pe),Kt.length==1&&Bt(Ft)}k("raphael.anim.start."+ye.id,ye,ae)}}function qr(ae){for(var ye=0;ye<Kt.length;ye++)Kt[ye].el.paper==ae&&Kt.splice(ye--,1)}er.animateWith=function(ae,ye,Ce,Pe,ze,Je){if(this.removed)return Je&&Je.call(this),this;var ge=Ce instanceof Vt?Ce:A.animation(Ce,Pe,ze,Je);ar(ge,this,ge.percents[0],null,this.attr());for(var we=0,Ae=Kt.length;we<Ae;we++)if(Kt[we].anim==ye&&Kt[we].el==ae){Kt[Ae-1].start=Kt[we].start;break}return this},er.onAnimation=function(ae){return ae?k.on("raphael.anim.frame."+this.id,ae):k.unbind("raphael.anim.frame."+this.id),this},Vt.prototype.delay=function(ae){var ye=new Vt(this.anim,this.ms);return ye.times=this.times,ye.del=+ae||0,ye},Vt.prototype.repeat=function(ae){var ye=new Vt(this.anim,this.ms);return ye.del=this.del,ye.times=u.floor(p(ae,0))||1,ye},A.animation=function(ae,ye,Ce,Pe){if(ae instanceof Vt)return ae;!A.is(Ce,"function")&&Ce||(Pe=Pe||Ce||null,Ce=null),ae=Object(ae),ye=+ye||0;var ze,Je,ge={};for(Je in ae)ae[$](Je)&&Y(Je)!=Je&&Y(Je)+"%"!=Je&&(ze=!0,ge[Je]=ae[Je]);if(ze)return Ce&&(ge.easing=Ce),Pe&&(ge.callback=Pe),new Vt({100:ge},ye);if(Pe){var we=0;for(var Ae in ae){var Ue=Z(Ae);ae[$](Ae)&&Ue>we&&(we=Ue)}!ae[we+="%"].callback&&(ae[we].callback=Pe)}return new Vt(ae,ye)},er.animate=function(ae,ye,Ce,Pe){if(this.removed)return Pe&&Pe.call(this),this;var ze=ae instanceof Vt?ae:A.animation(ae,ye,Ce,Pe);return ar(ze,this,ze.percents[0],null,this.attr()),this},er.setTime=function(ae,ye){return ae&&ye!=null&&this.status(ae,b(ye,ae.ms)/ae.ms),this},er.status=function(ae,ye){var Ce,Pe,ze=[],Je=0;if(ye!=null)return ar(ae,this,-1,b(ye,1)),this;for(Ce=Kt.length;Je<Ce;Je++)if((Pe=Kt[Je]).el.id==this.id&&(!ae||Pe.anim==ae)){if(ae)return Pe.status;ze.push({anim:Pe.anim,status:Pe.status})}return ae?0:ze},er.pause=function(ae){for(var ye=0;ye<Kt.length;ye++)Kt[ye].el.id!=this.id||ae&&Kt[ye].anim!=ae||k("raphael.anim.pause."+this.id,this,Kt[ye].anim)!==!1&&(Kt[ye].paused=!0);return this},er.resume=function(ae){for(var ye=0;ye<Kt.length;ye++)if(Kt[ye].el.id==this.id&&(!ae||Kt[ye].anim==ae)){var Ce=Kt[ye];k("raphael.anim.resume."+this.id,this,Ce.anim)!==!1&&(delete Ce.paused,this.status(Ce.anim,Ce.status))}return this},er.stop=function(ae){for(var ye=0;ye<Kt.length;ye++)Kt[ye].el.id!=this.id||ae&&Kt[ye].anim!=ae||k("raphael.anim.stop."+this.id,this,Kt[ye].anim)!==!1&&Kt.splice(ye--,1);return this},k.on("raphael.remove",qr),k.on("raphael.clear",qr),er.toString=function(){return"Raphaël’s object"};var Vr,Wr,Rr,bt,Kr=function(ae){if(this.items=[],this.length=0,this.type="set",ae)for(var ye=0,Ce=ae.length;ye<Ce;ye++)!ae[ye]||ae[ye].constructor!=er.constructor&&ae[ye].constructor!=Kr||(this[this.items.length]=this.items[this.items.length]=ae[ye],this.length++)},Ur=Kr.prototype;for(var ti in Ur.push=function(){for(var ae,ye,Ce=0,Pe=arguments.length;Ce<Pe;Ce++)!(ae=arguments[Ce])||ae.constructor!=er.constructor&&ae.constructor!=Kr||(this[ye=this.items.length]=this.items[ye]=ae,this.length++);return this},Ur.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Ur.forEach=function(ae,ye){for(var Ce=0,Pe=this.items.length;Ce<Pe;Ce++)if(ae.call(ye,this.items[Ce],Ce)===!1)return this;return this},er)er[$](ti)&&(Ur[ti]=function(ae){return function(){var ye=arguments;return this.forEach(function(Ce){Ce[ae][U](Ce,ye)})}}(ti));return Ur.attr=function(ae,ye){if(ae&&A.is(ae,v)&&A.is(ae[0],"object"))for(var Ce=0,Pe=ae.length;Ce<Pe;Ce++)this.items[Ce].attr(ae[Ce]);else for(var ze=0,Je=this.items.length;ze<Je;ze++)this.items[ze].attr(ae,ye);return this},Ur.clear=function(){for(;this.length;)this.pop()},Ur.splice=function(ae,ye,Ce){ae=ae<0?p(this.length+ae,0):ae,ye=p(0,b(this.length-ae,ye));var Pe,ze=[],Je=[],ge=[];for(Pe=2;Pe<arguments.length;Pe++)ge.push(arguments[Pe]);for(Pe=0;Pe<ye;Pe++)Je.push(this[ae+Pe]);for(;Pe<this.length-ae;Pe++)ze.push(this[ae+Pe]);var we=ge.length;for(Pe=0;Pe<we+ze.length;Pe++)this.items[ae+Pe]=this[ae+Pe]=Pe<we?ge[Pe]:ze[Pe-we];for(Pe=this.items.length=this.length-=ye-we;this[Pe];)delete this[Pe++];return new Kr(Je)},Ur.exclude=function(ae){for(var ye=0,Ce=this.length;ye<Ce;ye++)if(this[ye]==ae)return this.splice(ye,1),!0},Ur.animate=function(ae,ye,Ce,Pe){(A.is(Ce,"function")||!Ce)&&(Pe=Ce||null);var ze,Je,ge=this.items.length,we=ge,Ae=this;if(!ge)return this;Pe&&(Je=function(){!--ge&&Pe.call(Ae)}),Ce=A.is(Ce,"string")?Ce:Je;var Ue=A.animation(ae,ye,Ce,Je);for(ze=this.items[--we].animate(Ue);we--;)this.items[we]&&!this.items[we].removed&&this.items[we].animateWith(ze,Ue,Ue),this.items[we]&&!this.items[we].removed||ge--;return this},Ur.insertAfter=function(ae){for(var ye=this.items.length;ye--;)this.items[ye].insertAfter(ae);return this},Ur.getBBox=function(){for(var ae=[],ye=[],Ce=[],Pe=[],ze=this.items.length;ze--;)if(!this.items[ze].removed){var Je=this.items[ze].getBBox();ae.push(Je.x),ye.push(Je.y),Ce.push(Je.x+Je.width),Pe.push(Je.y+Je.height)}return{x:ae=b[U](0,ae),y:ye=b[U](0,ye),x2:Ce=p[U](0,Ce),y2:Pe=p[U](0,Pe),width:Ce-ae,height:Pe-ye}},Ur.clone=function(ae){ae=this.paper.set();for(var ye=0,Ce=this.items.length;ye<Ce;ye++)ae.push(this.items[ye].clone());return ae},Ur.toString=function(){return"Raphaël‘s set"},Ur.glow=function(ae){var ye=this.paper.set();return this.forEach(function(Ce,Pe){var ze=Ce.glow(ae);ze!=null&&ze.forEach(function(Je,ge){ye.push(Je)})}),ye},Ur.isPointInside=function(ae,ye){var Ce=!1;return this.forEach(function(Pe){if(Pe.isPointInside(ae,ye))return Ce=!0,!1}),Ce},A.registerFont=function(ae){if(!ae.face)return ae;this.fonts=this.fonts||{};var ye={w:ae.w,face:{},glyphs:{}},Ce=ae.face["font-family"];for(var Pe in ae.face)ae.face[$](Pe)&&(ye.face[Pe]=ae.face[Pe]);if(this.fonts[Ce]?this.fonts[Ce].push(ye):this.fonts[Ce]=[ye],!ae.svg){for(var ze in ye.face["units-per-em"]=Z(ae.face["units-per-em"],10),ae.glyphs)if(ae.glyphs[$](ze)){var Je=ae.glyphs[ze];if(ye.glyphs[ze]={w:Je.w,k:{},d:Je.d&&"M"+Je.d.replace(/[mlcxtrv]/g,function(we){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[we]||"M"})+"z"},Je.k)for(var ge in Je.k)Je[$](ge)&&(ye.glyphs[ze].k[ge]=Je.k[ge])}}return ae},M.getFont=function(ae,ye,Ce,Pe){if(Pe=Pe||"normal",Ce=Ce||"normal",ye=+ye||{normal:400,bold:700,lighter:300,bolder:800}[ye]||400,A.fonts){var ze,Je=A.fonts[ae];if(!Je){var ge=new RegExp("(^|\\s)"+ae.replace(/[^\w\d\s+!~.:_-]/g,se)+"(\\s|$)","i");for(var we in A.fonts)if(A.fonts[$](we)&&ge.test(we)){Je=A.fonts[we];break}}if(Je)for(var Ae=0,Ue=Je.length;Ae<Ue&&((ze=Je[Ae]).face["font-weight"]!=ye||ze.face["font-style"]!=Ce&&ze.face["font-style"]||ze.face["font-stretch"]!=Pe);Ae++);return ze}},M.print=function(ae,ye,Ce,Pe,ze,Je,ge,we){Je=Je||"middle",ge=p(b(ge||0,1),-1),we=p(b(we||1,3),1);var Ae,Ue=Q(Ce)[ve](se),ht=0,_t=0,Ct=se;if(A.is(Pe,"string")&&(Pe=this.getFont(Pe)),Pe){Ae=(ze||16)/Pe.face["units-per-em"];for(var At=Pe.face.bbox[ve](j),Qt=+At[0],ir=At[3]-At[1],tr=0,Zt=+At[1]+(Je=="baseline"?ir+ +Pe.face.descent:ir/2),Br=0,pr=Ue.length;Br<pr;Br++){if(Ue[Br]==`
`)ht=0,fr=0,_t=0,tr+=ir*we;else{var _r=_t&&Pe.glyphs[Ue[Br-1]]||{},fr=Pe.glyphs[Ue[Br]];ht+=_t?(_r.w||Pe.w)+(_r.k&&_r.k[Ue[Br]]||0)+Pe.w*ge:0,_t=1}fr&&fr.d&&(Ct+=A.transformPath(fr.d,["t",ht*Ae,tr*Ae,"s",Ae,Ae,Qt,Zt,"t",(ae-Qt)/Ae,(ye-Zt)/Ae]))}}return this.path(Ct).attr({fill:"#000",stroke:"none"})},M.add=function(ae){if(A.is(ae,"array"))for(var ye,Ce=this.set(),Pe=0,ze=ae.length;Pe<ze;Pe++)ye=ae[Pe]||{},I[$](ye.type)&&Ce.push(this[ye.type]().attr(ye));return Ce},A.format=function(ae,ye){var Ce=A.is(ye,v)?[0][J](ye):arguments;return ae&&A.is(ae,"string")&&Ce.length-1&&(ae=ae.replace(P,function(Pe,ze){return Ce[++ze]==null?se:Ce[ze]})),ae||se},A.fullfill=(Vr=/\{([^\}]+)\}/g,Wr=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(ae,ye){return String(ae).replace(Vr,function(Ce,Pe){return function(ze,Je,ge){var we=ge;return Je.replace(Wr,function(Ae,Ue,ht,_t,Ct){Ue=Ue||_t,we&&(Ue in we&&(we=we[Ue]),typeof we=="function"&&Ct&&(we=we()))}),we=(we==null||we==ge?ze:we)+""}(Ce,Pe,ye)})}),A.ninja=function(){if(N.was)z.win.Raphael=N.is;else{window.Raphael=void 0;try{delete window.Raphael}catch{}}return A},A.st=Ur,k.on("raphael.DOMload",function(){B=!0}),(Rr=document).readyState==null&&Rr.addEventListener&&(Rr.addEventListener("DOMContentLoaded",bt=function(){Rr.removeEventListener("DOMContentLoaded",bt,!1),Rr.readyState="complete"},!1),Rr.readyState="loading"),function ae(){/in/.test(Rr.readyState)?setTimeout(ae,9):A.eve("raphael.DOMload")}(),A}).apply(d,h))===void 0||(l.exports=S)},function(l,d,m){var h,S;h=[m(0),m(3),m(4)],(S=(function(k){return k}).apply(d,h))===void 0||(l.exports=S)},function(l,d,m){var h,S,k,A,B,M,j,I,P,$,z,N,F,U;A="hasOwnProperty",B=/[\.\/]/,M=/\s*,\s*/,j=function(J,te){return J-te},I={n:{}},P=function(){for(var J=0,te=this.length;J<te;J++)if(this[J]!==void 0)return this[J]},$=function(){for(var J=this.length;--J;)if(this[J]!==void 0)return this[J]},z=Object.prototype.toString,N=String,F=Array.isArray||function(J){return J instanceof Array||z.call(J)=="[object Array]"},(U=function(J,te){var se,de=k,Q=Array.prototype.slice.call(arguments,2),ve=U.listeners(J),he=0,ke=[],T={},u=[],p=S;u.firstDefined=P,u.lastDefined=$,S=J,k=0;for(var b=0,e=ve.length;b<e;b++)"zIndex"in ve[b]&&(ke.push(ve[b].zIndex),ve[b].zIndex<0&&(T[ve[b].zIndex]=ve[b]));for(ke.sort(j);ke[he]<0;)if(se=T[ke[he++]],u.push(se.apply(te,Q)),k)return k=de,u;for(b=0;b<e;b++)if("zIndex"in(se=ve[b]))if(se.zIndex==ke[he]){if(u.push(se.apply(te,Q)),k)break;do if((se=T[ke[++he]])&&u.push(se.apply(te,Q)),k)break;while(se)}else T[se.zIndex]=se;else if(u.push(se.apply(te,Q)),k)break;return k=de,S=p,u})._events=I,U.listeners=function(J){var te,se,de,Q,ve,he,ke,T,u=F(J)?J:J.split(B),p=I,b=[p],e=[];for(Q=0,ve=u.length;Q<ve;Q++){for(T=[],he=0,ke=b.length;he<ke;he++)for(se=[(p=b[he].n)[u[Q]],p["*"]],de=2;de--;)(te=se[de])&&(T.push(te),e=e.concat(te.f||[]));b=T}return e},U.separator=function(J){J?(J="["+(J=N(J).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",B=new RegExp(J)):B=/[\.\/]/},U.on=function(J,te){if(typeof te!="function")return function(){};for(var se=F(J)?F(J[0])?J:[J]:N(J).split(M),de=0,Q=se.length;de<Q;de++)(function(ve){for(var he,ke=F(ve)?ve:N(ve).split(B),T=I,u=0,p=ke.length;u<p;u++)T=(T=T.n).hasOwnProperty(ke[u])&&T[ke[u]]||(T[ke[u]]={n:{}});for(T.f=T.f||[],u=0,p=T.f.length;u<p;u++)if(T.f[u]==te){he=!0;break}!he&&T.f.push(te)})(se[de]);return function(ve){+ve==+ve&&(te.zIndex=+ve)}},U.f=function(J){var te=[].slice.call(arguments,1);return function(){U.apply(null,[J,null].concat(te).concat([].slice.call(arguments,0)))}},U.stop=function(){k=1},U.nt=function(J){var te=F(S)?S.join("."):S;return J?new RegExp("(?:\\.|\\/|^)"+J+"(?:\\.|\\/|$)").test(te):te},U.nts=function(){return F(S)?S:S.split(B)},U.off=U.unbind=function(J,te){if(J){var se=F(J)?F(J[0])?J:[J]:N(J).split(M);if(se.length>1)for(var de=0,Q=se.length;de<Q;de++)U.off(se[de],te);else{se=F(J)?J:N(J).split(B);var ve,he,ke,T,u,p=[I];for(de=0,Q=se.length;de<Q;de++)for(T=0;T<p.length;T+=ke.length-2){if(ke=[T,1],ve=p[T].n,se[de]!="*")ve[se[de]]&&ke.push(ve[se[de]]);else for(he in ve)ve[A](he)&&ke.push(ve[he]);p.splice.apply(p,ke)}for(de=0,Q=p.length;de<Q;de++)for(ve=p[de];ve.n;){if(te){if(ve.f){for(T=0,u=ve.f.length;T<u;T++)if(ve.f[T]==te){ve.f.splice(T,1);break}!ve.f.length&&delete ve.f}for(he in ve.n)if(ve.n[A](he)&&ve.n[he].f){var b=ve.n[he].f;for(T=0,u=b.length;T<u;T++)if(b[T]==te){b.splice(T,1);break}!b.length&&delete ve.n[he].f}}else for(he in delete ve.f,ve.n)ve.n[A](he)&&ve.n[he].f&&delete ve.n[he].f;ve=ve.n}}}else U._events=I={n:{}}},U.once=function(J,te){var se=function(){return U.off(J,se),te.apply(this,arguments)};return U.on(J,se)},U.version="0.5.0",U.toString=function(){return"You are running Eve 0.5.0"},l.exports?l.exports=U:(h=(function(){return U}).apply(d,[]))===void 0||(l.exports=h)},function(l,d,m){var h,S;h=[m(0)],(S=(function(k){if(!k||k.svg){var A="hasOwnProperty",B=String,M=parseFloat,j=parseInt,I=Math,P=I.max,$=I.abs,z=I.pow,N=/[, ]+/,F=k.eve,U="",J=" ",te="http://www.w3.org/1999/xlink",se={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},de={};k.toString=function(){return`Your browser supports SVG.
You are running Raphaël `+this.version};var Q=function(x,E){if(E)for(var R in typeof x=="string"&&(x=Q(x)),E)E[A](R)&&(R.substring(0,6)=="xlink:"?x.setAttributeNS(te,R.substring(6),B(E[R])):x.setAttribute(R,B(E[R])));else(x=k._g.doc.createElementNS("http://www.w3.org/2000/svg",x)).style&&(x.style.webkitTapHighlightColor="rgba(0,0,0,0)");return x},ve=function(x,E){var R="linear",H=x.id+E,Y=.5,Z=.5,L=x.node,D=x.paper,ee=L.style,oe=k._g.doc.getElementById(H);if(!oe){if(E=(E=B(E).replace(k._radial_gradient,function(mt,Ye,We){if(R="radial",Ye&&We){Y=M(Ye);var Xe=2*((Z=M(We))>.5)-1;z(Y-.5,2)+z(Z-.5,2)>.25&&(Z=I.sqrt(.25-z(Y-.5,2))*Xe+.5)&&Z!=.5&&(Z=Z.toFixed(5)-1e-5*Xe)}return U})).split(/\s*\-\s*/),R=="linear"){var fe=E.shift();if(fe=-M(fe),isNaN(fe))return null;var ue=[0,0,I.cos(k.rad(fe)),I.sin(k.rad(fe))],qe=1/(P($(ue[2]),$(ue[3]))||1);ue[2]*=qe,ue[3]*=qe,ue[2]<0&&(ue[0]=-ue[2],ue[2]=0),ue[3]<0&&(ue[1]=-ue[3],ue[3]=0)}var rt=k._parseDots(E);if(!rt)return null;if(H=H.replace(/[\(\)\s,\xb0#]/g,"_"),x.gradient&&H!=x.gradient.id&&(D.defs.removeChild(x.gradient),delete x.gradient),!x.gradient){oe=Q(R+"Gradient",{id:H}),x.gradient=oe,Q(oe,R=="radial"?{fx:Y,fy:Z}:{x1:ue[0],y1:ue[1],x2:ue[2],y2:ue[3],gradientTransform:x.matrix.invert()}),D.defs.appendChild(oe);for(var Ve=0,et=rt.length;Ve<et;Ve++)oe.appendChild(Q("stop",{offset:rt[Ve].offset?rt[Ve].offset:Ve?"100%":"0%","stop-color":rt[Ve].color||"#fff","stop-opacity":isFinite(rt[Ve].opacity)?rt[Ve].opacity:1}))}}return Q(L,{fill:he(H),opacity:1,"fill-opacity":1}),ee.fill=U,ee.opacity=1,ee.fillOpacity=1,1},he=function(x){if((E=document.documentMode)&&(E===9||E===10))return"url('#"+x+"')";var E,R=document.location;return"url('"+(R.protocol+"//"+R.host+R.pathname+R.search)+"#"+x+"')"},ke=function(x){var E=x.getBBox(1);Q(x.pattern,{patternTransform:x.matrix.invert()+" translate("+E.x+","+E.y+")"})},T=function(x,E,R){if(x.type=="path"){for(var H,Y,Z,L,D,ee=B(E).toLowerCase().split("-"),oe=x.paper,fe=R?"end":"start",ue=x.node,qe=x.attrs,rt=qe["stroke-width"],Ve=ee.length,et="classic",mt=3,Ye=3,We=5;Ve--;)switch(ee[Ve]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":et=ee[Ve];break;case"wide":Ye=5;break;case"narrow":Ye=2;break;case"long":mt=5;break;case"short":mt=2}if(et=="open"?(mt+=2,Ye+=2,We+=2,Z=1,L=R?4:1,D={fill:"none",stroke:qe.stroke}):(L=Z=mt/2,D={fill:qe.stroke,stroke:"none"}),x._.arrows?R?(x._.arrows.endPath&&de[x._.arrows.endPath]--,x._.arrows.endMarker&&de[x._.arrows.endMarker]--):(x._.arrows.startPath&&de[x._.arrows.startPath]--,x._.arrows.startMarker&&de[x._.arrows.startMarker]--):x._.arrows={},et!="none"){var Xe="raphael-marker-"+et,Ge="raphael-marker-"+fe+et+mt+Ye+"-obj"+x.id;k._g.doc.getElementById(Xe)?de[Xe]++:(oe.defs.appendChild(Q(Q("path"),{"stroke-linecap":"round",d:se[et],id:Xe})),de[Xe]=1);var nt,Et=k._g.doc.getElementById(Ge);Et?(de[Ge]++,nt=Et.getElementsByTagName("use")[0]):(Et=Q(Q("marker"),{id:Ge,markerHeight:Ye,markerWidth:mt,orient:"auto",refX:L,refY:Ye/2}),nt=Q(Q("use"),{"xlink:href":"#"+Xe,transform:(R?"rotate(180 "+mt/2+" "+Ye/2+") ":U)+"scale("+mt/We+","+Ye/We+")","stroke-width":(1/((mt/We+Ye/We)/2)).toFixed(4)}),Et.appendChild(nt),oe.defs.appendChild(Et),de[Ge]=1),Q(nt,D);var Le=Z*(et!="diamond"&&et!="oval");R?(H=x._.arrows.startdx*rt||0,Y=k.getTotalLength(qe.path)-Le*rt):(H=Le*rt,Y=k.getTotalLength(qe.path)-(x._.arrows.enddx*rt||0)),(D={})["marker-"+fe]="url(#"+Ge+")",(Y||H)&&(D.d=k.getSubpath(qe.path,H,Y)),Q(ue,D),x._.arrows[fe+"Path"]=Xe,x._.arrows[fe+"Marker"]=Ge,x._.arrows[fe+"dx"]=Le,x._.arrows[fe+"Type"]=et,x._.arrows[fe+"String"]=E}else R?(H=x._.arrows.startdx*rt||0,Y=k.getTotalLength(qe.path)-H):(H=0,Y=k.getTotalLength(qe.path)-(x._.arrows.enddx*rt||0)),x._.arrows[fe+"Path"]&&Q(ue,{d:k.getSubpath(qe.path,H,Y)}),delete x._.arrows[fe+"Path"],delete x._.arrows[fe+"Marker"],delete x._.arrows[fe+"dx"],delete x._.arrows[fe+"Type"],delete x._.arrows[fe+"String"];for(D in de)if(de[A](D)&&!de[D]){var Oe=k._g.doc.getElementById(D);Oe&&Oe.parentNode.removeChild(Oe)}}},u={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},p=function(x,E,R){if(E=u[B(E).toLowerCase()]){for(var H=x.attrs["stroke-width"]||"1",Y={round:H,square:H,butt:0}[x.attrs["stroke-linecap"]||R["stroke-linecap"]]||0,Z=[],L=E.length;L--;)Z[L]=E[L]*H+(L%2?1:-1)*Y;Q(x.node,{"stroke-dasharray":Z.join(",")})}else Q(x.node,{"stroke-dasharray":"none"})},b=function(x,E){var R=x.node,H=x.attrs,Y=R.style.visibility;for(var Z in R.style.visibility="hidden",E)if(E[A](Z)){if(!k._availableAttrs[A](Z))continue;var L=E[Z];switch(H[Z]=L,Z){case"blur":x.blur(L);break;case"title":var D=R.getElementsByTagName("title");if(D.length&&(D=D[0]))D.firstChild.nodeValue=L;else{D=Q("title");var ee=k._g.doc.createTextNode(L);D.appendChild(ee),R.appendChild(D)}break;case"href":case"target":var oe=R.parentNode;if(oe.tagName.toLowerCase()!="a"){var fe=Q("a");oe.insertBefore(fe,R),fe.appendChild(R),oe=fe}Z=="target"?oe.setAttributeNS(te,"show",L=="blank"?"new":L):oe.setAttributeNS(te,Z,L);break;case"cursor":R.style.cursor=L;break;case"transform":x.transform(L);break;case"arrow-start":T(x,L);break;case"arrow-end":T(x,L,1);break;case"clip-rect":var ue=B(L).split(N);if(ue.length==4){x.clip&&x.clip.parentNode.parentNode.removeChild(x.clip.parentNode);var qe=Q("clipPath"),rt=Q("rect");qe.id=k.createUUID(),Q(rt,{x:ue[0],y:ue[1],width:ue[2],height:ue[3]}),qe.appendChild(rt),x.paper.defs.appendChild(qe),Q(R,{"clip-path":"url(#"+qe.id+")"}),x.clip=rt}if(!L){var Ve=R.getAttribute("clip-path");if(Ve){var et=k._g.doc.getElementById(Ve.replace(/(^url\(#|\)$)/g,U));et&&et.parentNode.removeChild(et),Q(R,{"clip-path":U}),delete x.clip}}break;case"path":x.type=="path"&&(Q(R,{d:L?H.path=k._pathToAbsolute(L):"M0,0"}),x._.dirty=1,x._.arrows&&("startString"in x._.arrows&&T(x,x._.arrows.startString),"endString"in x._.arrows&&T(x,x._.arrows.endString,1)));break;case"width":if(R.setAttribute(Z,L),x._.dirty=1,!H.fx)break;Z="x",L=H.x;case"x":H.fx&&(L=-H.x-(H.width||0));case"rx":if(Z=="rx"&&x.type=="rect")break;case"cx":R.setAttribute(Z,L),x.pattern&&ke(x),x._.dirty=1;break;case"height":if(R.setAttribute(Z,L),x._.dirty=1,!H.fy)break;Z="y",L=H.y;case"y":H.fy&&(L=-H.y-(H.height||0));case"ry":if(Z=="ry"&&x.type=="rect")break;case"cy":R.setAttribute(Z,L),x.pattern&&ke(x),x._.dirty=1;break;case"r":x.type=="rect"?Q(R,{rx:L,ry:L}):R.setAttribute(Z,L),x._.dirty=1;break;case"src":x.type=="image"&&R.setAttributeNS(te,"href",L);break;case"stroke-width":x._.sx==1&&x._.sy==1||(L/=P($(x._.sx),$(x._.sy))||1),R.setAttribute(Z,L),H["stroke-dasharray"]&&p(x,H["stroke-dasharray"],E),x._.arrows&&("startString"in x._.arrows&&T(x,x._.arrows.startString),"endString"in x._.arrows&&T(x,x._.arrows.endString,1));break;case"stroke-dasharray":p(x,L,E);break;case"fill":var mt=B(L).match(k._ISURL);if(mt){qe=Q("pattern");var Ye=Q("image");qe.id=k.createUUID(),Q(qe,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),Q(Ye,{x:0,y:0,"xlink:href":mt[1]}),qe.appendChild(Ye),function(Et){k._preload(mt[1],function(){var Le=this.offsetWidth,Oe=this.offsetHeight;Q(Et,{width:Le,height:Oe}),Q(Ye,{width:Le,height:Oe})})}(qe),x.paper.defs.appendChild(qe),Q(R,{fill:"url(#"+qe.id+")"}),x.pattern=qe,x.pattern&&ke(x);break}var We=k.getRGB(L);if(We.error){if((x.type=="circle"||x.type=="ellipse"||B(L).charAt()!="r")&&ve(x,L)){if("opacity"in H||"fill-opacity"in H){var Xe=k._g.doc.getElementById(R.getAttribute("fill").replace(/^url\(#|\)$/g,U));if(Xe){var Ge=Xe.getElementsByTagName("stop");Q(Ge[Ge.length-1],{"stop-opacity":("opacity"in H?H.opacity:1)*("fill-opacity"in H?H["fill-opacity"]:1)})}}H.gradient=L,H.fill="none";break}}else delete E.gradient,delete H.gradient,!k.is(H.opacity,"undefined")&&k.is(E.opacity,"undefined")&&Q(R,{opacity:H.opacity}),!k.is(H["fill-opacity"],"undefined")&&k.is(E["fill-opacity"],"undefined")&&Q(R,{"fill-opacity":H["fill-opacity"]});We[A]("opacity")&&Q(R,{"fill-opacity":We.opacity>1?We.opacity/100:We.opacity});case"stroke":We=k.getRGB(L),R.setAttribute(Z,We.hex),Z=="stroke"&&We[A]("opacity")&&Q(R,{"stroke-opacity":We.opacity>1?We.opacity/100:We.opacity}),Z=="stroke"&&x._.arrows&&("startString"in x._.arrows&&T(x,x._.arrows.startString),"endString"in x._.arrows&&T(x,x._.arrows.endString,1));break;case"gradient":(x.type=="circle"||x.type=="ellipse"||B(L).charAt()!="r")&&ve(x,L);break;case"opacity":H.gradient&&!H[A]("stroke-opacity")&&Q(R,{"stroke-opacity":L>1?L/100:L});case"fill-opacity":if(H.gradient){(Xe=k._g.doc.getElementById(R.getAttribute("fill").replace(/^url\(#|\)$/g,U)))&&(Ge=Xe.getElementsByTagName("stop"),Q(Ge[Ge.length-1],{"stop-opacity":L}));break}default:Z=="font-size"&&(L=j(L,10)+"px");var nt=Z.replace(/(\-.)/g,function(Et){return Et.substring(1).toUpperCase()});R.style[nt]=L,x._.dirty=1,R.setAttribute(Z,L)}}e(x,E),R.style.visibility=Y},e=function(x,E){if(x.type=="text"&&(E[A]("text")||E[A]("font")||E[A]("font-size")||E[A]("x")||E[A]("y"))){var R=x.attrs,H=x.node,Y=H.firstChild?j(k._g.doc.defaultView.getComputedStyle(H.firstChild,U).getPropertyValue("font-size"),10):10;if(E[A]("text")){for(R.text=E.text;H.firstChild;)H.removeChild(H.firstChild);for(var Z,L=B(E.text).split(`
`),D=[],ee=0,oe=L.length;ee<oe;ee++)Z=Q("tspan"),ee&&Q(Z,{dy:1.2*Y,x:R.x}),Z.appendChild(k._g.doc.createTextNode(L[ee])),H.appendChild(Z),D[ee]=Z}else for(ee=0,oe=(D=H.getElementsByTagName("tspan")).length;ee<oe;ee++)ee?Q(D[ee],{dy:1.2*Y,x:R.x}):Q(D[0],{dy:0});Q(H,{x:R.x,y:R.y}),x._.dirty=1;var fe=x._getBBox(),ue=R.y-(fe.y+fe.height/2);ue&&k.is(ue,"finite")&&Q(D[0],{dy:ue})}},c=function(x){return x.parentNode&&x.parentNode.tagName.toLowerCase()==="a"?x.parentNode:x},y=function(x,E){this[0]=this.node=x,x.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),x.raphaelid=this.id,this.matrix=k.matrix(),this.realPath=null,this.paper=E,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!E.bottom&&(E.bottom=this),this.prev=E.top,E.top&&(E.top.next=this),E.top=this,this.next=null},w=k.el;y.prototype=w,w.constructor=y,k._engine.path=function(x,E){var R=Q("path");E.canvas&&E.canvas.appendChild(R);var H=new y(R,E);return H.type="path",b(H,{fill:"none",stroke:"#000",path:x}),H},w.rotate=function(x,E,R){if(this.removed)return this;if((x=B(x).split(N)).length-1&&(E=M(x[1]),R=M(x[2])),x=M(x[0]),R==null&&(E=R),E==null||R==null){var H=this.getBBox(1);E=H.x+H.width/2,R=H.y+H.height/2}return this.transform(this._.transform.concat([["r",x,E,R]])),this},w.scale=function(x,E,R,H){if(this.removed)return this;if((x=B(x).split(N)).length-1&&(E=M(x[1]),R=M(x[2]),H=M(x[3])),x=M(x[0]),E==null&&(E=x),H==null&&(R=H),R==null||H==null)var Y=this.getBBox(1);return R=R??Y.x+Y.width/2,H=H??Y.y+Y.height/2,this.transform(this._.transform.concat([["s",x,E,R,H]])),this},w.translate=function(x,E){return this.removed?this:((x=B(x).split(N)).length-1&&(E=M(x[1])),x=M(x[0])||0,E=+E||0,this.transform(this._.transform.concat([["t",x,E]])),this)},w.transform=function(x){var E=this._;if(x==null)return E.transform;if(k._extractTransform(this,x),this.clip&&Q(this.clip,{transform:this.matrix.invert()}),this.pattern&&ke(this),this.node&&Q(this.node,{transform:this.matrix}),E.sx!=1||E.sy!=1){var R=this.attrs[A]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":R})}return this},w.hide=function(){return this.removed||(this.node.style.display="none"),this},w.show=function(){return this.removed||(this.node.style.display=""),this},w.remove=function(){var x=c(this.node);if(!this.removed&&x.parentNode){var E=this.paper;for(var R in E.__set__&&E.__set__.exclude(this),F.unbind("raphael.*.*."+this.id),this.gradient&&E.defs.removeChild(this.gradient),k._tear(this,E),x.parentNode.removeChild(x),this.removeData(),this)this[R]=typeof this[R]=="function"?k._removedFactory(R):null;this.removed=!0}},w._getBBox=function(){if(this.node.style.display=="none"){this.show();var x=!0}var E,R=!1;this.paper.canvas.parentElement?E=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(E=this.paper.canvas.parentNode.style),E&&E.display=="none"&&(R=!0,E.display="");var H={};try{H=this.node.getBBox()}catch{H={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{H=H||{},R&&(E.display="none")}return x&&this.hide(),H},w.attr=function(x,E){if(this.removed)return this;if(x==null){var R={};for(var H in this.attrs)this.attrs[A](H)&&(R[H]=this.attrs[H]);return R.gradient&&R.fill=="none"&&(R.fill=R.gradient)&&delete R.gradient,R.transform=this._.transform,R}if(E==null&&k.is(x,"string")){if(x=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(x=="transform")return this._.transform;for(var Y=x.split(N),Z={},L=0,D=Y.length;L<D;L++)(x=Y[L])in this.attrs?Z[x]=this.attrs[x]:k.is(this.paper.customAttributes[x],"function")?Z[x]=this.paper.customAttributes[x].def:Z[x]=k._availableAttrs[x];return D-1?Z:Z[Y[0]]}if(E==null&&k.is(x,"array")){for(Z={},L=0,D=x.length;L<D;L++)Z[x[L]]=this.attr(x[L]);return Z}if(E!=null){var ee={};ee[x]=E}else x!=null&&k.is(x,"object")&&(ee=x);for(var oe in ee)F("raphael.attr."+oe+"."+this.id,this,ee[oe]);for(oe in this.paper.customAttributes)if(this.paper.customAttributes[A](oe)&&ee[A](oe)&&k.is(this.paper.customAttributes[oe],"function")){var fe=this.paper.customAttributes[oe].apply(this,[].concat(ee[oe]));for(var ue in this.attrs[oe]=ee[oe],fe)fe[A](ue)&&(ee[ue]=fe[ue])}return b(this,ee),this},w.toFront=function(){if(this.removed)return this;var x=c(this.node);x.parentNode.appendChild(x);var E=this.paper;return E.top!=this&&k._tofront(this,E),this},w.toBack=function(){if(this.removed)return this;var x=c(this.node),E=x.parentNode;return E.insertBefore(x,E.firstChild),k._toback(this,this.paper),this.paper,this},w.insertAfter=function(x){if(this.removed||!x)return this;var E=c(this.node),R=c(x.node||x[x.length-1].node);return R.nextSibling?R.parentNode.insertBefore(E,R.nextSibling):R.parentNode.appendChild(E),k._insertafter(this,x,this.paper),this},w.insertBefore=function(x){if(this.removed||!x)return this;var E=c(this.node),R=c(x.node||x[0].node);return R.parentNode.insertBefore(E,R),k._insertbefore(this,x,this.paper),this},w.blur=function(x){var E=this;if(+x!=0){var R=Q("filter"),H=Q("feGaussianBlur");E.attrs.blur=x,R.id=k.createUUID(),Q(H,{stdDeviation:+x||1.5}),R.appendChild(H),E.paper.defs.appendChild(R),E._blur=R,Q(E.node,{filter:"url(#"+R.id+")"})}else E._blur&&(E._blur.parentNode.removeChild(E._blur),delete E._blur,delete E.attrs.blur),E.node.removeAttribute("filter");return E},k._engine.circle=function(x,E,R,H){var Y=Q("circle");x.canvas&&x.canvas.appendChild(Y);var Z=new y(Y,x);return Z.attrs={cx:E,cy:R,r:H,fill:"none",stroke:"#000"},Z.type="circle",Q(Y,Z.attrs),Z},k._engine.rect=function(x,E,R,H,Y,Z){var L=Q("rect");x.canvas&&x.canvas.appendChild(L);var D=new y(L,x);return D.attrs={x:E,y:R,width:H,height:Y,rx:Z||0,ry:Z||0,fill:"none",stroke:"#000"},D.type="rect",Q(L,D.attrs),D},k._engine.ellipse=function(x,E,R,H,Y){var Z=Q("ellipse");x.canvas&&x.canvas.appendChild(Z);var L=new y(Z,x);return L.attrs={cx:E,cy:R,rx:H,ry:Y,fill:"none",stroke:"#000"},L.type="ellipse",Q(Z,L.attrs),L},k._engine.image=function(x,E,R,H,Y,Z){var L=Q("image");Q(L,{x:R,y:H,width:Y,height:Z,preserveAspectRatio:"none"}),L.setAttributeNS(te,"href",E),x.canvas&&x.canvas.appendChild(L);var D=new y(L,x);return D.attrs={x:R,y:H,width:Y,height:Z,src:E},D.type="image",D},k._engine.text=function(x,E,R,H){var Y=Q("text");x.canvas&&x.canvas.appendChild(Y);var Z=new y(Y,x);return Z.attrs={x:E,y:R,"text-anchor":"middle",text:H,"font-family":k._availableAttrs["font-family"],"font-size":k._availableAttrs["font-size"],stroke:"none",fill:"#000"},Z.type="text",b(Z,Z.attrs),Z},k._engine.setSize=function(x,E){return this.width=x||this.width,this.height=E||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},k._engine.create=function(){var x=k._getContainer.apply(0,arguments),E=x&&x.container;if(!E)throw new Error("SVG container not found.");var R,H=x.x,Y=x.y,Z=x.width,L=x.height,D=Q("svg"),ee="overflow:hidden;";return H=H||0,Y=Y||0,Q(D,{height:L=L||342,version:1.1,width:Z=Z||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),E==1?(D.style.cssText=ee+"position:absolute;left:"+H+"px;top:"+Y+"px",k._g.doc.body.appendChild(D),R=1):(D.style.cssText=ee+"position:relative",E.firstChild?E.insertBefore(D,E.firstChild):E.appendChild(D)),(E=new k._Paper).width=Z,E.height=L,E.canvas=D,E.clear(),E._left=E._top=0,R&&(E.renderfix=function(){}),E.renderfix(),E},k._engine.setViewBox=function(x,E,R,H,Y){F("raphael.setViewBox",this,this._viewBox,[x,E,R,H,Y]);var Z,L,D=this.getSize(),ee=P(R/D.width,H/D.height),oe=this.top,fe=Y?"xMidYMid meet":"xMinYMin";for(x==null?(this._vbSize&&(ee=1),delete this._vbSize,Z="0 0 "+this.width+J+this.height):(this._vbSize=ee,Z=x+J+E+J+R+J+H),Q(this.canvas,{viewBox:Z,preserveAspectRatio:fe});ee&&oe;)L="stroke-width"in oe.attrs?oe.attrs["stroke-width"]:1,oe.attr({"stroke-width":L}),oe._.dirty=1,oe._.dirtyT=1,oe=oe.prev;return this._viewBox=[x,E,R,H,!!Y],this},k.prototype.renderfix=function(){var x,E=this.canvas,R=E.style;try{x=E.getScreenCTM()||E.createSVGMatrix()}catch{x=E.createSVGMatrix()}var H=-x.e%1,Y=-x.f%1;(H||Y)&&(H&&(this._left=(this._left+H)%1,R.left=this._left+"px"),Y&&(this._top=(this._top+Y)%1,R.top=this._top+"px"))},k.prototype.clear=function(){k.eve("raphael.clear",this);for(var x=this.canvas;x.firstChild;)x.removeChild(x.firstChild);this.bottom=this.top=null,(this.desc=Q("desc")).appendChild(k._g.doc.createTextNode("Created with Raphaël "+k.version)),x.appendChild(this.desc),x.appendChild(this.defs=Q("defs"))},k.prototype.remove=function(){for(var x in F("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[x]=typeof this[x]=="function"?k._removedFactory(x):null};var v=k.st;for(var o in w)w[A](o)&&!v[A](o)&&(v[o]=function(x){return function(){var E=arguments;return this.forEach(function(R){R[x].apply(R,E)})}}(o))}}).apply(d,h))===void 0||(l.exports=S)},function(l,d,m){var h,S;h=[m(0)],(S=(function(k){if(!k||k.vml){var A="hasOwnProperty",B=String,M=parseFloat,j=Math,I=j.round,P=j.max,$=j.min,z=j.abs,N=/[, ]+/,F=k.eve,U=" ",J="",te={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},se=/([clmz]),?([^clmz]*)/gi,de=/ progid:\S+Blur\([^\)]+\)/g,Q=/-?[^,\s-]+/g,ve="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",he=21600,ke={path:1,rect:1,image:1},T={circle:1,ellipse:1},u=function(E,R,H){var Y=k.matrix();return Y.rotate(-E,.5,.5),{dx:Y.x(R,H),dy:Y.y(R,H)}},p=function(E,R,H,Y,Z,L){var D=E._,ee=E.matrix,oe=D.fillpos,fe=E.node,ue=fe.style,qe=1,rt="",Ve=he/R,et=he/H;if(ue.visibility="hidden",R&&H){if(fe.coordsize=z(Ve)+U+z(et),ue.rotation=L*(R*H<0?-1:1),L){var mt=u(L,Y,Z);Y=mt.dx,Z=mt.dy}if(R<0&&(rt+="x"),H<0&&(rt+=" y")&&(qe=-1),ue.flip=rt,fe.coordorigin=Y*-Ve+U+Z*-et,oe||D.fillsize){var Ye=fe.getElementsByTagName("fill");Ye=Ye&&Ye[0],fe.removeChild(Ye),oe&&(mt=u(L,ee.x(oe[0],oe[1]),ee.y(oe[0],oe[1])),Ye.position=mt.dx*qe+U+mt.dy*qe),D.fillsize&&(Ye.size=D.fillsize[0]*z(R)+U+D.fillsize[1]*z(H)),fe.appendChild(Ye)}ue.visibility="visible"}};k.toString=function(){return`Your browser doesn’t support SVG. Falling down to VML.
@@ -773,5 +773,5 @@
`,B(j),B(M.body),B(`\r
`)}),B("--"+k.boundary+"--"),k.request.postambleCRLF&&B(`\r
`),A},m.prototype.onRequest=function(h){var S=this,k=S.isChunked(h),A=h.data||h;S.setHeaders(k),S.chunked=k,S.body=S.build(A,k)},multipart.Multipart=m,multipart}var redirect={},hasRequiredRedirect;function requireRedirect(){if(hasRequiredRedirect)return redirect;hasRequiredRedirect=1;var t=require$$2$2,n=/^https?:/;function l(d){this.request=d,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}return l.prototype.onRequest=function(d){var m=this;d.maxRedirects!==void 0&&(m.maxRedirects=d.maxRedirects),typeof d.followRedirect=="function"&&(m.allowRedirect=d.followRedirect),d.followRedirect!==void 0&&(m.followRedirects=!!d.followRedirect),d.followAllRedirects!==void 0&&(m.followAllRedirects=d.followAllRedirects),(m.followRedirects||m.followAllRedirects)&&(m.redirects=m.redirects||[]),d.removeRefererHeader!==void 0&&(m.removeRefererHeader=d.removeRefererHeader),d.followOriginalHttpMethod!==void 0&&(m.followOriginalHttpMethod=d.followOriginalHttpMethod)},l.prototype.redirectTo=function(d){var m=this,h=m.request,S=null;if(d.statusCode>=300&&d.statusCode<400&&d.caseless.has("location")){var k=d.caseless.get("location");if(h.debug("redirect",k),m.followAllRedirects)S=k;else if(m.followRedirects)switch(h.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:S=k;break}}else if(d.statusCode===401){var A=h._auth.onResponse(d);A&&(h.setHeader("authorization",A),S=h.uri)}return S},l.prototype.onResponse=function(d){var m=this,h=m.request,S=m.redirectTo(d);if(!S||!m.allowRedirect.call(h,d))return!1;if(h.debug("redirect to",S),d.resume&&d.resume(),m.redirectsFollowed>=m.maxRedirects)return h.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+h.uri.href)),!1;m.redirectsFollowed+=1,n.test(S)||(S=t.resolve(h.uri.href,S));var k=h.uri;return h.uri=t.parse(S),h.uri.protocol!==k.protocol&&delete h.agent,m.redirects.push({statusCode:d.statusCode,redirectUri:S}),m.followAllRedirects&&h.method!=="HEAD"&&d.statusCode!==401&&d.statusCode!==307&&(h.method=m.followOriginalHttpMethod?h.method:"GET"),delete h.src,delete h.req,delete h._started,d.statusCode!==401&&d.statusCode!==307&&(delete h.body,delete h._form,h.headers&&(h.removeHeader("host"),h.removeHeader("content-type"),h.removeHeader("content-length"),h.uri.hostname!==h.originalHost.split(":")[0]&&h.removeHeader("authorization"))),m.removeRefererHeader||h.setHeader("referer",k.href),h.emit("redirect"),h.init(),!0},redirect.Redirect=l,redirect}var tunnel={},tunnelAgent={},hasRequiredTunnelAgent;function requireTunnelAgent(){if(hasRequiredTunnelAgent)return tunnelAgent;hasRequiredTunnelAgent=1;var t=require$$1$5,n=requireStreamHttp(),l=requireHttpsBrowserify(),d=requireEvents(),m=requireAssert$1(),h=util$6,S=safeBufferExports$1.Buffer;tunnelAgent.httpOverHttp=k,tunnelAgent.httpsOverHttp=A,tunnelAgent.httpOverHttps=B,tunnelAgent.httpsOverHttps=M;function k(z){var N=new j(z);return N.request=n.request,N}function A(z){var N=new j(z);return N.request=n.request,N.createSocket=I,N.defaultPort=443,N}function B(z){var N=new j(z);return N.request=l.request,N}function M(z){var N=new j(z);return N.request=l.request,N.createSocket=I,N.defaultPort=443,N}function j(z){var N=this;N.options=z||{},N.proxyOptions=N.options.proxy||{},N.maxSockets=N.options.maxSockets||n.Agent.defaultMaxSockets,N.requests=[],N.sockets=[],N.on("free",function(U,J,te){for(var se=0,de=N.requests.length;se<de;++se){var Q=N.requests[se];if(Q.host===J&&Q.port===te){N.requests.splice(se,1),Q.request.onSocket(U);return}}U.destroy(),N.removeSocket(U)})}h.inherits(j,d.EventEmitter),j.prototype.addRequest=function(N,F){var U=this;if(typeof F=="string"&&(F={host:F,port:arguments[2],path:arguments[3]}),U.sockets.length>=this.maxSockets){U.requests.push({host:F.host,port:F.port,request:N});return}U.createConnection({host:F.host,port:F.port,request:N})},j.prototype.createConnection=function(N){var F=this;F.createSocket(N,function(U){U.on("free",J),U.on("close",te),U.on("agentRemove",te),N.request.onSocket(U);function J(){F.emit("free",U,N.host,N.port)}function te(se){F.removeSocket(U),U.removeListener("free",J),U.removeListener("close",te),U.removeListener("agentRemove",te)}})},j.prototype.createSocket=function(N,F){var U=this,J={};U.sockets.push(J);var te=P({},U.proxyOptions,{method:"CONNECT",path:N.host+":"+N.port,agent:!1});te.proxyAuth&&(te.headers=te.headers||{},te.headers["Proxy-Authorization"]="Basic "+S.from(te.proxyAuth).toString("base64")),$("making CONNECT request");var se=U.request(te);se.useChunkedEncodingByDefault=!1,se.once("response",de),se.once("upgrade",Q),se.once("connect",ve),se.once("error",he),se.end();function de(ke){ke.upgrade=!0}function Q(ke,T,u){process$1.nextTick(function(){ve(ke,T,u)})}function ve(ke,T,u){if(se.removeAllListeners(),T.removeAllListeners(),ke.statusCode===200)m.equal(u.length,0),$("tunneling connection has established"),U.sockets[U.sockets.indexOf(J)]=T,F(T);else{$("tunneling socket could not be established, statusCode=%d",ke.statusCode);var p=new Error("tunneling socket could not be established, statusCode="+ke.statusCode);p.code="ECONNRESET",N.request.emit("error",p),U.removeSocket(J)}}function he(ke){se.removeAllListeners(),$(`tunneling socket could not be established, cause=%s
-`,ke.message,ke.stack);var T=new Error("tunneling socket could not be established, cause="+ke.message);T.code="ECONNRESET",N.request.emit("error",T),U.removeSocket(J)}},j.prototype.removeSocket=function(N){var F=this.sockets.indexOf(N);if(F!==-1){this.sockets.splice(F,1);var U=this.requests.shift();U&&this.createConnection(U)}};function I(z,N){var F=this;j.prototype.createSocket.call(F,z,function(U){var J=t.connect(0,P({},F.options,{servername:z.host,socket:U}));F.sockets[F.sockets.indexOf(U)]=J,N(J)})}function P(z){for(var N=1,F=arguments.length;N<F;++N){var U=arguments[N];if(typeof U=="object")for(var J=Object.keys(U),te=0,se=J.length;te<se;++te){var de=J[te];U[de]!==void 0&&(z[de]=U[de])}}return z}var $;return process$1.env.NODE_DEBUG&&/\btunnel\b/.test(process$1.env.NODE_DEBUG)?$=function(){var z=Array.prototype.slice.call(arguments);typeof z[0]=="string"?z[0]="TUNNEL: "+z[0]:z.unshift("TUNNEL:"),console.error.apply(console,z)}:$=function(){},tunnelAgent.debug=$,tunnelAgent}var hasRequiredTunnel;function requireTunnel(){if(hasRequiredTunnel)return tunnel;hasRequiredTunnel=1;var t=require$$2$2,n=requireTunnelAgent(),l=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],d=["proxy-authorization"];function m(M){var j=M.port,I=M.protocol,P=M.hostname+":";return j?P+=j:I==="https:"?P+="443":P+="80",P}function h(M,j){var I=j.reduce(function(P,$){return P[$.toLowerCase()]=!0,P},{});return Object.keys(M).filter(function(P){return I[P.toLowerCase()]}).reduce(function(P,$){return P[$]=M[$],P},{})}function S(M,j){var I=M.proxy,P={proxy:{host:I.hostname,port:+I.port,proxyAuth:I.auth,headers:j},headers:M.headers,ca:M.ca,cert:M.cert,key:M.key,passphrase:M.passphrase,pfx:M.pfx,ciphers:M.ciphers,rejectUnauthorized:M.rejectUnauthorized,secureOptions:M.secureOptions,secureProtocol:M.secureProtocol};return P}function k(M,j){var I=M.protocol==="https:"?"https":"http",P=j.protocol==="https:"?"Https":"Http";return[I,P].join("Over")}function A(M){var j=M.uri,I=M.proxy,P=k(j,I);return n[P]}function B(M){this.request=M,this.proxyHeaderWhiteList=l,this.proxyHeaderExclusiveList=[],typeof M.tunnel<"u"&&(this.tunnelOverride=M.tunnel)}return B.prototype.isEnabled=function(){var M=this,j=M.request;return typeof M.tunnelOverride<"u"?M.tunnelOverride:j.uri.protocol==="https:"},B.prototype.setup=function(M){var j=this,I=j.request;if(M=M||{},typeof I.proxy=="string"&&(I.proxy=t.parse(I.proxy)),!I.proxy||!I.tunnel)return!1;M.proxyHeaderWhiteList&&(j.proxyHeaderWhiteList=M.proxyHeaderWhiteList),M.proxyHeaderExclusiveList&&(j.proxyHeaderExclusiveList=M.proxyHeaderExclusiveList);var P=j.proxyHeaderExclusiveList.concat(d),$=j.proxyHeaderWhiteList.concat(P),z=h(I.headers,$);z.host=m(I.uri),P.forEach(I.removeHeader,I);var N=A(I),F=S(I,z);return I.agent=N(F),!0},B.defaultProxyHeaderWhiteList=l,B.defaultProxyHeaderExclusiveList=d,tunnel.Tunnel=B,tunnel}var performanceNow={exports:{}},hasRequiredPerformanceNow;function requirePerformanceNow(){return hasRequiredPerformanceNow||(hasRequiredPerformanceNow=1,(function(){var t,n,l,d,m,h;typeof performance<"u"&&performance!==null&&performance.now?performanceNow.exports=function(){return performance.now()}:typeof process$1<"u"&&process$1!==null&&process$1.hrtime?(performanceNow.exports=function(){return(t()-m)/1e6},n=process$1.hrtime,t=function(){var S;return S=n(),S[0]*1e9+S[1]},d=t(),h=process$1.uptime()*1e9,m=d-h):Date.now?(performanceNow.exports=function(){return Date.now()-l},l=Date.now()):(performanceNow.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(commonjsGlobal)),performanceNow.exports}var request$2,hasRequiredRequest;function requireRequest(){if(hasRequiredRequest)return request$2;hasRequiredRequest=1;var t=requireStreamHttp(),n=requireHttpsBrowserify(),l=require$$2$2,d=util$6,m=requireStreamBrowserify(),h=requireLib$5(),S=requireAwsSign2(),k=requireAws4(),A=requireLib$2(),B=requireMimeTypes(),M=requireCaseless(),j=requireForeverAgent(),I=requireBrowser(),P=extend$1,$=requireIsstream(),z=requireIsTypedarray().strict,N=helpers$1,F=cookies$1,U=requireGetProxyFromURI(),J=requireQuerystring().Querystring,te=requireHar().Har,se=requireAuth().Auth,de=requireOauth().OAuth,Q=requireHawk(),ve=requireMultipart().Multipart,he=requireRedirect().Redirect,ke=requireTunnel().Tunnel,T=requirePerformanceNow(),u=safeBufferExports$1.Buffer,p=N.safeStringify,b=N.isReadStream,e=N.toBase64,c=N.defer,y=N.copy,w=N.version,v=F.jar(),o={};function x(L,D){var ee={};for(var oe in D){var fe=L.indexOf(oe)===-1;fe&&(ee[oe]=D[oe])}return ee}function E(L,D){var ee={};for(var oe in D){var fe=L.indexOf(oe)!==-1,ue=typeof D[oe]=="function";fe&&ue||(ee[oe]=D[oe])}return ee}function R(){var L=this;return{uri:L.uri,method:L.method,headers:L.headers}}function H(){var L=this;return{statusCode:L.statusCode,body:L.body,headers:L.headers,request:R.call(L.request)}}function Y(L){var D=this;L.har&&(D._har=new te(D),L=D._har.options(L)),m.Stream.call(D);var ee=Object.keys(Y.prototype),oe=x(ee,L);P(D,oe),L=E(ee,L),D.readable=!0,D.writable=!0,L.method&&(D.explicitMethod=!0),D._qs=new J(D),D._auth=new se(D),D._oauth=new de(D),D._multipart=new ve(D),D._redirect=new he(D),D._tunnel=new ke(D),D.init(L)}d.inherits(Y,m.Stream),Y.debug=process$1.env.NODE_DEBUG&&/\brequest\b/.test(process$1.env.NODE_DEBUG);function Z(){Y.debug&&console.error("REQUEST %s",d.format.apply(d,arguments))}return Y.prototype.debug=Z,Y.prototype.init=function(L){var D=this;L||(L={}),D.headers=D.headers?y(D.headers):{};for(var ee in D.headers)typeof D.headers[ee]>"u"&&delete D.headers[ee];if(M.httpify(D,D.headers),D.method||(D.method=L.method||"GET"),D.localAddress||(D.localAddress=L.localAddress),D._qs.init(L),Z(L),!D.pool&&D.pool!==!1&&(D.pool=o),D.dests=D.dests||[],D.__isRequestRequest=!0,!D._callback&&D.callback&&(D._callback=D.callback,D.callback=function(){D._callbackCalled||(D._callbackCalled=!0,D._callback.apply(D,arguments))},D.on("error",D.callback.bind()),D.on("complete",D.callback.bind(D,null))),!D.uri&&D.url&&(D.uri=D.url,delete D.url),D.baseUrl){if(typeof D.baseUrl!="string")return D.emit("error",new Error("options.baseUrl must be a string"));if(typeof D.uri!="string")return D.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(D.uri.indexOf("//")===0||D.uri.indexOf("://")!==-1)return D.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var oe=D.baseUrl.lastIndexOf("/")===D.baseUrl.length-1,fe=D.uri.indexOf("/")===0;oe&&fe?D.uri=D.baseUrl+D.uri.slice(1):oe||fe?D.uri=D.baseUrl+D.uri:D.uri===""?D.uri=D.baseUrl:D.uri=D.baseUrl+"/"+D.uri,delete D.baseUrl}if(!D.uri)return D.emit("error",new Error("options.uri is a required argument"));if(typeof D.uri=="string"&&(D.uri=l.parse(D.uri)),D.uri.href||(D.uri.href=l.format(D.uri)),D.uri.protocol==="unix:")return D.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(D.uri.host==="unix"&&D.enableUnixSocket(),D.strictSSL===!1&&(D.rejectUnauthorized=!1),D.uri.pathname||(D.uri.pathname="/"),!(D.uri.host||D.uri.hostname&&D.uri.port)&&!D.uri.isUnix){var ue=l.format(D.uri),qe='Invalid URI "'+ue+'"';return Object.keys(L).length===0&&(qe+=". This can be caused by a crappy redirection."),D.abort(),D.emit("error",new Error(qe))}if(D.hasOwnProperty("proxy")||(D.proxy=U(D.uri)),D.tunnel=D._tunnel.isEnabled(),D.proxy&&D._tunnel.setup(L),D._redirect.onRequest(L),D.setHost=!1,!D.hasHeader("host")){var rt=D.originalHostHeaderName||"host";D.setHeader(rt,D.uri.host),D.uri.port&&(D.uri.port==="80"&&D.uri.protocol==="http:"||D.uri.port==="443"&&D.uri.protocol==="https:")&&D.setHeader(rt,D.uri.hostname),D.setHost=!0}if(D.jar(D._jar||L.jar),D.uri.port||(D.uri.protocol==="http:"?D.uri.port=80:D.uri.protocol==="https:"&&(D.uri.port=443)),D.proxy&&!D.tunnel?(D.port=D.proxy.port,D.host=D.proxy.hostname):(D.port=D.uri.port,D.host=D.uri.hostname),L.form&&D.form(L.form),L.formData){var Ve=L.formData,et=D.form(),mt=function(Lt,xe){xe&&xe.hasOwnProperty("value")&&xe.hasOwnProperty("options")?et.append(Lt,xe.value,xe.options):et.append(Lt,xe)};for(var Ye in Ve)if(Ve.hasOwnProperty(Ye)){var We=Ve[Ye];if(We instanceof Array)for(var Xe=0;Xe<We.length;Xe++)mt(Ye,We[Xe]);else mt(Ye,We)}}if(L.qs&&D.qs(L.qs),D.uri.path?D.path=D.uri.path:D.path=D.uri.pathname+(D.uri.search||""),D.path.length===0&&(D.path="/"),L.aws&&D.aws(L.aws),L.hawk&&D.hawk(L.hawk),L.httpSignature&&D.httpSignature(L.httpSignature),L.auth&&(Object.prototype.hasOwnProperty.call(L.auth,"username")&&(L.auth.user=L.auth.username),Object.prototype.hasOwnProperty.call(L.auth,"password")&&(L.auth.pass=L.auth.password),D.auth(L.auth.user,L.auth.pass,L.auth.sendImmediately,L.auth.bearer)),D.gzip&&!D.hasHeader("accept-encoding")&&D.setHeader("accept-encoding","gzip, deflate"),D.uri.auth&&!D.hasHeader("authorization")){var Ge=D.uri.auth.split(":").map(function(Lt){return D._qs.unescape(Lt)});D.auth(Ge[0],Ge.slice(1).join(":"),!0)}if(!D.tunnel&&D.proxy&&D.proxy.auth&&!D.hasHeader("proxy-authorization")){var nt=D.proxy.auth.split(":").map(function(Lt){return D._qs.unescape(Lt)}),Et="Basic "+e(nt.join(":"));D.setHeader("proxy-authorization",Et)}D.proxy&&!D.tunnel&&(D.path=D.uri.protocol+"//"+D.uri.host+D.path),L.json&&D.json(L.json),L.multipart&&D.multipart(L.multipart),L.time&&(D.timing=!0,D.elapsedTime=D.elapsedTime||0);function Le(){if(z(D.body)&&(D.body=u.from(D.body)),!D.hasHeader("content-length")){var Lt;typeof D.body=="string"?Lt=u.byteLength(D.body):Array.isArray(D.body)?Lt=D.body.reduce(function(xe,X){return xe+X.length},0):Lt=D.body.length,Lt?D.setHeader("content-length",Lt):D.emit("error",new Error("Argument error, options.body."))}}D.body&&!$(D.body)&&Le(),L.oauth?D.oauth(L.oauth):D._oauth.params&&D.hasHeader("authorization")&&D.oauth(D._oauth.params);var Oe=D.proxy&&!D.tunnel?D.proxy.protocol:D.uri.protocol,$t={"http:":t,"https:":n},dt=D.httpModules||{};if(D.httpModule=dt[Oe]||$t[Oe],!D.httpModule)return D.emit("error",new Error("Invalid protocol: "+Oe));if(L.ca&&(D.ca=L.ca),!D.agent)if(L.agentOptions&&(D.agentOptions=L.agentOptions),L.agentClass)D.agentClass=L.agentClass;else if(L.forever){var gt=w();gt.major===0&>.minor<=10?D.agentClass=Oe==="http:"?j:j.SSL:(D.agentClass=D.httpModule.Agent,D.agentOptions=D.agentOptions||{},D.agentOptions.keepAlive=!0)}else D.agentClass=D.httpModule.Agent;D.pool===!1?D.agent=!1:D.agent=D.agent||D.getNewAgent(),D.on("pipe",function(Lt){if(D.ntick&&D._started&&D.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),D.src=Lt,b(Lt))D.hasHeader("content-type")||D.setHeader("content-type",B.lookup(Lt.path));else{if(Lt.headers)for(var xe in Lt.headers)D.hasHeader(xe)||D.setHeader(xe,Lt.headers[xe]);D._json&&!D.hasHeader("content-type")&&D.setHeader("content-type","application/json"),Lt.method&&!D.explicitMethod&&(D.method=Lt.method)}}),c(function(){if(!D._aborted){var Lt=function(){if(D._form&&(D._auth.hasAuth?D._auth.hasAuth&&D._auth.sentAuth&&D._form.pipe(D):D._form.pipe(D)),D._multipart&&D._multipart.chunked&&D._multipart.body.pipe(D),D.body)$(D.body)?D.body.pipe(D):(Le(),Array.isArray(D.body)?D.body.forEach(function(xe){D.write(xe)}):D.write(D.body),D.end());else if(D.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),D.requestBodyStream.pipe(D);else if(!D.src){if(D._auth.hasAuth&&!D._auth.sentAuth){D.end();return}D.method!=="GET"&&typeof D.method<"u"&&D.setHeader("content-length",0),D.end()}};D._form&&!D.hasHeader("content-length")?(D.setHeader(D._form.getHeaders(),!0),D._form.getLength(function(xe,X){!xe&&!isNaN(X)&&D.setHeader("content-length",X),Lt()})):Lt(),D.ntick=!0}})},Y.prototype.getNewAgent=function(){var L=this,D=L.agentClass,ee={};if(L.agentOptions)for(var oe in L.agentOptions)ee[oe]=L.agentOptions[oe];L.ca&&(ee.ca=L.ca),L.ciphers&&(ee.ciphers=L.ciphers),L.secureProtocol&&(ee.secureProtocol=L.secureProtocol),L.secureOptions&&(ee.secureOptions=L.secureOptions),typeof L.rejectUnauthorized<"u"&&(ee.rejectUnauthorized=L.rejectUnauthorized),L.cert&&L.key&&(ee.key=L.key,ee.cert=L.cert),L.pfx&&(ee.pfx=L.pfx),L.passphrase&&(ee.passphrase=L.passphrase);var fe="";D!==L.httpModule.Agent&&(fe+=D.name);var ue=L.proxy;typeof ue=="string"&&(ue=l.parse(ue));var qe=ue&&ue.protocol==="https:"||this.uri.protocol==="https:";return qe&&(ee.ca&&(fe&&(fe+=":"),fe+=ee.ca),typeof ee.rejectUnauthorized<"u"&&(fe&&(fe+=":"),fe+=ee.rejectUnauthorized),ee.cert&&(fe&&(fe+=":"),fe+=ee.cert.toString("ascii")+ee.key.toString("ascii")),ee.pfx&&(fe&&(fe+=":"),fe+=ee.pfx.toString("ascii")),ee.ciphers&&(fe&&(fe+=":"),fe+=ee.ciphers),ee.secureProtocol&&(fe&&(fe+=":"),fe+=ee.secureProtocol),ee.secureOptions&&(fe&&(fe+=":"),fe+=ee.secureOptions)),L.pool===o&&!fe&&Object.keys(ee).length===0&&L.httpModule.globalAgent?L.httpModule.globalAgent:(fe=L.uri.protocol+fe,L.pool[fe]||(L.pool[fe]=new D(ee),L.pool.maxSockets&&(L.pool[fe].maxSockets=L.pool.maxSockets)),L.pool[fe])},Y.prototype.start=function(){var L=this;if(L.timing)var D=new Date().getTime(),ee=T();if(!L._aborted){L._started=!0,L.method=L.method||"GET",L.href=L.uri.href,L.src&&L.src.stat&&L.src.stat.size&&!L.hasHeader("content-length")&&L.setHeader("content-length",L.src.stat.size),L._aws&&L.aws(L._aws,!0);var oe=y(L);delete oe.auth,Z("make request",L.uri.href),delete oe.timeout;try{L.req=L.httpModule.request(oe)}catch(ue){L.emit("error",ue);return}L.timing&&(L.startTime=D,L.startTimeNow=ee,L.timings={});var fe;L.timeout&&!L.timeoutTimer&&(L.timeout<0?fe=0:typeof L.timeout=="number"&&isFinite(L.timeout)&&(fe=L.timeout)),L.req.on("response",L.onRequestResponse.bind(L)),L.req.on("error",L.onRequestError.bind(L)),L.req.on("drain",function(){L.emit("drain")}),L.req.on("socket",function(ue){var qe=ue._connecting||ue.connecting;if(L.timing&&(L.timings.socket=T()-L.startTimeNow,qe)){var rt=function(){L.timings.lookup=T()-L.startTimeNow},Ve=function(){L.timings.connect=T()-L.startTimeNow};ue.once("lookup",rt),ue.once("connect",Ve),L.req.once("error",function(){ue.removeListener("lookup",rt),ue.removeListener("connect",Ve)})}var et=function(){L.req.setTimeout(fe,function(){if(L.req){L.abort();var Ye=new Error("ESOCKETTIMEDOUT");Ye.code="ESOCKETTIMEDOUT",Ye.connect=!1,L.emit("error",Ye)}})};if(fe!==void 0)if(qe){var mt=function(){ue.removeListener("connect",mt),L.clearTimeout(),et()};ue.on("connect",mt),L.req.on("error",function(Ye){ue.removeListener("connect",mt)}),L.timeoutTimer=setTimeout(function(){ue.removeListener("connect",mt),L.abort();var Ye=new Error("ETIMEDOUT");Ye.code="ETIMEDOUT",Ye.connect=!0,L.emit("error",Ye)},fe)}else et();L.emit("socket",ue)}),L.emit("request",L.req)}},Y.prototype.onRequestError=function(L){var D=this;if(!D._aborted){if(D.req&&D.req._reusedSocket&&L.code==="ECONNRESET"&&D.agent.addRequestNoreuse){D.agent={addRequest:D.agent.addRequestNoreuse.bind(D.agent)},D.start(),D.req.end();return}D.clearTimeout(),D.emit("error",L)}},Y.prototype.onRequestResponse=function(L){var D=this;if(D.timing&&(D.timings.response=T()-D.startTimeNow),Z("onRequestResponse",D.uri.href,L.statusCode,L.headers),L.on("end",function(){D.timing&&(D.timings.end=T()-D.startTimeNow,L.timingStart=D.startTime,D.timings.socket||(D.timings.socket=0),D.timings.lookup||(D.timings.lookup=D.timings.socket),D.timings.connect||(D.timings.connect=D.timings.lookup),D.timings.response||(D.timings.response=D.timings.connect),Z("elapsed time",D.timings.end),D.elapsedTime+=Math.round(D.timings.end),L.elapsedTime=D.elapsedTime,L.timings=D.timings,L.timingPhases={wait:D.timings.socket,dns:D.timings.lookup-D.timings.socket,tcp:D.timings.connect-D.timings.lookup,firstByte:D.timings.response-D.timings.connect,download:D.timings.end-D.timings.response,total:D.timings.end}),Z("response end",D.uri.href,L.statusCode,L.headers)}),D._aborted){Z("aborted",D.uri.href),L.resume();return}if(D.response=L,L.request=D,L.toJSON=H,D.httpModule===n&&D.strictSSL&&(!L.hasOwnProperty("socket")||!L.socket.authorized)){Z("strict ssl error",D.uri.href);var ee=L.hasOwnProperty("socket")?L.socket.authorizationError:D.uri.href+" does not support SSL";D.emit("error",new Error("SSL Error: "+ee));return}D.originalHost=D.getHeader("host"),D.originalHostHeaderName||(D.originalHostHeaderName=D.hasHeader("host")),D.setHost&&D.removeHeader("host"),D.clearTimeout();var oe=D._jar&&D._jar.setCookie?D._jar:v,fe=function(mt){try{oe.setCookie(mt,D.uri.href,{ignoreError:!0})}catch(Ye){D.emit("error",Ye)}};if(L.caseless=M(L.headers),L.caseless.has("set-cookie")&&!D._disableCookies){var ue=L.caseless.has("set-cookie");Array.isArray(L.headers[ue])?L.headers[ue].forEach(fe):fe(L.headers[ue])}if(!D._redirect.onResponse(L)){{L.on("close",function(){D._ended||D.response.emit("end")}),L.once("end",function(){D._ended=!0});var qe=function(mt){return D.method==="HEAD"||mt>=100&&mt<200||mt===204||mt===304},rt;if(D.gzip&&!qe(L.statusCode)){var Ve=L.headers["content-encoding"]||"identity";Ve=Ve.trim().toLowerCase();var et={flush:h.Z_SYNC_FLUSH,finishFlush:h.Z_SYNC_FLUSH};Ve==="gzip"?(rt=h.createGunzip(et),L.pipe(rt)):Ve==="deflate"?(rt=h.createInflate(et),L.pipe(rt)):(Ve!=="identity"&&Z("ignoring unrecognized Content-Encoding "+Ve),rt=L)}else rt=L;D.encoding&&(D.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):rt.setEncoding(D.encoding)),D._paused&&rt.pause(),D.responseContent=rt,D.emit("response",L),D.dests.forEach(function(mt){D.pipeDest(mt)}),rt.on("data",function(mt){D.timing&&!D.responseStarted&&(D.responseStartTime=new Date().getTime(),L.responseStartTime=D.responseStartTime),D._destdata=!0,D.emit("data",mt)}),rt.once("end",function(mt){D.emit("end",mt)}),rt.on("error",function(mt){D.emit("error",mt)}),rt.on("close",function(){D.emit("close")}),D.callback?D.readResponseBody(L):D.on("end",function(){if(D._aborted){Z("aborted",D.uri.href);return}D.emit("complete",L)})}Z("finish init function",D.uri.href)}},Y.prototype.readResponseBody=function(L){var D=this;Z("reading response's body");var ee=[],oe=0,fe=[];D.on("data",function(ue){u.isBuffer(ue)?ue.length&&(oe+=ue.length,ee.push(ue)):fe.push(ue)}),D.on("end",function(){if(Z("end event",D.uri.href),D._aborted){Z("aborted",D.uri.href),ee=[],oe=0;return}if(oe?(Z("has body",D.uri.href,oe),L.body=u.concat(ee,oe),D.encoding!==null&&(L.body=L.body.toString(D.encoding)),ee=[],oe=0):fe.length&&(D.encoding==="utf8"&&fe[0].length>0&&fe[0][0]==="\uFEFF"&&(fe[0]=fe[0].substring(1)),L.body=fe.join("")),D._json)try{L.body=JSON.parse(L.body,D._jsonReviver)}catch{Z("invalid JSON received",D.uri.href)}Z("emitting complete",D.uri.href),typeof L.body>"u"&&!D._json&&(L.body=D.encoding===null?u.alloc(0):""),D.emit("complete",L,L.body)})},Y.prototype.abort=function(){var L=this;L._aborted=!0,L.req?L.req.abort():L.response&&L.response.destroy(),L.clearTimeout(),L.emit("abort")},Y.prototype.pipeDest=function(L){var D=this,ee=D.response;if(L.headers&&!L.headersSent){if(ee.caseless.has("content-type")){var oe=ee.caseless.has("content-type");L.setHeader?L.setHeader(oe,ee.headers[oe]):L.headers[oe]=ee.headers[oe]}if(ee.caseless.has("content-length")){var fe=ee.caseless.has("content-length");L.setHeader?L.setHeader(fe,ee.headers[fe]):L.headers[fe]=ee.headers[fe]}}if(L.setHeader&&!L.headersSent){for(var ue in ee.headers)(!D.gzip||ue!=="content-encoding")&&L.setHeader(ue,ee.headers[ue]);L.statusCode=ee.statusCode}D.pipefilter&&D.pipefilter(ee,L)},Y.prototype.qs=function(L,D){var ee=this,oe;!D&&ee.uri.query?oe=ee._qs.parse(ee.uri.query):oe={};for(var fe in L)oe[fe]=L[fe];var ue=ee._qs.stringify(oe);return ue===""||(ee.uri=l.parse(ee.uri.href.split("?")[0]+"?"+ue),ee.url=ee.uri,ee.path=ee.uri.path,ee.uri.host==="unix"&&ee.enableUnixSocket()),ee},Y.prototype.form=function(L){var D=this;return L?(/^application\/x-www-form-urlencoded\b/.test(D.getHeader("content-type"))||D.setHeader("content-type","application/x-www-form-urlencoded"),D.body=typeof L=="string"?D._qs.rfc3986(L.toString("utf8")):D._qs.stringify(L).toString("utf8"),D):(D._form=new I,D._form.on("error",function(ee){ee.message="form-data: "+ee.message,D.emit("error",ee),D.abort()}),D._form)},Y.prototype.multipart=function(L){var D=this;return D._multipart.onRequest(L),D._multipart.chunked||(D.body=D._multipart.body),D},Y.prototype.json=function(L){var D=this;return D.hasHeader("accept")||D.setHeader("accept","application/json"),typeof D.jsonReplacer=="function"&&(D._jsonReplacer=D.jsonReplacer),D._json=!0,typeof L=="boolean"?D.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(D.getHeader("content-type"))?D.body=D._qs.rfc3986(D.body):D.body=p(D.body,D._jsonReplacer),D.hasHeader("content-type")||D.setHeader("content-type","application/json")):(D.body=p(L,D._jsonReplacer),D.hasHeader("content-type")||D.setHeader("content-type","application/json")),typeof D.jsonReviver=="function"&&(D._jsonReviver=D.jsonReviver),D},Y.prototype.getHeader=function(L,D){var ee=this,oe,fe,ue;return D||(D=ee.headers),Object.keys(D).forEach(function(qe){qe.length===L.length&&(fe=new RegExp(L,"i"),ue=qe.match(fe),ue&&(oe=D[qe]))}),oe},Y.prototype.enableUnixSocket=function(){var L=this.uri.path.split(":"),D=L[0],ee=L[1];this.socketPath=D,this.uri.pathname=ee,this.uri.path=ee,this.uri.host=D,this.uri.hostname=D,this.uri.isUnix=!0},Y.prototype.auth=function(L,D,ee,oe){var fe=this;return fe._auth.onRequest(L,D,ee,oe),fe},Y.prototype.aws=function(L,D){var ee=this;if(!D)return ee._aws=L,ee;if(L.sign_version===4||L.sign_version==="4"){var oe={host:ee.uri.host,path:ee.uri.path,method:ee.method,headers:ee.headers,body:ee.body};L.service&&(oe.service=L.service);var fe=k.sign(oe,{accessKeyId:L.key,secretAccessKey:L.secret,sessionToken:L.session});ee.setHeader("authorization",fe.headers.Authorization),ee.setHeader("x-amz-date",fe.headers["X-Amz-Date"]),fe.headers["X-Amz-Security-Token"]&&ee.setHeader("x-amz-security-token",fe.headers["X-Amz-Security-Token"])}else{var ue=new Date;ee.setHeader("date",ue.toUTCString());var qe={key:L.key,secret:L.secret,verb:ee.method.toUpperCase(),date:ue,contentType:ee.getHeader("content-type")||"",md5:ee.getHeader("content-md5")||"",amazonHeaders:S.canonicalizeHeaders(ee.headers)},rt=ee.uri.path;L.bucket&&rt?qe.resource="/"+L.bucket+rt:L.bucket&&!rt?qe.resource="/"+L.bucket:!L.bucket&&rt?qe.resource=rt:!L.bucket&&!rt&&(qe.resource="/"),qe.resource=S.canonicalizeResource(qe.resource),ee.setHeader("authorization",S.authorization(qe))}return ee},Y.prototype.httpSignature=function(L){var D=this;return A.signRequest({getHeader:function(ee){return D.getHeader(ee,D.headers)},setHeader:function(ee,oe){D.setHeader(ee,oe)},method:D.method,path:D.path},L),Z("httpSignature authorization",D.getHeader("authorization")),D},Y.prototype.hawk=function(L){var D=this;D.setHeader("Authorization",Q.header(D.uri,D.method,L))},Y.prototype.oauth=function(L){var D=this;return D._oauth.onRequest(L),D},Y.prototype.jar=function(L){var D=this,ee;if(D._redirect.redirectsFollowed===0&&(D.originalCookieHeader=D.getHeader("cookie")),!L)ee=!1,D._disableCookies=!0;else{var oe=L.getCookieString?L:v,fe=D.uri.href;oe&&(ee=oe.getCookieString(fe))}return ee&&ee.length&&(D.originalCookieHeader?D.setHeader("cookie",D.originalCookieHeader+"; "+ee):D.setHeader("cookie",ee)),D._jar=L,D},Y.prototype.pipe=function(L,D){var ee=this;if(ee.response)if(ee._destdata)ee.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(ee._ended)ee.emit("error",new Error("You cannot pipe after the response has been ended."));else return m.Stream.prototype.pipe.call(ee,L,D),ee.pipeDest(L),L;else return ee.dests.push(L),m.Stream.prototype.pipe.call(ee,L,D),L},Y.prototype.write=function(){var L=this;if(!L._aborted&&(L._started||L.start(),L.req))return L.req.write.apply(L.req,arguments)},Y.prototype.end=function(L){var D=this;D._aborted||(L&&D.write(L),D._started||D.start(),D.req&&D.req.end())},Y.prototype.pause=function(){var L=this;L.responseContent?L.responseContent.pause.apply(L.responseContent,arguments):L._paused=!0},Y.prototype.resume=function(){var L=this;L.responseContent?L.responseContent.resume.apply(L.responseContent,arguments):L._paused=!1},Y.prototype.destroy=function(){var L=this;this.clearTimeout(),L._ended?L.response&&L.response.destroy():L.end()},Y.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},Y.defaultProxyHeaderWhiteList=ke.defaultProxyHeaderWhiteList.slice(),Y.defaultProxyHeaderExclusiveList=ke.defaultProxyHeaderExclusiveList.slice(),Y.prototype.toJSON=R,request$2=Y,request$2}var extend=extend$1,cookies=cookies$1,helpers=helpers$1,paramsHaveRequestBody=helpers.paramsHaveRequestBody;function initParams(t,n,l){typeof n=="function"&&(l=n);var d={};return n!==null&&typeof n=="object"?extend(d,n,{uri:t}):typeof t=="string"?extend(d,{uri:t}):extend(d,t),d.callback=l||d.callback,d}function request$1(t,n,l){if(typeof t>"u")throw new Error("undefined is not a valid uri or options object.");var d=initParams(t,n,l);if(d.method==="HEAD"&¶msHaveRequestBody(d))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new request$1.Request(d)}function verbFunc(t){var n=t.toUpperCase();return function(l,d,m){var h=initParams(l,d,m);return h.method=n,request$1(h,h.callback)}}request$1.get=verbFunc("get"),request$1.head=verbFunc("head"),request$1.options=verbFunc("options"),request$1.post=verbFunc("post"),request$1.put=verbFunc("put"),request$1.patch=verbFunc("patch"),request$1.del=verbFunc("delete"),request$1.delete=verbFunc("delete"),request$1.jar=function(t){return cookies.jar(t)},request$1.cookie=function(t){return cookies.parse(t)};function wrapRequestMethod(t,n,l,d){return function(m,h,S){var k=initParams(m,h,S),A={};return extend(!0,A,n,k),A.pool=k.pool||n.pool,d&&(A.method=d.toUpperCase()),typeof l=="function"&&(t=l),t(A,A.callback)}}request$1.defaults=function(t,n){var l=this;t=t||{},typeof t=="function"&&(n=t,t={});var d=wrapRequestMethod(l,t,n),m=["get","head","post","put","patch","del","delete"];return m.forEach(function(h){d[h]=wrapRequestMethod(l[h],t,n,h)}),d.cookie=wrapRequestMethod(l.cookie,t,n),d.jar=l.jar,d.defaults=l.defaults,d},request$1.forever=function(t,n){var l={};return n&&extend(l,n),t&&(l.agentOptions=t),l.forever=!0,request$1.defaults(l)};var request_1=request$1;request$1.Request=requireRequest(),request$1.initParams=initParams,Object.defineProperty(request$1,"debug",{enumerable:!0,get:function(){return request$1.Request.debug},set:function(t){request$1.Request.debug=t}});var sha1$1={exports:{}},crypt={exports:{}};(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(l,d){return l<<d|l>>>32-d},rotr:function(l,d){return l<<32-d|l>>>d},endian:function(l){if(l.constructor==Number)return n.rotl(l,8)&16711935|n.rotl(l,24)&4278255360;for(var d=0;d<l.length;d++)l[d]=n.endian(l[d]);return l},randomBytes:function(l){for(var d=[];l>0;l--)d.push(Math.floor(Math.random()*256));return d},bytesToWords:function(l){for(var d=[],m=0,h=0;m<l.length;m++,h+=8)d[h>>>5]|=l[m]<<24-h%32;return d},wordsToBytes:function(l){for(var d=[],m=0;m<l.length*32;m+=8)d.push(l[m>>>5]>>>24-m%32&255);return d},bytesToHex:function(l){for(var d=[],m=0;m<l.length;m++)d.push((l[m]>>>4).toString(16)),d.push((l[m]&15).toString(16));return d.join("")},hexToBytes:function(l){for(var d=[],m=0;m<l.length;m+=2)d.push(parseInt(l.substr(m,2),16));return d},bytesToBase64:function(l){for(var d=[],m=0;m<l.length;m+=3)for(var h=l[m]<<16|l[m+1]<<8|l[m+2],S=0;S<4;S++)m*8+S*6<=l.length*8?d.push(t.charAt(h>>>6*(3-S)&63)):d.push("=");return d.join("")},base64ToBytes:function(l){l=l.replace(/[^A-Z0-9+\/]/ig,"");for(var d=[],m=0,h=0;m<l.length;h=++m%4)h!=0&&d.push((t.indexOf(l.charAt(m-1))&Math.pow(2,-2*h+8)-1)<<h*2|t.indexOf(l.charAt(m))>>>6-h*2);return d}};crypt.exports=n})();var cryptExports=crypt.exports,charenc={utf8:{stringToBytes:function(t){return charenc.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(charenc.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],l=0;l<t.length;l++)n.push(t.charCodeAt(l)&255);return n},bytesToString:function(t){for(var n=[],l=0;l<t.length;l++)n.push(String.fromCharCode(t[l]));return n.join("")}}},charenc_1=charenc;(function(){var t=cryptExports,n=charenc_1.utf8,l=charenc_1.bin,d=function(h){h.constructor==String?h=n.stringToBytes(h):typeof Buffer$C<"u"&&typeof Buffer$C.isBuffer=="function"&&Buffer$C.isBuffer(h)?h=Array.prototype.slice.call(h,0):Array.isArray(h)||(h=h.toString());var S=t.bytesToWords(h),k=h.length*8,A=[],B=1732584193,M=-271733879,j=-1732584194,I=271733878,P=-1009589776;S[k>>5]|=128<<24-k%32,S[(k+64>>>9<<4)+15]=k;for(var $=0;$<S.length;$+=16){for(var z=B,N=M,F=j,U=I,J=P,te=0;te<80;te++){if(te<16)A[te]=S[$+te];else{var se=A[te-3]^A[te-8]^A[te-14]^A[te-16];A[te]=se<<1|se>>>31}var de=(B<<5|B>>>27)+P+(A[te]>>>0)+(te<20?(M&j|~M&I)+1518500249:te<40?(M^j^I)+1859775393:te<60?(M&j|M&I|j&I)-1894007588:(M^j^I)-899497514);P=I,I=j,j=M<<30|M>>>2,M=B,B=de}B+=z,M+=N,j+=F,I+=U,P+=J}return[B,M,j,I,P]},m=function(h,S){var k=t.wordsToBytes(d(h));return S&&S.asBytes?k:S&&S.asString?l.bytesToString(k):t.bytesToHex(k)};m._blocksize=16,m._digestsize=20,sha1$1.exports=m})();var sha1Exports=sha1$1.exports,php2js$1={rawurlencode:function(t){return t=(t+"").toString(),encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/\+/g," ")},http_build_query:function(t,n,l){var d,m,h=[],S=function(A,B,M){var j,I=[];if(B===!0?B="1":B===!1&&(B="0"),B!=null)if(typeof B=="object"){for(j in B)B[j]!=null&&I.push(S(A+"["+j+"]",B[j],M));return I.join(M)}else{if(typeof B!="function")return php2js$1.urlencode(A)+"="+php2js$1.urlencode(B);throw new Error("There was an error processing for http_build_query().")}else return""};l||(l="&");for(m in t){d=t[m],n&&!isNaN(m)&&(m=String(n)+m);var k=S(m,d,l);k!==""&&h.push(k)}return h.join(l)},urlencode:function(t){return t=(t+"").toString(),encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}},php2js_1=php2js$1,request=request_1,sha1=sha1Exports,php2js=php2js_1,APIConfig={url:"http://api.jwplatform.com/v1/videos/create",key:"",secret:"",format:"json",kit:"php-1.4"},jwplayer$1={makeRequest:function(t,n){request({url:t,method:"GET",headers:{"Content-Type":"MyContentType","Custom-Header":"Custom Value"}},n)},setArguments:function(t,n){t.api_nonce=Math.floor(Math.random()*1e8),t.api_timestamp=Math.floor(Date.now()/1e3),t.api_key=APIConfig.key,t.api_format=APIConfig.format,t.api_kit=APIConfig.kit;var l={};Object.keys(t).sort().forEach(function(h){l[h]=t[h]});var d="";Object.keys(l).forEach(function(h){d!=""&&(d+="&"),d+=php2js.rawurlencode(h)+"="+php2js.rawurlencode(l[h])}),t.api_signature=sha1(d+APIConfig.secret);var m=APIConfig.url+"?"+php2js.http_build_query(t,"","&");jwplayer$1.makeRequest(m,n)}},jwplayer_1=jwplayer$1;const JwpPlayerWidget=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l={},d=jwplayer_1.Player(this.$[0]),m=!1,h=!0;typeof this.video>"u"&&(this.video=this.media.video),l.file=this.video,l.primary="flash",l.fallback=!1,l.controls=!1,l.width=this.width,this.height&&(l.height=this.height),this.autostart,this.url_transform&&(l.file=this.url_transform(l.file));var S=this.media;S.on("setcurrenttime",function(A){m=h,d.seek(A/1e3)}),S.on("setvolume",function(A){d.setVolume(Math.floor(A*100)),S.volume=A}),S.on("setmuted",function(A){d.setMute(A),S.muted=A}),S.on("setplay",function(){d.play(!0),S.paused=!1}),S.on("setpause",function(){d.pause(!0),S.paused=!0});function k(){S.muted=d.getMute(),S.volume=d.getVolume()/100}l.events={onReady:function(){k(),S.currentTime=new t.Model.Time(1e3*d.getPosition()||0),S.trigger("loadedmetadata")},onTime:function(A){m?(d.pause(!0),m=!1):h&&d.getState()==="PLAYING"&&(h=!1,S.trigger("play")),S.trigger("timeupdate",new t.Model.Time(A.position*1e3))},onPlay:function(){m||(h=!1,S.trigger("play"))},onPause:function(){h=!0,S.trigger("pause")},onSeek:function(){S.trigger("seeked")},onMute:function(A){S.muted=A.mute,S.trigger("volumechange")},onVolume:function(A){S.volume=A.volume/100,S.trigger("volumechange")}},d=d.setup(l),this.jwplayer=d}},Cr(n,"defaults",{}),n},latestAnnotationStyles={},LatestAnnotation=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}importUsers(){if(!this.source.users_data){this.usernames=Array();var l=this,d=this.getWidgetAnnotations(),m="";return d.forEach(function(h){l.usernames.indexOf(h.creator)==-1&&l.usernames.push(h.creator)}),this.usernames.forEach(function(h){m+=h+","}),m=m.substring(0,m.length-1),_url=mustache.render(this.api_users_endpoint,{usernames_list_string:encodeURIComponent(m),usernames_list_length:this.usernames.length}),jQuery.ajax({async:!1,url:_url,type:"GET",success:function(h){l.source.users_data=h.objects},error:function(h,S,k){console.log(h),console.log(S),console.log(k)}})}}draw(){var l=this;this.renderTemplate(),this.annotationContainer_$=this.$.find(".Ldt-LatestAnnotation"),this.selectable_annotations&&(this.onMdpEvent("AnnotationsList.refresh",function(){l.getWidgetAnnotations().forEach(function(d){d.off("click"),d.on("click",function(){var m={},h="",S=this.source.users_data.filter(function(k){return k.username==d.creator});S.length==0?m.username=d.creator:m=S[0],h=l.make_name_string_function(m),_html=mustache.render(l.annotationTemplate,{annotation_created:d.created.toLocaleDateString()+", "+d.created.toLocaleTimeString(),annotation_creator:h,annotation_title:d.title,annotation_content:d.description,copy_and_edit_button:l.copy_and_edit_button,button_text:l.l10n.copy_and_edit}),l.annotationContainer_$.html(_html),l.selectedAnnotation=!0})})}),this.segments=l.source.getAnnotationsByTypeTitle(this.segments_annotation_type),this.segments.forEach(function(d){d.on("click",function(){l.selectedAnnotation=!1})}),this.currentSegment=!1),this.onMediaEvent("timeupdate",function(){l.refresh()}),this.onMediaEvent("settimerange",function(d){l.refresh(d)}),this.starts_hidden?(this.visible=!0,this.hide()):(this.visible=!1,this.show()),this.selectedAnnotation=!1,this.player.trigger("AnnotationsList.refresh"),this.refresh()}refresh(l){l=typeof l<"u"?l:!1;var d=this;if(this.hide_without_segment){if(!l&&!this.media.getTimeRange()){var m=this.media.getCurrentTime(),h=this.segments.filter(function($){return m>=$.begin&&m<=$.end});h.length==0?(this.currentSegment=!1,this.selectedAnnotation=!1):this.currentSegment=h[0]}else{var S=l?l[0]:this.media.getTimeRange()[0],k=l?l[1]:this.media.getTimeRange()[1];if(!this.currentSegment||this.currentSegment.begin!=S||this.currentSegment.end!=k){var h=this.segments.filter(function(z){return z.begin==S&&z.end==k});h.length>0&&(this.selectedAnnotation=!1,this.currentSegment=h[0])}}this.currentSegment?this.visible||this.show():this.visible&&this.hide()}if(this.visible&&!this.selectedAnnotation){var A=this.getWidgetAnnotations();this.filter_by_segment&&(this.currentSegment?A=A.filter(function($){return _annotationTime=($.begin+$.end)/2,d.currentSegment.begin<=_annotationTime&&d.currentSegment.end>=_annotationTime}):A=A.filter(function($){return!1})),A=A.sortBy(function($){return $.created});var B=!1,M="",j="",I={};if(A.length!=0)B=A.pop(),_users=this.source.users_data.filter(function($){return $.username==B.creator}),_users.length==0?I.username=B.creator:I=_users[0],j=this.make_name_string_function(I),M=mustache.render(this.annotationTemplate,{annotation_created:B.created.toLocaleDateString()+", "+B.created.toLocaleTimeString(),annotation_creator:j,annotation_title:B.title,annotation_content:B.description,copy_and_edit_button:this.copy_and_edit_button,button_text:this.l10n.copy_and_edit});else{var P=this.l10n.empty;this.empty_message&&(P=this.empty_message),M="<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-NoAnnotation'>"+P+"</div>"}this.annotationContainer_$.html(M)}this.copy_and_edit_button&&(this.copyAndEditButton_$=this.$.find(".Ldt-LatestAnnotation-CopyEditButton"),this.copyAndEditButton_$.click(this.functionWrapper("copy_and_edit")))}copy_and_edit(){this.player.trigger("CreateAnnotation.show"),this.hide_annotations_list&&this.player.trigger("AnnotationsList.hide"),annotationText=jQuery(".Ldt-LatestAnnotation-Content").get(0).innerHTML,jQuery(".Ldt-CreateAnnotation-Description").removeClass("empty"),jQuery(".Ldt-CreateAnnotation-Description").val(annotationText)}hide(){this.visible&&(this.visible=!1,this.$.find(".Ldt-LatestAnnotation-header").hide(),this.annotationContainer_$.hide())}show(){this.visible||(this.visible=!0,this.$.find(".Ldt-LatestAnnotation-header").show(),this.annotationContainer_$.show())}},Cr(n,"defaults",{pre_draw_callback:function(){return this.importUsers()},from_user:!1,filter_by_segment:!1,segments_annotation_type:"chap",hide_without_segment:!1,annotation_type:"contribution",show_only_annotation_from_user:!1,copy_and_edit_button:!1,hide_annotations_list:!1,selectable_annotations:!1,empty_message:!1,starts_hidden:!1,show_header:!1,custom_header:!1,make_name_string_function:function(l){return l.username?l.username:"Anonymous"}}),Cr(n,"messages",{fr:{copy_and_edit:"Copier et Editer",empty:"Aucune annotation à afficher",header:"Dernière annotation"},en:{copy_and_edit:"Copy and Edit",empty:"No annotation to display",header:"Last annotation"}}),Cr(n,"template","{{#show_header}}<p class='Ldt-LatestAnnotation-header'>{{#custom_header}}{{custom_header}}{{/custom_header}}{{^custom_header}}{{l10n.header}}{{/custom_header}}</p>{{/show_header}}<div class='Ldt-LatestAnnotation'></div>"),Cr(n,"annotationTemplate","<div class='Ldt-LatestAnnotation-Box'>{{#copy_and_edit_button}}<div class='Ldt-LatestAnnotation-CopyEditButton'>{{button_text}}</div>{{/copy_and_edit_button}}<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-CreationDate'>{{{annotation_created}}}</div><div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Title'>{{{annotation_creator}}}{{#annotation_title}}: {{{annotation_title}}}{{/annotation_title}}</div><div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Content'>{{{annotation_content}}}</div></div>"),n},mashupPlayerStyles={},MashupPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.is_mashup=!0}draw(){var l=this,d=this.media,m=null,h=null,S,k,A=0,B=!1,M,j,I=d.getMedias();d.paused=!this.autostart&&!this.autoplay;function P(){A>=d.duration&&(d.paused||(d.paused=!0,d.trigger("pause")),A=0);var F=d.getAnnotationAtTime(A);if(typeof F>"u"){m&&(m.pause(),d.paused||(d.paused=!0,d.trigger("pause")));return}if(F!==h){h=F,S=h.annotation.begin.milliseconds,k=h.annotation.end.milliseconds,j=S-h.begin.milliseconds,m=h.getMedia();for(var U=0;U<I.length;U++)I[U].id!==m.id?(l.split_screen||I[U].hide(),I[U].pause()):I[U].show();var J=[],te=d.getAnnotations().filter(function(se){return se.begin>=h.end&&se.getMedia()!==m});_$1(te).each(function(se){var de=se.getMedia();_$1(J).indexOf(de.id)===-1&&(J.push(de.id),de.setCurrentTime(se.annotation.begin.getSeconds()),de.seeking=!0)})}m.setCurrentTime(A+j),m.seeking=!0,d.paused||(m.play(),B=!0,M.show()),d.trigger("timeupdate",new t.Model.Time(A))}this.height||(this.height=Math.floor(this.width/this.aspect_ratio),this.$.css({height:this.height})),this.$.css({background:this.background});var $=Math.ceil(Math.sqrt(I.length)),z=this.split_screen?this.width/$:this.width,N=this.split_screen?this.height/$:this.height;_$1(I).each(function(F,U){var J=jQuery('<div class="Ldt-MashupPlayer-Media"><div class="Ldt-MashupPlayer-Subwidget"></div></div>');J.css({top:l.split_screen?N*Math.floor(U/$):0,left:l.split_screen?z*(U%$):0,height:N,width:z,display:l.split_screen?"block":"none"}),l.$.append(J),l.insertSubwidget(J.find(".Ldt-MashupPlayer-Subwidget"),_$1({type:l.player_type,media_id:F.id,height:N,width:z,url_transform:l.url_transform}).extend(l.player_options)),F.loadedMetadata=!1,F.show=function(){J.show()},F.hide=function(){J.hide()},F.on("loadedmetadata",function(){F.loadedMetadata=!0;for(var te=!0,se=0;se<I.length;se++)te=te&&I[se].loadedMetadata;te&&(M.fadeOut(),P(),d.trigger("loadedmetadata"))}),F.on("timeupdate",function(te){!d.paused&&F===m&&!F.seeking&&(te<k?te>=S?A=te-j:(A=S-j,F.setCurrentTime(S)):(A=k-j,F.pause(),P()),d.trigger("timeupdate",new t.Model.Time(A)))}),F.on("seeked",function(){F.seeking=!1,F===m&&B&&(B=!1,M.hide())}),F.on("play",function(){F===m&&d.trigger("play")}),F.on("pause",function(){F===m&&d.trigger("pause")}),F.on("volumechange",function(){d.muted=F.muted,d.volume=F.volume,d.trigger("volumechange")})}),M=jQuery('<div class="Ldt-MashupPlayer-Waiting"></div>'),this.$.append(M),d.on("setcurrenttime",function(F){A=F,P()}),d.on("setvolume",function(F){for(var U=0;U<I.length;U++)I[U].setVolume(F);d.volume=F}),d.on("setmuted",function(F){for(var U=0;U<I.length;U++)I[U].setMuted(F);d.muted=F}),d.on("setplay",function(){d.paused=!1,P()}),d.on("setpause",function(){d.paused=!0,m&&m.pause()}),d.on("loadedmetadata",P)}},Cr(n,"defaults",{aspect_ratio:14/9,split_screen:!1,player_type:"PopcornPlayer",background:"#000000"}),n},Mediafragment=function(t){return class extends t.Widgets.Widget{constructor(n,l){if(super(n,l),this.last_hash_key="",this.last_hash_value="",this.last_extra_key="",this.last_extra_value="",window.onhashchange=this.functionWrapper("goToHash"),typeof window.addEventListener<"u"){var d=this;window.addEventListener("message",function(m){/^#/.test(m.data)&&d.setWindowHash(m.data)})}this.onMdpEvent("Mediafragment.setHashToAnnotation","setHashToAnnotation"),this.blocked=!1}draw(){this.onMediaEvent("setpause","setHashToTime");var n=this;this.getWidgetAnnotations().forEach(function(l){l.on("click",function(){n.setHashToAnnotation(l)})}),this.media.loadedMetadata?this.goToHash():this.onMediaEvent("loadedmetadata","goToHash")}setWindowHash(n){typeof window.history<"u"&&typeof window.history.replaceState<"u"?window.history.replaceState({},"",n):document.location.hash=n}getLastHash(){var n=document.location.hash.replace(/^#/,"").split("&");return n=_$1(n).filter(function(l){return l&&!/^(id|t)=/.test(l)}),this.last_hash_key&&n.push(this.last_hash_key+"="+this.last_hash_value),this.last_extra_key&&n.push(this.last_extra_key+"="+this.last_extra_value),"#"+n.join("&")}goToHash(){if(document.location.hash!==this.getLastHash())for(var n=document.location.hash.replace(/^#/,"").split("&"),l=0;l<n.length;l++){var d=n[l].split("=");if(d[0]=="id"||d[0]=="t"){if(this.last_hash_key=d[0],this.last_hash_value=d[1],this.last_hash_key=="id"){var m=this.source.getElement(this.last_hash_value);if(typeof m<"u")this.media.setCurrentTime(m.begin);else continue}this.last_hash_key=="t"&&this.media.setCurrentTime(1e3*this.last_hash_value);break}}}setHashToAnnotation(n){this.setHash("id",n.id,"t",n.begin/1e3)}setHashToTime(){this.setHash("t",this.media.getCurrentTime().getSeconds())}setHash(n,l,d,m){if(!this.blocked&&(this.last_hash_key!==n||this.last_hash_value!==l)){this.last_hash_key=n,this.last_hash_value=l,this.last_extra_key=d,this.last_extra_value=m;var h=this.getLastHash();this.setWindowHash(h),window.parent!==window&&window.parent.postMessage(h,"*"),this.block()}}unblock(){typeof this.blockTimeout<"u"&&window.clearTimeout(this.blockTimeout),this.blockTimeout=void 0,this.blocked=!1}block(){typeof this.blockTimeout<"u"&&window.clearTimeout(this.blockTimeout),this.blocked=!0,this.blockTimeout=window.setTimeout(this.functionWrapper("unblock"),1500)}}},mediaListStyles={},MediaList=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastMedia=!1}onSearch(l){this.searchString=typeof l<"u"?l:"";var d=this.refresh(!0);this.searchString&&(d?this.player.trigger("search.matchFound"):this.player.trigger("search.noMatchFound"))}draw(){this.$.addClass("Ldt-MediaListWidget"),this.renderTemplate();var l=this;typeof this.media.getMedias=="function"&&this.media.on("enter-annotation",function(d){l.redraw(d.getMedia())}),this.redraw()}getSegments(l){var d=this,m=this.$.width()/l.duration.milliseconds;return this.getWidgetAnnotations().filter(function(h){return h.getMedia().id==l.id}).map(function(h){var S=h.type=h.annotation;return{left:m*S.begin,width:m*(S.end-S.begin),color:typeof S.color<"u"&&S.color?S.color:d.default_color}})}redraw(l){if(typeof l<"u"){this.$.find(".Ldt-MediaList-Other h2").html(this.l10n.other_media),this.$.find(".Ldt-MediaList-NowPlaying").show(),this.$.find(".Ldt-MediaList-Now-Thumbnail").attr("src",l.thumbnail||this.default_thumbnail),this.$.find(".Ldt-MediaList-Now-Title a").html(l.title),this.$.find(".Ldt-MediaList-Now-Description").html(l.description);var d=l.url||mustache.render(this.media_url_template,{media:l.id});this.$.find(".Ldt-MediaList-NowContainer a").attr("href",d);var m=mustache.render(this.mediaViewTemplate,{segments:this.getSegments(l)});this.$.find(".Ldt-MediaList-Now-MediaView").html(m)}else this.$.find(".Ldt-MediaList-Other h2").html(this.l10n.all_media),this.$.find(".Ldt-MediaList-NowPlaying").hide();var h=this,S=this.source.getMedias().filter(function(A){return A.id!==h.lastMedia});if(S.length){this.$.find(".Ldt-MediaList-Other").show();var k=S.map(function(A){return mustache.render(h.mediaTemplate,{thumbnail:A.thumbnail||h.default_thumbnail,url:A.url||mustache.render(h.media_url_template,{media:A.id}),title:A.title,description:A.description,segments:h.getSegments(A)})}).join("");this.$.find(".Ldt-MediaList-OtherList").html(k)}else this.$.find(".Ldt-MediaList-Other").hide()}},Cr(n,"messages",{fr:{now_playing:"Vidéo en cours",all_media:"Toutes les vidéos",other_media:"Autres vidéos"},en:{now_playing:"Now playing",all_media:"All videos",other_media:"Other videos"}}),Cr(n,"defaults",{default_thumbnail:"http://ldt.iri.centrepompidou.fr/static/site/ldt/css/imgs/video_sequence.png",media_url_template:"http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/",default_color:"#000080"}),Cr(n,"template",'<div class="Ldt-MediaList-NowPlaying"><h2>{{l10n.now_playing}}</h2><hr /><div class="Ldt-MediaList-NowContainer"><div class="Ldt-MediaList-Now-ThumbContainer"><a href="" target="_blank"><img class="Ldt-MediaList-Now-Thumbnail" src="" /></a></div><h3 class="Ldt-MediaList-Now-Title"><a href="" target="_blank"></a></h3><p class="Ldt-MediaList-Now-Description"></p><div class="Ldt-MediaList-Now-MediaView"></div></div></div><div class="Ldt-MediaList-Other"><h2></h2><hr /><ul class="Ldt-MediaList-OtherList"></ul></div>'),Cr(n,"mediaViewTemplate",'<div class="Ldt-MediaList-MediaView-Background"></div>{{#segments}}<div class="Ldt-MediaList-Segment" style="background: {{color}}; left: {{left}}px; width: {{width}}px;"></div>{{/segments}}'),Cr(n,"mediaTemplate",'<li class="Ldt-MediaList-OtherList-li"><div class="Ldt-MediaList-Other-ThumbContainer"><a href="{{url}}" target="_blank"><img class="Ldt-MediaList-Other-Thumbnail" src="{{thumbnail}}" /></a></div><h3 class="Ldt-MediaList-Other-Title"><a href="{{url}}" target="_blank">{{title}}</a></h3><p class="Ldt-MediaList-Other-Description">{{description}}</p><div class="Ldt-MediaList-Other-MediaView">'+MediaList.mediaViewTemplate+"</div></li>"),n},noteTakingStyles={},NoteTaking=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this,d,m=jQuery;l.renderTemplate(),d=l.$.find(".Ldt-NoteTaking-Text");function h(){m(d).val(window.localStorage[l.editable_storage])}function S(){window.localStorage[l.editable_storage]=m(d).val()}window.localStorage[l.editable_storage]&&h(),m.fn.insertAtCaret=function(A){return this.each(function(){if(this.selectionStart!==void 0){var B=this.selectionStart,M=this.selectionEnd,j=this.scrollTop;this.value=this.value.substring(0,B)+A+this.value.substring(M,this.value.length),this.focus(),this.selectionStart=B+A.length,this.selectionEnd=B+A.length,this.scrollTop=j}else this.value+=A,this.focus(),this.value=this.value})};function k(A,B){var M=A.selectionStart;return A.value.substring(M-B,M+B)}m(d).keydown(function(A){if(A.keyCode==13&&(A.ctrlKey||A.metaKey)){A.preventDefault();var B=/\[([\d:]+)\]/.exec(k(d[0],8));B?l.media.setCurrentTime(t.timestamp2ms(B[1])):(m(d).insertAtCaret("["+new t.Model.Time(l.media.getCurrentTime()).toString()+"]"),S())}}).on("input",function(A){console.log("Change"),S()}).on("dblclick",function(A){var B=/\[([\d:]+)\]/.exec(k(d[0],8));B&&(A.preventDefault(),l.media.setCurrentTime(t.timestamp2ms(B[1])))})}},Cr(n,"defaults",{editable_storage:""}),Cr(n,"template",'<textarea class="Ldt-NoteTaking-Text"></textarea>'),n},placeholderPlayerStyles={},PlaceholderPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate();var l=!0,d=0,m=new t.Model.Time(0),h=this.media,S=this.$.find(".Ldt-PlaceholderPlayer");function k(){l||(m=new t.Model.Time(new Date().valueOf()-d),m<=h.duration?(h.trigger("timeupdate",m),setTimeout(k,100)):(m=h.duration,h.pause())),S.text(m.toString(!0))}h.on("setcurrenttime",function(A){d=new Date().valueOf()-A,m=new t.Model.Time(A),h.trigger("seeked"),h.trigger("timeupdate",m),S.text(m.toString(!0))}),h.on("setplay",function(){l=!1,d=new Date().valueOf()-m,h.trigger("play"),k()}),h.on("setpause",function(){l=!0,h.trigger("pause"),k()}),h.trigger("loadedmetadata"),h.trigger("setcurrenttime",0),this.autostart&&h.trigger("setplay")}},Cr(n,"defaults",{autostart:!1}),Cr(n,"template",'<div class="Ldt-PlaceholderPlayer">(loading)</div>'),n},polemicStyles={},Polemic=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}getPolemics(l){return(typeof l>"u"||!l)&&(l=this.default_version),this.polemics.constructor===Array?this.polemics:this.polemics[l]}drawNoStackgraph(l,d){var m=this;if(this.is_stackgraph=!1,l){let S=function(k,A,F,M,j){var I=mustache.render('<div class="Ldt-Polemic-TweetDiv Ldt-TraceMe" trace-info="annotation-id:{{id}}, media-id:{{media_id}}, polemic:{{polemic}}, time:{{time}}" polemic-color="{{color}}" tweet-title="{{title}}" annotation-id="{{id}}" style="width: {{width}}px; height: {{height}}px; top: {{top}}px; left: {{left}}px; background: {{color}}"></div>',{id:j.id,media_id:m.source.currentMedia.id,polemic:F,left:k,top:A,color:M,width:m.element_width-1,height:m.element_height,title:j.title,time:j.begin.toString()}),P=jQuery(I);P.on("mouseover",function(){j.trigger("select")}).on("mouseout",function(){j.trigger("unselect")}).on("click",function(){return j.trigger("click"),!1}),t.attachDndData(P,{title:j.title,description:j.description,image:j.thumbnail,uri:typeof j.url<"u"?j.url:document.location.href.replace(/#.*$/,"")+"#id="+j.id,text:"["+j.begin.toString()+"] "+j.title});for(var $=[],z=j.content&&j.content.polemic_version||m.default_version,N=m.getPolemics(z)||[],F,U,J=0;J<N.length;J++)F=N[J],U=t.Model.regexpFromTextOrArray(F.keywords),U.test(j.description)&&$.push(F.color);j.on("select",function(){m.tooltip&&m.tooltip.show(+Math.floor(k+(m.element_width-1)/2),+A,j.title,$.length>1?$:M),m.$tweets.each(function(){var te=jQuery(this);te.css("opacity",te.attr("annotation-id")==j.id?1:.3)})}),j.on("unselect",function(){m.tooltip&&m.tooltip.hide(),m.$tweets.css("opacity",1)}),j.on("found",function(){P.css({background:m.foundcolor,opacity:1})}),j.on("not-found",function(){P.css({background:M,opacity:.3})}),m.$zone.append(P)};this.height=(2+l)*this.element_height,this.$zone.css({width:this.width+"px",height:this.height+"px",position:"relative"});var h=0;_$1(d).forEach(function(k){var A=m.height;k.annotations.forEach(function(B){A-=m.element_height,S(h,A,"none",m.defaultcolor,B)}),_$1(k.polemicStacks).forEach(function(B){var M=B.polemicDef.color,j=B.polemicDef.name;B.annotations.forEach(function(I){A-=m.element_height,S(h,A,j,M,I)})}),h+=m.element_width}),this.$tweets=this.$.find(".Ldt-Polemic-TweetDiv"),this.source.getAnnotations().on("search-cleared",function(){m.$tweets.each(function(){var k=jQuery(this);k.css({background:k.attr("polemic-color"),opacity:1})})})}else this.$zone.hide()}drawStackgraph(l,d){this.is_stackgraph=!0;var m=this;this.height=(2+this.max_elements)*this.element_height,this.$zone.css({width:this.width+"px",height:this.height+"px",position:"relative"});var h=0,S="",k=this.max_elements*this.element_height/l;function A(B,M,j,I,P,$,z,N){S+=mustache.render('<div class="Ldt-Polemic-TweetDiv Ldt-TraceMe" trace-info="annotation-block, media-id={{media_id}}, polemic={{polemic}}, time:{{begin}}" pos-x="{{posx}}" pos-y="{{top}}" annotation-counts="{{nums}}" begin-time="{{begin}}" end-time="{{end}}" style="width: {{width}}px; height: {{height}}px; top: {{top}}px; left: {{left}}px; background: {{color}}"></div>',{nums:P,posx:Math.floor(B+(m.element_width-1)/2),media_id:m.source.currentMedia.id,polemic:N,left:B,top:M,color:I,width:m.element_width-1,height:j,begin:$,end:z})}_$1(d).forEach(function(B){var M=m.height,j=B.annotations.length+"|"+m.defaultcolor+","+_$1(B.polemicStacks).map(function(P){return P.annotations.length+"|"+P.polemicDef.color}).join(",");if(B.annotations.length){var I=Math.ceil(k*B.annotations.length);M-=I,A(h,M,I,m.defaultcolor,j,B.begin,B.end,"none")}_$1(B.polemicStacks).forEach(function(P){if(P.annotations.length){var $=P.polemicDef.color,z=P.polemicDef.name,N=Math.ceil(k*P.annotations.length);M-=N,A(h,M,N,$,j,B.begin,B.end,z)}}),h+=m.element_width}),this.$zone.append(S),this.$tweets=this.$.find(".Ldt-Polemic-TweetDiv"),this.$tweets.mouseover(function(){var B=jQuery(this),M=B.attr("annotation-counts").split(","),j="<p>"+m.l10n.from_+B.attr("begin-time")+m.l10n._to_+B.attr("end-time")+"</p>";j=_$1.reduce(M,function(I,P){var $=P.split("|");return I+='<div class="Ldt-Tooltip-AltColor" style="background: '+$[1]+'"></div><p>'+$[0]+m.l10n._annotations+"</p>",I},j),m.tooltip&&m.tooltip.show(+B.attr("pos-x"),+B.attr("pos-y"),j)}).mouseout(function(){m.tooltip&&m.tooltip.hide()})}draw(){console.log("LDRAW PoLEMIC"),this.onMediaEvent("timeupdate","onTimeupdate"),this.$zone=jQuery("<div>"),this.$zone.addClass("Ldt-Polemic"),this.$.append(this.$zone),this.$elapsed=jQuery("<div>").css({background:"#cccccc",position:"absolute",top:0,left:0,width:0,height:"100%"}),this.$zone.append(this.$elapsed);for(var l=[],d=Math.floor(this.width/this.element_width),m=this.source.getDuration(),h=0,S=this.getWidgetAnnotations(),k=this,A=0;A<d;A++){var B=new t.Model.Time(A*m/d),M=new t.Model.Time((A+1)*m/d),j=0,I={begin:B.toString(),end:M.toString(),annotations:S.filter(function(P){return P.begin>=B&&P.begin<M}),polemicStacks:{}};I.annotations=I.annotations.filter(function(P){for(var $=P.content&&P.content.polemic_version||k.default_version,z=k.getPolemics($)||[],N,F,U,J,te=!0,se=0;se<z.length;se++)N=z[se],J=t.Model.regexpFromTextOrArray(N.keywords),J.test(P.description)&&(F=$+"_"+N.name,U=I.polemicStacks[F]||(I.polemicStacks[F]={polemicDef:N,annotations:[]}),U.annotations.push(P),te=!1,j++);return te}),j+=I.annotations.length,h=Math.max(h,j),l.push(I)}console.log("SLICES",l,S),h<this.max_elements?this.drawNoStackgraph(h,l):this.drawStackgraph(h,l),this.$position=jQuery("<div>").addClass("Ldt-Polemic-Position"),this.$zone.append(this.$position),this.$zone.on("click",function(P){var $=P.pageX-k.$zone.offset().left;k.media.setCurrentTime(k.media.duration*$/k.width)}),this.$.append('<div class="Ldt-Polemic-Tooltip"></div>'),this.insertSubwidget(this.$.find(".Ldt-Polemic-Tooltip"),{type:"Tooltip",min_x:0,max_x:this.width},"tooltip")}onTimeupdate(l){var d=Math.floor(this.width*l/this.media.duration);this.$elapsed.css({width:d+"px"}),this.$position.css({left:d+"px"})}},Cr(n,"messages",{fr:{from_:"de ",_to_:" à ",_annotations:" annotation(s)"},en:{from_:"from ",_to_:" to ",_annotations:" annotation(s)"}}),Cr(n,"defaults",{element_width:5,element_height:5,max_elements:20,annotation_type:"tweet",defaultcolor:"#585858",foundcolor:"#fc00ff",default_version:"1",polemics:{1:[{name:"OK",keywords:["++"],color:"#1D973D"},{name:"KO",keywords:["--"],color:"#CE0A15"},{name:"REF",keywords:["==","http://"],color:"#C5A62D"},{name:"Q",keywords:["?"],color:"#036AAE"}],2:[{name:"OK",keywords:["++"],color:"#1D973D"},{name:"KO",keywords:["!!"],color:"#CE0A15"},{name:"REF",keywords:["==","http://"],color:"#C5A62D"},{name:"Q",keywords:["?"],color:"#036AAE"}]}}),n},PopcornPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){typeof this.video>"u"&&(this.video=this.media.video),this.url_transform&&(this.video=this.url_transform(this.video));var l=this.video;if(/^(https?:\/\/)?(www\.)?youtube\.com/.test(this.video)){for(var d=this.video.split(/[?&]/),m={},h=1;h<d.length;h++){var S=d[h].split("=");m[S[0]]=decodeURIComponent(S[1])}m.controls=0,m.modestbranding=1,(this.autostart||this.autoplay)&&(m.autoplay=1),l=d[0]+"?"+jQuery.param(m)}var k=global$1.Popcorn.smart("#"+this.container,l);(this.autostart||this.autoplay)&&k.autoplay(!0);var A=this.media;A.on("setcurrenttime",function(M){k.currentTime(M/1e3)}),A.on("setvolume",function(M){k.volume(M),A.volume=M}),A.on("setmuted",function(M){k.muted(M),A.muted=M}),A.on("setplay",function(){k.play()}),A.on("setpause",function(){k.pause()}),A.on("settimerange",function(M){A.timeRange=M;try{(A.getCurrentTime()>M[0]||A.getCurrentTime()<M)&&k.currentTime(M[0]/1e3)}catch{}}),A.on("resettimerange",function(){A.timeRange=!1});function B(){A.muted=k.muted(),A.volume=k.volume()}k.on("loadedmetadata",function(){B(),A.trigger("loadedmetadata"),A.trigger("volumechange")}),k.on("timeupdate",function(){A.trigger("timeupdate",new t.Model.Time(1e3*k.currentTime()))}),k.on("volumechange",function(){B(),A.trigger("volumechange")}),k.on("play",function(M){A.trigger("play")}),k.on("pause",function(){A.trigger("pause")}),k.on("seeked",function(){A.trigger("seeked")})}},Cr(n,"defaults",{}),n},quizStyles={},Quiz=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}update(l){var d=this;if(this.quiz_activated&&this.correct[l.id]!=1&&this.correct[l.id]!=0){d.quiz_displayed=!0,this.media.pause(),this.annotation=l;var m=l.content.data.question,h=l.content.data.answers,S=l.content.data.resource;jQuery(".Ldt-Quiz-Votes").hide(),jQuery(".Ldt-Pause-Add-Question").hide(),jQuery(".Ldt-Quiz-Container .Ldt-Quiz-Title").html(m);var k=0,A=mustache.render('<span class="Ldt-Quiz-Correct-Answer">{{ correctness.0 }}</span> / <span class="Ldt-Quiz-Incorrect-Answer">{{ correctness.1 }}</span>',{correctness:this.globalScore()});jQuery(".Ldt-Quiz-Index").html(mustache.render("Q{{index}}/{{total}}",{index:l.number+1,total:this.totalAmount})),jQuery(".Ldt-Quiz-Score").html(A),this.question=new t.Widgets.UniqueChoiceQuestion(l),this.resource=new t.Widgets.UniqueChoiceQuestion(S),l.content.data.type=="multiple_choice"?(this.question=new t.Widgets.MultipleChoiceQuestion(l),this.resource=new t.Widgets.MultipleChoiceQuestion(S)):l.content.data.type=="unique_choice"&&(this.question=new t.Widgets.UniqueChoiceQuestion(l),this.resource=new t.Widgets.UniqueChoiceQuestion(S));var B="";for(k=0;k<h.length;k++)B+='<div class="quiz-question-block"><p>'+this.question.renderQuizTemplate(h[k],k)+'<span class="quiz-question-label">'+h[k].content+"</span></p></div>";var M="";S!=null&&(M='<div class="quiz-resource-block" id="resource" >'+S+"</div>"),jQuery(".Ldt-Quiz-Questions").html(M+B),jQuery(".Ldt-Quiz-Overlay").fadeIn(),jQuery(".Ldt-Quiz-Submit").fadeIn(),jQuery(".quiz-question-label").click(function(){var j=jQuery(this).siblings("input");j.prop("checked")&&j.prop("type")=="radio"?d.answer():j.prop("checked",!j.prop("checked"))}),jQuery(".Ldt-Quiz-Submit-Skip-Link").click({media:this.media},function(j){d.hide(),d.player.trigger("QuizCreator.skip"),j.data.media.play()})}}hide(){var l=this;jQuery(".Ldt-Quiz-Votes").hide(),jQuery(".Ldt-Quiz-Overlay").hide(),jQuery(".Ldt-Pause-Add-Question").hide(),l.quiz_displayed=!1}answer(){var l=this;function d(j){return(j||"").replace(/\s(\d+:\d+)/,function(I,P){return' <a href="#t='+t.timestamp2ms(P)/1e3+'">'+P+"</a>"})}var m=l.annotation.content.data.answers,h=0,S=0,k=[];l.$.find(".Ldt-Quiz-Question-Check").each(function(j){var I=jQuery(this).is(":checked");k.push(I?1:0);var P=m[h];P.correct&&!I||!P.correct&&I?(S+=1,jQuery(this).parents(".quiz-question-block").append('<div class="quiz-question-feedback quiz-question-incorrect-feedback">'+d(P.feedback)+"</div>")):jQuery(this).parents(".quiz-question-block").append('<div class="quiz-question-feedback quiz-question-correct-feedback">'+d(P.feedback)+"</div>"),h++}),S?(jQuery(".Ldt-Quiz-Result").html("Mauvaise réponse"),jQuery(".Ldt-Quiz-Result").css({"background-color":"red"}),this.correct[this.annotation.id]=0):(jQuery(".Ldt-Quiz-Result").html("Bonne réponse !"),jQuery(".Ldt-Quiz-Result").css({"background-color":"green"}),this.correct[this.annotation.id]=1),jQuery(".Ldt-Quiz-Result").animate({height:"100%"},500,"linear",function(){jQuery(".Ldt-Quiz-Result").delay(2e3).animate({height:"0%"},500)});var A=this.annotation.number+1,B=this.globalScore(),M="";M+='<span class="Ldt-Quiz-Correct-Answer">'+B[0]+'</span> / <span class="Ldt-Quiz-Incorrect-Answer">'+B[1]+"</span>",jQuery(".Ldt-Quiz-Index").html("Q"+A+"/"+this.totalAmount),jQuery(".Ldt-Quiz-Score").html(M),this.submit(this.user,this.userid,this.annotation.id,S?"wrong_answer":"right_answer",k.join("")),jQuery(".Ldt-Quiz-Submit").fadeOut(400,function(){jQuery(".Ldt-Quiz-Votes").show()})}globalScore(){var l=_.values(this.correct),d=l.filter(function(h){return h==1}).length,m=l.filter(function(h){return h==0}).length;return[d,m]}refresh(){var l=this.getWidgetAnnotations().sortBy(function(m){return m.begin}),d=this;d.totalAmount=l.length,d.number=0,d.correct={},d.keys={},l.forEach(function(m){d.correct[m.id]=-1,d.keys[d.number]=m.id,m.number=d.number++})}draw(){var l=this;l.quiz_displayed=!1,this.onMediaEvent("enter-annotation",function(d){var m=l.getWidgetAnnotations().filter(function(h){return h===d});m.number===void 0&&l.refresh(),m.length&&l.update(m[0])}),this.onMdpEvent("Quiz.activate",function(){l.quiz_activated=!0}),this.onMdpEvent("Quiz.deactivate",function(){l.quiz_activated=!1,l.hide()}),this.onMdpEvent("Quiz.hide",function(){l.hide()}),this.onMdpEvent("Quiz.refresh",function(){l.refresh()}),this.onMediaEvent("pause",function(){l.quiz_displayed||jQuery(".Ldt-Pause-Add-Question").show()}),this.onMediaEvent("play",function(){jQuery(".Ldt-Pause-Add-Question").hide()}),l.overlay=jQuery("<div class='Ldt-Quiz-Overlay'></div>").appendTo(jQuery("#"+l.container)),l.PauseAddQuestion=jQuery("<div class='Ldt-Pause-Add-Question' title='Ajoutez une question !'>").on("click",function(){l.player.trigger("QuizCreator.create")}).appendTo(jQuery("#"+l.container)),l.overlay.html(this.template),jQuery(".Ldt-Quiz-Overlay").hide(),jQuery(".Ldt-Quiz-Submit input").click(function(){l.answer()}),jQuery(".Ldt-Quiz-Submit-Skip-Link").click({media:this.media},function(d){l.submit(l.user,l.userid,l.annotation.id,"skipped_answer",0),l.hide(),l.player.trigger("QuizCreator.skip"),d.data.media.play()}),jQuery('.Ldt-Quiz-Votes-Buttons input[type="button"], .Ldt-Quiz-Votes-Buttons a').click({media:this.media},function(d){var m,h;jQuery(this).hasClass("Ldt-Quiz-Vote-Useful")?(m="useful",h=1):jQuery(this).hasClass("Ldt-Quiz-Vote-Useless")?(m="useless",h=-1,jQuery(".Ldt-Ctrl-Quiz-Create").addClass("button_highlight").delay(5e3).queue(function(){jQuery(this).removeClass("button_highlight").dequeue()})):(m="skipped_vote",h=0),l.submit(l.user,l.userid,l.annotation.id,m,h),d.data.media.play(),l.hide(),jQuery(".Ldt-Pause-Add-Question").hide(),l.player.trigger("QuizCreator.skip")}),l.refresh()}},Cr(n,"defaults",{quiz_activated:!0,api_serializer:"ldt_annotate",analytics_api:"",api_method:"POST",user:"",userid:""}),Cr(n,"template",'<div class="Ldt-Quiz-Container"><div class="Ldt-Quiz-Header"> <div class="Ldt-Quiz-Index"></div><div class="Ldt-Quiz-Score"></div></div><div class="Ldt-Quiz-Content"> <h1 class="Ldt-Quiz-Title">{{question}}</h1> <div class="Ldt-Quiz-Questions"> </div></div><div class="Ldt-Quiz-Footer"> <div class="Ldt-Quiz-Votes"> <span class="Ldt-Quiz-Votes-Question">Avez-vous trouvé cette question utile ?</span> <div class="Ldt-Quiz-Votes-Buttons"> <div class="Ldt-Quiz-Vote-Skip-Block"><a href="#" class="Ldt-Quiz-Vote-Skip">Passer</a></div> <div><input type="button" value="Non" class="Ldt-Quiz-Vote-Useless" /></div> <div><input type="button" value="Oui" class="Ldt-Quiz-Vote-Useful" /></div> </div> </div> <div class="Ldt-Quiz-Submit"> <div class="Ldt-Quiz-Submit-Button"><input type="button" value="Valider" /></div> <div class="Ldt-Quiz-Submit-Skip-Link"><a href="#">Passer</a></div><div style="clear:both;"></div> </div> <div class="Ldt-Quiz-Result">Bonne réponse</div></div></div>'),Cr(n,"annotationTemplate",""),n},UniqueChoiceQuestion=function(t){return class extends t.Widgets.Widget{constructor(n){this.annotation=n}renderQuizTemplate(n,l){return'<input type="radio" class="quiz-question Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question" data-question="'+l+'" value="'+l+'" />'}renderTemplate(n,l){var d=this.generateUid();return'<input type="radio" id="'+d+'" class="quiz-question-edition Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question" data-question="'+l+'" value="'+l+'" /><label for="'+d+'" title="Veuillez sélectionner la réponse correcte"></label>'}renderFullTemplate(n,l){var d=n&&n.correct?"checked":"",m=this.generateUid();return'<input type="radio" id="'+m+'" '+d+' class="quiz-question-edition Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question" data-question="'+l+'" value="'+l+'" /><label for="'+m+'"></label>'}}},MultipleChoiceQuestion=function(t){return class extends t.Widgets.Widget{constructor(n){this.annotation=n}renderQuizTemplate(n,l){return'<input type="checkbox" class="quiz-question Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question['+l+']" data-question="'+l+'" value="'+l+'" /> '}renderTemplate(n,l){var d=this.generateUid();return'<input type="checkbox" id="'+d+'" class="quiz-question-edition Ldt-Quiz-Question-Check" name="question['+l+']" data-question="'+l+'" value="'+l+'" /><label for="'+d+'" title="Veuillez sélectionner la ou les réponses correctes"></label>'}renderFullTemplate(n,l){var d=n&&n.correct?"checked":"",m=this.generateUid();return'<input type="checkbox" id="'+m+'" '+d+' class="quiz-question-edition Ldt-Quiz-Question-Check" name="question['+l+']" data-question="'+l+'" value="'+l+'" /><label for="'+m+'"></label> '}submit(n,l,d,m,h){var S=this,k=mustache.render(this.analytics_api,{id:this.source.projectId}),A={username:n,useruuid:l,subject:d,property:m,value:h,session:S.session_id};jQuery.ajax({url:k,type:this.api_method,contentType:"application/json",data:JSON.stringify(A),success:function(B){},error:function(B,M,j){t.log("Error when sending annotation",j)}})}}},quizCreatorStyles={},QuizCreator=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}skip(){this.$.find(".Ldt-QuizCreator-Time").val(""),this.$.find(".Ldt-QuizCreator-Question-Area").val(""),this.$.find(".Ldt-QuizCreator-Resource-Area").val(""),this.$.find(".Ldt-QuizCreator-Questions-Block").html(""),this.current_annotation=void 0}nbAnswers(){var l=this.$.find(".Ldt-QuizCreator-Questions-Answer").length;return l}draw(){var l=this;this.onMediaEvent("timeupdate",function(d){l.setBegin(d)}),this.onMdpEvent("QuizCreator.show",function(){l.setBegin(l.media.currentTime)}),this.onMdpEvent("QuizCreator.create",function(){l.skip(),l.setBegin(l.media.currentTime)}),this.onMdpEvent("QuizCreator.skip",function(){l.skip()}),this.onMdpEvent("QuizCreator.edit",function(d){l.skip(),l.addQuestion(d)}),this.$.on("click",".Ldt-QuizCreator-Remove",function(){jQuery(this).parents(".Ldt-QuizCreator-Questions-Answer").remove()}),this.begin=new t.Model.Time,this.end=this.source.getDuration(),this.answers=[],this.renderTemplate(),this.question=new t.Widgets.UniqueChoiceQuestion,this.$.find(".Ldt-QuizCreator-Question-Type").bind("change",this.functionWrapper("onQuestionTypeChange")),this.$.find(".Ldt-QuizCreator-Question-Add").bind("click",this.functionWrapper("onQuestionAdd")),this.$.find(".Ldt-QuizCreator-Question-Save").bind("click",this.functionWrapper("onSave")),this.$.find(".Ldt-QuizCreator-Time").keyup(function(){var d=l.$.find(".Ldt-QuizCreator-Time").val();l.begin=t.timestamp2ms(d),l.end=l.begin+1e3}),this.onMediaEvent("timeupdate",function(d){l.getDescription()&&l.setBegin(d)})}getDescription(){return this.$.find(".Ldt-QuizCreator-Question-Area").val().trim()}addQuestion(l,d){var m=this;l.content.data.type=="multiple_choice"?this.question=new t.Widgets.MultipleChoiceQuestion(l):l.content.data.type=="unique_choice"&&(this.question=new t.Widgets.UniqueChoiceQuestion(l));var h=l.content.data.answers;this.answers=[],this.$.find(".Ldt-QuizCreator-Time").val(l.begin),this.$.find(".Ldt-QuizCreator-Question-Area").val(l.content.data.question),this.$.find(".Ldt-QuizCreator-Resource-Area").val(l.content.data.resource),this.$.find(".Ldt-QuizCreator-Questions-Block").html(""),h.forEach(function(S){m.onQuestionAdd(null,S)}),m.current_annotation=l}onQuestionTypeChange(l){var d=this.$.find(".Ldt-QuizCreator-Question-Type"),m=d.val(),h=this;switch(m){case"unique_choice":this.question=new t.Widgets.UniqueChoiceQuestion;break;case"multiple_choice":this.question=new t.Widgets.MultipleChoiceQuestion;break}var S="";h.$.find(".Ldt-QuizCreator-Questions-Block").html(S),this.pauseOnWrite()}onQuestionAdd(l,d){var m='<div class="Ldt-QuizCreator-Questions-Answer">Réponse <div class="Ldt-QuizCreator-Questions-Answer-Correct">'+this.question.renderFullTemplate(d,this.nbAnswers())+'</div><br /><div class="Ldt-QuizCreator-Questions-Answer-Content"><input type="text" class="Ldt-QuizCreator-Answer-Content" data-question="'+this.nbAnswers()+'" id="question'+this.nbAnswers()+'"'+(d?' value="'+d.content+'"':"")+'/><br />Commentaire <br/><textarea class="Ldt-QuizCreator-Answer-Feedback" data-question="'+this.nbAnswers()+'" id="feedback'+this.nbAnswers()+'">'+(d?d.feedback:"")+'</textarea></div><div class="Ldt-QuizCreator-Questions-Answer-Delete"><div class="Ldt-QuizCreator-Remove"> </div></div></div>';this.$.find(".Ldt-QuizCreator-Questions-Block").append(m),this.$.find(".Ldt-QuizCreator-Answer-Content").last().focus(),this.pauseOnWrite()}pauseOnWrite(){this.pause_on_write&&!this.media.getPaused()&&this.media.pause()}setBegin(l){this.begin=new t.Model.Time(l||0),this.end=this.begin+500,this.$.find(".Ldt-QuizCreator-Time").val(this.begin.toString())}get_local_annotation(l){return this.player.getLocalAnnotation(l)}save_local_annotations(){this.player.saveLocalAnnotations(),this.source.merge(this.player.localSource)}delete_local_annotation(l){this.source.getAnnotations().removeId(l),this.player.deleteLocalAnnotation(l),this.current_annotation=void 0,this.refresh(!0)}show(){this.$.find(".Ldt-QuizCreator-Question-Area").focus()}hide(){this.$.find(".Ldt-QuizCreator-Questions-Block").html(""),this.$.find(".Ldt-QuizCreator-Question-Area").val(""),this.$.find(".Ldt-QuizCreator-Resource-Area").val(""),this.$.find(".Ldt-QuizCreator-Time").val("")}onSave(l,d){var m=!1;if(this.nbAnswers()<=0)return alert("Vous devez spécifier au moins une réponse à votre question !"),!1;if(!this.$.find(".quiz-question-edition:checked").length)return alert("Vous n'avez pas indiqué de bonne réponse."),!1;var h;if(this.current_annotation)m=!1,h=this.current_annotation;else{m=!0;var S=this.source.getAnnotationTypes().searchByTitle(this.annotation_type,!0),k=S.length?S[0]:new t.Model.AnnotationType(!1,this.player.localSource);S.length||(k.dont_send_id=!0,k.title=this.annotation_type),h=new t.Model.Annotation(!1,this.player.localSource),h.created=new Date,h.creator=this.creator_name,h.setAnnotationType(k.id),this.player.localSource.getMedias().push(this.source.currentMedia),h.setMedia(this.source.currentMedia.id)}h.setBeginEnd(this.begin,this.end),h.modified=new Date,h.contributor=this.creator_name,h.description=this.getDescription(),h.title=h.description,h.content={},h.content.data={},h.content.data.type=this.$.find(".Ldt-QuizCreator-Question-Type").val(),h.content.data.question=h.description,h.content.data.resource=this.$.find(".Ldt-QuizCreator-Resource-Area").val(),h.content.data.answers=jQuery.makeArray(jQuery(".Ldt-QuizCreator-Questions-Answer").map(function(A){return{content:jQuery(this).find(".Ldt-QuizCreator-Answer-Content").val(),feedback:jQuery(this).find(".Ldt-QuizCreator-Answer-Feedback").val(),correct:jQuery(this).find(".Ldt-Quiz-Question-Check").is(":checked")}})),this.current_annotation=h,m?(this.player.addLocalAnnotation(h),this.source.merge([h]),this.player.trigger("Annotation.create",h)):(this.player.saveLocalAnnotations(),this.player.trigger("Annotation.update",h)),this.player.trigger("AnnotationsList.update"),this.player.trigger("Quiz.refresh")}},Cr(n,"defaults",{creator_name:"",tags:!1,tag_titles:!1,pause_on_write:!0,annotation_type:"Quiz",api_serializer:"ldt_annotate",api_endpoint_template:"",api_method:"POST"}),Cr(n,"messages",{en:{},fr:{}}),Cr(n,"template",'<div class="Ldt-QuizCreator-Ui Ldt-TraceMe"><div class="Ldt-QuizCreator-Question-Form"><textarea class="Ldt-QuizCreator-Question-Area" placeholder="Votre question"></textarea><br /><textarea class="Ldt-QuizCreator-Resource-Area" placeholder="Ressources (lien vers une image, etc.)"></textarea><br /></div><p>Type de question <select name="type" class="Ldt-QuizCreator-Question-Type"><option value="unique_choice">Choix unique</option><option value="multiple_choice">Choix multiple</option></select> à <input type="text" placeholder="hh:mm:ss" size="6" class="Ldt-QuizCreator-Time" /><div class="Ldt-QuizCreator-Questions-Block"></div><div> <button class="Ldt-QuizCreator-Question-Add">Ajouter une réponse</button><hr> <button class="Ldt-QuizCreator-Question-Save">Sauvegarder</button></div></div>'),n},segmentsStyles={},Segments=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}do_draw(l){this.width!=this.$.parent().width()&&this.scale_to_parent&&(this.width=this.$.parent().width(),this.$.css({width:this.width+"px"}));var d=this,m=this.getWidgetAnnotations().filter(function(M){return M.getDuration()>0&&M.getMedia().id==d.media.id}),h=this.width/this.source.getDuration(),S=this.$.find(".Ldt-Segments-List"),k=[],A=1;function B(M,j,I,P){function $(N){return Math.floor(240*(1-P)+N*P)}for(var z=(65536*$(M)+256*$(j)+$(I)).toString(16);z.length<6;)z="0"+z;return"#"+z}l&&this.$.find(".Ldt-Segments-Segment").remove(),m.forEach(function(M,j){var I=M.begin*h,P=M.getDuration()*h,$=Math.floor(I+P/2),z=M.title+(M.description?"<br/>"+M.description:""),N=_$1(k).find(function(T){return!_$1(T.annotations).find(function(u){return u.begin<M.end&&u.end>M.begin})});N||(N={index:k.length,annotations:[]},k.push(N)),N.annotations.push(M);var F=(1-d.overlap)*N.index*d.line_height,U=typeof M.color<"u"&&M.color?M.color:d.colors[j%d.colors.length],J=parseInt(U.substr(1,2),16),te=parseInt(U.substr(3,2),16),se=parseInt(U.substr(5,2),16),de=B(J,te,se,.5),Q=B(J,te,se,.2),ve={color:U,medcolor:de,lowcolor:Q,text:(M.creator?M.creator+" : ":"")+z.replace(/(\n|\r|\r\n)/gm," ").replace(/(^.{120,140})[\s].+$/m,"$1…"),left:I,width:P,top:F,height:d.line_height-1,id:M.id,media_id:M.getMedia().id,from:M.begin.toString(),to:M.end.toString()},he=mustache.render(d.constructor.annotationTemplate,ve),ke=jQuery(he);ke.on("mouseover",function(){M.trigger("select")}).on("mouseout",function(){M.trigger("unselect")}).on("click",function(){d.use_timerange&&(d.media.getTimeRange()?d.media.getTimeRange()[0]==M.begin||d.media.getTimeRange()[1]==M.end?(d.media.resetTimeRange(),d.$segments.each(function(){var T=jQuery(this);T.css("background",Q).removeClass("selected"),M.trigger("select")})):(d.media.setCurrentTime(M.begin),d.media.setTimeRange(M.begin,M.end),d.media.play(),d.$segments.each(function(){var T=jQuery(this);T.css("background",Q).removeClass("selected")}),ke.css("background",d.selected_color).addClass("selected")):(d.media.setCurrentTime(M.begin),d.media.setTimeRange(M.begin,M.end),d.media.play(),d.$segments.each(function(){var T=jQuery(this);T.css("background",Q).removeClass("selected")}),ke.css("background",d.selected_color).addClass("selected"))),M.trigger("click")}).appendTo(S),t.attachDndData(ke,{title:M.title,description:M.description,uri:typeof M.url<"u"?M.url:document.location.href.replace(/#.*$/,"")+"#id="+M.id,image:M.thumbnail,text:"["+M.begin.toString()+"] "+M.title}),M.on("select",function(){d.$segments.each(function(){var T=jQuery(this);T.css({background:T.hasClass("found")?d.faded_found_color:T.attr("data-low-color")}),T.css({background:T.hasClass("selected")?d.faded_selected_color:T.attr("data-low-color")})}),ke.css({background:ke.hasClass("found")?d.found_color:U,background:ke.hasClass("selected")?d.selected_color:U,"z-index":++A}),d.tooltip&&d.tooltip.show($,F,ve.text,ve.color)}),M.on("unselect",function(){d.tooltip&&d.tooltip.hide(),d.$segments.each(function(){var T=jQuery(this);T.css("background",T.hasClass("found")?d.found_color:T.attr("data-medium-color")),T.css("background",T.hasClass("selected")?d.selected_color:T.attr("data-medium-color"))})}),M.on("found",function(){ke.css("background",d.found_color).addClass("found")}),M.on("not-found",function(){ke.css("background",Q).removeClass("found")})}),this.onMediaEvent("resettimerange",function(){d.$segments.each(function(){var M=jQuery(this);M.removeClass("selected")})}),this.$.css({width:this.width+"px",height:((1-this.overlap)*k.length+this.overlap)*this.line_height+"px",background:this.background,margin:"1px 0"}),this.$segments=this.$.find(".Ldt-Segments-Segment")}draw(){var l=this;l.onMediaEvent("timeupdate","onTimeupdate"),l.renderTemplate(),l.do_draw(),this.no_tooltip||l.insertSubwidget(l.$.find(".Ldt-Segments-Tooltip"),{type:"Tooltip",min_x:0,max_x:this.width},"tooltip"),l.source.getAnnotations().on("search",function(){searching=!0}),l.source.getAnnotations().on("search-cleared",function(){searching=!1,_this.$segments.each(function(){var d=jQuery(this);d.css("background",d.attr("data-medium-color")).removeClass("found")})}),this.$.on("resize",function(){l.do_draw(!0)})}onTimeupdate(l){var d=Math.floor(this.width*l/this.media.duration);this.$.find(".Ldt-Segments-Position").css({left:d+"px"})}},Cr(n,"defaults",{annotation_type:"chap",colors:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],line_height:8,background:"#e0e0e0",overlap:.25,found_color:"#FF00FC",faded_found_color:"#ff80fc",selected_color:"#74d600",faded_selected_color:"#baf9b5",no_tooltip:!1,use_timerange:!1,scale_to_parent:!0}),Cr(n,"template",'<div class="Ldt-Segments-List"></div><div class="Ldt-Segments-Position"></div><div class="Ldt-Segments-Tooltip"></div>'),Cr(n,"annotationTemplate",'<div class="Ldt-Segments-Segment Ldt-TraceMe" trace-info="segment-id:{{id}}, media-id:{{media_id}}, from:{{from}}, to:{{to}}" segment-text="{{text}}"style="top:{{top}}px; height:{{height}}px; left:{{left}}px; width:{{width}}px; background:{{medcolor}}" data-base-color="{{color}}" data-low-color="{{lowcolor}}" data-medium-color="{{medcolor}}"></div>'),n},shortcutsStyles={},Shortcuts=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this;Mousetrap.bindGlobal("ctrl+space",function(d){return d.preventDefault(),l.media.getPaused()?l.media.play():l.media.pause(),!1}),Mousetrap.bindGlobal("ctrl+left",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.max(0,l.media.getCurrentTime()-l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+shift+left",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.max(0,l.media.getCurrentTime()-5*l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+right",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.min(l.media.duration,l.media.getCurrentTime()+l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+shift+right",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.min(l.media.duration,l.media.getCurrentTime()+5*l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+a",function(d){return d.preventDefault(),l.player.trigger("CreateAnnotation.toggle"),!1})}},Cr(n,"defaults",{time_increment:2e3}),n},sliceStyles={},Slice=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.sliding=!1}draw(){this.renderTemplate(),this.$slider=this.$.find(".Ldt-Slice"),this.show_arrow&&this.insertSubwidget(this.$.find(".Ldt-Slice-Arrow"),{type:"Arrow"},"arrow"),this.min=0,this.max=this.media.duration.valueOf();var l=this,d;this.$slider.slider({range:!0,values:[0,this.max],min:0,max:this.max,change:function(m,h){l.arrow&&l.arrow.moveToTime((h.values[0]+h.values[1])/2),l.onBoundsChanged&&l.onBoundsChanged(h.values[0],h.values[1])},start:function(){l.sliding=!0,l.media.getPaused()||l.media.pause(),d=l.media.getCurrentTime()},slide:function(m,h){l.media.setCurrentTime(h.value)},stop:function(){l.sliding=!1,l.media.setCurrentTime(d)}}),this.$slider.find(".ui-slider-handle:first").addClass("Ldt-Slice-left-handle"),this.$slider.find(".ui-slider-handle:last").addClass("Ldt-Slice-right-handle"),this.getWidgetAnnotations().forEach(function(m){m.on("enter",function(){l.setBounds(m.begin,m.end)})}),this.player.on("annotation-click",function(m){l.setBounds(m.begin,m.end)})}setBounds(l,d){this.$slider.slider("values",[l,d])}show(){this.$slider.show()}hide(){this.$slider.hide()}},Cr(n,"defaults",{show_arrow:!1}),Cr(n,"template",'<div class="Ldt-Slice"></div>{{#show_arrow}}<div class="Ldt-Slice-Arrow"></div>{{/show_arrow}}'),n},slidePreviewStyles={},SlidePreview=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.getWidgetAnnotations().sortBy(function(m){return m.begin});var l=this;l.renderTemplate();var d=l.$.find(".Ldt-SlidePreview-Slides");this.getWidgetAnnotations().forEach(function(m){var h={id:m.id,content:t.textFieldHtml(m.title),begin:m.begin.toString(),ms:m.begin.milliseconds,thumbnail:m.thumbnail},S=mustache.render(l.annotationTemplate,h),k=jQuery(S);d.append(k)}),l.$.on("click",".Ldt-SlidePreview-Item",function(){l.media.setCurrentTime(Number(this.dataset.timecode))})}},Cr(n,"defaults",{annotation_type:"Slides"}),Cr(n,"template",'<div class="Ldt-SlidePreview-Container"><div class="Ldt-SlidePreview-Slides"></div></div>'),Cr(n,"annotationTemplate",'<div data-id="{{ id }}" data-timecode="{{ ms }}" class="Ldt-SlidePreview-Item"><img title="{{ begin }} - {{ atitle }}" class="Ldt-AnnotationsList-Thumbnail" src="{{ thumbnail }}"></div>'),n},sliderStyles={},Slider=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"calculateHandleCss",function(d){return{height:2+d+"px",width:2+d+"px","margin-left":-Math.ceil(2+d/2)+"px"}})}draw(){this.renderTemplate(),this.$time=this.$.find(".Ldt-Slider-Time"),this.$slider=this.$.find(".Ldt-Slider");var d=this;this.$slider.slider({range:"min",value:0,min:0,max:this.source.getDuration().milliseconds,slide:function(m,h){d.media.setCurrentTime(h.value),d.player.trigger("Mediafragment.setHashToTime")}}),this.$handle=this.$slider.find(".ui-slider-handle"),this.onMediaEvent("timeupdate","onTimeupdate"),this.onMdpEvent("Player.MouseOver","onMouseover"),this.onMdpEvent("Player.MouseOut","onMouseout"),this.minimize_timeout&&(this.$slider.css(this.calculateSliderCss(this.minimized_height)),this.$handle.css(this.calculateHandleCss(this.minimized_height)),this.maximized=!1,this.timeoutId=!1),this.$slider.mouseover(function(){d.$time.show(),d.onMouseover()}).mouseout(this.functionWrapper("onMouseout")).mousemove(function(m){var h=m.pageX-d.$.offset().left,S=new t.Model.Time(d.media.duration*h/d.width);d.$time.text(S.toString()).css("left",h)})}onTimeupdate(d){this.$slider.slider("value",d),this.player.trigger("Arrow.updatePosition",{widget:this.type,time:d})}onMouseover(){this.minimize_timeout&&(this.timeoutId&&(window.clearTimeout(this.timeoutId),this.timeoutId=!1),this.maximized||(this.animateToHeight(this.maximized_height),this.maximized=!0))}onMouseout(){if(this.$time.hide(),this.minimize_timeout){this.timeoutId&&(window.clearTimeout(this.timeoutId),this.timeoutId=!1);var d=this;this.timeoutId=window.setTimeout(function(){d.maximized&&(d.animateToHeight(d.minimized_height),d.maximized=!1),d.timeoutId=!1},this.minimize_timeout)}}animateToHeight(d){this.$slider.stop().animate(this.calculateSliderCss(d),500,function(){jQuery(this).css("overflow","visible")}),this.$handle.stop().animate(this.calculateHandleCss(d),500,function(){jQuery(this).css("overflow","visible")})}calculateSliderCss(d){return{height:d+"px","margin-top":this.minimized_height-d+"px"}}},Cr(n,"defaults",{minimized_height:4,maximized_height:4,minimize_timeout:1500}),Cr(n,"template",'<div class="Ldt-Slider"></div><div class="Ldt-Slider-Time">00:00</div>'),n},slideVideoPlayerStyles={},SlideVideoPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"template",'<div class="Ldt-SlideVideoPlayer"> <div class="Ldt-SlideVideoPlayer-slide Ldt-SlideVideoPlayer-panel"> </div> <div class="Ldt-SlideVideoPlayer-video Ldt-SlideVideoPlayer-panel"> </div></div>')}draw(){var d=this;d.renderTemplate(),this.insertSubwidget(d.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-slide"),{type:"ImageDisplay",annotation_type:d.annotation_type},"slide"),this.insertSubwidget(d.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-video"),{type:d.playerModule,video:d.video,width:"100%",url_transform:d.url_transform},"player"),d.mode=="pip"?(d.$.find(".Ldt-SlideVideoPlayer-panel").append('<div class="Ldt-SlideVideoPlayer-pip-menu"><div class="Ldt-SlideVideoPlayer-pip-menu-toggle"></div></div>'),d.$.on("click",".Ldt-SlideVideoPlayer-pip-menu-toggle",function(){d.toggleMainDisplay()}),window.setTimeout(function(){d.setMainDisplay("video")},1500)):window.setTimeout(function(){d.$.find(".Ldt-SlideVideoPlayer").touchSplit({orientation:screen.height>screen.width?"vertical":"horizontal",leftMin:20,topMin:20})},1500)}toggleMainDisplay(){this.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-video").hasClass("Ldt-SlideVideoPlayer-pip-main")?this.setMainDisplay("slides"):this.setMainDisplay("video")}setMainDisplay(d){var m=this.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-video"),h=this.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-slide");if(d=="slides"){var S=m;m=h,h=S}m.removeClass("Ldt-SlideVideoPlayer-pip-pip").addClass("Ldt-SlideVideoPlayer-pip-main"),h.removeClass("Ldt-SlideVideoPlayer-pip-main").addClass("Ldt-SlideVideoPlayer-pip-pip")}},Cr(n,"defaults",{playerModule:"HtmlPlayer",mode:"sidebyside"}),n},socialStyles={},Social=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate(),this.clipId=_$1.uniqueId("Ldt-Social-CopyBtn-"),this.$.find(".Ldt-Social-CopyBtn").attr("id",this.clipId);var l=this;this.$.find(".Ldt-Social-Url").click(function(){return l.toggleCopy(),!1}).on("dragstart",function(d){d.originalEvent.dataTransfer.setData("text/x-iri-title",l.text),d.originalEvent.dataTransfer.setData("text/x-iri-uri",l.url)}),this.$.find(".Ldt-Social-Input").focus(function(){this.select()}),this.$.find(".Ldt-Social-Ext").click(function(){return window.open(jQuery(this).attr("href"),"_blank","height=300,width=450,left=100,top=100,toolbar=0,menubar=0,status=0,location=0"),!1}),this.updateUrls(this.url,this.text)}toggleCopy(){var l=this.$.find(".Ldt-Social-UrlPop");l.toggle(),this.$.find(".Ldt-Social-Input").val(this.url).focus()}updateUrls(l,d){this.url=l,this.text=d,this.$.find(".Ldt-Social-Fb").attr("href","http://www.facebook.com/share.php?"+jQuery.param({u:l,t:d})),this.$.find(".Ldt-Social-Twitter").attr("href","https://twitter.com/intent/tweet?"+jQuery.param({url:l,text:d})),this.$.find(".Ldt-Social-Gplus").attr("href","https://plus.google.com/share?"+jQuery.param({url:l,title:d})),this.$.find(".Ldt-Social-Mail").attr("href","mailto:?"+jQuery.param({subject:d,body:d+": "+l}))}},Cr(n,"defaults",{text:"",url:"",show_url:!0,show_twitter:!0,show_fb:!0,show_gplus:!0,show_mail:!0}),Cr(n,"template",'<span class="Ldt-Social">{{#show_url}}<div class="Ldt-Social-Url-Container"><a href="#" draggable="true" target="_blank" class="Ldt-Social-Square Ldt-Social-Url Ldt-TraceMe" title="{{l10n.share_link}}"></a><div class="Ldt-Social-UrlPop"><input class="Ldt-Social-Input"/></div></div>{{/show_url}}{{#show_fb}}<a href="#" target="_blank" class="Ldt-Social-Fb Ldt-Social-Ext Ldt-TraceMe" title="{{l10n.share_on}} Facebook"></a>{{/show_fb}}{{#show_twitter}}<a href="#" target="_blank" class="Ldt-Social-Twitter Ldt-Social-Ext Ldt-TraceMe" title="{{l10n.share_on}} Twitter"></a>{{/show_twitter}}{{#show_gplus}}<a href="#" target="_blank" class="Ldt-Social-Gplus Ldt-Social-Ext Ldt-TraceMe" title="{{l10n.share_on}} Google+"></a>{{/show_gplus}}{{#show_mail}}<a href="#" target="_blank" class="Ldt-Social-Mail Ldt-TraceMe" title="{{l10n.share_mail}}"></a>{{/show_mail}}</span>'),Cr(n,"messages",{fr:{share_on:"Partager sur",share_mail:"Envoyer par courriel",share_link:"Partager le lien hypertexte",copy:"Copier"},en:{share_on:"Share on",share_mail:"Share by e-mail",share_link:"Share hypertext link",copy:"Copy"}}),n},Sparkline=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){for(var l=[],d=this.source.getDuration(),m=0,h=this.getWidgetAnnotations(),S=0;S<this.slice_count;S++){var k=S*d/this.slice_count,A=(S+1)*d/this.slice_count,B=0;h.forEach(function(N){if(N.begin<A&&N.end>=k){var F=N.getDuration().milliseconds;F?B+=(Math.min(N.end,A)-Math.max(N.begin,k))/F:B+=1}}),m=Math.max(m,B),l.push(B)}if(m){this.paper=new Raphael(this.$[0],this.width,this.height);var M=(this.height-this.margin)/m,j=this.width/this.slice_count,I=this,P=_$1(l).map(function(N){return I.margin+I.height-M*N}).value(),$=_$1(P).reduce(function(N,F,U){return N+(U?"C"+U*j+" "+P[U-1]+" "+U*j+" "+F+" "+(U+.5)*j+" "+F:"M0 "+F+"L"+.5*j+" "+F)},"")+"L"+this.width+" "+P[P.length-1],z=$+"L"+this.width+" "+this.height+"L0 "+this.height;this.paper.path(z).attr({stroke:"none",fill:this.fillColor}),this.paper.path($).attr({fill:"none",stroke:this.lineColor,"stroke-width":this.lineWidth}),this.rectangleProgress=this.paper.rect(0,0,0,this.height).attr({stroke:"none",fill:"#808080",opacity:.3}),this.ligneProgress=this.paper.path("M0 0L0 "+this.height).attr({stroke:"#ff00ff","line-width":2}),this.$.click(function(N){var F=N.pageX-I.$.offset().left;I.media.setCurrentTime(I.media.duration*F/I.width)}),this.onMediaEvent("timeupdate","onTimeupdate")}}onTimeupdate(l){var d=Math.floor(this.width*l/this.media.duration);this.rectangleProgress.attr({width:d}),this.ligneProgress.attr({path:"M"+d+" 0L"+d+" "+this.height})}},Cr(n,"defaults",{lineColor:"#7492b4",fillColor:"#aeaeb8",lineWidth:2,slice_count:20,height:50,margin:5}),n},SpelSyncHtml=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget")}draw(){this.renderTemplate();var l=this.$.find("iframe")[0],d=this.src.replace(/#.*$/,"");this.getWidgetAnnotations().forEach(function(m){m.on("enter",function(){m.content&&m.content.data&&m.content.data.ref_text&&(l.src=d+"#"+m.content.data.ref_text)})})}},Cr(n,"defaults",{src:"about:blank"}),Cr(n,"template",'<div class="Ldt-SpelSyncHtml"><iframe src="{{src}}" {{#width}}width="{{width}}"{{/width}} {{#height}}height="{{height}}"{{/height}}</div>'),n},tagcloudStyles={},Tagcloud=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"stopword_lists",{fr:["aussi","avec","aux","bien","car","cette","comme","dans","des","donc","dont","elle","encore","entre","est","être","eux","faire","fait","http","ici","ils","les","leur","leurs","mais","mes","même","mon","notre","non","nos","nous","ont","par","pas","peu","peut","plus","pour","quand","que","qui","quoi","sans","ses","son","sont","sur","tes","très","the","ton","tous","tout","une","votre","vos","vous"],en:["about","again","are","and","because","being","but","can","done","have","for","from","get","here","http","like","more","one","our","she","that","the","their","then","there","they","this","very","what","when","where","who","why","will","with","www","you","your"]});this.stopwords=_$1.uniq([].concat(this.custom_stopwords).concat(this.stopword_lists[this.stopword_language]))}draw(){if(this.segment_annotation_type){var d=this;this.source.getAnnotationsByTypeTitle(this.segment_annotation_type).forEach(function(m){m.on("enter",function(){d.redraw(m.begin,m.end)})})}else this.redraw()}redraw(d,m){var h=/https?:\/\/[0-9a-zA-Z\.%\/-_]+/g,S={},k=this,A=this.getWidgetAnnotations();if(!this.include_titles&&!this.include_descriptions)var B=/[^\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»\/]{3,}/g;else var B=/[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g;if(typeof d<"u"&&typeof m<"u"&&(A=A.filter(function(P){return P.begin>=d&&P.end<=m})),this.remove_zero_duration&&(A=A.filter(function(P){return P.getDuration()>0})),A.forEach(function(P){var $=(k.include_titles?P.title:"")+" "+(k.include_descriptions?P.description:"")+" "+(k.include_tag_texts?P.getTagTexts():"");_$1($.toLowerCase().replace(h,"").match(B)).each(function(z){z=z.trim(),_$1(k.stopwords).indexOf(z)==-1&&(!k.exclude_pattern||!k.exclude_pattern.test(z))&&(S[z]=1+(S[z]||0))})}),S=_$1(S).chain().map(function(P,$){return{word:$,count:P}}).filter(function(P){return P.count>k.min_count}).sortBy(function(P){return-P.count}).first(this.tag_count).value(),S&&S.length){var M=S[0].count,j=Math.min(S[S.length-1].count,M-1),I=(this.max_font_size-this.min_font_size)/Math.sqrt(M-j);_$1(S).each(function(P){P.size=Math.floor(k.min_font_size+I*Math.sqrt(P.count-j))})}this.$.html(mustache.render(this.template,{words:S})),this.$.find(".Ldt-Tagcloud-item").click(function(){var P=jQuery(this).attr("content");k.source.getAnnotations().searchByTags(P)}),this.source.getAnnotations().on("search",this.functionWrapper("onSearch")),this.source.getAnnotations().on("search-cleared",this.functionWrapper("onSearch"))}onSearch(d){if(d=typeof d<"u"?d:"",d)var m=t.Model.regexpFromTextOrArray(d);this.$.find(".Ldt-Tagcloud-item").each(function(){var h=jQuery(this),S=h.attr("content");d?h.html(S.replace(m,'<span class="Ldt-Tagcloud-active">$1</span>')):h.html(S)})}},Cr(n,"template",'<div class="Ldt-Tagcloud-Container"><ul class="Ldt-Tagcloud-List">{{#words}}<li class="Ldt-Tagcloud-item Ldt-TraceMe" trace-info="tag:{{word}}" content="{{word}}" style="font-size: {{size}}px">{{word}}</li>{{/words}}</ul></div>'),Cr(n,"defaults",{include_titles:!0,include_descriptions:!0,include_tag_texts:!0,tag_count:30,stopword_language:"fr",custom_stopwords:[],exclude_pattern:!1,annotation_type:!1,segment_annotation_type:!1,min_font_size:10,max_font_size:26,min_count:2,remove_zero_duration:!1}),n},Title=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate()}},Cr(n,"defaults",{media_title:!1}),Cr(n,"template",'<div class="Ldt-TitleWidget"><h2>{{#media_title}}{{media.title}}{{/media_title}}{{^media_title}}{{source.title}}{{/media_title}}</h2></div>'),n},tooltipStyles={},Tooltip=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){const l=this;this.renderTemplate(),this.$.parent().css({position:"relative"}),this.$tooltip=this.$.find(".Ldt-Tooltip"),this.$tip=this.$.find(".Ldt-Tooltip-Tip"),this.$sw=this.$.find(".Ldt-Tooltip-Border-SW"),this.$se=this.$.find(".Ldt-Tooltip-Border-SE"),this.__halfWidth=Math.floor((this.$.find(".Ldt-Tooltip-Main").width()||192)/2),this.__borderWidth=this.$.find(".Ldt-Tooltip-Border-Left").width(),this.__tipDelta=this.__halfWidth-Math.floor(this.$tip.width()/2),this.__maxShift=this.__tipDelta-this.__borderWidth,this.$.mouseover(function(){l.$tooltip.hide()}),this.hide()}show(l,d,m,h){if(typeof h<"u")if(typeof h=="string")this.$.find(".Ldt-Tooltip-Color").html(""),this.$.find(".Ldt-Tooltip-Color").show().css("background-color",h),this.$.find(".Ldt-Tooltip-Color").show().css("height","");else{var S=this.$.find(".Ldt-Tooltip-Color");S.html(""),S.show();for(var k=0;k<h.length;k++)S.append('<div style="float: left; height: 10px; width: 10px; background-color: '+h[k]+'">');this.$.find(".Ldt-Tooltip-Color").css("height",h.length*10+"px")}else this.$.find(".Ldt-Tooltip-Color").hide();this.$.find(".Ldt-Tooltip-Text").html(m),this.$tooltip.show();var A=0;typeof this.min_x<"u"&&l-this.__halfWidth<this.min_x&&(A=Math.max(l-this.__halfWidth-this.min_x,-this.__maxShift)),typeof this.max_x<"u"&&+l+this.__halfWidth>this.max_x&&(A=Math.min(+l+this.__halfWidth-this.max_x,this.__maxShift)),this.$tooltip.css({left:l-A+"px",top:d+"px"}),this.$tip.css({left:this.__tipDelta+A+"px"}),this.$sw.css({width:this.__tipDelta+A-this.__borderWidth+"px"}),this.$se.css({width:this.__tipDelta-A-this.__borderWidth+"px"})}hide(){this.$tooltip.hide()}},Cr(n,"defaults",{}),Cr(n,"template",'<div class="Ldt-Tooltip"><div class="Ldt-Tooltip-Main"><div class="Ldt-Tooltip-Corner-NW"></div><div class="Ldt-Tooltip-Border-Top"></div><div class="Ldt-Tooltip-Corner-NE"></div><div class="Ldt-Tooltip-Border-Left"></div><div class="Ldt-Tooltip-Border-Right"></div><div class="Ldt-Tooltip-Corner-SW"></div><div class="Ldt-Tooltip-Border-SW"></div><div class="Ldt-Tooltip-Tip"></div><div class="Ldt-Tooltip-Border-SE"></div><div class="Ldt-Tooltip-Corner-SE"></div><div class="Ldt-Tooltip-Inner"><div class="Ldt-Tooltip-Color"></div><p class="Ldt-Tooltip-Text"></p></div></div></div>'),n},transcriptStyles={},Transcript=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this.getWidgetAnnotations(),d=this,m;if(d.renderTemplate(),m=d.$.find(".Ldt-TranscriptWidget"),d.use_vtt_track){var h=d.player.widgets.filter(function(k){return k.type=="HtmlPlayer"});if(h){var S=h[0].$.find("video")[0];S.addEventListener("loadedmetadata",function(){var k=S.textTracks[0],A=k.cues,B=1;Array.prototype.forEach.apply(A,[function(M){M.id="cue"+B;var j=mustache.render(d.annotationTemplate,{id:M.id,content:M.text,begin:1e3*M.startTime,end:1e3*M.endTime});B+=1;var I=jQuery(j);m.append(I)}]),k.addEventListener("cuechange",function(){var M=k.activeCues;M.length>0&&(d.$.find(".Ldt-Transcript-Annotation.active").removeClass("active"),Array.prototype.forEach.apply(M,[function(j){d.$.find("#"+j.id).addClass("active")}]))},!1),m.on("click",".Ldt-Transcript-Annotation",function(){d.media.setCurrentTime(this.dataset.begin)})})}else console.log("cannot find a video object")}else l.forEach(function(k){var A={id:k.id,content:t.textFieldHtml(k.title),begin:k.begin.toString(),end:k.end.toString()},B=mustache.render(d.annotationTemplate,A),M=jQuery(B);m.append(M)})}},Cr(n,"defaults",{annotation_type:"Caption",use_vtt_track:!1}),Cr(n,"template",'<div class="Ldt-TranscriptWidget"></div>'),Cr(n,"annotationTemplate",'<span data-begin="{{ begin }}" data-end="{{ end }}" data-id="{{ id }}" class="Ldt-Transcript-Annotation">{{ content }}</span> '),n},tweetStyles={},Tweet=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastAnnotation=!1}draw(){this.renderTemplate(),this.pinned=this.pin_at_start;var l=this;this.$.find(".Ldt-Tweet-Pin").click(function(){l.pinned=!l.pinned;var d=jQuery(this);l.pinned?(d.addClass("active").attr("title",l.l10n.dont_keep_visible),l.cancelTimeout()):(d.removeClass("active").attr("title",l.l10n.keep_visible),l.hideTimeout())}),this.$.find(".Ldt-Tweet-Close").click(function(){l.hide()}),this.$.hide(),this.getWidgetAnnotations().forEach(function(d){d.on("click",function(){l.show(d)})})}show(l){if(typeof l<"u"&&typeof l.source<"u"){var d=[[/#(\w+)/gm,function(I){return'<a href="http://twitter.com/search?q=%23'+I[1]+'" target="_blank">'},"</a>"]],m=_$1(l.source.entities.urls).sortBy(function(I){return I.indices[0]}),h=0,S="";_$1(m).each(function(I){I.indices[0]>=h&&(S+=l.source.text.substring(h,I.indices[0]),S+=typeof I.expanded_url<"u"&&I.expanded_url!==null?I.expanded_url:I.url,h=I.indices[1])}),S+=l.source.text.substring(h);for(var k=0;k<this.polemics.length;k++){var A=t.Model.regexpFromTextOrArray(this.polemics[k].keywords);d.push([A,'<span style="background: '+this.polemics[k].color+'">',"</span>"])}var A=l.found&&_this.source.getAnnotations().regexp||!1,B=l.source.user?l.source.user.profile_image_url:l.source.profile_image_url,M=l.source.user?l.source.user.screen_name:l.source.from_user,j=l.source.user?l.source.user.name:l.source.from_user_name;this.$.find(".Ldt-Tweet-Avatar").attr("src",B),this.$.find(".Ldt-Tweet-ScreenName").html("@"+M),this.$.find(".Ldt-Tweet-ProfileLink").attr("href","https://twitter.com/"+M),this.$.find(".Ldt-Tweet-FullName").html(j),this.$.find(".Ldt-Tweet-Contents").html(t.textFieldHtml(S,A,d)),this.$.find(".Ldt-Tweet-Time").html(this.l10n.original_time+new Date(l.source.created_at).toLocaleTimeString()+" / "+this.l10n.video_time+l.begin.toString()),this.$.find(".Ldt-Tweet-Retweet").attr("href","https://twitter.com/intent/retweet?tweet_id="+l.source.id_str),this.$.find(".Ldt-Tweet-Reply").attr("href","https://twitter.com/intent/tweet?in_reply_to="+l.source.id_str),this.$.find(".Ldt-Tweet-Original").attr("href","https://twitter.com/"+M+"/status/"+l.source.id_str),this.player.trigger("Annotation.minimize"),this.$.slideDown(),this.cancelTimeout(),this.pinned||this.hideTimeout()}else this.hide()}hide(){this.player.trigger("Annotation.maximize"),this.$.slideUp(),this.cancelTimeout()}cancelTimeout(){typeof this.hide_timer<"u"&&(window.clearTimeout(this.hide_timer),this.hide_timer=void 0)}hideTimeout(){this.cancelTimeout(),this.hide_timer=window.setTimeout(this.functionWrapper("hide"),this.hide_timeout)}},Cr(n,"defaults",{hide_timeout:1e4,polemics:[{keywords:["++"],color:"#30d765"},{keywords:["--"],color:"#f51123"},{keywords:["=="],color:"#f1e24a"},{keywords:["??"],color:"#05aae6"}],annotation_type:"tweet",pin_at_start:!1}),Cr(n,"messages",{fr:{retweet:"Retweeter",reply:"Répondre",keep_visible:"Empêcher la fermeture automatique",dont_keep_visible:"Permettre la fermeture automatique",close_widget:"Fermer l'affichage du tweet",original_time:"Heure d'envoi : ",video_time:"Temps de la vidéo : ",show_original:"Voir l'original"},en:{retweet:"Retweet",reply:"Reply",keep_visible:"Keep visible",dont_keep_visible:"Don't keep visible",close_widget:"Close tweet display",original_time:"Tweet sent at: ",video_time:"Video time: ",show_original:"Show original"}}),Cr(n,"template",'<div class="Ldt-Tweet-Widget"><div class="Ldt-Tweet-Inner"><div class="Ldt-Tweet-PinClose-Buttons"><a href="#" class="Ldt-Tweet-Pin Ldt-TraceMe{{#pin_at_start}} active" title="{{l10n.dont_keep_visible}}{{/pin_at_start}}{{^pin_at_start}}" title="{{l10n.keep_visible}}{{/pin_at_start}}"></a><a href="#" class="Ldt-Tweet-Close Ldt-TraceMe" title="{{l10n.close_widget}}"></a></div><div class="Ldt-Tweet-AvatarContainer"><a href="#" class="Ldt-Tweet-ProfileLink" target="_blank"><img src="" class="Ldt-Tweet-Avatar"/></a></div><h3><a href="#" class="Ldt-Tweet-ProfileLink Ldt-Tweet-ScreenName" target="_blank"></a> (<span class="Ldt-Tweet-FullName"></span>)</h3><p class="Ldt-Tweet-Contents"></p><div class="Ldt-Tweet-Bottom"><span class="Ldt-Tweet-Time"></span><a class="Ldt-Tweet-Original" href="" target="_blank">{{l10n.show_original}}</a><a href="" target="_blank" class="Ldt-Tweet-Retweet"><div class="Ldt-Tweet-Icon"></div>{{l10n.retweet}}</a><a href="" target="_blank" class="Ldt-Tweet-Reply"><div class="Ldt-Tweet-Icon"></div>{{l10n.reply}}</a></div></div></div>'),n},AutoPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){console.log("CONSTRUCT AUTOPLAYER"),super(l,d)}draw(){console.log("DRAW AUTOPLAYER"),typeof this.video>"u"&&(this.video=this.media.video);for(var l=["live","provider","autostart","streamer","video","height","width","url_transform"],d={},m=[{regexp:/^rtmp:\/\//,type:"JwpPlayer"},{regexp:/\.(mp4|m4v|mp3)$/,type:"AdaptivePlayer"},{regexp:/\.(ogg|ogv|webm)$/,type:"HtmlPlayer"},{regexp:/^(https?:\/\/)?(www\.)?youtube\.com/,type:"PopcornPlayer"},{regexp:/^(https?:\/\/)?(www\.)?vimeo\.com/,type:"PopcornPlayer"},{regexp:/^(https?:\/\/)?(www\.)?dailymotion\.com/,type:"DailymotionPlayer"}],h=/^rtmp:\/\//,S=0;S<m.length;S++)if(this.video&&m[S].regexp.test(this.video.toLowerCase())){d.type=m[S].type;break}if(typeof d.type>"u"&&(d.type=this.default_type),d.type==="AdaptivePlayer"){var k=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E"');d.type=k!=="no"?"HtmlPlayer":"JwpPlayer"}h.test(this.video)&&(d.provider="rtmp",d.live=!0);for(var S=0;S<l.length;S++)typeof this[l[S]]<"u"&&(d[l[S]]=this[l[S]]);this.insertSubwidget(this.$,d)}},Cr(n,"defaults",{default_type:"HtmlPlayer"}),n},MultiSegments=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this,d=[],m=null,h={},S={};_$1(this).each(function(k,A){/^segments_/.test(A)&&(h[A.replace(/^segments_/,"")]=k),/^annotation_/.test(A)&&(S[A.replace(/^annotation_/,"")]=k)}),this.source.getAnnotationTypes().forEach(function(k){var A=k.getAnnotations().filter(function(j){return j.getDuration()>0&&j.getMedia().id==l.media.id});if(A.length){var B=!1,M={segmentWidget:jQuery("<div>"),annotationWidget:jQuery("<div>"),hasSegmentsNow:function(){var j=l.media.getCurrentTime();return!!A.filter(function(I){return I.begin<=j&&I.end>j}).length},hide:function(){B&&(B=!1,this.annotationWidget.slideUp())},show:function(){B||(B=!0,this.annotationWidget.slideDown())}};M.segmentWidget.addClass("Ldt-MultiSegments-Segment").appendTo(l.$),l.show_all||M.segmentWidget.on("mouseenter",function(){M.hasSegmentsNow()&&(m=M)}),M.annotationWidget.addClass("Ldt-MultiSegments-Annotation").appendTo(l.$).hide(),l.insertSubwidget(M.segmentWidget,_$1({type:"Segments",annotation_type:k,width:"100%"}).extend(h).value()),l.insertSubwidget(M.annotationWidget,_$1({type:"Annotation",annotation_type:k,width:"100%"}).extend(S).value()),d.push(M)}}),jQuery(document).on("click",".Ldt-Segments-Segment",function(k){!l.show_all&&m&&!m.hasSegmentsNow()&&(m=void 0),_$1(d).each(function(A){jQuery(k.target).parent().parent()[0]==A.segmentWidget[0]?(m=A,A.show()):A.hide()})})}},Cr(n,"defaults",{annotation_show_arrow:!0,annotation_start_minimized:!1,annotation_show_annotation_type:!0,show_all:!1}),n};function widgets(t){return{AdaptivePlayer:AdaptivePlayer(t),AutoPlayer:AutoPlayer(t),HelloWorld:HelloWorld(t),Annotation:Annotation(t),AnnotationsController:AnnotationsController(t),AnnotationsList:AnnotationsList(t),Arrow:Arrow(t),Controller:Controller(t),CreateAnnotation:CreateAnnotation(t),CurrentSegmentInfobox:CurrentSegmentInfobox(t),DailymotionPlayer:DailymotionPlayer(t),EnrichedPlan:EnrichedPlan(t),Highlighter:Highlighter(t),HtmlMashupPlayer:HtmlMashupPlayer(t),HtmlPlayer:HtmlPlayer(t),ImageDisplay:ImageDisplay(t),JwpPlayer:JwpPlayerWidget(t),LatestAnnotation:LatestAnnotation(t),MashupPlayer:MashupPlayer(t),Mediafragment:Mediafragment(t),MediaList:MediaList(t),MultiSegments:MultiSegments(t),NoteTaking:NoteTaking(t),PlaceholderPlayer:PlaceholderPlayer(t),Polemic:Polemic(t),PopcornPlayer:PopcornPlayer(t),Quiz:Quiz(t),UniqueChoiceQuestion:UniqueChoiceQuestion(t),MultipleChoiceQuestion:MultipleChoiceQuestion(t),QuizCreator:QuizCreator(t),Segments:Segments(t),Shortcuts:Shortcuts(t),Slice:Slice(t),SlidePreview:SlidePreview(t),Slider:Slider(t),SlideVideoPlayer:SlideVideoPlayer(t),Social:Social(t),Sparkline:Sparkline(t),SpelSyncHtml:SpelSyncHtml(t),Tagcloud:Tagcloud(t),Title:Title(t),Tooltip:Tooltip(t),Transcript:Transcript(t),Tweet:Tweet(t),styles:{annotationStyles,helloWorldStyles,annotationsControllerStyles,annotationsListStyles,controllerStyles,createAnnotationStyles,currentSegmentInfoboxStyles,enrichedPlanStyles,highlighterStyles,imageDisplayStyles,latestAnnotationStyles,mashupPlayerStyles,mediaListStyles,noteTakingStyles,placeholderPlayerStyles,polemicStyles,quizStyles,quizCreatorStyles,segmentsStyles,shortcutsStyles,sliceStyles,slidePreviewStyles,sliderStyles,slideVideoPlayerStyles,socialStyles,tagcloudStyles,tooltipStyles,transcriptStyles,tweetStyles}}}typeof window.IriSP>"u"&&(window.IriSP=IriSP$1),IriSP$1.Model=Model(IriSP$1),IriSP$1.htmlPlayer=htmlPlayer,Object.assign(IriSP$1,utils$r(IriSP$1)),IriSP$1.iFrameUpdater=iFrameUpdater,IriSP$1.serializers=serializers(IriSP$1),Object.assign(IriSP$1,defaults()),metadataplayer(IriSP$1),IriSP$1.Widgets=widgetsBase(IriSP$1),Object.assign(IriSP$1.Widgets,widgets(IriSP$1));const main={IriSP:IriSP$1,style};return main});
+`,ke.message,ke.stack);var T=new Error("tunneling socket could not be established, cause="+ke.message);T.code="ECONNRESET",N.request.emit("error",T),U.removeSocket(J)}},j.prototype.removeSocket=function(N){var F=this.sockets.indexOf(N);if(F!==-1){this.sockets.splice(F,1);var U=this.requests.shift();U&&this.createConnection(U)}};function I(z,N){var F=this;j.prototype.createSocket.call(F,z,function(U){var J=t.connect(0,P({},F.options,{servername:z.host,socket:U}));F.sockets[F.sockets.indexOf(U)]=J,N(J)})}function P(z){for(var N=1,F=arguments.length;N<F;++N){var U=arguments[N];if(typeof U=="object")for(var J=Object.keys(U),te=0,se=J.length;te<se;++te){var de=J[te];U[de]!==void 0&&(z[de]=U[de])}}return z}var $;return process$1.env.NODE_DEBUG&&/\btunnel\b/.test(process$1.env.NODE_DEBUG)?$=function(){var z=Array.prototype.slice.call(arguments);typeof z[0]=="string"?z[0]="TUNNEL: "+z[0]:z.unshift("TUNNEL:"),console.error.apply(console,z)}:$=function(){},tunnelAgent.debug=$,tunnelAgent}var hasRequiredTunnel;function requireTunnel(){if(hasRequiredTunnel)return tunnel;hasRequiredTunnel=1;var t=require$$2$2,n=requireTunnelAgent(),l=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],d=["proxy-authorization"];function m(M){var j=M.port,I=M.protocol,P=M.hostname+":";return j?P+=j:I==="https:"?P+="443":P+="80",P}function h(M,j){var I=j.reduce(function(P,$){return P[$.toLowerCase()]=!0,P},{});return Object.keys(M).filter(function(P){return I[P.toLowerCase()]}).reduce(function(P,$){return P[$]=M[$],P},{})}function S(M,j){var I=M.proxy,P={proxy:{host:I.hostname,port:+I.port,proxyAuth:I.auth,headers:j},headers:M.headers,ca:M.ca,cert:M.cert,key:M.key,passphrase:M.passphrase,pfx:M.pfx,ciphers:M.ciphers,rejectUnauthorized:M.rejectUnauthorized,secureOptions:M.secureOptions,secureProtocol:M.secureProtocol};return P}function k(M,j){var I=M.protocol==="https:"?"https":"http",P=j.protocol==="https:"?"Https":"Http";return[I,P].join("Over")}function A(M){var j=M.uri,I=M.proxy,P=k(j,I);return n[P]}function B(M){this.request=M,this.proxyHeaderWhiteList=l,this.proxyHeaderExclusiveList=[],typeof M.tunnel<"u"&&(this.tunnelOverride=M.tunnel)}return B.prototype.isEnabled=function(){var M=this,j=M.request;return typeof M.tunnelOverride<"u"?M.tunnelOverride:j.uri.protocol==="https:"},B.prototype.setup=function(M){var j=this,I=j.request;if(M=M||{},typeof I.proxy=="string"&&(I.proxy=t.parse(I.proxy)),!I.proxy||!I.tunnel)return!1;M.proxyHeaderWhiteList&&(j.proxyHeaderWhiteList=M.proxyHeaderWhiteList),M.proxyHeaderExclusiveList&&(j.proxyHeaderExclusiveList=M.proxyHeaderExclusiveList);var P=j.proxyHeaderExclusiveList.concat(d),$=j.proxyHeaderWhiteList.concat(P),z=h(I.headers,$);z.host=m(I.uri),P.forEach(I.removeHeader,I);var N=A(I),F=S(I,z);return I.agent=N(F),!0},B.defaultProxyHeaderWhiteList=l,B.defaultProxyHeaderExclusiveList=d,tunnel.Tunnel=B,tunnel}var performanceNow={exports:{}},hasRequiredPerformanceNow;function requirePerformanceNow(){return hasRequiredPerformanceNow||(hasRequiredPerformanceNow=1,(function(){var t,n,l,d,m,h;typeof performance<"u"&&performance!==null&&performance.now?performanceNow.exports=function(){return performance.now()}:typeof process$1<"u"&&process$1!==null&&process$1.hrtime?(performanceNow.exports=function(){return(t()-m)/1e6},n=process$1.hrtime,t=function(){var S;return S=n(),S[0]*1e9+S[1]},d=t(),h=process$1.uptime()*1e9,m=d-h):Date.now?(performanceNow.exports=function(){return Date.now()-l},l=Date.now()):(performanceNow.exports=function(){return new Date().getTime()-l},l=new Date().getTime())}).call(commonjsGlobal)),performanceNow.exports}var request$2,hasRequiredRequest;function requireRequest(){if(hasRequiredRequest)return request$2;hasRequiredRequest=1;var t=requireStreamHttp(),n=requireHttpsBrowserify(),l=require$$2$2,d=util$6,m=requireStreamBrowserify(),h=requireLib$5(),S=requireAwsSign2(),k=requireAws4(),A=requireLib$2(),B=requireMimeTypes(),M=requireCaseless(),j=requireForeverAgent(),I=requireBrowser(),P=extend$1,$=requireIsstream(),z=requireIsTypedarray().strict,N=helpers$1,F=cookies$1,U=requireGetProxyFromURI(),J=requireQuerystring().Querystring,te=requireHar().Har,se=requireAuth().Auth,de=requireOauth().OAuth,Q=requireHawk(),ve=requireMultipart().Multipart,he=requireRedirect().Redirect,ke=requireTunnel().Tunnel,T=requirePerformanceNow(),u=safeBufferExports$1.Buffer,p=N.safeStringify,b=N.isReadStream,e=N.toBase64,c=N.defer,y=N.copy,w=N.version,v=F.jar(),o={};function x(L,D){var ee={};for(var oe in D){var fe=L.indexOf(oe)===-1;fe&&(ee[oe]=D[oe])}return ee}function E(L,D){var ee={};for(var oe in D){var fe=L.indexOf(oe)!==-1,ue=typeof D[oe]=="function";fe&&ue||(ee[oe]=D[oe])}return ee}function R(){var L=this;return{uri:L.uri,method:L.method,headers:L.headers}}function H(){var L=this;return{statusCode:L.statusCode,body:L.body,headers:L.headers,request:R.call(L.request)}}function Y(L){var D=this;L.har&&(D._har=new te(D),L=D._har.options(L)),m.Stream.call(D);var ee=Object.keys(Y.prototype),oe=x(ee,L);P(D,oe),L=E(ee,L),D.readable=!0,D.writable=!0,L.method&&(D.explicitMethod=!0),D._qs=new J(D),D._auth=new se(D),D._oauth=new de(D),D._multipart=new ve(D),D._redirect=new he(D),D._tunnel=new ke(D),D.init(L)}d.inherits(Y,m.Stream),Y.debug=process$1.env.NODE_DEBUG&&/\brequest\b/.test(process$1.env.NODE_DEBUG);function Z(){Y.debug&&console.error("REQUEST %s",d.format.apply(d,arguments))}return Y.prototype.debug=Z,Y.prototype.init=function(L){var D=this;L||(L={}),D.headers=D.headers?y(D.headers):{};for(var ee in D.headers)typeof D.headers[ee]>"u"&&delete D.headers[ee];if(M.httpify(D,D.headers),D.method||(D.method=L.method||"GET"),D.localAddress||(D.localAddress=L.localAddress),D._qs.init(L),Z(L),!D.pool&&D.pool!==!1&&(D.pool=o),D.dests=D.dests||[],D.__isRequestRequest=!0,!D._callback&&D.callback&&(D._callback=D.callback,D.callback=function(){D._callbackCalled||(D._callbackCalled=!0,D._callback.apply(D,arguments))},D.on("error",D.callback.bind()),D.on("complete",D.callback.bind(D,null))),!D.uri&&D.url&&(D.uri=D.url,delete D.url),D.baseUrl){if(typeof D.baseUrl!="string")return D.emit("error",new Error("options.baseUrl must be a string"));if(typeof D.uri!="string")return D.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(D.uri.indexOf("//")===0||D.uri.indexOf("://")!==-1)return D.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var oe=D.baseUrl.lastIndexOf("/")===D.baseUrl.length-1,fe=D.uri.indexOf("/")===0;oe&&fe?D.uri=D.baseUrl+D.uri.slice(1):oe||fe?D.uri=D.baseUrl+D.uri:D.uri===""?D.uri=D.baseUrl:D.uri=D.baseUrl+"/"+D.uri,delete D.baseUrl}if(!D.uri)return D.emit("error",new Error("options.uri is a required argument"));if(typeof D.uri=="string"&&(D.uri=l.parse(D.uri)),D.uri.href||(D.uri.href=l.format(D.uri)),D.uri.protocol==="unix:")return D.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(D.uri.host==="unix"&&D.enableUnixSocket(),D.strictSSL===!1&&(D.rejectUnauthorized=!1),D.uri.pathname||(D.uri.pathname="/"),!(D.uri.host||D.uri.hostname&&D.uri.port)&&!D.uri.isUnix){var ue=l.format(D.uri),qe='Invalid URI "'+ue+'"';return Object.keys(L).length===0&&(qe+=". This can be caused by a crappy redirection."),D.abort(),D.emit("error",new Error(qe))}if(D.hasOwnProperty("proxy")||(D.proxy=U(D.uri)),D.tunnel=D._tunnel.isEnabled(),D.proxy&&D._tunnel.setup(L),D._redirect.onRequest(L),D.setHost=!1,!D.hasHeader("host")){var rt=D.originalHostHeaderName||"host";D.setHeader(rt,D.uri.host),D.uri.port&&(D.uri.port==="80"&&D.uri.protocol==="http:"||D.uri.port==="443"&&D.uri.protocol==="https:")&&D.setHeader(rt,D.uri.hostname),D.setHost=!0}if(D.jar(D._jar||L.jar),D.uri.port||(D.uri.protocol==="http:"?D.uri.port=80:D.uri.protocol==="https:"&&(D.uri.port=443)),D.proxy&&!D.tunnel?(D.port=D.proxy.port,D.host=D.proxy.hostname):(D.port=D.uri.port,D.host=D.uri.hostname),L.form&&D.form(L.form),L.formData){var Ve=L.formData,et=D.form(),mt=function(Lt,xe){xe&&xe.hasOwnProperty("value")&&xe.hasOwnProperty("options")?et.append(Lt,xe.value,xe.options):et.append(Lt,xe)};for(var Ye in Ve)if(Ve.hasOwnProperty(Ye)){var We=Ve[Ye];if(We instanceof Array)for(var Xe=0;Xe<We.length;Xe++)mt(Ye,We[Xe]);else mt(Ye,We)}}if(L.qs&&D.qs(L.qs),D.uri.path?D.path=D.uri.path:D.path=D.uri.pathname+(D.uri.search||""),D.path.length===0&&(D.path="/"),L.aws&&D.aws(L.aws),L.hawk&&D.hawk(L.hawk),L.httpSignature&&D.httpSignature(L.httpSignature),L.auth&&(Object.prototype.hasOwnProperty.call(L.auth,"username")&&(L.auth.user=L.auth.username),Object.prototype.hasOwnProperty.call(L.auth,"password")&&(L.auth.pass=L.auth.password),D.auth(L.auth.user,L.auth.pass,L.auth.sendImmediately,L.auth.bearer)),D.gzip&&!D.hasHeader("accept-encoding")&&D.setHeader("accept-encoding","gzip, deflate"),D.uri.auth&&!D.hasHeader("authorization")){var Ge=D.uri.auth.split(":").map(function(Lt){return D._qs.unescape(Lt)});D.auth(Ge[0],Ge.slice(1).join(":"),!0)}if(!D.tunnel&&D.proxy&&D.proxy.auth&&!D.hasHeader("proxy-authorization")){var nt=D.proxy.auth.split(":").map(function(Lt){return D._qs.unescape(Lt)}),Et="Basic "+e(nt.join(":"));D.setHeader("proxy-authorization",Et)}D.proxy&&!D.tunnel&&(D.path=D.uri.protocol+"//"+D.uri.host+D.path),L.json&&D.json(L.json),L.multipart&&D.multipart(L.multipart),L.time&&(D.timing=!0,D.elapsedTime=D.elapsedTime||0);function Le(){if(z(D.body)&&(D.body=u.from(D.body)),!D.hasHeader("content-length")){var Lt;typeof D.body=="string"?Lt=u.byteLength(D.body):Array.isArray(D.body)?Lt=D.body.reduce(function(xe,X){return xe+X.length},0):Lt=D.body.length,Lt?D.setHeader("content-length",Lt):D.emit("error",new Error("Argument error, options.body."))}}D.body&&!$(D.body)&&Le(),L.oauth?D.oauth(L.oauth):D._oauth.params&&D.hasHeader("authorization")&&D.oauth(D._oauth.params);var Oe=D.proxy&&!D.tunnel?D.proxy.protocol:D.uri.protocol,$t={"http:":t,"https:":n},dt=D.httpModules||{};if(D.httpModule=dt[Oe]||$t[Oe],!D.httpModule)return D.emit("error",new Error("Invalid protocol: "+Oe));if(L.ca&&(D.ca=L.ca),!D.agent)if(L.agentOptions&&(D.agentOptions=L.agentOptions),L.agentClass)D.agentClass=L.agentClass;else if(L.forever){var gt=w();gt.major===0&>.minor<=10?D.agentClass=Oe==="http:"?j:j.SSL:(D.agentClass=D.httpModule.Agent,D.agentOptions=D.agentOptions||{},D.agentOptions.keepAlive=!0)}else D.agentClass=D.httpModule.Agent;D.pool===!1?D.agent=!1:D.agent=D.agent||D.getNewAgent(),D.on("pipe",function(Lt){if(D.ntick&&D._started&&D.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),D.src=Lt,b(Lt))D.hasHeader("content-type")||D.setHeader("content-type",B.lookup(Lt.path));else{if(Lt.headers)for(var xe in Lt.headers)D.hasHeader(xe)||D.setHeader(xe,Lt.headers[xe]);D._json&&!D.hasHeader("content-type")&&D.setHeader("content-type","application/json"),Lt.method&&!D.explicitMethod&&(D.method=Lt.method)}}),c(function(){if(!D._aborted){var Lt=function(){if(D._form&&(D._auth.hasAuth?D._auth.hasAuth&&D._auth.sentAuth&&D._form.pipe(D):D._form.pipe(D)),D._multipart&&D._multipart.chunked&&D._multipart.body.pipe(D),D.body)$(D.body)?D.body.pipe(D):(Le(),Array.isArray(D.body)?D.body.forEach(function(xe){D.write(xe)}):D.write(D.body),D.end());else if(D.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),D.requestBodyStream.pipe(D);else if(!D.src){if(D._auth.hasAuth&&!D._auth.sentAuth){D.end();return}D.method!=="GET"&&typeof D.method<"u"&&D.setHeader("content-length",0),D.end()}};D._form&&!D.hasHeader("content-length")?(D.setHeader(D._form.getHeaders(),!0),D._form.getLength(function(xe,X){!xe&&!isNaN(X)&&D.setHeader("content-length",X),Lt()})):Lt(),D.ntick=!0}})},Y.prototype.getNewAgent=function(){var L=this,D=L.agentClass,ee={};if(L.agentOptions)for(var oe in L.agentOptions)ee[oe]=L.agentOptions[oe];L.ca&&(ee.ca=L.ca),L.ciphers&&(ee.ciphers=L.ciphers),L.secureProtocol&&(ee.secureProtocol=L.secureProtocol),L.secureOptions&&(ee.secureOptions=L.secureOptions),typeof L.rejectUnauthorized<"u"&&(ee.rejectUnauthorized=L.rejectUnauthorized),L.cert&&L.key&&(ee.key=L.key,ee.cert=L.cert),L.pfx&&(ee.pfx=L.pfx),L.passphrase&&(ee.passphrase=L.passphrase);var fe="";D!==L.httpModule.Agent&&(fe+=D.name);var ue=L.proxy;typeof ue=="string"&&(ue=l.parse(ue));var qe=ue&&ue.protocol==="https:"||this.uri.protocol==="https:";return qe&&(ee.ca&&(fe&&(fe+=":"),fe+=ee.ca),typeof ee.rejectUnauthorized<"u"&&(fe&&(fe+=":"),fe+=ee.rejectUnauthorized),ee.cert&&(fe&&(fe+=":"),fe+=ee.cert.toString("ascii")+ee.key.toString("ascii")),ee.pfx&&(fe&&(fe+=":"),fe+=ee.pfx.toString("ascii")),ee.ciphers&&(fe&&(fe+=":"),fe+=ee.ciphers),ee.secureProtocol&&(fe&&(fe+=":"),fe+=ee.secureProtocol),ee.secureOptions&&(fe&&(fe+=":"),fe+=ee.secureOptions)),L.pool===o&&!fe&&Object.keys(ee).length===0&&L.httpModule.globalAgent?L.httpModule.globalAgent:(fe=L.uri.protocol+fe,L.pool[fe]||(L.pool[fe]=new D(ee),L.pool.maxSockets&&(L.pool[fe].maxSockets=L.pool.maxSockets)),L.pool[fe])},Y.prototype.start=function(){var L=this;if(L.timing)var D=new Date().getTime(),ee=T();if(!L._aborted){L._started=!0,L.method=L.method||"GET",L.href=L.uri.href,L.src&&L.src.stat&&L.src.stat.size&&!L.hasHeader("content-length")&&L.setHeader("content-length",L.src.stat.size),L._aws&&L.aws(L._aws,!0);var oe=y(L);delete oe.auth,Z("make request",L.uri.href),delete oe.timeout;try{L.req=L.httpModule.request(oe)}catch(ue){L.emit("error",ue);return}L.timing&&(L.startTime=D,L.startTimeNow=ee,L.timings={});var fe;L.timeout&&!L.timeoutTimer&&(L.timeout<0?fe=0:typeof L.timeout=="number"&&isFinite(L.timeout)&&(fe=L.timeout)),L.req.on("response",L.onRequestResponse.bind(L)),L.req.on("error",L.onRequestError.bind(L)),L.req.on("drain",function(){L.emit("drain")}),L.req.on("socket",function(ue){var qe=ue._connecting||ue.connecting;if(L.timing&&(L.timings.socket=T()-L.startTimeNow,qe)){var rt=function(){L.timings.lookup=T()-L.startTimeNow},Ve=function(){L.timings.connect=T()-L.startTimeNow};ue.once("lookup",rt),ue.once("connect",Ve),L.req.once("error",function(){ue.removeListener("lookup",rt),ue.removeListener("connect",Ve)})}var et=function(){L.req.setTimeout(fe,function(){if(L.req){L.abort();var Ye=new Error("ESOCKETTIMEDOUT");Ye.code="ESOCKETTIMEDOUT",Ye.connect=!1,L.emit("error",Ye)}})};if(fe!==void 0)if(qe){var mt=function(){ue.removeListener("connect",mt),L.clearTimeout(),et()};ue.on("connect",mt),L.req.on("error",function(Ye){ue.removeListener("connect",mt)}),L.timeoutTimer=setTimeout(function(){ue.removeListener("connect",mt),L.abort();var Ye=new Error("ETIMEDOUT");Ye.code="ETIMEDOUT",Ye.connect=!0,L.emit("error",Ye)},fe)}else et();L.emit("socket",ue)}),L.emit("request",L.req)}},Y.prototype.onRequestError=function(L){var D=this;if(!D._aborted){if(D.req&&D.req._reusedSocket&&L.code==="ECONNRESET"&&D.agent.addRequestNoreuse){D.agent={addRequest:D.agent.addRequestNoreuse.bind(D.agent)},D.start(),D.req.end();return}D.clearTimeout(),D.emit("error",L)}},Y.prototype.onRequestResponse=function(L){var D=this;if(D.timing&&(D.timings.response=T()-D.startTimeNow),Z("onRequestResponse",D.uri.href,L.statusCode,L.headers),L.on("end",function(){D.timing&&(D.timings.end=T()-D.startTimeNow,L.timingStart=D.startTime,D.timings.socket||(D.timings.socket=0),D.timings.lookup||(D.timings.lookup=D.timings.socket),D.timings.connect||(D.timings.connect=D.timings.lookup),D.timings.response||(D.timings.response=D.timings.connect),Z("elapsed time",D.timings.end),D.elapsedTime+=Math.round(D.timings.end),L.elapsedTime=D.elapsedTime,L.timings=D.timings,L.timingPhases={wait:D.timings.socket,dns:D.timings.lookup-D.timings.socket,tcp:D.timings.connect-D.timings.lookup,firstByte:D.timings.response-D.timings.connect,download:D.timings.end-D.timings.response,total:D.timings.end}),Z("response end",D.uri.href,L.statusCode,L.headers)}),D._aborted){Z("aborted",D.uri.href),L.resume();return}if(D.response=L,L.request=D,L.toJSON=H,D.httpModule===n&&D.strictSSL&&(!L.hasOwnProperty("socket")||!L.socket.authorized)){Z("strict ssl error",D.uri.href);var ee=L.hasOwnProperty("socket")?L.socket.authorizationError:D.uri.href+" does not support SSL";D.emit("error",new Error("SSL Error: "+ee));return}D.originalHost=D.getHeader("host"),D.originalHostHeaderName||(D.originalHostHeaderName=D.hasHeader("host")),D.setHost&&D.removeHeader("host"),D.clearTimeout();var oe=D._jar&&D._jar.setCookie?D._jar:v,fe=function(mt){try{oe.setCookie(mt,D.uri.href,{ignoreError:!0})}catch(Ye){D.emit("error",Ye)}};if(L.caseless=M(L.headers),L.caseless.has("set-cookie")&&!D._disableCookies){var ue=L.caseless.has("set-cookie");Array.isArray(L.headers[ue])?L.headers[ue].forEach(fe):fe(L.headers[ue])}if(!D._redirect.onResponse(L)){{L.on("close",function(){D._ended||D.response.emit("end")}),L.once("end",function(){D._ended=!0});var qe=function(mt){return D.method==="HEAD"||mt>=100&&mt<200||mt===204||mt===304},rt;if(D.gzip&&!qe(L.statusCode)){var Ve=L.headers["content-encoding"]||"identity";Ve=Ve.trim().toLowerCase();var et={flush:h.Z_SYNC_FLUSH,finishFlush:h.Z_SYNC_FLUSH};Ve==="gzip"?(rt=h.createGunzip(et),L.pipe(rt)):Ve==="deflate"?(rt=h.createInflate(et),L.pipe(rt)):(Ve!=="identity"&&Z("ignoring unrecognized Content-Encoding "+Ve),rt=L)}else rt=L;D.encoding&&(D.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):rt.setEncoding(D.encoding)),D._paused&&rt.pause(),D.responseContent=rt,D.emit("response",L),D.dests.forEach(function(mt){D.pipeDest(mt)}),rt.on("data",function(mt){D.timing&&!D.responseStarted&&(D.responseStartTime=new Date().getTime(),L.responseStartTime=D.responseStartTime),D._destdata=!0,D.emit("data",mt)}),rt.once("end",function(mt){D.emit("end",mt)}),rt.on("error",function(mt){D.emit("error",mt)}),rt.on("close",function(){D.emit("close")}),D.callback?D.readResponseBody(L):D.on("end",function(){if(D._aborted){Z("aborted",D.uri.href);return}D.emit("complete",L)})}Z("finish init function",D.uri.href)}},Y.prototype.readResponseBody=function(L){var D=this;Z("reading response's body");var ee=[],oe=0,fe=[];D.on("data",function(ue){u.isBuffer(ue)?ue.length&&(oe+=ue.length,ee.push(ue)):fe.push(ue)}),D.on("end",function(){if(Z("end event",D.uri.href),D._aborted){Z("aborted",D.uri.href),ee=[],oe=0;return}if(oe?(Z("has body",D.uri.href,oe),L.body=u.concat(ee,oe),D.encoding!==null&&(L.body=L.body.toString(D.encoding)),ee=[],oe=0):fe.length&&(D.encoding==="utf8"&&fe[0].length>0&&fe[0][0]==="\uFEFF"&&(fe[0]=fe[0].substring(1)),L.body=fe.join("")),D._json)try{L.body=JSON.parse(L.body,D._jsonReviver)}catch{Z("invalid JSON received",D.uri.href)}Z("emitting complete",D.uri.href),typeof L.body>"u"&&!D._json&&(L.body=D.encoding===null?u.alloc(0):""),D.emit("complete",L,L.body)})},Y.prototype.abort=function(){var L=this;L._aborted=!0,L.req?L.req.abort():L.response&&L.response.destroy(),L.clearTimeout(),L.emit("abort")},Y.prototype.pipeDest=function(L){var D=this,ee=D.response;if(L.headers&&!L.headersSent){if(ee.caseless.has("content-type")){var oe=ee.caseless.has("content-type");L.setHeader?L.setHeader(oe,ee.headers[oe]):L.headers[oe]=ee.headers[oe]}if(ee.caseless.has("content-length")){var fe=ee.caseless.has("content-length");L.setHeader?L.setHeader(fe,ee.headers[fe]):L.headers[fe]=ee.headers[fe]}}if(L.setHeader&&!L.headersSent){for(var ue in ee.headers)(!D.gzip||ue!=="content-encoding")&&L.setHeader(ue,ee.headers[ue]);L.statusCode=ee.statusCode}D.pipefilter&&D.pipefilter(ee,L)},Y.prototype.qs=function(L,D){var ee=this,oe;!D&&ee.uri.query?oe=ee._qs.parse(ee.uri.query):oe={};for(var fe in L)oe[fe]=L[fe];var ue=ee._qs.stringify(oe);return ue===""||(ee.uri=l.parse(ee.uri.href.split("?")[0]+"?"+ue),ee.url=ee.uri,ee.path=ee.uri.path,ee.uri.host==="unix"&&ee.enableUnixSocket()),ee},Y.prototype.form=function(L){var D=this;return L?(/^application\/x-www-form-urlencoded\b/.test(D.getHeader("content-type"))||D.setHeader("content-type","application/x-www-form-urlencoded"),D.body=typeof L=="string"?D._qs.rfc3986(L.toString("utf8")):D._qs.stringify(L).toString("utf8"),D):(D._form=new I,D._form.on("error",function(ee){ee.message="form-data: "+ee.message,D.emit("error",ee),D.abort()}),D._form)},Y.prototype.multipart=function(L){var D=this;return D._multipart.onRequest(L),D._multipart.chunked||(D.body=D._multipart.body),D},Y.prototype.json=function(L){var D=this;return D.hasHeader("accept")||D.setHeader("accept","application/json"),typeof D.jsonReplacer=="function"&&(D._jsonReplacer=D.jsonReplacer),D._json=!0,typeof L=="boolean"?D.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(D.getHeader("content-type"))?D.body=D._qs.rfc3986(D.body):D.body=p(D.body,D._jsonReplacer),D.hasHeader("content-type")||D.setHeader("content-type","application/json")):(D.body=p(L,D._jsonReplacer),D.hasHeader("content-type")||D.setHeader("content-type","application/json")),typeof D.jsonReviver=="function"&&(D._jsonReviver=D.jsonReviver),D},Y.prototype.getHeader=function(L,D){var ee=this,oe,fe,ue;return D||(D=ee.headers),Object.keys(D).forEach(function(qe){qe.length===L.length&&(fe=new RegExp(L,"i"),ue=qe.match(fe),ue&&(oe=D[qe]))}),oe},Y.prototype.enableUnixSocket=function(){var L=this.uri.path.split(":"),D=L[0],ee=L[1];this.socketPath=D,this.uri.pathname=ee,this.uri.path=ee,this.uri.host=D,this.uri.hostname=D,this.uri.isUnix=!0},Y.prototype.auth=function(L,D,ee,oe){var fe=this;return fe._auth.onRequest(L,D,ee,oe),fe},Y.prototype.aws=function(L,D){var ee=this;if(!D)return ee._aws=L,ee;if(L.sign_version===4||L.sign_version==="4"){var oe={host:ee.uri.host,path:ee.uri.path,method:ee.method,headers:ee.headers,body:ee.body};L.service&&(oe.service=L.service);var fe=k.sign(oe,{accessKeyId:L.key,secretAccessKey:L.secret,sessionToken:L.session});ee.setHeader("authorization",fe.headers.Authorization),ee.setHeader("x-amz-date",fe.headers["X-Amz-Date"]),fe.headers["X-Amz-Security-Token"]&&ee.setHeader("x-amz-security-token",fe.headers["X-Amz-Security-Token"])}else{var ue=new Date;ee.setHeader("date",ue.toUTCString());var qe={key:L.key,secret:L.secret,verb:ee.method.toUpperCase(),date:ue,contentType:ee.getHeader("content-type")||"",md5:ee.getHeader("content-md5")||"",amazonHeaders:S.canonicalizeHeaders(ee.headers)},rt=ee.uri.path;L.bucket&&rt?qe.resource="/"+L.bucket+rt:L.bucket&&!rt?qe.resource="/"+L.bucket:!L.bucket&&rt?qe.resource=rt:!L.bucket&&!rt&&(qe.resource="/"),qe.resource=S.canonicalizeResource(qe.resource),ee.setHeader("authorization",S.authorization(qe))}return ee},Y.prototype.httpSignature=function(L){var D=this;return A.signRequest({getHeader:function(ee){return D.getHeader(ee,D.headers)},setHeader:function(ee,oe){D.setHeader(ee,oe)},method:D.method,path:D.path},L),Z("httpSignature authorization",D.getHeader("authorization")),D},Y.prototype.hawk=function(L){var D=this;D.setHeader("Authorization",Q.header(D.uri,D.method,L))},Y.prototype.oauth=function(L){var D=this;return D._oauth.onRequest(L),D},Y.prototype.jar=function(L){var D=this,ee;if(D._redirect.redirectsFollowed===0&&(D.originalCookieHeader=D.getHeader("cookie")),!L)ee=!1,D._disableCookies=!0;else{var oe=L.getCookieString?L:v,fe=D.uri.href;oe&&(ee=oe.getCookieString(fe))}return ee&&ee.length&&(D.originalCookieHeader?D.setHeader("cookie",D.originalCookieHeader+"; "+ee):D.setHeader("cookie",ee)),D._jar=L,D},Y.prototype.pipe=function(L,D){var ee=this;if(ee.response)if(ee._destdata)ee.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(ee._ended)ee.emit("error",new Error("You cannot pipe after the response has been ended."));else return m.Stream.prototype.pipe.call(ee,L,D),ee.pipeDest(L),L;else return ee.dests.push(L),m.Stream.prototype.pipe.call(ee,L,D),L},Y.prototype.write=function(){var L=this;if(!L._aborted&&(L._started||L.start(),L.req))return L.req.write.apply(L.req,arguments)},Y.prototype.end=function(L){var D=this;D._aborted||(L&&D.write(L),D._started||D.start(),D.req&&D.req.end())},Y.prototype.pause=function(){var L=this;L.responseContent?L.responseContent.pause.apply(L.responseContent,arguments):L._paused=!0},Y.prototype.resume=function(){var L=this;L.responseContent?L.responseContent.resume.apply(L.responseContent,arguments):L._paused=!1},Y.prototype.destroy=function(){var L=this;this.clearTimeout(),L._ended?L.response&&L.response.destroy():L.end()},Y.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)},Y.defaultProxyHeaderWhiteList=ke.defaultProxyHeaderWhiteList.slice(),Y.defaultProxyHeaderExclusiveList=ke.defaultProxyHeaderExclusiveList.slice(),Y.prototype.toJSON=R,request$2=Y,request$2}var extend=extend$1,cookies=cookies$1,helpers=helpers$1,paramsHaveRequestBody=helpers.paramsHaveRequestBody;function initParams(t,n,l){typeof n=="function"&&(l=n);var d={};return n!==null&&typeof n=="object"?extend(d,n,{uri:t}):typeof t=="string"?extend(d,{uri:t}):extend(d,t),d.callback=l||d.callback,d}function request$1(t,n,l){if(typeof t>"u")throw new Error("undefined is not a valid uri or options object.");var d=initParams(t,n,l);if(d.method==="HEAD"&¶msHaveRequestBody(d))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new request$1.Request(d)}function verbFunc(t){var n=t.toUpperCase();return function(l,d,m){var h=initParams(l,d,m);return h.method=n,request$1(h,h.callback)}}request$1.get=verbFunc("get"),request$1.head=verbFunc("head"),request$1.options=verbFunc("options"),request$1.post=verbFunc("post"),request$1.put=verbFunc("put"),request$1.patch=verbFunc("patch"),request$1.del=verbFunc("delete"),request$1.delete=verbFunc("delete"),request$1.jar=function(t){return cookies.jar(t)},request$1.cookie=function(t){return cookies.parse(t)};function wrapRequestMethod(t,n,l,d){return function(m,h,S){var k=initParams(m,h,S),A={};return extend(!0,A,n,k),A.pool=k.pool||n.pool,d&&(A.method=d.toUpperCase()),typeof l=="function"&&(t=l),t(A,A.callback)}}request$1.defaults=function(t,n){var l=this;t=t||{},typeof t=="function"&&(n=t,t={});var d=wrapRequestMethod(l,t,n),m=["get","head","post","put","patch","del","delete"];return m.forEach(function(h){d[h]=wrapRequestMethod(l[h],t,n,h)}),d.cookie=wrapRequestMethod(l.cookie,t,n),d.jar=l.jar,d.defaults=l.defaults,d},request$1.forever=function(t,n){var l={};return n&&extend(l,n),t&&(l.agentOptions=t),l.forever=!0,request$1.defaults(l)};var request_1=request$1;request$1.Request=requireRequest(),request$1.initParams=initParams,Object.defineProperty(request$1,"debug",{enumerable:!0,get:function(){return request$1.Request.debug},set:function(t){request$1.Request.debug=t}});var sha1$1={exports:{}},crypt={exports:{}};(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(l,d){return l<<d|l>>>32-d},rotr:function(l,d){return l<<32-d|l>>>d},endian:function(l){if(l.constructor==Number)return n.rotl(l,8)&16711935|n.rotl(l,24)&4278255360;for(var d=0;d<l.length;d++)l[d]=n.endian(l[d]);return l},randomBytes:function(l){for(var d=[];l>0;l--)d.push(Math.floor(Math.random()*256));return d},bytesToWords:function(l){for(var d=[],m=0,h=0;m<l.length;m++,h+=8)d[h>>>5]|=l[m]<<24-h%32;return d},wordsToBytes:function(l){for(var d=[],m=0;m<l.length*32;m+=8)d.push(l[m>>>5]>>>24-m%32&255);return d},bytesToHex:function(l){for(var d=[],m=0;m<l.length;m++)d.push((l[m]>>>4).toString(16)),d.push((l[m]&15).toString(16));return d.join("")},hexToBytes:function(l){for(var d=[],m=0;m<l.length;m+=2)d.push(parseInt(l.substr(m,2),16));return d},bytesToBase64:function(l){for(var d=[],m=0;m<l.length;m+=3)for(var h=l[m]<<16|l[m+1]<<8|l[m+2],S=0;S<4;S++)m*8+S*6<=l.length*8?d.push(t.charAt(h>>>6*(3-S)&63)):d.push("=");return d.join("")},base64ToBytes:function(l){l=l.replace(/[^A-Z0-9+\/]/ig,"");for(var d=[],m=0,h=0;m<l.length;h=++m%4)h!=0&&d.push((t.indexOf(l.charAt(m-1))&Math.pow(2,-2*h+8)-1)<<h*2|t.indexOf(l.charAt(m))>>>6-h*2);return d}};crypt.exports=n})();var cryptExports=crypt.exports,charenc={utf8:{stringToBytes:function(t){return charenc.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(charenc.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var n=[],l=0;l<t.length;l++)n.push(t.charCodeAt(l)&255);return n},bytesToString:function(t){for(var n=[],l=0;l<t.length;l++)n.push(String.fromCharCode(t[l]));return n.join("")}}},charenc_1=charenc;(function(){var t=cryptExports,n=charenc_1.utf8,l=charenc_1.bin,d=function(h){h.constructor==String?h=n.stringToBytes(h):typeof Buffer$C<"u"&&typeof Buffer$C.isBuffer=="function"&&Buffer$C.isBuffer(h)?h=Array.prototype.slice.call(h,0):Array.isArray(h)||(h=h.toString());var S=t.bytesToWords(h),k=h.length*8,A=[],B=1732584193,M=-271733879,j=-1732584194,I=271733878,P=-1009589776;S[k>>5]|=128<<24-k%32,S[(k+64>>>9<<4)+15]=k;for(var $=0;$<S.length;$+=16){for(var z=B,N=M,F=j,U=I,J=P,te=0;te<80;te++){if(te<16)A[te]=S[$+te];else{var se=A[te-3]^A[te-8]^A[te-14]^A[te-16];A[te]=se<<1|se>>>31}var de=(B<<5|B>>>27)+P+(A[te]>>>0)+(te<20?(M&j|~M&I)+1518500249:te<40?(M^j^I)+1859775393:te<60?(M&j|M&I|j&I)-1894007588:(M^j^I)-899497514);P=I,I=j,j=M<<30|M>>>2,M=B,B=de}B+=z,M+=N,j+=F,I+=U,P+=J}return[B,M,j,I,P]},m=function(h,S){var k=t.wordsToBytes(d(h));return S&&S.asBytes?k:S&&S.asString?l.bytesToString(k):t.bytesToHex(k)};m._blocksize=16,m._digestsize=20,sha1$1.exports=m})();var sha1Exports=sha1$1.exports,php2js$1={rawurlencode:function(t){return t=(t+"").toString(),encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/\+/g," ")},http_build_query:function(t,n,l){var d,m,h=[],S=function(A,B,M){var j,I=[];if(B===!0?B="1":B===!1&&(B="0"),B!=null)if(typeof B=="object"){for(j in B)B[j]!=null&&I.push(S(A+"["+j+"]",B[j],M));return I.join(M)}else{if(typeof B!="function")return php2js$1.urlencode(A)+"="+php2js$1.urlencode(B);throw new Error("There was an error processing for http_build_query().")}else return""};l||(l="&");for(m in t){d=t[m],n&&!isNaN(m)&&(m=String(n)+m);var k=S(m,d,l);k!==""&&h.push(k)}return h.join(l)},urlencode:function(t){return t=(t+"").toString(),encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/%20/g,"+")}},php2js_1=php2js$1,request=request_1,sha1=sha1Exports,php2js=php2js_1,APIConfig={url:"http://api.jwplatform.com/v1/videos/create",key:"",secret:"",format:"json",kit:"php-1.4"},jwplayer$1={makeRequest:function(t,n){request({url:t,method:"GET",headers:{"Content-Type":"MyContentType","Custom-Header":"Custom Value"}},n)},setArguments:function(t,n){t.api_nonce=Math.floor(Math.random()*1e8),t.api_timestamp=Math.floor(Date.now()/1e3),t.api_key=APIConfig.key,t.api_format=APIConfig.format,t.api_kit=APIConfig.kit;var l={};Object.keys(t).sort().forEach(function(h){l[h]=t[h]});var d="";Object.keys(l).forEach(function(h){d!=""&&(d+="&"),d+=php2js.rawurlencode(h)+"="+php2js.rawurlencode(l[h])}),t.api_signature=sha1(d+APIConfig.secret);var m=APIConfig.url+"?"+php2js.http_build_query(t,"","&");jwplayer$1.makeRequest(m,n)}},jwplayer_1=jwplayer$1;const JwpPlayerWidget=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l={},d=jwplayer_1.Player(this.$[0]),m=!1,h=!0;typeof this.video>"u"&&(this.video=this.media.video),l.file=this.video,l.primary="flash",l.fallback=!1,l.controls=!1,l.width=this.width,this.height&&(l.height=this.height),this.autostart,this.url_transform&&(l.file=this.url_transform(l.file));var S=this.media;S.on("setcurrenttime",function(A){m=h,d.seek(A/1e3)}),S.on("setvolume",function(A){d.setVolume(Math.floor(A*100)),S.volume=A}),S.on("setmuted",function(A){d.setMute(A),S.muted=A}),S.on("setplay",function(){d.play(!0),S.paused=!1}),S.on("setpause",function(){d.pause(!0),S.paused=!0});function k(){S.muted=d.getMute(),S.volume=d.getVolume()/100}l.events={onReady:function(){k(),S.currentTime=new t.Model.Time(1e3*d.getPosition()||0),S.trigger("loadedmetadata")},onTime:function(A){m?(d.pause(!0),m=!1):h&&d.getState()==="PLAYING"&&(h=!1,S.trigger("play")),S.trigger("timeupdate",new t.Model.Time(A.position*1e3))},onPlay:function(){m||(h=!1,S.trigger("play"))},onPause:function(){h=!0,S.trigger("pause")},onSeek:function(){S.trigger("seeked")},onMute:function(A){S.muted=A.mute,S.trigger("volumechange")},onVolume:function(A){S.volume=A.volume/100,S.trigger("volumechange")}},d=d.setup(l),this.jwplayer=d}},Cr(n,"defaults",{}),n},latestAnnotationStyles={},LatestAnnotation=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}importUsers(){if(!this.source.users_data){this.usernames=Array();var l=this,d=this.getWidgetAnnotations(),m="";return d.forEach(function(h){l.usernames.indexOf(h.creator)==-1&&l.usernames.push(h.creator)}),this.usernames.forEach(function(h){m+=h+","}),m=m.substring(0,m.length-1),_url=mustache.render(this.api_users_endpoint,{usernames_list_string:encodeURIComponent(m),usernames_list_length:this.usernames.length}),jQuery.ajax({async:!1,url:_url,type:"GET",success:function(h){l.source.users_data=h.objects},error:function(h,S,k){console.log(h),console.log(S),console.log(k)}})}}draw(){var l=this;this.renderTemplate(),this.annotationContainer_$=this.$.find(".Ldt-LatestAnnotation"),this.selectable_annotations&&(this.onMdpEvent("AnnotationsList.refresh",function(){l.getWidgetAnnotations().forEach(function(d){d.off("click"),d.on("click",function(){var m={},h="",S=this.source.users_data.filter(function(k){return k.username==d.creator});S.length==0?m.username=d.creator:m=S[0],h=l.make_name_string_function(m),_html=mustache.render(l.annotationTemplate,{annotation_created:d.created.toLocaleDateString()+", "+d.created.toLocaleTimeString(),annotation_creator:h,annotation_title:d.title,annotation_content:d.description,copy_and_edit_button:l.copy_and_edit_button,button_text:l.l10n.copy_and_edit}),l.annotationContainer_$.html(_html),l.selectedAnnotation=!0})})}),this.segments=l.source.getAnnotationsByTypeTitle(this.segments_annotation_type),this.segments.forEach(function(d){d.on("click",function(){l.selectedAnnotation=!1})}),this.currentSegment=!1),this.onMediaEvent("timeupdate",function(){l.refresh()}),this.onMediaEvent("settimerange",function(d){l.refresh(d)}),this.starts_hidden?(this.visible=!0,this.hide()):(this.visible=!1,this.show()),this.selectedAnnotation=!1,this.player.trigger("AnnotationsList.refresh"),this.refresh()}refresh(l){l=typeof l<"u"?l:!1;var d=this;if(this.hide_without_segment){if(!l&&!this.media.getTimeRange()){var m=this.media.getCurrentTime(),h=this.segments.filter(function($){return m>=$.begin&&m<=$.end});h.length==0?(this.currentSegment=!1,this.selectedAnnotation=!1):this.currentSegment=h[0]}else{var S=l?l[0]:this.media.getTimeRange()[0],k=l?l[1]:this.media.getTimeRange()[1];if(!this.currentSegment||this.currentSegment.begin!=S||this.currentSegment.end!=k){var h=this.segments.filter(function(z){return z.begin==S&&z.end==k});h.length>0&&(this.selectedAnnotation=!1,this.currentSegment=h[0])}}this.currentSegment?this.visible||this.show():this.visible&&this.hide()}if(this.visible&&!this.selectedAnnotation){var A=this.getWidgetAnnotations();this.filter_by_segment&&(this.currentSegment?A=A.filter(function($){return _annotationTime=($.begin+$.end)/2,d.currentSegment.begin<=_annotationTime&&d.currentSegment.end>=_annotationTime}):A=A.filter(function($){return!1})),A=A.sortBy(function($){return $.created});var B=!1,M="",j="",I={};if(A.length!=0)B=A.pop(),_users=this.source.users_data.filter(function($){return $.username==B.creator}),_users.length==0?I.username=B.creator:I=_users[0],j=this.make_name_string_function(I),M=mustache.render(this.annotationTemplate,{annotation_created:B.created.toLocaleDateString()+", "+B.created.toLocaleTimeString(),annotation_creator:j,annotation_title:B.title,annotation_content:B.description,copy_and_edit_button:this.copy_and_edit_button,button_text:this.l10n.copy_and_edit});else{var P=this.l10n.empty;this.empty_message&&(P=this.empty_message),M="<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-NoAnnotation'>"+P+"</div>"}this.annotationContainer_$.html(M)}this.copy_and_edit_button&&(this.copyAndEditButton_$=this.$.find(".Ldt-LatestAnnotation-CopyEditButton"),this.copyAndEditButton_$.click(this.functionWrapper("copy_and_edit")))}copy_and_edit(){this.player.trigger("CreateAnnotation.show"),this.hide_annotations_list&&this.player.trigger("AnnotationsList.hide"),annotationText=jQuery(".Ldt-LatestAnnotation-Content").get(0).innerHTML,jQuery(".Ldt-CreateAnnotation-Description").removeClass("empty"),jQuery(".Ldt-CreateAnnotation-Description").val(annotationText)}hide(){this.visible&&(this.visible=!1,this.$.find(".Ldt-LatestAnnotation-header").hide(),this.annotationContainer_$.hide())}show(){this.visible||(this.visible=!0,this.$.find(".Ldt-LatestAnnotation-header").show(),this.annotationContainer_$.show())}},Cr(n,"defaults",{pre_draw_callback:function(){return this.importUsers()},from_user:!1,filter_by_segment:!1,segments_annotation_type:"chap",hide_without_segment:!1,annotation_type:"contribution",show_only_annotation_from_user:!1,copy_and_edit_button:!1,hide_annotations_list:!1,selectable_annotations:!1,empty_message:!1,starts_hidden:!1,show_header:!1,custom_header:!1,make_name_string_function:function(l){return l.username?l.username:"Anonymous"}}),Cr(n,"messages",{fr:{copy_and_edit:"Copier et Editer",empty:"Aucune annotation à afficher",header:"Dernière annotation"},en:{copy_and_edit:"Copy and Edit",empty:"No annotation to display",header:"Last annotation"}}),Cr(n,"template","{{#show_header}}<p class='Ldt-LatestAnnotation-header'>{{#custom_header}}{{custom_header}}{{/custom_header}}{{^custom_header}}{{l10n.header}}{{/custom_header}}</p>{{/show_header}}<div class='Ldt-LatestAnnotation'></div>"),Cr(n,"annotationTemplate","<div class='Ldt-LatestAnnotation-Box'>{{#copy_and_edit_button}}<div class='Ldt-LatestAnnotation-CopyEditButton'>{{button_text}}</div>{{/copy_and_edit_button}}<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-CreationDate'>{{{annotation_created}}}</div><div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Title'>{{{annotation_creator}}}{{#annotation_title}}: {{{annotation_title}}}{{/annotation_title}}</div><div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Content'>{{{annotation_content}}}</div></div>"),n},mashupPlayerStyles={},MashupPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.is_mashup=!0}draw(){var l=this,d=this.media,m=null,h=null,S,k,A=0,B=!1,M,j,I=d.getMedias();d.paused=!this.autostart&&!this.autoplay;function P(){A>=d.duration&&(d.paused||(d.paused=!0,d.trigger("pause")),A=0);var F=d.getAnnotationAtTime(A);if(typeof F>"u"){m&&(m.pause(),d.paused||(d.paused=!0,d.trigger("pause")));return}if(F!==h){h=F,S=h.annotation.begin.milliseconds,k=h.annotation.end.milliseconds,j=S-h.begin.milliseconds,m=h.getMedia();for(var U=0;U<I.length;U++)I[U].id!==m.id?(l.split_screen||I[U].hide(),I[U].pause()):I[U].show();var J=[],te=d.getAnnotations().filter(function(se){return se.begin>=h.end&&se.getMedia()!==m});_$1(te).each(function(se){var de=se.getMedia();_$1(J).indexOf(de.id)===-1&&(J.push(de.id),de.setCurrentTime(se.annotation.begin.getSeconds()),de.seeking=!0)})}m.setCurrentTime(A+j),m.seeking=!0,d.paused||(m.play(),B=!0,M.show()),d.trigger("timeupdate",new t.Model.Time(A))}this.height||(this.height=Math.floor(this.width/this.aspect_ratio),this.$.css({height:this.height})),this.$.css({background:this.background});var $=Math.ceil(Math.sqrt(I.length)),z=this.split_screen?this.width/$:this.width,N=this.split_screen?this.height/$:this.height;_$1(I).each(function(F,U){var J=jQuery('<div class="Ldt-MashupPlayer-Media"><div class="Ldt-MashupPlayer-Subwidget"></div></div>');J.css({top:l.split_screen?N*Math.floor(U/$):0,left:l.split_screen?z*(U%$):0,height:N,width:z,display:l.split_screen?"block":"none"}),l.$.append(J),l.insertSubwidget(J.find(".Ldt-MashupPlayer-Subwidget"),_$1({type:l.player_type,media_id:F.id,height:N,width:z,url_transform:l.url_transform}).extend(l.player_options)),F.loadedMetadata=!1,F.show=function(){J.show()},F.hide=function(){J.hide()},F.on("loadedmetadata",function(){F.loadedMetadata=!0;for(var te=!0,se=0;se<I.length;se++)te=te&&I[se].loadedMetadata;te&&(M.fadeOut(),P(),d.trigger("loadedmetadata"))}),F.on("timeupdate",function(te){!d.paused&&F===m&&!F.seeking&&(te<k?te>=S?A=te-j:(A=S-j,F.setCurrentTime(S)):(A=k-j,F.pause(),P()),d.trigger("timeupdate",new t.Model.Time(A)))}),F.on("seeked",function(){F.seeking=!1,F===m&&B&&(B=!1,M.hide())}),F.on("play",function(){F===m&&d.trigger("play")}),F.on("pause",function(){F===m&&d.trigger("pause")}),F.on("volumechange",function(){d.muted=F.muted,d.volume=F.volume,d.trigger("volumechange")})}),M=jQuery('<div class="Ldt-MashupPlayer-Waiting"></div>'),this.$.append(M),d.on("setcurrenttime",function(F){A=F,P()}),d.on("setvolume",function(F){for(var U=0;U<I.length;U++)I[U].setVolume(F);d.volume=F}),d.on("setmuted",function(F){for(var U=0;U<I.length;U++)I[U].setMuted(F);d.muted=F}),d.on("setplay",function(){d.paused=!1,P()}),d.on("setpause",function(){d.paused=!0,m&&m.pause()}),d.on("loadedmetadata",P)}},Cr(n,"defaults",{aspect_ratio:14/9,split_screen:!1,player_type:"PopcornPlayer",background:"#000000"}),n},Mediafragment=function(t){return class extends t.Widgets.Widget{constructor(n,l){if(super(n,l),this.last_hash_key="",this.last_hash_value="",this.last_extra_key="",this.last_extra_value="",window.onhashchange=this.functionWrapper("goToHash"),typeof window.addEventListener<"u"){var d=this;window.addEventListener("message",function(m){/^#/.test(m.data)&&d.setWindowHash(m.data)})}this.onMdpEvent("Mediafragment.setHashToAnnotation","setHashToAnnotation"),this.blocked=!1}draw(){this.onMediaEvent("setpause","setHashToTime");var n=this;this.getWidgetAnnotations().forEach(function(l){l.on("click",function(){n.setHashToAnnotation(l)})}),this.media.loadedMetadata?this.goToHash():this.onMediaEvent("loadedmetadata","goToHash")}setWindowHash(n){typeof window.history<"u"&&typeof window.history.replaceState<"u"?window.history.replaceState({},"",n):document.location.hash=n}getLastHash(){var n=document.location.hash.replace(/^#/,"").split("&");return n=_$1(n).filter(function(l){return l&&!/^(id|t)=/.test(l)}),this.last_hash_key&&n.push(this.last_hash_key+"="+this.last_hash_value),this.last_extra_key&&n.push(this.last_extra_key+"="+this.last_extra_value),"#"+n.join("&")}goToHash(){if(document.location.hash!==this.getLastHash())for(var n=document.location.hash.replace(/^#/,"").split("&"),l=0;l<n.length;l++){var d=n[l].split("=");if(d[0]=="id"||d[0]=="t"){if(this.last_hash_key=d[0],this.last_hash_value=d[1],this.last_hash_key=="id"){var m=this.source.getElement(this.last_hash_value);if(typeof m<"u")this.media.setCurrentTime(m.begin);else continue}this.last_hash_key=="t"&&this.media.setCurrentTime(1e3*this.last_hash_value);break}}}setHashToAnnotation(n){this.setHash("id",n.id,"t",n.begin/1e3)}setHashToTime(){this.setHash("t",this.media.getCurrentTime().getSeconds())}setHash(n,l,d,m){if(!this.blocked&&(this.last_hash_key!==n||this.last_hash_value!==l)){this.last_hash_key=n,this.last_hash_value=l,this.last_extra_key=d,this.last_extra_value=m;var h=this.getLastHash();this.setWindowHash(h),window.parent!==window&&window.parent.postMessage(h,"*"),this.block()}}unblock(){typeof this.blockTimeout<"u"&&window.clearTimeout(this.blockTimeout),this.blockTimeout=void 0,this.blocked=!1}block(){typeof this.blockTimeout<"u"&&window.clearTimeout(this.blockTimeout),this.blocked=!0,this.blockTimeout=window.setTimeout(this.functionWrapper("unblock"),1500)}}},mediaListStyles={},MediaList=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastMedia=!1}onSearch(l){this.searchString=typeof l<"u"?l:"";var d=this.refresh(!0);this.searchString&&(d?this.player.trigger("search.matchFound"):this.player.trigger("search.noMatchFound"))}draw(){this.$.addClass("Ldt-MediaListWidget"),this.renderTemplate();var l=this;typeof this.media.getMedias=="function"&&this.media.on("enter-annotation",function(d){l.redraw(d.getMedia())}),this.redraw()}getSegments(l){var d=this,m=this.$.width()/l.duration.milliseconds;return this.getWidgetAnnotations().filter(function(h){return h.getMedia().id==l.id}).map(function(h){var S=h.type=h.annotation;return{left:m*S.begin,width:m*(S.end-S.begin),color:typeof S.color<"u"&&S.color?S.color:d.default_color}})}redraw(l){if(typeof l<"u"){this.$.find(".Ldt-MediaList-Other h2").html(this.l10n.other_media),this.$.find(".Ldt-MediaList-NowPlaying").show(),this.$.find(".Ldt-MediaList-Now-Thumbnail").attr("src",l.thumbnail||this.default_thumbnail),this.$.find(".Ldt-MediaList-Now-Title a").html(l.title),this.$.find(".Ldt-MediaList-Now-Description").html(l.description);var d=l.url||mustache.render(this.media_url_template,{media:l.id});this.$.find(".Ldt-MediaList-NowContainer a").attr("href",d);var m=mustache.render(this.mediaViewTemplate,{segments:this.getSegments(l)});this.$.find(".Ldt-MediaList-Now-MediaView").html(m)}else this.$.find(".Ldt-MediaList-Other h2").html(this.l10n.all_media),this.$.find(".Ldt-MediaList-NowPlaying").hide();var h=this,S=this.source.getMedias().filter(function(A){return A.id!==h.lastMedia});if(S.length){this.$.find(".Ldt-MediaList-Other").show();var k=S.map(function(A){return mustache.render(h.mediaTemplate,{thumbnail:A.thumbnail||h.default_thumbnail,url:A.url||mustache.render(h.media_url_template,{media:A.id}),title:A.title,description:A.description,segments:h.getSegments(A)})}).join("");this.$.find(".Ldt-MediaList-OtherList").html(k)}else this.$.find(".Ldt-MediaList-Other").hide()}},Cr(n,"messages",{fr:{now_playing:"Vidéo en cours",all_media:"Toutes les vidéos",other_media:"Autres vidéos"},en:{now_playing:"Now playing",all_media:"All videos",other_media:"Other videos"}}),Cr(n,"defaults",{default_thumbnail:"http://ldt.iri.centrepompidou.fr/static/site/ldt/css/imgs/video_sequence.png",media_url_template:"http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/front/player/{{media}}/",default_color:"#000080"}),Cr(n,"template",'<div class="Ldt-MediaList-NowPlaying"><h2>{{l10n.now_playing}}</h2><hr /><div class="Ldt-MediaList-NowContainer"><div class="Ldt-MediaList-Now-ThumbContainer"><a href="" target="_blank"><img class="Ldt-MediaList-Now-Thumbnail" src="" /></a></div><h3 class="Ldt-MediaList-Now-Title"><a href="" target="_blank"></a></h3><p class="Ldt-MediaList-Now-Description"></p><div class="Ldt-MediaList-Now-MediaView"></div></div></div><div class="Ldt-MediaList-Other"><h2></h2><hr /><ul class="Ldt-MediaList-OtherList"></ul></div>'),Cr(n,"mediaViewTemplate",'<div class="Ldt-MediaList-MediaView-Background"></div>{{#segments}}<div class="Ldt-MediaList-Segment" style="background: {{color}}; left: {{left}}px; width: {{width}}px;"></div>{{/segments}}'),Cr(n,"mediaTemplate",'<li class="Ldt-MediaList-OtherList-li"><div class="Ldt-MediaList-Other-ThumbContainer"><a href="{{url}}" target="_blank"><img class="Ldt-MediaList-Other-Thumbnail" src="{{thumbnail}}" /></a></div><h3 class="Ldt-MediaList-Other-Title"><a href="{{url}}" target="_blank">{{title}}</a></h3><p class="Ldt-MediaList-Other-Description">{{description}}</p><div class="Ldt-MediaList-Other-MediaView">'+MediaList.mediaViewTemplate+"</div></li>"),n},noteTakingStyles={},NoteTaking=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this,d,m=jQuery;l.renderTemplate(),d=l.$.find(".Ldt-NoteTaking-Text");function h(){m(d).val(window.localStorage[l.editable_storage])}function S(){window.localStorage[l.editable_storage]=m(d).val()}window.localStorage[l.editable_storage]&&h(),m.fn.insertAtCaret=function(A){return this.each(function(){if(this.selectionStart!==void 0){var B=this.selectionStart,M=this.selectionEnd,j=this.scrollTop;this.value=this.value.substring(0,B)+A+this.value.substring(M,this.value.length),this.focus(),this.selectionStart=B+A.length,this.selectionEnd=B+A.length,this.scrollTop=j}else this.value+=A,this.focus(),this.value=this.value})};function k(A,B){var M=A.selectionStart;return A.value.substring(M-B,M+B)}m(d).keydown(function(A){if(A.keyCode==13&&(A.ctrlKey||A.metaKey)){A.preventDefault();var B=/\[([\d:]+)\]/.exec(k(d[0],8));B?l.media.setCurrentTime(t.timestamp2ms(B[1])):(m(d).insertAtCaret("["+new t.Model.Time(l.media.getCurrentTime()).toString()+"]"),S())}}).on("input",function(A){S()}).on("dblclick",function(A){var B=/\[([\d:]+)\]/.exec(k(d[0],8));B&&(A.preventDefault(),l.media.setCurrentTime(t.timestamp2ms(B[1])))})}},Cr(n,"defaults",{editable_storage:""}),Cr(n,"template",'<textarea class="Ldt-NoteTaking-Text"></textarea>'),n},placeholderPlayerStyles={},PlaceholderPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate();var l=!0,d=0,m=new t.Model.Time(0),h=this.media,S=this.$.find(".Ldt-PlaceholderPlayer");function k(){l||(m=new t.Model.Time(new Date().valueOf()-d),m<=h.duration?(h.trigger("timeupdate",m),setTimeout(k,100)):(m=h.duration,h.pause())),S.text(m.toString(!0))}h.on("setcurrenttime",function(A){d=new Date().valueOf()-A,m=new t.Model.Time(A),h.trigger("seeked"),h.trigger("timeupdate",m),S.text(m.toString(!0))}),h.on("setplay",function(){l=!1,d=new Date().valueOf()-m,h.trigger("play"),k()}),h.on("setpause",function(){l=!0,h.trigger("pause"),k()}),h.trigger("loadedmetadata"),h.trigger("setcurrenttime",0),this.autostart&&h.trigger("setplay")}},Cr(n,"defaults",{autostart:!1}),Cr(n,"template",'<div class="Ldt-PlaceholderPlayer">(loading)</div>'),n},polemicStyles={},Polemic=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}getPolemics(l){return(typeof l>"u"||!l)&&(l=this.default_version),this.polemics.constructor===Array?this.polemics:this.polemics[l]}drawNoStackgraph(l,d){var m=this;if(this.is_stackgraph=!1,l){let S=function(k,A,F,M,j){var I=mustache.render('<div class="Ldt-Polemic-TweetDiv Ldt-TraceMe" trace-info="annotation-id:{{id}}, media-id:{{media_id}}, polemic:{{polemic}}, time:{{time}}" polemic-color="{{color}}" tweet-title="{{title}}" annotation-id="{{id}}" style="width: {{width}}px; height: {{height}}px; top: {{top}}px; left: {{left}}px; background: {{color}}"></div>',{id:j.id,media_id:m.source.currentMedia.id,polemic:F,left:k,top:A,color:M,width:m.element_width-1,height:m.element_height,title:j.title,time:j.begin.toString()}),P=jQuery(I);P.on("mouseover",function(){j.trigger("select")}).on("mouseout",function(){j.trigger("unselect")}).on("click",function(){return j.trigger("click"),!1}),t.attachDndData(P,{title:j.title,description:j.description,image:j.thumbnail,uri:typeof j.url<"u"?j.url:document.location.href.replace(/#.*$/,"")+"#id="+j.id,text:"["+j.begin.toString()+"] "+j.title});for(var $=[],z=j.content&&j.content.polemic_version||m.default_version,N=m.getPolemics(z)||[],F,U,J=0;J<N.length;J++)F=N[J],U=t.Model.regexpFromTextOrArray(F.keywords),U.test(j.description)&&$.push(F.color);j.on("select",function(){m.tooltip&&m.tooltip.show(+Math.floor(k+(m.element_width-1)/2),+A,j.title,$.length>1?$:M),m.$tweets.each(function(){var te=jQuery(this);te.css("opacity",te.attr("annotation-id")==j.id?1:.3)})}),j.on("unselect",function(){m.tooltip&&m.tooltip.hide(),m.$tweets.css("opacity",1)}),j.on("found",function(){P.css({background:m.foundcolor,opacity:1})}),j.on("not-found",function(){P.css({background:M,opacity:.3})}),m.$zone.append(P)};this.height=(2+l)*this.element_height,this.$zone.css({width:this.width+"px",height:this.height+"px",position:"relative"});var h=0;_$1(d).forEach(function(k){var A=m.height;k.annotations.forEach(function(B){A-=m.element_height,S(h,A,"none",m.defaultcolor,B)}),_$1(k.polemicStacks).forEach(function(B){var M=B.polemicDef.color,j=B.polemicDef.name;B.annotations.forEach(function(I){A-=m.element_height,S(h,A,j,M,I)})}),h+=m.element_width}),this.$tweets=this.$.find(".Ldt-Polemic-TweetDiv"),this.source.getAnnotations().on("search-cleared",function(){m.$tweets.each(function(){var k=jQuery(this);k.css({background:k.attr("polemic-color"),opacity:1})})})}else this.$zone.hide()}drawStackgraph(l,d){this.is_stackgraph=!0;var m=this;this.height=(2+this.max_elements)*this.element_height,this.$zone.css({width:this.width+"px",height:this.height+"px",position:"relative"});var h=0,S="",k=this.max_elements*this.element_height/l;function A(B,M,j,I,P,$,z,N){S+=mustache.render('<div class="Ldt-Polemic-TweetDiv Ldt-TraceMe" trace-info="annotation-block, media-id={{media_id}}, polemic={{polemic}}, time:{{begin}}" pos-x="{{posx}}" pos-y="{{top}}" annotation-counts="{{nums}}" begin-time="{{begin}}" end-time="{{end}}" style="width: {{width}}px; height: {{height}}px; top: {{top}}px; left: {{left}}px; background: {{color}}"></div>',{nums:P,posx:Math.floor(B+(m.element_width-1)/2),media_id:m.source.currentMedia.id,polemic:N,left:B,top:M,color:I,width:m.element_width-1,height:j,begin:$,end:z})}_$1(d).forEach(function(B){var M=m.height,j=B.annotations.length+"|"+m.defaultcolor+","+_$1(B.polemicStacks).map(function(P){return P.annotations.length+"|"+P.polemicDef.color}).join(",");if(B.annotations.length){var I=Math.ceil(k*B.annotations.length);M-=I,A(h,M,I,m.defaultcolor,j,B.begin,B.end,"none")}_$1(B.polemicStacks).forEach(function(P){if(P.annotations.length){var $=P.polemicDef.color,z=P.polemicDef.name,N=Math.ceil(k*P.annotations.length);M-=N,A(h,M,N,$,j,B.begin,B.end,z)}}),h+=m.element_width}),this.$zone.append(S),this.$tweets=this.$.find(".Ldt-Polemic-TweetDiv"),this.$tweets.mouseover(function(){var B=jQuery(this),M=B.attr("annotation-counts").split(","),j="<p>"+m.l10n.from_+B.attr("begin-time")+m.l10n._to_+B.attr("end-time")+"</p>";j=_$1.reduce(M,function(I,P){var $=P.split("|");return I+='<div class="Ldt-Tooltip-AltColor" style="background: '+$[1]+'"></div><p>'+$[0]+m.l10n._annotations+"</p>",I},j),m.tooltip&&m.tooltip.show(+B.attr("pos-x"),+B.attr("pos-y"),j)}).mouseout(function(){m.tooltip&&m.tooltip.hide()})}draw(){this.onMediaEvent("timeupdate","onTimeupdate"),this.$zone=jQuery("<div>"),this.$zone.addClass("Ldt-Polemic"),this.$.append(this.$zone),this.$elapsed=jQuery("<div>").css({background:"#cccccc",position:"absolute",top:0,left:0,width:0,height:"100%"}),this.$zone.append(this.$elapsed);for(var l=[],d=Math.floor(this.width/this.element_width),m=this.source.getDuration(),h=0,S=this.getWidgetAnnotations(),k=this,A=0;A<d;A++){var B=new t.Model.Time(A*m/d),M=new t.Model.Time((A+1)*m/d),j=0,I={begin:B.toString(),end:M.toString(),annotations:S.filter(function(P){return P.begin>=B&&P.begin<M}),polemicStacks:{}};I.annotations=I.annotations.filter(function(P){for(var $=P.content&&P.content.polemic_version||k.default_version,z=k.getPolemics($)||[],N,F,U,J,te=!0,se=0;se<z.length;se++)N=z[se],J=t.Model.regexpFromTextOrArray(N.keywords),J.test(P.description)&&(F=$+"_"+N.name,U=I.polemicStacks[F]||(I.polemicStacks[F]={polemicDef:N,annotations:[]}),U.annotations.push(P),te=!1,j++);return te}),j+=I.annotations.length,h=Math.max(h,j),l.push(I)}h<this.max_elements?this.drawNoStackgraph(h,l):this.drawStackgraph(h,l),this.$position=jQuery("<div>").addClass("Ldt-Polemic-Position"),this.$zone.append(this.$position),this.$zone.on("click",function(P){var $=P.pageX-k.$zone.offset().left;k.media.setCurrentTime(k.media.duration*$/k.width)}),this.$.append('<div class="Ldt-Polemic-Tooltip"></div>'),this.insertSubwidget(this.$.find(".Ldt-Polemic-Tooltip"),{type:"Tooltip",min_x:0,max_x:this.width},"tooltip")}onTimeupdate(l){var d=Math.floor(this.width*l/this.media.duration);this.$elapsed.css({width:d+"px"}),this.$position.css({left:d+"px"})}},Cr(n,"messages",{fr:{from_:"de ",_to_:" à ",_annotations:" annotation(s)"},en:{from_:"from ",_to_:" to ",_annotations:" annotation(s)"}}),Cr(n,"defaults",{element_width:5,element_height:5,max_elements:20,annotation_type:"tweet",defaultcolor:"#585858",foundcolor:"#fc00ff",default_version:"1",polemics:{1:[{name:"OK",keywords:["++"],color:"#1D973D"},{name:"KO",keywords:["--"],color:"#CE0A15"},{name:"REF",keywords:["==","http://"],color:"#C5A62D"},{name:"Q",keywords:["?"],color:"#036AAE"}],2:[{name:"OK",keywords:["++"],color:"#1D973D"},{name:"KO",keywords:["!!"],color:"#CE0A15"},{name:"REF",keywords:["==","http://"],color:"#C5A62D"},{name:"Q",keywords:["?"],color:"#036AAE"}]}}),n},PopcornPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){typeof this.video>"u"&&(this.video=this.media.video),this.url_transform&&(this.video=this.url_transform(this.video));var l=this.video;if(/^(https?:\/\/)?(www\.)?youtube\.com/.test(this.video)){for(var d=this.video.split(/[?&]/),m={},h=1;h<d.length;h++){var S=d[h].split("=");m[S[0]]=decodeURIComponent(S[1])}m.controls=0,m.modestbranding=1,(this.autostart||this.autoplay)&&(m.autoplay=1),l=d[0]+"?"+jQuery.param(m)}var k=global$1.Popcorn.smart("#"+this.container,l);(this.autostart||this.autoplay)&&k.autoplay(!0);var A=this.media;A.on("setcurrenttime",function(M){k.currentTime(M/1e3)}),A.on("setvolume",function(M){k.volume(M),A.volume=M}),A.on("setmuted",function(M){k.muted(M),A.muted=M}),A.on("setplay",function(){k.play()}),A.on("setpause",function(){k.pause()}),A.on("settimerange",function(M){A.timeRange=M;try{(A.getCurrentTime()>M[0]||A.getCurrentTime()<M)&&k.currentTime(M[0]/1e3)}catch{}}),A.on("resettimerange",function(){A.timeRange=!1});function B(){A.muted=k.muted(),A.volume=k.volume()}k.on("loadedmetadata",function(){B(),A.trigger("loadedmetadata"),A.trigger("volumechange")}),k.on("timeupdate",function(){A.trigger("timeupdate",new t.Model.Time(1e3*k.currentTime()))}),k.on("volumechange",function(){B(),A.trigger("volumechange")}),k.on("play",function(M){A.trigger("play")}),k.on("pause",function(){A.trigger("pause")}),k.on("seeked",function(){A.trigger("seeked")})}},Cr(n,"defaults",{}),n},quizStyles={},Quiz=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}update(l){var d=this;if(this.quiz_activated&&this.correct[l.id]!=1&&this.correct[l.id]!=0){d.quiz_displayed=!0,this.media.pause(),this.annotation=l;var m=l.content.data.question,h=l.content.data.answers,S=l.content.data.resource;jQuery(".Ldt-Quiz-Votes").hide(),jQuery(".Ldt-Pause-Add-Question").hide(),jQuery(".Ldt-Quiz-Container .Ldt-Quiz-Title").html(m);var k=0,A=mustache.render('<span class="Ldt-Quiz-Correct-Answer">{{ correctness.0 }}</span> / <span class="Ldt-Quiz-Incorrect-Answer">{{ correctness.1 }}</span>',{correctness:this.globalScore()});jQuery(".Ldt-Quiz-Index").html(mustache.render("Q{{index}}/{{total}}",{index:l.number+1,total:this.totalAmount})),jQuery(".Ldt-Quiz-Score").html(A),this.question=new t.Widgets.UniqueChoiceQuestion(l),this.resource=new t.Widgets.UniqueChoiceQuestion(S),l.content.data.type=="multiple_choice"?(this.question=new t.Widgets.MultipleChoiceQuestion(l),this.resource=new t.Widgets.MultipleChoiceQuestion(S)):l.content.data.type=="unique_choice"&&(this.question=new t.Widgets.UniqueChoiceQuestion(l),this.resource=new t.Widgets.UniqueChoiceQuestion(S));var B="";for(k=0;k<h.length;k++)B+='<div class="quiz-question-block"><p>'+this.question.renderQuizTemplate(h[k],k)+'<span class="quiz-question-label">'+h[k].content+"</span></p></div>";var M="";S!=null&&(M='<div class="quiz-resource-block" id="resource" >'+S+"</div>"),jQuery(".Ldt-Quiz-Questions").html(M+B),jQuery(".Ldt-Quiz-Overlay").fadeIn(),jQuery(".Ldt-Quiz-Submit").fadeIn(),jQuery(".quiz-question-label").click(function(){var j=jQuery(this).siblings("input");j.prop("checked")&&j.prop("type")=="radio"?d.answer():j.prop("checked",!j.prop("checked"))}),jQuery(".Ldt-Quiz-Submit-Skip-Link").click({media:this.media},function(j){d.hide(),d.player.trigger("QuizCreator.skip"),j.data.media.play()})}}hide(){var l=this;jQuery(".Ldt-Quiz-Votes").hide(),jQuery(".Ldt-Quiz-Overlay").hide(),jQuery(".Ldt-Pause-Add-Question").hide(),l.quiz_displayed=!1}answer(){var l=this;function d(j){return(j||"").replace(/\s(\d+:\d+)/,function(I,P){return' <a href="#t='+t.timestamp2ms(P)/1e3+'">'+P+"</a>"})}var m=l.annotation.content.data.answers,h=0,S=0,k=[];l.$.find(".Ldt-Quiz-Question-Check").each(function(j){var I=jQuery(this).is(":checked");k.push(I?1:0);var P=m[h];P.correct&&!I||!P.correct&&I?(S+=1,jQuery(this).parents(".quiz-question-block").append('<div class="quiz-question-feedback quiz-question-incorrect-feedback">'+d(P.feedback)+"</div>")):jQuery(this).parents(".quiz-question-block").append('<div class="quiz-question-feedback quiz-question-correct-feedback">'+d(P.feedback)+"</div>"),h++}),S?(jQuery(".Ldt-Quiz-Result").html("Mauvaise réponse"),jQuery(".Ldt-Quiz-Result").css({"background-color":"red"}),this.correct[this.annotation.id]=0):(jQuery(".Ldt-Quiz-Result").html("Bonne réponse !"),jQuery(".Ldt-Quiz-Result").css({"background-color":"green"}),this.correct[this.annotation.id]=1),jQuery(".Ldt-Quiz-Result").animate({height:"100%"},500,"linear",function(){jQuery(".Ldt-Quiz-Result").delay(2e3).animate({height:"0%"},500)});var A=this.annotation.number+1,B=this.globalScore(),M="";M+='<span class="Ldt-Quiz-Correct-Answer">'+B[0]+'</span> / <span class="Ldt-Quiz-Incorrect-Answer">'+B[1]+"</span>",jQuery(".Ldt-Quiz-Index").html("Q"+A+"/"+this.totalAmount),jQuery(".Ldt-Quiz-Score").html(M),this.submit(this.user,this.userid,this.annotation.id,S?"wrong_answer":"right_answer",k.join("")),jQuery(".Ldt-Quiz-Submit").fadeOut(400,function(){jQuery(".Ldt-Quiz-Votes").show()})}globalScore(){var l=_.values(this.correct),d=l.filter(function(h){return h==1}).length,m=l.filter(function(h){return h==0}).length;return[d,m]}refresh(){var l=this.getWidgetAnnotations().sortBy(function(m){return m.begin}),d=this;d.totalAmount=l.length,d.number=0,d.correct={},d.keys={},l.forEach(function(m){d.correct[m.id]=-1,d.keys[d.number]=m.id,m.number=d.number++})}draw(){var l=this;l.quiz_displayed=!1,this.onMediaEvent("enter-annotation",function(d){var m=l.getWidgetAnnotations().filter(function(h){return h===d});m.number===void 0&&l.refresh(),m.length&&l.update(m[0])}),this.onMdpEvent("Quiz.activate",function(){l.quiz_activated=!0}),this.onMdpEvent("Quiz.deactivate",function(){l.quiz_activated=!1,l.hide()}),this.onMdpEvent("Quiz.hide",function(){l.hide()}),this.onMdpEvent("Quiz.refresh",function(){l.refresh()}),this.onMediaEvent("pause",function(){l.quiz_displayed||jQuery(".Ldt-Pause-Add-Question").show()}),this.onMediaEvent("play",function(){jQuery(".Ldt-Pause-Add-Question").hide()}),l.overlay=jQuery("<div class='Ldt-Quiz-Overlay'></div>").appendTo(jQuery("#"+l.container)),l.PauseAddQuestion=jQuery("<div class='Ldt-Pause-Add-Question' title='Ajoutez une question !'>").on("click",function(){l.player.trigger("QuizCreator.create")}).appendTo(jQuery("#"+l.container)),l.overlay.html(this.template),jQuery(".Ldt-Quiz-Overlay").hide(),jQuery(".Ldt-Quiz-Submit input").click(function(){l.answer()}),jQuery(".Ldt-Quiz-Submit-Skip-Link").click({media:this.media},function(d){l.submit(l.user,l.userid,l.annotation.id,"skipped_answer",0),l.hide(),l.player.trigger("QuizCreator.skip"),d.data.media.play()}),jQuery('.Ldt-Quiz-Votes-Buttons input[type="button"], .Ldt-Quiz-Votes-Buttons a').click({media:this.media},function(d){var m,h;jQuery(this).hasClass("Ldt-Quiz-Vote-Useful")?(m="useful",h=1):jQuery(this).hasClass("Ldt-Quiz-Vote-Useless")?(m="useless",h=-1,jQuery(".Ldt-Ctrl-Quiz-Create").addClass("button_highlight").delay(5e3).queue(function(){jQuery(this).removeClass("button_highlight").dequeue()})):(m="skipped_vote",h=0),l.submit(l.user,l.userid,l.annotation.id,m,h),d.data.media.play(),l.hide(),jQuery(".Ldt-Pause-Add-Question").hide(),l.player.trigger("QuizCreator.skip")}),l.refresh()}},Cr(n,"defaults",{quiz_activated:!0,api_serializer:"ldt_annotate",analytics_api:"",api_method:"POST",user:"",userid:""}),Cr(n,"template",'<div class="Ldt-Quiz-Container"><div class="Ldt-Quiz-Header"> <div class="Ldt-Quiz-Index"></div><div class="Ldt-Quiz-Score"></div></div><div class="Ldt-Quiz-Content"> <h1 class="Ldt-Quiz-Title">{{question}}</h1> <div class="Ldt-Quiz-Questions"> </div></div><div class="Ldt-Quiz-Footer"> <div class="Ldt-Quiz-Votes"> <span class="Ldt-Quiz-Votes-Question">Avez-vous trouvé cette question utile ?</span> <div class="Ldt-Quiz-Votes-Buttons"> <div class="Ldt-Quiz-Vote-Skip-Block"><a href="#" class="Ldt-Quiz-Vote-Skip">Passer</a></div> <div><input type="button" value="Non" class="Ldt-Quiz-Vote-Useless" /></div> <div><input type="button" value="Oui" class="Ldt-Quiz-Vote-Useful" /></div> </div> </div> <div class="Ldt-Quiz-Submit"> <div class="Ldt-Quiz-Submit-Button"><input type="button" value="Valider" /></div> <div class="Ldt-Quiz-Submit-Skip-Link"><a href="#">Passer</a></div><div style="clear:both;"></div> </div> <div class="Ldt-Quiz-Result">Bonne réponse</div></div></div>'),Cr(n,"annotationTemplate",""),n},UniqueChoiceQuestion=function(t){return class extends t.Widgets.Widget{constructor(n){this.annotation=n}renderQuizTemplate(n,l){return'<input type="radio" class="quiz-question Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question" data-question="'+l+'" value="'+l+'" />'}renderTemplate(n,l){var d=this.generateUid();return'<input type="radio" id="'+d+'" class="quiz-question-edition Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question" data-question="'+l+'" value="'+l+'" /><label for="'+d+'" title="Veuillez sélectionner la réponse correcte"></label>'}renderFullTemplate(n,l){var d=n&&n.correct?"checked":"",m=this.generateUid();return'<input type="radio" id="'+m+'" '+d+' class="quiz-question-edition Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question" data-question="'+l+'" value="'+l+'" /><label for="'+m+'"></label>'}}},MultipleChoiceQuestion=function(t){return class extends t.Widgets.Widget{constructor(n){this.annotation=n}renderQuizTemplate(n,l){return'<input type="checkbox" class="quiz-question Ldt-Quiz-Question-Check Ldt-Quiz-Question-Check-'+l+'" name="question['+l+']" data-question="'+l+'" value="'+l+'" /> '}renderTemplate(n,l){var d=this.generateUid();return'<input type="checkbox" id="'+d+'" class="quiz-question-edition Ldt-Quiz-Question-Check" name="question['+l+']" data-question="'+l+'" value="'+l+'" /><label for="'+d+'" title="Veuillez sélectionner la ou les réponses correctes"></label>'}renderFullTemplate(n,l){var d=n&&n.correct?"checked":"",m=this.generateUid();return'<input type="checkbox" id="'+m+'" '+d+' class="quiz-question-edition Ldt-Quiz-Question-Check" name="question['+l+']" data-question="'+l+'" value="'+l+'" /><label for="'+m+'"></label> '}submit(n,l,d,m,h){var S=this,k=mustache.render(this.analytics_api,{id:this.source.projectId}),A={username:n,useruuid:l,subject:d,property:m,value:h,session:S.session_id};jQuery.ajax({url:k,type:this.api_method,contentType:"application/json",data:JSON.stringify(A),success:function(B){},error:function(B,M,j){t.log("Error when sending annotation",j)}})}}},quizCreatorStyles={},QuizCreator=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}skip(){this.$.find(".Ldt-QuizCreator-Time").val(""),this.$.find(".Ldt-QuizCreator-Question-Area").val(""),this.$.find(".Ldt-QuizCreator-Resource-Area").val(""),this.$.find(".Ldt-QuizCreator-Questions-Block").html(""),this.current_annotation=void 0}nbAnswers(){var l=this.$.find(".Ldt-QuizCreator-Questions-Answer").length;return l}draw(){var l=this;this.onMediaEvent("timeupdate",function(d){l.setBegin(d)}),this.onMdpEvent("QuizCreator.show",function(){l.setBegin(l.media.currentTime)}),this.onMdpEvent("QuizCreator.create",function(){l.skip(),l.setBegin(l.media.currentTime)}),this.onMdpEvent("QuizCreator.skip",function(){l.skip()}),this.onMdpEvent("QuizCreator.edit",function(d){l.skip(),l.addQuestion(d)}),this.$.on("click",".Ldt-QuizCreator-Remove",function(){jQuery(this).parents(".Ldt-QuizCreator-Questions-Answer").remove()}),this.begin=new t.Model.Time,this.end=this.source.getDuration(),this.answers=[],this.renderTemplate(),this.question=new t.Widgets.UniqueChoiceQuestion,this.$.find(".Ldt-QuizCreator-Question-Type").bind("change",this.functionWrapper("onQuestionTypeChange")),this.$.find(".Ldt-QuizCreator-Question-Add").bind("click",this.functionWrapper("onQuestionAdd")),this.$.find(".Ldt-QuizCreator-Question-Save").bind("click",this.functionWrapper("onSave")),this.$.find(".Ldt-QuizCreator-Time").keyup(function(){var d=l.$.find(".Ldt-QuizCreator-Time").val();l.begin=t.timestamp2ms(d),l.end=l.begin+1e3}),this.onMediaEvent("timeupdate",function(d){l.getDescription()&&l.setBegin(d)})}getDescription(){return this.$.find(".Ldt-QuizCreator-Question-Area").val().trim()}addQuestion(l,d){var m=this;l.content.data.type=="multiple_choice"?this.question=new t.Widgets.MultipleChoiceQuestion(l):l.content.data.type=="unique_choice"&&(this.question=new t.Widgets.UniqueChoiceQuestion(l));var h=l.content.data.answers;this.answers=[],this.$.find(".Ldt-QuizCreator-Time").val(l.begin),this.$.find(".Ldt-QuizCreator-Question-Area").val(l.content.data.question),this.$.find(".Ldt-QuizCreator-Resource-Area").val(l.content.data.resource),this.$.find(".Ldt-QuizCreator-Questions-Block").html(""),h.forEach(function(S){m.onQuestionAdd(null,S)}),m.current_annotation=l}onQuestionTypeChange(l){var d=this.$.find(".Ldt-QuizCreator-Question-Type"),m=d.val(),h=this;switch(m){case"unique_choice":this.question=new t.Widgets.UniqueChoiceQuestion;break;case"multiple_choice":this.question=new t.Widgets.MultipleChoiceQuestion;break}var S="";h.$.find(".Ldt-QuizCreator-Questions-Block").html(S),this.pauseOnWrite()}onQuestionAdd(l,d){var m='<div class="Ldt-QuizCreator-Questions-Answer">Réponse <div class="Ldt-QuizCreator-Questions-Answer-Correct">'+this.question.renderFullTemplate(d,this.nbAnswers())+'</div><br /><div class="Ldt-QuizCreator-Questions-Answer-Content"><input type="text" class="Ldt-QuizCreator-Answer-Content" data-question="'+this.nbAnswers()+'" id="question'+this.nbAnswers()+'"'+(d?' value="'+d.content+'"':"")+'/><br />Commentaire <br/><textarea class="Ldt-QuizCreator-Answer-Feedback" data-question="'+this.nbAnswers()+'" id="feedback'+this.nbAnswers()+'">'+(d?d.feedback:"")+'</textarea></div><div class="Ldt-QuizCreator-Questions-Answer-Delete"><div class="Ldt-QuizCreator-Remove"> </div></div></div>';this.$.find(".Ldt-QuizCreator-Questions-Block").append(m),this.$.find(".Ldt-QuizCreator-Answer-Content").last().focus(),this.pauseOnWrite()}pauseOnWrite(){this.pause_on_write&&!this.media.getPaused()&&this.media.pause()}setBegin(l){this.begin=new t.Model.Time(l||0),this.end=this.begin+500,this.$.find(".Ldt-QuizCreator-Time").val(this.begin.toString())}get_local_annotation(l){return this.player.getLocalAnnotation(l)}save_local_annotations(){this.player.saveLocalAnnotations(),this.source.merge(this.player.localSource)}delete_local_annotation(l){this.source.getAnnotations().removeId(l),this.player.deleteLocalAnnotation(l),this.current_annotation=void 0,this.refresh(!0)}show(){this.$.find(".Ldt-QuizCreator-Question-Area").focus()}hide(){this.$.find(".Ldt-QuizCreator-Questions-Block").html(""),this.$.find(".Ldt-QuizCreator-Question-Area").val(""),this.$.find(".Ldt-QuizCreator-Resource-Area").val(""),this.$.find(".Ldt-QuizCreator-Time").val("")}onSave(l,d){var m=!1;if(this.nbAnswers()<=0)return alert("Vous devez spécifier au moins une réponse à votre question !"),!1;if(!this.$.find(".quiz-question-edition:checked").length)return alert("Vous n'avez pas indiqué de bonne réponse."),!1;var h;if(this.current_annotation)m=!1,h=this.current_annotation;else{m=!0;var S=this.source.getAnnotationTypes().searchByTitle(this.annotation_type,!0),k=S.length?S[0]:new t.Model.AnnotationType(!1,this.player.localSource);S.length||(k.dont_send_id=!0,k.title=this.annotation_type),h=new t.Model.Annotation(!1,this.player.localSource),h.created=new Date,h.creator=this.creator_name,h.setAnnotationType(k.id),this.player.localSource.getMedias().push(this.source.currentMedia),h.setMedia(this.source.currentMedia.id)}h.setBeginEnd(this.begin,this.end),h.modified=new Date,h.contributor=this.creator_name,h.description=this.getDescription(),h.title=h.description,h.content={},h.content.data={},h.content.data.type=this.$.find(".Ldt-QuizCreator-Question-Type").val(),h.content.data.question=h.description,h.content.data.resource=this.$.find(".Ldt-QuizCreator-Resource-Area").val(),h.content.data.answers=jQuery.makeArray(jQuery(".Ldt-QuizCreator-Questions-Answer").map(function(A){return{content:jQuery(this).find(".Ldt-QuizCreator-Answer-Content").val(),feedback:jQuery(this).find(".Ldt-QuizCreator-Answer-Feedback").val(),correct:jQuery(this).find(".Ldt-Quiz-Question-Check").is(":checked")}})),this.current_annotation=h,m?(this.player.addLocalAnnotation(h),this.source.merge([h]),this.player.trigger("Annotation.create",h)):(this.player.saveLocalAnnotations(),this.player.trigger("Annotation.update",h)),this.player.trigger("AnnotationsList.update"),this.player.trigger("Quiz.refresh")}},Cr(n,"defaults",{creator_name:"",tags:!1,tag_titles:!1,pause_on_write:!0,annotation_type:"Quiz",api_serializer:"ldt_annotate",api_endpoint_template:"",api_method:"POST"}),Cr(n,"messages",{en:{},fr:{}}),Cr(n,"template",'<div class="Ldt-QuizCreator-Ui Ldt-TraceMe"><div class="Ldt-QuizCreator-Question-Form"><textarea class="Ldt-QuizCreator-Question-Area" placeholder="Votre question"></textarea><br /><textarea class="Ldt-QuizCreator-Resource-Area" placeholder="Ressources (lien vers une image, etc.)"></textarea><br /></div><p>Type de question <select name="type" class="Ldt-QuizCreator-Question-Type"><option value="unique_choice">Choix unique</option><option value="multiple_choice">Choix multiple</option></select> à <input type="text" placeholder="hh:mm:ss" size="6" class="Ldt-QuizCreator-Time" /><div class="Ldt-QuizCreator-Questions-Block"></div><div> <button class="Ldt-QuizCreator-Question-Add">Ajouter une réponse</button><hr> <button class="Ldt-QuizCreator-Question-Save">Sauvegarder</button></div></div>'),n},segmentsStyles={},Segments=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}do_draw(l){this.width!=this.$.parent().width()&&this.scale_to_parent&&(this.width=this.$.parent().width(),this.$.css({width:this.width+"px"}));var d=this,m=this.getWidgetAnnotations().filter(function(M){return M.getDuration()>0&&M.getMedia().id==d.media.id}),h=this.width/this.source.getDuration(),S=this.$.find(".Ldt-Segments-List"),k=[],A=1;function B(M,j,I,P){function $(N){return Math.floor(240*(1-P)+N*P)}for(var z=(65536*$(M)+256*$(j)+$(I)).toString(16);z.length<6;)z="0"+z;return"#"+z}l&&this.$.find(".Ldt-Segments-Segment").remove(),m.forEach(function(M,j){var I=M.begin*h,P=M.getDuration()*h,$=Math.floor(I+P/2),z=M.title+(M.description?"<br/>"+M.description:""),N=_$1(k).find(function(T){return!_$1(T.annotations).find(function(u){return u.begin<M.end&&u.end>M.begin})});N||(N={index:k.length,annotations:[]},k.push(N)),N.annotations.push(M);var F=(1-d.overlap)*N.index*d.line_height,U=typeof M.color<"u"&&M.color?M.color:d.colors[j%d.colors.length],J=parseInt(U.substr(1,2),16),te=parseInt(U.substr(3,2),16),se=parseInt(U.substr(5,2),16),de=B(J,te,se,.5),Q=B(J,te,se,.2),ve={color:U,medcolor:de,lowcolor:Q,text:(M.creator?M.creator+" : ":"")+z.replace(/(\n|\r|\r\n)/gm," ").replace(/(^.{120,140})[\s].+$/m,"$1…"),left:I,width:P,top:F,height:d.line_height-1,id:M.id,media_id:M.getMedia().id,from:M.begin.toString(),to:M.end.toString()},he=mustache.render(d.constructor.annotationTemplate,ve),ke=jQuery(he);ke.on("mouseover",function(){M.trigger("select")}).on("mouseout",function(){M.trigger("unselect")}).on("click",function(){d.use_timerange&&(d.media.getTimeRange()?d.media.getTimeRange()[0]==M.begin||d.media.getTimeRange()[1]==M.end?(d.media.resetTimeRange(),d.$segments.each(function(){var T=jQuery(this);T.css("background",Q).removeClass("selected"),M.trigger("select")})):(d.media.setCurrentTime(M.begin),d.media.setTimeRange(M.begin,M.end),d.media.play(),d.$segments.each(function(){var T=jQuery(this);T.css("background",Q).removeClass("selected")}),ke.css("background",d.selected_color).addClass("selected")):(d.media.setCurrentTime(M.begin),d.media.setTimeRange(M.begin,M.end),d.media.play(),d.$segments.each(function(){var T=jQuery(this);T.css("background",Q).removeClass("selected")}),ke.css("background",d.selected_color).addClass("selected"))),M.trigger("click")}).appendTo(S),t.attachDndData(ke,{title:M.title,description:M.description,uri:typeof M.url<"u"?M.url:document.location.href.replace(/#.*$/,"")+"#id="+M.id,image:M.thumbnail,text:"["+M.begin.toString()+"] "+M.title}),M.on("select",function(){d.$segments.each(function(){var T=jQuery(this);T.css({background:T.hasClass("found")?d.faded_found_color:T.attr("data-low-color")}),T.css({background:T.hasClass("selected")?d.faded_selected_color:T.attr("data-low-color")})}),ke.css({background:ke.hasClass("found")?d.found_color:U,background:ke.hasClass("selected")?d.selected_color:U,"z-index":++A}),d.tooltip&&d.tooltip.show($,F,ve.text,ve.color)}),M.on("unselect",function(){d.tooltip&&d.tooltip.hide(),d.$segments.each(function(){var T=jQuery(this);T.css("background",T.hasClass("found")?d.found_color:T.attr("data-medium-color")),T.css("background",T.hasClass("selected")?d.selected_color:T.attr("data-medium-color"))})}),M.on("found",function(){ke.css("background",d.found_color).addClass("found")}),M.on("not-found",function(){ke.css("background",Q).removeClass("found")})}),this.onMediaEvent("resettimerange",function(){d.$segments.each(function(){var M=jQuery(this);M.removeClass("selected")})}),this.$.css({width:this.width+"px",height:((1-this.overlap)*k.length+this.overlap)*this.line_height+"px",background:this.background,margin:"1px 0"}),this.$segments=this.$.find(".Ldt-Segments-Segment")}draw(){var l=this;l.onMediaEvent("timeupdate","onTimeupdate"),l.renderTemplate(),l.do_draw(),this.no_tooltip||l.insertSubwidget(l.$.find(".Ldt-Segments-Tooltip"),{type:"Tooltip",min_x:0,max_x:this.width},"tooltip"),l.source.getAnnotations().on("search",function(){searching=!0}),l.source.getAnnotations().on("search-cleared",function(){searching=!1,_this.$segments.each(function(){var d=jQuery(this);d.css("background",d.attr("data-medium-color")).removeClass("found")})}),this.$.on("resize",function(){l.do_draw(!0)})}onTimeupdate(l){var d=Math.floor(this.width*l/this.media.duration);this.$.find(".Ldt-Segments-Position").css({left:d+"px"})}},Cr(n,"defaults",{annotation_type:"chap",colors:["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],line_height:8,background:"#e0e0e0",overlap:.25,found_color:"#FF00FC",faded_found_color:"#ff80fc",selected_color:"#74d600",faded_selected_color:"#baf9b5",no_tooltip:!1,use_timerange:!1,scale_to_parent:!0}),Cr(n,"template",'<div class="Ldt-Segments-List"></div><div class="Ldt-Segments-Position"></div><div class="Ldt-Segments-Tooltip"></div>'),Cr(n,"annotationTemplate",'<div class="Ldt-Segments-Segment Ldt-TraceMe" trace-info="segment-id:{{id}}, media-id:{{media_id}}, from:{{from}}, to:{{to}}" segment-text="{{text}}"style="top:{{top}}px; height:{{height}}px; left:{{left}}px; width:{{width}}px; background:{{medcolor}}" data-base-color="{{color}}" data-low-color="{{lowcolor}}" data-medium-color="{{medcolor}}"></div>'),n},shortcutsStyles={},Shortcuts=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this;Mousetrap.bindGlobal("ctrl+space",function(d){return d.preventDefault(),l.media.getPaused()?l.media.play():l.media.pause(),!1}),Mousetrap.bindGlobal("ctrl+left",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.max(0,l.media.getCurrentTime()-l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+shift+left",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.max(0,l.media.getCurrentTime()-5*l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+right",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.min(l.media.duration,l.media.getCurrentTime()+l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+shift+right",function(d){return d.preventDefault(),l.media.setCurrentTime(Math.min(l.media.duration,l.media.getCurrentTime()+5*l.time_increment)),!1}),Mousetrap.bindGlobal("ctrl+a",function(d){return d.preventDefault(),l.player.trigger("CreateAnnotation.toggle"),!1})}},Cr(n,"defaults",{time_increment:2e3}),n},sliceStyles={},Slice=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.sliding=!1}draw(){this.renderTemplate(),this.$slider=this.$.find(".Ldt-Slice"),this.show_arrow&&this.insertSubwidget(this.$.find(".Ldt-Slice-Arrow"),{type:"Arrow"},"arrow"),this.min=0,this.max=this.media.duration.valueOf();var l=this,d;this.$slider.slider({range:!0,values:[0,this.max],min:0,max:this.max,change:function(m,h){l.arrow&&l.arrow.moveToTime((h.values[0]+h.values[1])/2),l.onBoundsChanged&&l.onBoundsChanged(h.values[0],h.values[1])},start:function(){l.sliding=!0,l.media.getPaused()||l.media.pause(),d=l.media.getCurrentTime()},slide:function(m,h){l.media.setCurrentTime(h.value)},stop:function(){l.sliding=!1,l.media.setCurrentTime(d)}}),this.$slider.find(".ui-slider-handle:first").addClass("Ldt-Slice-left-handle"),this.$slider.find(".ui-slider-handle:last").addClass("Ldt-Slice-right-handle"),this.getWidgetAnnotations().forEach(function(m){m.on("enter",function(){l.setBounds(m.begin,m.end)})}),this.player.on("annotation-click",function(m){l.setBounds(m.begin,m.end)})}setBounds(l,d){this.$slider.slider("values",[l,d])}show(){this.$slider.show()}hide(){this.$slider.hide()}},Cr(n,"defaults",{show_arrow:!1}),Cr(n,"template",'<div class="Ldt-Slice"></div>{{#show_arrow}}<div class="Ldt-Slice-Arrow"></div>{{/show_arrow}}'),n},slidePreviewStyles={},SlidePreview=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.getWidgetAnnotations().sortBy(function(m){return m.begin});var l=this;l.renderTemplate();var d=l.$.find(".Ldt-SlidePreview-Slides");this.getWidgetAnnotations().forEach(function(m){var h={id:m.id,content:t.textFieldHtml(m.title),begin:m.begin.toString(),ms:m.begin.milliseconds,thumbnail:m.thumbnail},S=mustache.render(l.annotationTemplate,h),k=jQuery(S);d.append(k)}),l.$.on("click",".Ldt-SlidePreview-Item",function(){l.media.setCurrentTime(Number(this.dataset.timecode))})}},Cr(n,"defaults",{annotation_type:"Slides"}),Cr(n,"template",'<div class="Ldt-SlidePreview-Container"><div class="Ldt-SlidePreview-Slides"></div></div>'),Cr(n,"annotationTemplate",'<div data-id="{{ id }}" data-timecode="{{ ms }}" class="Ldt-SlidePreview-Item"><img title="{{ begin }} - {{ atitle }}" class="Ldt-AnnotationsList-Thumbnail" src="{{ thumbnail }}"></div>'),n},sliderStyles={},Slider=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"calculateHandleCss",function(d){return{height:2+d+"px",width:2+d+"px","margin-left":-Math.ceil(2+d/2)+"px"}})}draw(){this.renderTemplate(),this.$time=this.$.find(".Ldt-Slider-Time"),this.$slider=this.$.find(".Ldt-Slider");var d=this;this.$slider.slider({range:"min",value:0,min:0,max:this.source.getDuration().milliseconds,slide:function(m,h){d.media.setCurrentTime(h.value),d.player.trigger("Mediafragment.setHashToTime")}}),this.$handle=this.$slider.find(".ui-slider-handle"),this.onMediaEvent("timeupdate","onTimeupdate"),this.onMdpEvent("Player.MouseOver","onMouseover"),this.onMdpEvent("Player.MouseOut","onMouseout"),this.minimize_timeout&&(this.$slider.css(this.calculateSliderCss(this.minimized_height)),this.$handle.css(this.calculateHandleCss(this.minimized_height)),this.maximized=!1,this.timeoutId=!1),this.$slider.mouseover(function(){d.$time.show(),d.onMouseover()}).mouseout(this.functionWrapper("onMouseout")).mousemove(function(m){var h=m.pageX-d.$.offset().left,S=new t.Model.Time(d.media.duration*h/d.width);d.$time.text(S.toString()).css("left",h)})}onTimeupdate(d){this.$slider.slider("value",d),this.player.trigger("Arrow.updatePosition",{widget:this.type,time:d})}onMouseover(){this.minimize_timeout&&(this.timeoutId&&(window.clearTimeout(this.timeoutId),this.timeoutId=!1),this.maximized||(this.animateToHeight(this.maximized_height),this.maximized=!0))}onMouseout(){if(this.$time.hide(),this.minimize_timeout){this.timeoutId&&(window.clearTimeout(this.timeoutId),this.timeoutId=!1);var d=this;this.timeoutId=window.setTimeout(function(){d.maximized&&(d.animateToHeight(d.minimized_height),d.maximized=!1),d.timeoutId=!1},this.minimize_timeout)}}animateToHeight(d){this.$slider.stop().animate(this.calculateSliderCss(d),500,function(){jQuery(this).css("overflow","visible")}),this.$handle.stop().animate(this.calculateHandleCss(d),500,function(){jQuery(this).css("overflow","visible")})}calculateSliderCss(d){return{height:d+"px","margin-top":this.minimized_height-d+"px"}}},Cr(n,"defaults",{minimized_height:4,maximized_height:4,minimize_timeout:1500}),Cr(n,"template",'<div class="Ldt-Slider"></div><div class="Ldt-Slider-Time">00:00</div>'),n},slideVideoPlayerStyles={},SlideVideoPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"template",'<div class="Ldt-SlideVideoPlayer"> <div class="Ldt-SlideVideoPlayer-slide Ldt-SlideVideoPlayer-panel"> </div> <div class="Ldt-SlideVideoPlayer-video Ldt-SlideVideoPlayer-panel"> </div></div>')}draw(){var d=this;d.renderTemplate(),this.insertSubwidget(d.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-slide"),{type:"ImageDisplay",annotation_type:d.annotation_type},"slide"),this.insertSubwidget(d.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-video"),{type:d.playerModule,video:d.video,width:"100%",url_transform:d.url_transform},"player"),d.mode=="pip"?(d.$.find(".Ldt-SlideVideoPlayer-panel").append('<div class="Ldt-SlideVideoPlayer-pip-menu"><div class="Ldt-SlideVideoPlayer-pip-menu-toggle"></div></div>'),d.$.on("click",".Ldt-SlideVideoPlayer-pip-menu-toggle",function(){d.toggleMainDisplay()}),window.setTimeout(function(){d.setMainDisplay("video")},1500)):window.setTimeout(function(){d.$.find(".Ldt-SlideVideoPlayer").touchSplit({orientation:screen.height>screen.width?"vertical":"horizontal",leftMin:20,topMin:20})},1500)}toggleMainDisplay(){this.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-video").hasClass("Ldt-SlideVideoPlayer-pip-main")?this.setMainDisplay("slides"):this.setMainDisplay("video")}setMainDisplay(d){var m=this.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-video"),h=this.$.find(".Ldt-SlideVideoPlayer-panel.Ldt-SlideVideoPlayer-slide");if(d=="slides"){var S=m;m=h,h=S}m.removeClass("Ldt-SlideVideoPlayer-pip-pip").addClass("Ldt-SlideVideoPlayer-pip-main"),h.removeClass("Ldt-SlideVideoPlayer-pip-main").addClass("Ldt-SlideVideoPlayer-pip-pip")}},Cr(n,"defaults",{playerModule:"HtmlPlayer",mode:"sidebyside"}),n},socialStyles={},Social=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate(),this.clipId=_$1.uniqueId("Ldt-Social-CopyBtn-"),this.$.find(".Ldt-Social-CopyBtn").attr("id",this.clipId);var l=this;this.$.find(".Ldt-Social-Url").click(function(){return l.toggleCopy(),!1}).on("dragstart",function(d){d.originalEvent.dataTransfer.setData("text/x-iri-title",l.text),d.originalEvent.dataTransfer.setData("text/x-iri-uri",l.url)}),this.$.find(".Ldt-Social-Input").focus(function(){this.select()}),this.$.find(".Ldt-Social-Ext").click(function(){return window.open(jQuery(this).attr("href"),"_blank","height=300,width=450,left=100,top=100,toolbar=0,menubar=0,status=0,location=0"),!1}),this.updateUrls(this.url,this.text)}toggleCopy(){var l=this.$.find(".Ldt-Social-UrlPop");l.toggle(),this.$.find(".Ldt-Social-Input").val(this.url).focus()}updateUrls(l,d){this.url=l,this.text=d,this.$.find(".Ldt-Social-Fb").attr("href","http://www.facebook.com/share.php?"+jQuery.param({u:l,t:d})),this.$.find(".Ldt-Social-Twitter").attr("href","https://twitter.com/intent/tweet?"+jQuery.param({url:l,text:d})),this.$.find(".Ldt-Social-Gplus").attr("href","https://plus.google.com/share?"+jQuery.param({url:l,title:d})),this.$.find(".Ldt-Social-Mail").attr("href","mailto:?"+jQuery.param({subject:d,body:d+": "+l}))}},Cr(n,"defaults",{text:"",url:"",show_url:!0,show_twitter:!0,show_fb:!0,show_gplus:!0,show_mail:!0}),Cr(n,"template",'<span class="Ldt-Social">{{#show_url}}<div class="Ldt-Social-Url-Container"><a href="#" draggable="true" target="_blank" class="Ldt-Social-Square Ldt-Social-Url Ldt-TraceMe" title="{{l10n.share_link}}"></a><div class="Ldt-Social-UrlPop"><input class="Ldt-Social-Input"/></div></div>{{/show_url}}{{#show_fb}}<a href="#" target="_blank" class="Ldt-Social-Fb Ldt-Social-Ext Ldt-TraceMe" title="{{l10n.share_on}} Facebook"></a>{{/show_fb}}{{#show_twitter}}<a href="#" target="_blank" class="Ldt-Social-Twitter Ldt-Social-Ext Ldt-TraceMe" title="{{l10n.share_on}} Twitter"></a>{{/show_twitter}}{{#show_gplus}}<a href="#" target="_blank" class="Ldt-Social-Gplus Ldt-Social-Ext Ldt-TraceMe" title="{{l10n.share_on}} Google+"></a>{{/show_gplus}}{{#show_mail}}<a href="#" target="_blank" class="Ldt-Social-Mail Ldt-TraceMe" title="{{l10n.share_mail}}"></a>{{/show_mail}}</span>'),Cr(n,"messages",{fr:{share_on:"Partager sur",share_mail:"Envoyer par courriel",share_link:"Partager le lien hypertexte",copy:"Copier"},en:{share_on:"Share on",share_mail:"Share by e-mail",share_link:"Share hypertext link",copy:"Copy"}}),n},Sparkline=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){for(var l=[],d=this.source.getDuration(),m=0,h=this.getWidgetAnnotations(),S=0;S<this.slice_count;S++){var k=S*d/this.slice_count,A=(S+1)*d/this.slice_count,B=0;h.forEach(function(N){if(N.begin<A&&N.end>=k){var F=N.getDuration().milliseconds;F?B+=(Math.min(N.end,A)-Math.max(N.begin,k))/F:B+=1}}),m=Math.max(m,B),l.push(B)}if(m){this.paper=new Raphael(this.$[0],this.width,this.height);var M=(this.height-this.margin)/m,j=this.width/this.slice_count,I=this,P=_$1(l).map(function(N){return I.margin+I.height-M*N}).value(),$=_$1(P).reduce(function(N,F,U){return N+(U?"C"+U*j+" "+P[U-1]+" "+U*j+" "+F+" "+(U+.5)*j+" "+F:"M0 "+F+"L"+.5*j+" "+F)},"")+"L"+this.width+" "+P[P.length-1],z=$+"L"+this.width+" "+this.height+"L0 "+this.height;this.paper.path(z).attr({stroke:"none",fill:this.fillColor}),this.paper.path($).attr({fill:"none",stroke:this.lineColor,"stroke-width":this.lineWidth}),this.rectangleProgress=this.paper.rect(0,0,0,this.height).attr({stroke:"none",fill:"#808080",opacity:.3}),this.ligneProgress=this.paper.path("M0 0L0 "+this.height).attr({stroke:"#ff00ff","line-width":2}),this.$.click(function(N){var F=N.pageX-I.$.offset().left;I.media.setCurrentTime(I.media.duration*F/I.width)}),this.onMediaEvent("timeupdate","onTimeupdate")}}onTimeupdate(l){var d=Math.floor(this.width*l/this.media.duration);this.rectangleProgress.attr({width:d}),this.ligneProgress.attr({path:"M"+d+" 0L"+d+" "+this.height})}},Cr(n,"defaults",{lineColor:"#7492b4",fillColor:"#aeaeb8",lineWidth:2,slice_count:20,height:50,margin:5}),n},SpelSyncHtml=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget")}draw(){this.renderTemplate();var l=this.$.find("iframe")[0],d=this.src.replace(/#.*$/,"");this.getWidgetAnnotations().forEach(function(m){m.on("enter",function(){m.content&&m.content.data&&m.content.data.ref_text&&(l.src=d+"#"+m.content.data.ref_text)})})}},Cr(n,"defaults",{src:"about:blank"}),Cr(n,"template",'<div class="Ldt-SpelSyncHtml"><iframe src="{{src}}" {{#width}}width="{{width}}"{{/width}} {{#height}}height="{{height}}"{{/height}}</div>'),n},tagcloudStyles={},Tagcloud=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"stopword_lists",{fr:["aussi","avec","aux","bien","car","cette","comme","dans","des","donc","dont","elle","encore","entre","est","être","eux","faire","fait","http","ici","ils","les","leur","leurs","mais","mes","même","mon","notre","non","nos","nous","ont","par","pas","peu","peut","plus","pour","quand","que","qui","quoi","sans","ses","son","sont","sur","tes","très","the","ton","tous","tout","une","votre","vos","vous"],en:["about","again","are","and","because","being","but","can","done","have","for","from","get","here","http","like","more","one","our","she","that","the","their","then","there","they","this","very","what","when","where","who","why","will","with","www","you","your"]});this.stopwords=_$1.uniq([].concat(this.custom_stopwords).concat(this.stopword_lists[this.stopword_language]))}draw(){if(this.segment_annotation_type){var d=this;this.source.getAnnotationsByTypeTitle(this.segment_annotation_type).forEach(function(m){m.on("enter",function(){d.redraw(m.begin,m.end)})})}else this.redraw()}redraw(d,m){var h=/https?:\/\/[0-9a-zA-Z\.%\/-_]+/g,S={},k=this,A=this.getWidgetAnnotations();if(!this.include_titles&&!this.include_descriptions)var B=/[^\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»\/]{3,}/g;else var B=/[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g;if(typeof d<"u"&&typeof m<"u"&&(A=A.filter(function(P){return P.begin>=d&&P.end<=m})),this.remove_zero_duration&&(A=A.filter(function(P){return P.getDuration()>0})),A.forEach(function(P){var $=(k.include_titles?P.title:"")+" "+(k.include_descriptions?P.description:"")+" "+(k.include_tag_texts?P.getTagTexts():"");_$1($.toLowerCase().replace(h,"").match(B)).each(function(z){z=z.trim(),_$1(k.stopwords).indexOf(z)==-1&&(!k.exclude_pattern||!k.exclude_pattern.test(z))&&(S[z]=1+(S[z]||0))})}),S=_$1(S).chain().map(function(P,$){return{word:$,count:P}}).filter(function(P){return P.count>k.min_count}).sortBy(function(P){return-P.count}).first(this.tag_count).value(),S&&S.length){var M=S[0].count,j=Math.min(S[S.length-1].count,M-1),I=(this.max_font_size-this.min_font_size)/Math.sqrt(M-j);_$1(S).each(function(P){P.size=Math.floor(k.min_font_size+I*Math.sqrt(P.count-j))})}this.$.html(mustache.render(this.constructor.template,{words:S})),this.$.find(".Ldt-Tagcloud-item").click(function(){var P=jQuery(this).attr("content");k.source.getAnnotations().searchByTags(P)}),this.source.getAnnotations().on("search",this.functionWrapper("onSearch")),this.source.getAnnotations().on("search-cleared",this.functionWrapper("onSearch"))}onSearch(d){if(d=typeof d<"u"?d:"",d)var m=t.Model.regexpFromTextOrArray(d);this.$.find(".Ldt-Tagcloud-item").each(function(){var h=jQuery(this),S=h.attr("content");d?h.html(S.replace(m,'<span class="Ldt-Tagcloud-active">$1</span>')):h.html(S)})}},Cr(n,"template",'<div class="Ldt-Tagcloud-Container"><ul class="Ldt-Tagcloud-List">{{#words}}<li class="Ldt-Tagcloud-item Ldt-TraceMe" trace-info="tag:{{word}}" content="{{word}}" style="font-size: {{size}}px">{{word}}</li>{{/words}}</ul></div>'),Cr(n,"defaults",{include_titles:!0,include_descriptions:!0,include_tag_texts:!0,tag_count:30,stopword_language:"fr",custom_stopwords:[],exclude_pattern:!1,annotation_type:!1,segment_annotation_type:!1,min_font_size:10,max_font_size:26,min_count:2,remove_zero_duration:!1}),n},Title=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){this.renderTemplate()}},Cr(n,"defaults",{media_title:!1}),Cr(n,"template",'<div class="Ldt-TitleWidget"><h2>{{#media_title}}{{media.title}}{{/media_title}}{{^media_title}}{{source.title}}{{/media_title}}</h2></div>'),n},tooltipStyles={},Tooltip=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){const l=this;this.renderTemplate(),this.$.parent().css({position:"relative"}),this.$tooltip=this.$.find(".Ldt-Tooltip"),this.$tip=this.$.find(".Ldt-Tooltip-Tip"),this.$sw=this.$.find(".Ldt-Tooltip-Border-SW"),this.$se=this.$.find(".Ldt-Tooltip-Border-SE"),this.__halfWidth=Math.floor((this.$.find(".Ldt-Tooltip-Main").width()||192)/2),this.__borderWidth=this.$.find(".Ldt-Tooltip-Border-Left").width(),this.__tipDelta=this.__halfWidth-Math.floor(this.$tip.width()/2),this.__maxShift=this.__tipDelta-this.__borderWidth,this.$.mouseover(function(){l.$tooltip.hide()}),this.hide()}show(l,d,m,h){if(typeof h<"u")if(typeof h=="string")this.$.find(".Ldt-Tooltip-Color").html(""),this.$.find(".Ldt-Tooltip-Color").show().css("background-color",h),this.$.find(".Ldt-Tooltip-Color").show().css("height","");else{var S=this.$.find(".Ldt-Tooltip-Color");S.html(""),S.show();for(var k=0;k<h.length;k++)S.append('<div style="float: left; height: 10px; width: 10px; background-color: '+h[k]+'">');this.$.find(".Ldt-Tooltip-Color").css("height",h.length*10+"px")}else this.$.find(".Ldt-Tooltip-Color").hide();this.$.find(".Ldt-Tooltip-Text").html(m),this.$tooltip.show();var A=0;typeof this.min_x<"u"&&l-this.__halfWidth<this.min_x&&(A=Math.max(l-this.__halfWidth-this.min_x,-this.__maxShift)),typeof this.max_x<"u"&&+l+this.__halfWidth>this.max_x&&(A=Math.min(+l+this.__halfWidth-this.max_x,this.__maxShift)),this.$tooltip.css({left:l-A+"px",top:d+"px"}),this.$tip.css({left:this.__tipDelta+A+"px"}),this.$sw.css({width:this.__tipDelta+A-this.__borderWidth+"px"}),this.$se.css({width:this.__tipDelta-A-this.__borderWidth+"px"})}hide(){this.$tooltip.hide()}},Cr(n,"defaults",{}),Cr(n,"template",'<div class="Ldt-Tooltip"><div class="Ldt-Tooltip-Main"><div class="Ldt-Tooltip-Corner-NW"></div><div class="Ldt-Tooltip-Border-Top"></div><div class="Ldt-Tooltip-Corner-NE"></div><div class="Ldt-Tooltip-Border-Left"></div><div class="Ldt-Tooltip-Border-Right"></div><div class="Ldt-Tooltip-Corner-SW"></div><div class="Ldt-Tooltip-Border-SW"></div><div class="Ldt-Tooltip-Tip"></div><div class="Ldt-Tooltip-Border-SE"></div><div class="Ldt-Tooltip-Corner-SE"></div><div class="Ldt-Tooltip-Inner"><div class="Ldt-Tooltip-Color"></div><p class="Ldt-Tooltip-Text"></p></div></div></div>'),n},transcriptStyles={},Transcript=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this.getWidgetAnnotations(),d=this,m;if(d.renderTemplate(),m=d.$.find(".Ldt-TranscriptWidget"),d.use_vtt_track){var h=d.player.widgets.filter(function(k){return k.type=="HtmlPlayer"});if(h){var S=h[0].$.find("video")[0];S.addEventListener("loadedmetadata",function(){var k=S.textTracks[0],A=k.cues,B=1;Array.prototype.forEach.apply(A,[function(M){M.id="cue"+B;var j=mustache.render(d.annotationTemplate,{id:M.id,content:M.text,begin:1e3*M.startTime,end:1e3*M.endTime});B+=1;var I=jQuery(j);m.append(I)}]),k.addEventListener("cuechange",function(){var M=k.activeCues;M.length>0&&(d.$.find(".Ldt-Transcript-Annotation.active").removeClass("active"),Array.prototype.forEach.apply(M,[function(j){d.$.find("#"+j.id).addClass("active")}]))},!1),m.on("click",".Ldt-Transcript-Annotation",function(){d.media.setCurrentTime(this.dataset.begin)})})}else console.log("cannot find a video object")}else l.forEach(function(k){var A={id:k.id,content:t.textFieldHtml(k.title),begin:k.begin.toString(),end:k.end.toString()},B=mustache.render(d.annotationTemplate,A),M=jQuery(B);m.append(M)})}},Cr(n,"defaults",{annotation_type:"Caption",use_vtt_track:!1}),Cr(n,"template",'<div class="Ldt-TranscriptWidget"></div>'),Cr(n,"annotationTemplate",'<span data-begin="{{ begin }}" data-end="{{ end }}" data-id="{{ id }}" class="Ldt-Transcript-Annotation">{{ content }}</span> '),n},tweetStyles={},Tweet=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d),this.lastAnnotation=!1}draw(){this.renderTemplate(),this.pinned=this.pin_at_start;var l=this;this.$.find(".Ldt-Tweet-Pin").click(function(){l.pinned=!l.pinned;var d=jQuery(this);l.pinned?(d.addClass("active").attr("title",l.l10n.dont_keep_visible),l.cancelTimeout()):(d.removeClass("active").attr("title",l.l10n.keep_visible),l.hideTimeout())}),this.$.find(".Ldt-Tweet-Close").click(function(){l.hide()}),this.$.hide(),this.getWidgetAnnotations().forEach(function(d){d.on("click",function(){l.show(d)})})}show(l){if(typeof l<"u"&&typeof l.source<"u"){var d=[[/#(\w+)/gm,function(I){return'<a href="http://twitter.com/search?q=%23'+I[1]+'" target="_blank">'},"</a>"]],m=_$1(l.source.entities.urls).sortBy(function(I){return I.indices[0]}),h=0,S="";_$1(m).each(function(I){I.indices[0]>=h&&(S+=l.source.text.substring(h,I.indices[0]),S+=typeof I.expanded_url<"u"&&I.expanded_url!==null?I.expanded_url:I.url,h=I.indices[1])}),S+=l.source.text.substring(h);for(var k=0;k<this.polemics.length;k++){var A=t.Model.regexpFromTextOrArray(this.polemics[k].keywords);d.push([A,'<span style="background: '+this.polemics[k].color+'">',"</span>"])}var A=l.found&&_this.source.getAnnotations().regexp||!1,B=l.source.user?l.source.user.profile_image_url:l.source.profile_image_url,M=l.source.user?l.source.user.screen_name:l.source.from_user,j=l.source.user?l.source.user.name:l.source.from_user_name;this.$.find(".Ldt-Tweet-Avatar").attr("src",B),this.$.find(".Ldt-Tweet-ScreenName").html("@"+M),this.$.find(".Ldt-Tweet-ProfileLink").attr("href","https://twitter.com/"+M),this.$.find(".Ldt-Tweet-FullName").html(j),this.$.find(".Ldt-Tweet-Contents").html(t.textFieldHtml(S,A,d)),this.$.find(".Ldt-Tweet-Time").html(this.l10n.original_time+new Date(l.source.created_at).toLocaleTimeString()+" / "+this.l10n.video_time+l.begin.toString()),this.$.find(".Ldt-Tweet-Retweet").attr("href","https://twitter.com/intent/retweet?tweet_id="+l.source.id_str),this.$.find(".Ldt-Tweet-Reply").attr("href","https://twitter.com/intent/tweet?in_reply_to="+l.source.id_str),this.$.find(".Ldt-Tweet-Original").attr("href","https://twitter.com/"+M+"/status/"+l.source.id_str),this.player.trigger("Annotation.minimize"),this.$.slideDown(),this.cancelTimeout(),this.pinned||this.hideTimeout()}else this.hide()}hide(){this.player.trigger("Annotation.maximize"),this.$.slideUp(),this.cancelTimeout()}cancelTimeout(){typeof this.hide_timer<"u"&&(window.clearTimeout(this.hide_timer),this.hide_timer=void 0)}hideTimeout(){this.cancelTimeout(),this.hide_timer=window.setTimeout(this.functionWrapper("hide"),this.hide_timeout)}},Cr(n,"defaults",{hide_timeout:1e4,polemics:[{keywords:["++"],color:"#30d765"},{keywords:["--"],color:"#f51123"},{keywords:["=="],color:"#f1e24a"},{keywords:["??"],color:"#05aae6"}],annotation_type:"tweet",pin_at_start:!1}),Cr(n,"messages",{fr:{retweet:"Retweeter",reply:"Répondre",keep_visible:"Empêcher la fermeture automatique",dont_keep_visible:"Permettre la fermeture automatique",close_widget:"Fermer l'affichage du tweet",original_time:"Heure d'envoi : ",video_time:"Temps de la vidéo : ",show_original:"Voir l'original"},en:{retweet:"Retweet",reply:"Reply",keep_visible:"Keep visible",dont_keep_visible:"Don't keep visible",close_widget:"Close tweet display",original_time:"Tweet sent at: ",video_time:"Video time: ",show_original:"Show original"}}),Cr(n,"template",'<div class="Ldt-Tweet-Widget"><div class="Ldt-Tweet-Inner"><div class="Ldt-Tweet-PinClose-Buttons"><a href="#" class="Ldt-Tweet-Pin Ldt-TraceMe{{#pin_at_start}} active" title="{{l10n.dont_keep_visible}}{{/pin_at_start}}{{^pin_at_start}}" title="{{l10n.keep_visible}}{{/pin_at_start}}"></a><a href="#" class="Ldt-Tweet-Close Ldt-TraceMe" title="{{l10n.close_widget}}"></a></div><div class="Ldt-Tweet-AvatarContainer"><a href="#" class="Ldt-Tweet-ProfileLink" target="_blank"><img src="" class="Ldt-Tweet-Avatar"/></a></div><h3><a href="#" class="Ldt-Tweet-ProfileLink Ldt-Tweet-ScreenName" target="_blank"></a> (<span class="Ldt-Tweet-FullName"></span>)</h3><p class="Ldt-Tweet-Contents"></p><div class="Ldt-Tweet-Bottom"><span class="Ldt-Tweet-Time"></span><a class="Ldt-Tweet-Original" href="" target="_blank">{{l10n.show_original}}</a><a href="" target="_blank" class="Ldt-Tweet-Retweet"><div class="Ldt-Tweet-Icon"></div>{{l10n.retweet}}</a><a href="" target="_blank" class="Ldt-Tweet-Reply"><div class="Ldt-Tweet-Icon"></div>{{l10n.reply}}</a></div></div></div>'),n},AutoPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){typeof this.video>"u"&&(this.video=this.media.video);for(var l=["live","provider","autostart","streamer","video","height","width","url_transform"],d={},m=[{regexp:/^rtmp:\/\//,type:"JwpPlayer"},{regexp:/\.(mp4|m4v|mp3)$/,type:"AdaptivePlayer"},{regexp:/\.(ogg|ogv|webm)$/,type:"HtmlPlayer"},{regexp:/^(https?:\/\/)?(www\.)?youtube\.com/,type:"PopcornPlayer"},{regexp:/^(https?:\/\/)?(www\.)?vimeo\.com/,type:"PopcornPlayer"},{regexp:/^(https?:\/\/)?(www\.)?dailymotion\.com/,type:"DailymotionPlayer"}],h=/^rtmp:\/\//,S=0;S<m.length;S++)if(this.video&&m[S].regexp.test(this.video.toLowerCase())){d.type=m[S].type;break}if(typeof d.type>"u"&&(d.type=this.default_type),d.type==="AdaptivePlayer"){var k=document.createElement("video").canPlayType('video/mp4; codecs="avc1.42E01E"');d.type=k!=="no"?"HtmlPlayer":"JwpPlayer"}h.test(this.video)&&(d.provider="rtmp",d.live=!0);for(var S=0;S<l.length;S++)typeof this[l[S]]<"u"&&(d[l[S]]=this[l[S]]);this.insertSubwidget(this.$,d)}},Cr(n,"defaults",{default_type:"HtmlPlayer"}),n},MultiSegments=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this,d=[],m=null,h={},S={};_$1(this).each(function(k,A){/^segments_/.test(A)&&(h[A.replace(/^segments_/,"")]=k),/^annotation_/.test(A)&&(S[A.replace(/^annotation_/,"")]=k)}),this.source.getAnnotationTypes().forEach(function(k){var A=k.getAnnotations().filter(function(j){return j.getDuration()>0&&j.getMedia().id==l.media.id});if(A.length){var B=!1,M={segmentWidget:jQuery("<div>"),annotationWidget:jQuery("<div>"),hasSegmentsNow:function(){var j=l.media.getCurrentTime();return!!A.filter(function(I){return I.begin<=j&&I.end>j}).length},hide:function(){B&&(B=!1,this.annotationWidget.slideUp())},show:function(){B||(B=!0,this.annotationWidget.slideDown())}};M.segmentWidget.addClass("Ldt-MultiSegments-Segment").appendTo(l.$),l.show_all||M.segmentWidget.on("mouseenter",function(){M.hasSegmentsNow()&&(m=M)}),M.annotationWidget.addClass("Ldt-MultiSegments-Annotation").appendTo(l.$).hide(),l.insertSubwidget(M.segmentWidget,_$1({type:"Segments",annotation_type:k,width:"100%"}).extend(h).value()),l.insertSubwidget(M.annotationWidget,_$1({type:"Annotation",annotation_type:k,width:"100%"}).extend(S).value()),d.push(M)}}),jQuery(document).on("click",".Ldt-Segments-Segment",function(k){!l.show_all&&m&&!m.hasSegmentsNow()&&(m=void 0),_$1(d).each(function(A){jQuery(k.target).parent().parent()[0]==A.segmentWidget[0]?(m=A,A.show()):A.hide()})})}},Cr(n,"defaults",{annotation_show_arrow:!0,annotation_start_minimized:!1,annotation_show_annotation_type:!0,show_all:!1}),n};function widgets(t){return{AdaptivePlayer:AdaptivePlayer(t),AutoPlayer:AutoPlayer(t),HelloWorld:HelloWorld(t),Annotation:Annotation(t),AnnotationsController:AnnotationsController(t),AnnotationsList:AnnotationsList(t),Arrow:Arrow(t),Controller:Controller(t),CreateAnnotation:CreateAnnotation(t),CurrentSegmentInfobox:CurrentSegmentInfobox(t),DailymotionPlayer:DailymotionPlayer(t),EnrichedPlan:EnrichedPlan(t),Highlighter:Highlighter(t),HtmlMashupPlayer:HtmlMashupPlayer(t),HtmlPlayer:HtmlPlayer(t),ImageDisplay:ImageDisplay(t),JwpPlayer:JwpPlayerWidget(t),LatestAnnotation:LatestAnnotation(t),MashupPlayer:MashupPlayer(t),Mediafragment:Mediafragment(t),MediaList:MediaList(t),MultiSegments:MultiSegments(t),NoteTaking:NoteTaking(t),PlaceholderPlayer:PlaceholderPlayer(t),Polemic:Polemic(t),PopcornPlayer:PopcornPlayer(t),Quiz:Quiz(t),UniqueChoiceQuestion:UniqueChoiceQuestion(t),MultipleChoiceQuestion:MultipleChoiceQuestion(t),QuizCreator:QuizCreator(t),Segments:Segments(t),Shortcuts:Shortcuts(t),Slice:Slice(t),SlidePreview:SlidePreview(t),Slider:Slider(t),SlideVideoPlayer:SlideVideoPlayer(t),Social:Social(t),Sparkline:Sparkline(t),SpelSyncHtml:SpelSyncHtml(t),Tagcloud:Tagcloud(t),Title:Title(t),Tooltip:Tooltip(t),Transcript:Transcript(t),Tweet:Tweet(t),styles:{annotationStyles,helloWorldStyles,annotationsControllerStyles,annotationsListStyles,controllerStyles,createAnnotationStyles,currentSegmentInfoboxStyles,enrichedPlanStyles,highlighterStyles,imageDisplayStyles,latestAnnotationStyles,mashupPlayerStyles,mediaListStyles,noteTakingStyles,placeholderPlayerStyles,polemicStyles,quizStyles,quizCreatorStyles,segmentsStyles,shortcutsStyles,sliceStyles,slidePreviewStyles,sliderStyles,slideVideoPlayerStyles,socialStyles,tagcloudStyles,tooltipStyles,transcriptStyles,tweetStyles}}}typeof window.IriSP>"u"&&(window.IriSP=IriSP$1),IriSP$1.Model=Model(IriSP$1),IriSP$1.htmlPlayer=htmlPlayer,Object.assign(IriSP$1,utils$r(IriSP$1)),IriSP$1.iFrameUpdater=iFrameUpdater,IriSP$1.serializers=serializers(IriSP$1),Object.assign(IriSP$1,defaults()),metadataplayer(IriSP$1),IriSP$1.Widgets=widgetsBase(IriSP$1),Object.assign(IriSP$1.Widgets,widgets(IriSP$1));const main={IriSP:IriSP$1,style};return main});
//# sourceMappingURL=LdtPlayer-core.js.map