# HG changeset patch # User ymh # Date 1725282008 -7200 # Node ID 8cc1dda7efc8dc2cb1bfa9e0786e9d030f8da70a # Parent ed7bcbefc941401853e960f02ab434706bb0f4b8 change metadataplayer version + add css to loaded files diff -r ed7bcbefc941 -r 8cc1dda7efc8 src/ldt/ldt/ldt_utils/templates/front/front_player.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_player.html Wed Jul 03 14:27:13 2024 +0200 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_player.html Mon Sep 02 15:00:08 2024 +0200 @@ -10,6 +10,7 @@ + {% if toggle_multisegments %} ").appendTo(v)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!y)for(w=this.containers.length-1;w>=0;w--)this.containers[w]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(e),!0},_scroll:function(e){var c=this.options,y=!1;return this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;c--)if(y=this.items[c],w=y.item[0],v=this._intersectsWithPointer(y),!!v&&y.instance===this.currentContainer&&w!==this.currentItem[0]&&this.placeholder[v===1?"next":"prev"]()[0]!==w&&!t.contains(this.placeholder[0],w)&&(this.options.type!=="semi-dynamic"||!t.contains(this.element[0],w))){if(this.direction=v===1?"down":"up",this.options.tolerance==="pointer"||this._intersectsWithSides(y))this._rearrange(e,y);else break;this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,c){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var y=this,w=this.placeholder.offset(),v=this.options.axis,o={};(!v||v==="x")&&(o.left=w.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),(!v||v==="y")&&(o.top=w.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){y._clear(e)})}else this._clear(e,c);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),this.options.helper==="original"?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var c=this._getItemsAsjQuery(e&&e.connected),y=[];return e=e||{},t(c).each(function(){var w=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);w&&y.push((e.key||w[1]+"[]")+"="+(e.key&&e.expression?w[1]:w[2]))}),!y.length&&e.key&&y.push(e.key+"="),y.join("&")},toArray:function(e){var c=this._getItemsAsjQuery(e&&e.connected),y=[];return e=e||{},c.each(function(){y.push(t(e.item||this).attr(e.attribute||"id")||"")}),y},_intersectsWith:function(e){var c=this.positionAbs.left,y=c+this.helperProportions.width,w=this.positionAbs.top,v=w+this.helperProportions.height,o=e.left,x=o+e.width,E=e.top,R=E+e.height,H=this.offset.click.top,Y=this.offset.click.left,Z=this.options.axis==="x"||w+H>E&&w+Ho&&c+Ye[this.floating?"width":"height"]?D:o0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!==0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(e){var c,y,w,v,o=[],x=[],E=this._connectWith();if(E&&e)for(c=E.length-1;c>=0;c--)for(w=t(E[c],this.document[0]),y=w.length-1;y>=0;y--)v=t.data(w[y],this.widgetFullName),v&&v!==this&&!v.options.disabled&&x.push([typeof v.options.items=="function"?v.options.items.call(v.element):t(v.options.items,v.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),v]);x.push([typeof this.options.items=="function"?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function R(){o.push(this)}for(c=x.length-1;c>=0;c--)x[c][0].each(R);return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(c){for(var y=0;y=0;c--)for(w=t(Z[c],this.document[0]),y=w.length-1;y>=0;y--)v=t.data(w[y],this.widgetFullName),v&&v!==this&&!v.options.disabled&&(Y.push([typeof v.options.items=="function"?v.options.items.call(v.element[0],e,{item:this.currentItem}):t(v.options.items,v.element),v]),this.containers.push(v));for(c=Y.length-1;c>=0;c--)for(o=Y[c][1],x=Y[c][0],y=0,R=x.length;y=0;c--)y=this.items[c],!(this.currentContainer&&y.instance!==this.currentContainer&&y.item[0]!==this.currentItem[0])&&(w=this.options.toleranceElement?t(this.options.toleranceElement,y.item):y.item,e||(y.width=w.outerWidth(),y.height=w.outerHeight()),v=w.offset(),y.left=v.left,y.top=v.top)},refreshPositions:function(e){this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(e);var c,y;if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(c=this.containers.length-1;c>=0;c--)y=this.containers[c].element.offset(),this.containers[c].containerCache.left=y.left,this.containers[c].containerCache.top=y.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var c,y,w=e.options;(!w.placeholder||w.placeholder.constructor===String)&&(c=w.placeholder,y=e.currentItem[0].nodeName.toLowerCase(),w.placeholder={element:function(){var v=t("<"+y+">",e.document[0]);return e._addClass(v,"ui-sortable-placeholder",c||e.currentItem[0].className)._removeClass(v,"ui-sortable-helper"),y==="tbody"?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("",e.document[0]).appendTo(v)):y==="tr"?e._createTrPlaceholder(e.currentItem,v):y==="img"&&v.attr("src",e.currentItem.attr("src")),c||v.css("visibility","hidden"),v},update:function(v,o){c&&!w.forcePlaceholderSize||((!o.height()||w.forcePlaceholderSize&&(y==="tbody"||y==="tr"))&&o.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),o.width()||o.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(w.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),w.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,c){var y=this;e.children().each(function(){t(" ",y.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(c)})},_contactContainers:function(e){var c,y,w,v,o,x,E,R,H,Y,Z=null,L=null;for(c=this.containers.length-1;c>=0;c--)if(!t.contains(this.currentItem[0],this.containers[c].element[0]))if(this._intersectsWith(this.containers[c].containerCache)){if(Z&&t.contains(this.containers[c].element[0],Z.element[0]))continue;Z=this.containers[c],L=c}else this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",e,this._uiHash(this)),this.containers[c].containerCache.over=0);if(Z)if(this.containers.length===1)this.containers[L].containerCache.over||(this.containers[L]._trigger("over",e,this._uiHash(this)),this.containers[L].containerCache.over=1);else{for(w=1e4,v=null,H=Z.floating||this._isFloating(this.currentItem),o=H?"left":"top",x=H?"width":"height",Y=H?"pageX":"pageY",y=this.items.length-1;y>=0;y--)t.contains(this.containers[L].element[0],this.items[y].item[0])&&this.items[y].item[0]!==this.currentItem[0]&&(E=this.items[y].item.offset()[o],R=!1,e[Y]-E>this.items[y][x]/2&&(R=!0),Math.abs(e[Y]-E)this.containment[2]&&(v=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),w.grid&&(c=this.originalPageY+Math.round((o-this.originalPageY)/w.grid[1])*w.grid[1],o=this.containment?c-this.offset.click.top>=this.containment[1]&&c-this.offset.click.top<=this.containment[3]?c:c-this.offset.click.top>=this.containment[1]?c-w.grid[1]:c+w.grid[1]:c,y=this.originalPageX+Math.round((v-this.originalPageX)/w.grid[0])*w.grid[0],v=this.containment?y-this.offset.click.left>=this.containment[0]&&y-this.offset.click.left<=this.containment[2]?y:y-this.offset.click.left>=this.containment[0]?y-w.grid[0]:y+w.grid[0]:y)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():E?0:x.scrollTop()),left:v-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():E?0:x.scrollLeft())}},_rearrange:function(e,c,y,w){y?y[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?c.item[0]:c.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var v=this.counter;this._delay(function(){v===this.counter&&this.refreshPositions(!w)})},_clear:function(e,c){this.reverting=!1;var y,w=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(y in this._storedCSS)(this._storedCSS[y]==="auto"||this._storedCSS[y]==="static")&&(this._storedCSS[y]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&w.push(function(o){this._trigger("receive",o,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!c&&w.push(function(o){this._trigger("update",o,this._uiHash())}),this!==this.currentContainer&&(c||(w.push(function(o){this._trigger("remove",o,this._uiHash())}),w.push((function(o){return function(x){o._trigger("receive",x,this._uiHash(this))}}).call(this,this.currentContainer)),w.push((function(o){return function(x){o._trigger("update",x,this._uiHash(this))}}).call(this,this.currentContainer))));function v(o,x,E){return function(R){E._trigger(o,R,x._uiHash(x))}}for(y=this.containers.length-1;y>=0;y--)c||w.push(v("deactivate",this,this.containers[y])),this.containers[y].containerCache.over&&(w.push(v("out",this,this.containers[y])),this.containers[y].containerCache.over=0);if(this._storedStylesheet&&(this._storedStylesheet.remove(),this._storedStylesheet=null),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex),this.dragging=!1,c||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!c){for(y=0;y",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this.value()!==""&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),c=this.element;return t.each(["min","max","step"],function(y,w){var v=c.attr(w);v!=null&&v.length&&(e[w]=v)}),e},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,c){var y=this.document[0].activeElement,w=this.element[0]===y;if(!(!w||!c)){if(!this.spinning&&!this._start(e))return!1;this._spin((c>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(e){var c;c=this.element[0]===this.document[0].activeElement?this.previous:this.element.val();function y(){var w=this.element[0]===this.document[0].activeElement;w||(this.element.trigger("focus"),this.previous=c)}e.preventDefault(),y.call(this),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active")){if(this._start(e)===!1)return!1;this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)}},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("").parent().append("")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(this.uiSpinner.height()*.5)&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var c=this.options,y=t.ui.keyCode;switch(e.keyCode){case y.UP:return this._repeat(null,1,e),!0;case y.DOWN:return this._repeat(null,-1,e),!0;case y.PAGE_UP:return this._repeat(null,c.page,e),!0;case y.PAGE_DOWN:return this._repeat(null,-c.page,e),!0}return!1},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,c,y){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,c,y)},e),this._spin(c*this.options.step,y)},_spin:function(e,c){var y=this.value()||0;this.counter||(this.counter=1),y=this._adjustValue(y+e*this._increment(this.counter)),(!this.spinning||this._trigger("spin",c,{value:y})!==!1)&&(this._value(y),this.counter++)},_increment:function(e){var c=this.options.incremental;return c?typeof c=="function"?c(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var c=e.toString(),y=c.indexOf(".");return y===-1?0:c.length-y-1},_adjustValue:function(e){var c,y,w=this.options;return c=w.min!==null?w.min:0,y=e-c,y=Math.round(y/w.step)*w.step,e=c+y,e=parseFloat(e.toFixed(this._precision())),w.max!==null&&e>w.max?w.max:w.min!==null&&e"},_buttonHtml:function(){return""}}),t.ui.spinner;/*! + * jQuery UI Tabs 1.14.0 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */t.widget("ui.tabs",{version:"1.14.0",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(c){var y,w;y=c.href.replace(e,""),w=location.href.replace(e,"");try{y=decodeURIComponent(y)}catch{}try{w=decodeURIComponent(w)}catch{}return c.hash.length>1&&y===w}}(),_create:function(){var e=this,c=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,c.collapsible),this._processTabs(),c.active=this._initialActive(),Array.isArray(c.disabled)&&(c.disabled=t.uniqueSort(c.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(y){return e.tabs.index(y)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(c.active):this.active=t(),this._refresh(),this.active.length&&this.load(c.active)},_initialActive:function(){var e=this.options.active,c=this.options.collapsible,y=location.hash.substring(1);return e===null&&(y&&this.tabs.each(function(w,v){if(t(v).attr("aria-controls")===y)return e=w,!1}),e===null&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(e===null||e===-1)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),e===-1&&(e=c?!1:0)),!c&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var c=t(this.document[0].activeElement).closest("li"),y=this.tabs.index(c),w=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:y++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:w=!1,y--;break;case t.ui.keyCode.END:y=this.anchors.length-1;break;case t.ui.keyCode.HOME:y=0;break;case t.ui.keyCode.SPACE:e.preventDefault(),clearTimeout(this.activating),this._activate(y);return;case t.ui.keyCode.ENTER:e.preventDefault(),clearTimeout(this.activating),this._activate(y===this.options.active?!1:y);return;default:return}e.preventDefault(),clearTimeout(this.activating),y=this._focusNextTab(y,w),!e.ctrlKey&&!e.metaKey&&(c.attr("aria-selected","false"),this.tabs.eq(y).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",y)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){if(e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(e,c){var y=this.tabs.length-1;function w(){return e>y&&(e=0),e<0&&(e=y),e}for(;t.inArray(w(),this.options.disabled)!==-1;)e=c?e+1:e-1;return e},_focusNextTab:function(e,c){return e=this._findNextTab(e,c),this.tabs.eq(e).trigger("focus"),e},_setOption:function(e,c){if(e==="active"){this._activate(c);return}this._super(e,c),e==="collapsible"&&(this._toggleClass("ui-tabs-collapsible",null,c),!c&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(c),e==="heightStyle"&&this._setupHeightStyle(c)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,c=this.tablist.children(":has(a[href])");e.disabled=t.map(c.filter(".ui-state-disabled"),function(y){return c.index(y)}),this._processTabs(),e.active===!1||!this.anchors.length?(e.active=!1,this.active=t()):this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,c=this.tabs,y=this.anchors,w=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(v){t(this).is(".ui-state-disabled")&&v.preventDefault()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(v,o){var x,E,R,H=t(o).uniqueId().attr("id"),Y=t(o).closest("li"),Z=Y.attr("aria-controls");e._isLocal(o)?(x=o.hash,R=x.substring(1),E=e.element.find(e._sanitizeSelector(x))):(R=Y.attr("aria-controls")||t({}).uniqueId()[0].id,x="#"+R,E=e.element.find(x),E.length||(E=e._createPanel(R),E.insertAfter(e.panels[v-1]||e.tablist)),E.attr("aria-live","polite")),E.length&&(e.panels=e.panels.add(E)),Z&&Y.data("ui-tabs-aria-controls",Z),Y.attr({"aria-controls":R,"aria-labelledby":H}),E.attr("aria-labelledby",H)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),c&&(this._off(c.not(this.tabs)),this._off(y.not(this.anchors)),this._off(w.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("
").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var c,y,w;for(Array.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),w=0;y=this.tabs[w];w++)c=t(y),e===!0||t.inArray(w,e)!==-1?(c.attr("aria-disabled","true"),this._addClass(c,null,"ui-state-disabled")):(c.removeAttr("aria-disabled"),this._removeClass(c,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var c={};e&&t.each(e.split(" "),function(y,w){c[w]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(y){y.preventDefault()}}),this._on(this.anchors,c),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var c,y=this.element.parent();e==="fill"?(c=y.height(),c-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var w=t(this),v=w.css("position");v==="absolute"||v==="fixed"||(c-=w.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){c-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,c-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):e==="auto"&&(c=0,this.panels.each(function(){c=Math.max(c,t(this).height("").height())}).height(c))},_eventHandler:function(e){var c=this.options,y=this.active,w=t(e.currentTarget),v=w.closest("li"),o=v[0]===y[0],x=o&&c.collapsible,E=x?t():this._getPanelForTab(v),R=y.length?this._getPanelForTab(y):t(),H={oldTab:y,oldPanel:R,newTab:x?t():v,newPanel:E};e.preventDefault(),!(v.hasClass("ui-state-disabled")||v.hasClass("ui-tabs-loading")||this.running||o&&!c.collapsible||this._trigger("beforeActivate",e,H)===!1)&&(c.active=x?!1:this.tabs.index(v),this.active=o?t():v,this.xhr&&this.xhr.abort(),!R.length&&!E.length&&t.error("jQuery UI Tabs: Mismatching fragment identifier."),E.length&&this.load(this.tabs.index(v),e),this._toggle(e,H))},_toggle:function(e,c){var y=this,w=c.newPanel,v=c.oldPanel;this.running=!0;function o(){y.running=!1,y._trigger("activate",e,c)}function x(){y._addClass(c.newTab.closest("li"),"ui-tabs-active","ui-state-active"),w.length&&y.options.show?y._show(w,y.options.show,o):(w.show(),o())}v.length&&this.options.hide?this._hide(v,this.options.hide,function(){y._removeClass(c.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),x()}):(this._removeClass(c.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),v.hide(),x()),v.attr("aria-hidden","true"),c.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),w.length&&v.length?c.oldTab.attr("tabIndex",-1):w.length&&this.tabs.filter(function(){return t(this).attr("tabIndex")===0}).attr("tabIndex",-1),w.attr("aria-hidden","false"),c.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var c,y=this._findActive(e);y[0]!==this.active[0]&&(y.length||(y=this.active),c=y.find(".ui-tabs-anchor")[0],this._eventHandler({target:c,currentTarget:c,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+CSS.escape(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),c=e.data("ui-tabs-aria-controls");c?e.attr("aria-controls",c).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(e){var c=this.options.disabled;c!==!1&&(e===void 0?c=!1:(e=this._getIndex(e),Array.isArray(c)?c=t.map(c,function(y){return y!==e?y:null}):c=t.map(this.tabs,function(y,w){return w!==e?w:null})),this._setOptionDisabled(c))},disable:function(e){var c=this.options.disabled;if(c!==!0){if(e===void 0)c=!0;else{if(e=this._getIndex(e),t.inArray(e,c)!==-1)return;Array.isArray(c)?c=t.merge([e],c).sort():c=[e]}this._setOptionDisabled(c)}},load:function(e,c){e=this._getIndex(e);var y=this,w=this.tabs.eq(e),v=w.find(".ui-tabs-anchor"),o=this._getPanelForTab(w),x={tab:w,panel:o},E=function(R,H){H==="abort"&&y.panels.stop(!1,!0),y._removeClass(w,"ui-tabs-loading"),o.removeAttr("aria-busy"),R===y.xhr&&delete y.xhr};this._isLocal(v[0])||(this.xhr=t.ajax(this._ajaxSettings(v,c,x)),this.xhr.statusText!=="canceled"&&(this._addClass(w,"ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(R,H,Y){o.html(R),y._trigger("load",c,x),E(Y,H)}).fail(function(R,H){E(R,H)})))},_ajaxSettings:function(e,c,y){var w=this;return{url:e.attr("href"),beforeSend:function(v,o){return w._trigger("beforeLoad",c,t.extend({jqXHR:v,ajaxSettings:o},y))}}},_getPanelForTab:function(e){var c=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+c))}}),t.uiBackCompat===!0&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs;/*! + * jQuery UI Tooltip 1.14.0 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */t.widget("ui.tooltip",{version:"1.14.0",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title");return t("").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,c){var y=(e.attr("aria-describedby")||"").split(/\s+/);y.push(c),e.data("ui-tooltip-id",c).attr("aria-describedby",String.prototype.trim.call(y.join(" ")))},_removeDescribedBy:function(e){var c=e.data("ui-tooltip-id"),y=(e.attr("aria-describedby")||"").split(/\s+/),w=t.inArray(c,y);w!==-1&&y.splice(w,1),e.removeData("ui-tooltip-id"),y=String.prototype.trim.call(y.join(" ")),y?e.attr("aria-describedby",y):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("
").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,c){var y=this;this._super(e,c),e==="content"&&t.each(this.tooltips,function(w,v){y._updateContent(v.element)})},_setOptionDisabled:function(e){this[e?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(c,y){var w=t.Event("blur");w.target=w.currentTarget=y.element[0],e.close(w,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var c=t(this);if(c.is("[title]"))return c.data("ui-tooltip-title",c.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var c=this,y=t(e?e.target:this.element).closest(this.options.items);!y.length||y.data("ui-tooltip-id")||(y.attr("title")&&y.data("ui-tooltip-title",y.attr("title")),y.data("ui-tooltip-open",!0),e&&e.type==="mouseover"&&y.parents().each(function(){var w=t(this),v;w.data("ui-tooltip-open")&&(v=t.Event("blur"),v.target=v.currentTarget=this,c.close(v,!0)),w.attr("title")&&(w.uniqueId(),c.parents[this.id]={element:this,title:w.attr("title")},w.attr("title",""))}),this._registerCloseHandlers(e,y),this._updateContent(y,e))},_updateContent:function(e,c){var y,w=this.options.content,v=this,o=c?c.type:null;if(typeof w=="string"||w.nodeType||w.jquery)return this._open(c,e,w);y=w.call(e[0],function(x){e.data("ui-tooltip-open")&&(c&&(c.type=o),v._open(c,e,x))}),y&&this._open(c,e,y)},_open:function(e,c,y){var w,v,o,x,E=t.extend({},this.options.position);if(!y)return;if(w=this._find(c),w){w.tooltip.find(".ui-tooltip-content").html(y);return}c.is("[title]")&&(e&&e.type==="mouseover"?c.attr("title",""):c.removeAttr("title")),w=this._tooltip(c),v=w.tooltip,this._addDescribedBy(c,v.attr("id")),v.find(".ui-tooltip-content").html(y),this.liveRegion.children().hide(),x=t("
").html(v.find(".ui-tooltip-content").html()),x.removeAttr("name").find("[name]").removeAttr("name"),x.removeAttr("id").find("[id]").removeAttr("id"),x.appendTo(this.liveRegion);function R(H){E.of=H,!v.is(":hidden")&&v.position(E)}this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:R}),R(e)):v.position(t.extend({of:c},this.options.position)),v.hide(),this._show(v,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){v.is(":visible")&&(R(E.of),clearInterval(o))},13)),this._trigger("open",e,{tooltip:v})},_registerCloseHandlers:function(e,c){var y={keyup:function(w){if(w.keyCode===t.ui.keyCode.ESCAPE){var v=t.Event(w);v.currentTarget=c[0],this.close(v,!0)}}};c[0]!==this.element[0]&&(y.remove=function(){var w=this._find(c);w&&this._removeTooltip(w.tooltip)}),(!e||e.type==="mouseover")&&(y.mouseleave="close"),(!e||e.type==="focusin")&&(y.focusout="close"),this._on(!0,c,y)},close:function(e){var c,y=this,w=t(e?e.currentTarget:this.element),v=this._find(w);if(!v){w.removeData("ui-tooltip-open");return}c=v.tooltip,!v.closing&&(clearInterval(this.delayedShow),w.data("ui-tooltip-title")&&!w.attr("title")&&w.attr("title",w.data("ui-tooltip-title")),this._removeDescribedBy(w),v.hiding=!0,c.stop(!0),this._hide(c,this.options.hide,function(){y._removeTooltip(t(this))}),w.removeData("ui-tooltip-open"),this._off(w,"mouseleave focusout keyup"),w[0]!==this.element[0]&&this._off(w,"remove"),this._off(this.document,"mousemove"),e&&e.type==="mouseleave"&&t.each(this.parents,function(o,x){t(x.element).attr("title",x.title),delete y.parents[o]}),v.closing=!0,this._trigger("close",e,{tooltip:c}),v.hiding||(v.closing=!1))},_tooltip:function(e){var c=t("
").attr("role","tooltip"),y=t("
").appendTo(c),w=c.uniqueId().attr("id");return this._addClass(y,"ui-tooltip-content"),this._addClass(c,"ui-tooltip","ui-widget ui-widget-content"),c.appendTo(this._appendTo(e)),this.tooltips[w]={element:e,tooltip:c}},_find:function(e){var c=e.data("ui-tooltip-id");return c?this.tooltips[c]:null},_removeTooltip:function(e){clearInterval(this.delayedShow),e.remove(),delete this.tooltips[e.attr("id")]},_appendTo:function(e){var c=e.closest(".ui-front, dialog");return c.length||(c=this.document[0].body),c},_destroy:function(){var e=this;t.each(this.tooltips,function(c,y){var w=t.Event("blur"),v=y.element;w.target=w.currentTarget=v[0],e.close(w,!0),t("#"+c).remove(),v.data("ui-tooltip-title")&&(v.attr("title")||v.attr("title",v.data("ui-tooltip-title")),v.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat===!0&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var e=this._superApply(arguments);return this.options.tooltipClass&&e.tooltip.addClass(this.options.tooltipClass),e}}),t.ui.tooltip});var lodash={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */lodash.exports,function(t,n){(function(){var l,d="4.17.21",m=200,h="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",S="Expected a function",k="Invalid `variable` option passed into `_.template`",A="__lodash_hash_undefined__",B=500,M="__lodash_placeholder__",j=1,I=2,P=4,$=1,z=2,N=1,F=2,U=4,J=8,te=16,se=32,de=64,Q=128,ve=256,he=512,ke=30,T="...",u=800,p=16,b=1,e=2,c=3,y=1/0,w=9007199254740991,v=17976931348623157e292,o=NaN,x=4294967295,E=x-1,R=x>>>1,H=[["ary",Q],["bind",N],["bindKey",F],["curry",J],["curryRight",te],["flip",he],["partial",se],["partialRight",de],["rearg",ve]],Y="[object Arguments]",Z="[object Array]",L="[object AsyncFunction]",D="[object Boolean]",ee="[object Date]",oe="[object DOMException]",fe="[object Error]",ue="[object Function]",qe="[object GeneratorFunction]",rt="[object Map]",Ve="[object Number]",et="[object Null]",mt="[object Object]",Ye="[object Promise]",We="[object Proxy]",Xe="[object RegExp]",Ge="[object Set]",nt="[object String]",Et="[object Symbol]",Le="[object Undefined]",Oe="[object WeakMap]",$t="[object WeakSet]",dt="[object ArrayBuffer]",gt="[object DataView]",Lt="[object Float32Array]",xe="[object Float64Array]",X="[object Int8Array]",pe="[object Int16Array]",je="[object Int32Array]",$e="[object Uint8Array]",He="[object Uint8ClampedArray]",Fe="[object Uint16Array]",Me="[object Uint32Array]",Rt=/\b__p \+= '';/g,yt=/\b(__p \+=) '' \+/g,le=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,at=/[&<>"']/g,Be=RegExp(wt.source),ot=RegExp(at.source),tt=/<%-([\s\S]+?)%>/g,kt=/<%([\s\S]+?)%>/g,Yt=/<%=([\s\S]+?)%>/g,pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,It=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,Ot=RegExp(Pt.source),Te=/^\s+/,me=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ne=/\{\n\/\* \[wrapped with (.+)\] \*/,_e=/,? & /,Re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,Ze=/\\(\\)?/g,ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Ut=/^[-+]0x[0-9a-f]+$/i,Mr=/^0b[01]+$/i,Xt=/^\[object .+?Constructor\]$/,Sr=/^0o[0-7]+$/i,rr=/^(?:0|[1-9]\d*)$/,er=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kr=/($^)/,vr=/['\n\r\u2028\u2029\\]/g,Pr="\\ud800-\\udfff",Tr="\\u0300-\\u036f",br="\\ufe20-\\ufe2f",Ar="\\u20d0-\\u20ff",gr=Tr+br+Ar,dr="\\u2700-\\u27bf",lr="a-z\\xdf-\\xf6\\xf8-\\xff",Kt="\\xac\\xb1\\xd7\\xf7",Bt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ft="\\u2000-\\u206f",cr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",nr="A-Z\\xc0-\\xd6\\xd8-\\xde",Vt="\\ufe0e\\ufe0f",ar=Kt+Bt+Ft+cr,qr="['’]",Vr="["+Pr+"]",Wr="["+ar+"]",Rr="["+gr+"]",bt="\\d+",Kr="["+dr+"]",Ur="["+lr+"]",ti="[^"+Pr+ar+bt+dr+lr+nr+"]",ae="\\ud83c[\\udffb-\\udfff]",ye="(?:"+Rr+"|"+ae+")",Ce="[^"+Pr+"]",Pe="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",Je="["+nr+"]",ge="\\u200d",we="(?:"+Ur+"|"+ti+")",Ae="(?:"+Je+"|"+ti+")",Ue="(?:"+qr+"(?:d|ll|m|re|s|t|ve))?",ht="(?:"+qr+"(?:D|LL|M|RE|S|T|VE))?",_t=ye+"?",Ct="["+Vt+"]?",At="(?:"+ge+"(?:"+[Ce,Pe,ze].join("|")+")"+Ct+_t+")*",Qt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ir="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tr=Ct+_t+At,Zt="(?:"+[Kr,Pe,ze].join("|")+")"+tr,Br="(?:"+[Ce+Rr+"?",Rr,Pe,ze,Vr].join("|")+")",pr=RegExp(qr,"g"),_r=RegExp(Rr,"g"),fr=RegExp(ae+"(?="+ae+")|"+Br+tr,"g"),Gr=RegExp([Je+"?"+Ur+"+"+Ue+"(?="+[Wr,Je,"$"].join("|")+")",Ae+"+"+ht+"(?="+[Wr,Je+we,"$"].join("|")+")",Je+"?"+we+"+"+Ue,Je+"+"+ht,ir,Qt,bt,Zt].join("|"),"g"),Nr=RegExp("["+ge+Pr+gr+Vt+"]"),Zr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Sn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],qn=-1,ii={};ii[Lt]=ii[xe]=ii[X]=ii[pe]=ii[je]=ii[$e]=ii[He]=ii[Fe]=ii[Me]=!0,ii[Y]=ii[Z]=ii[dt]=ii[D]=ii[gt]=ii[ee]=ii[fe]=ii[ue]=ii[rt]=ii[Ve]=ii[mt]=ii[Xe]=ii[Ge]=ii[nt]=ii[Oe]=!1;var si={};si[Y]=si[Z]=si[dt]=si[gt]=si[D]=si[ee]=si[Lt]=si[xe]=si[X]=si[pe]=si[je]=si[rt]=si[Ve]=si[mt]=si[Xe]=si[Ge]=si[nt]=si[Et]=si[$e]=si[He]=si[Fe]=si[Me]=!0,si[fe]=si[ue]=si[Oe]=!1;var vn={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},on={"&":"&","<":"<",">":">",'"':""","'":"'"},Bn={"&":"&","<":"<",">":">",""":'"',"'":"'"},Hi={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xi=parseFloat,Kn=parseInt,ta=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,ma=typeof self=="object"&&self&&self.Object===Object&&self,yi=ta||ma||Function("return this")(),Rn=n&&!n.nodeType&&n,Ui=Rn&&!0&&t&&!t.nodeType&&t,ra=Ui&&Ui.exports===Rn,Wi=ra&&ta.process,Bi=function(){try{var st=Ui&&Ui.require&&Ui.require("util").types;return st||Wi&&Wi.binding&&Wi.binding("util")}catch{}}(),V=Bi&&Bi.isArrayBuffer,ie=Bi&&Bi.isDate,be=Bi&&Bi.isMap,Ee=Bi&&Bi.isRegExp,Ie=Bi&&Bi.isSet,De=Bi&&Bi.isTypedArray;function Ke(st,jt,Mt){switch(Mt.length){case 0:return st.call(jt);case 1:return st.call(jt,Mt[0]);case 2:return st.call(jt,Mt[0],Mt[1]);case 3:return st.call(jt,Mt[0],Mt[1],Mt[2])}return st.apply(jt,Mt)}function St(st,jt,Mt,ur){for(var yr=-1,Lr=st==null?0:st.length;++yr-1}function jr(st,jt,Mt){for(var ur=-1,yr=st==null?0:st.length;++ur-1;);return Mt}function sa(st,jt){for(var Mt=st.length;Mt--&&wi(jt,st[Mt],0)>-1;);return Mt}function en(st,jt){for(var Mt=st.length,ur=0;Mt--;)st[Mt]===jt&&++ur;return ur}var Vn=Ki(vn),As=Ki(on);function Cs(st){return"\\"+Hi[st]}function Wa(st,jt){return st==null?l:st[jt]}function Vi(st){return Nr.test(st)}function Ca(st){return Zr.test(st)}function An(st){for(var jt,Mt=[];!(jt=st.next()).done;)Mt.push(jt.value);return Mt}function ga(st){var jt=-1,Mt=Array(st.size);return st.forEach(function(ur,yr){Mt[++jt]=[yr,ur]}),Mt}function Gn(st,jt){return function(Mt){return st(jt(Mt))}}function tn(st,jt){for(var Mt=-1,ur=st.length,yr=0,Lr=[];++Mt-1}function Uf(C,O){var re=this.__data__,Se=as(re,C);return Se<0?(++this.size,re.push([C,O])):re[Se][1]=O,this}Dn.prototype.clear=Ff,Dn.prototype.delete=zf,Dn.prototype.get=Nf,Dn.prototype.has=Hf,Dn.prototype.set=Uf;function Ln(C){var O=-1,re=C==null?0:C.length;for(this.clear();++O=O?C:O)),C}function hn(C,O,re,Se,Ne,it){var xt,Tt=O&j,zt=O&I,wr=O&P;if(re&&(xt=Ne?re(C,Se,Ne,it):re(C)),xt!==l)return xt;if(!_i(C))return C;var xr=ai(C);if(xr){if(xt=Yl(C),!Tt)return Gi(C,xt)}else{var Er=$i(C),Ir=Er==ue||Er==qe;if(ea(C))return nu(C,Tt);if(Er==mt||Er==Y||Ir&&!Ne){if(xt=zt||Ir?{}:ku(C),!Tt)return zt?Ol(C,ol(xt,C)):Ll(C,Ro(xt,C))}else{if(!si[Er])return Ne?C:{};xt=Xl(C,Er,Tt)}}it||(it=new xn);var Hr=it.get(C);if(Hr)return Hr;it.set(C,xt),Xu(C)?C.forEach(function(Jr){xt.add(hn(Jr,O,re,Jr,C,it))}):Zu(C)&&C.forEach(function(Jr,pi){xt.set(pi,hn(Jr,O,re,pi,C,it))});var Xr=wr?zt?eo:Js:zt?Zi:Pi,fi=xr?l:Xr(C);return vt(fi||C,function(Jr,pi){fi&&(pi=Jr,Jr=C[pi]),$a(xt,pi,hn(Jr,O,re,pi,C,it))}),xt}function ul(C){var O=Pi(C);return function(re){return Io(re,C,O)}}function Io(C,O,re){var Se=re.length;if(C==null)return!Se;for(C=$r(C);Se--;){var Ne=re[Se],it=O[Ne],xt=C[Ne];if(xt===l&&!(Ne in C)||!it(xt))return!1}return!0}function $o(C,O,re){if(typeof C!="function")throw new li(S);return Ha(function(){C.apply(l,re)},O)}function Da(C,O,re,Se){var Ne=-1,it=Wt,xt=!0,Tt=C.length,zt=[],wr=O.length;if(!Tt)return zt;re&&(O=Dr(O,Di(re))),Se?(it=jr,xt=!1):O.length>=m&&(it=aa,xt=!1,O=new fa(O));e:for(;++NeNe?0:Ne+re),Se=Se===l||Se>Ne?Ne:ui(Se),Se<0&&(Se+=Ne),Se=re>Se?0:ef(Se);re0&&re(Tt)?O>1?qi(Tt,O-1,re,Se,Ne):ni(Ne,Tt):Se||(Ne[Ne.length]=Tt)}return Ne}var Is=lu(),Oo=lu(!0);function jn(C,O){return C&&Is(C,O,Pi)}function $s(C,O){return C&&Oo(C,O,Pi)}function os(C,O){return or(O,function(re){return Hn(C[re])})}function ca(C,O){O=Xn(O,C);for(var re=0,Se=O.length;C!=null&&reO}function cl(C,O){return C!=null&&ei.call(C,O)}function dl(C,O){return C!=null&&O in $r(C)}function pl(C,O,re){return C>=Ii(O,re)&&C=120&&xr.length>=120)?new fa(xt&&xr):l}xr=C[0];var Er=-1,Ir=Tt[0];e:for(;++Er-1;)Tt!==C&&Xa.call(Tt,zt,1),Xa.call(C,zt,1);return C}function Zo(C,O){for(var re=C?O.length:0,Se=re-1;re--;){var Ne=O[re];if(re==Se||Ne!==it){var it=Ne;Nn(Ne)?Xa.call(C,Ne,1):Ks(C,Ne)}}return C}function Hs(C,O){return C+ts(To()*(O-C+1))}function Al(C,O,re,Se){for(var Ne=-1,it=ji(es((O-C)/(re||1)),0),xt=Mt(it);it--;)xt[Se?it:++Ne]=C,C+=re;return xt}function Us(C,O){var re="";if(!C||O<1||O>w)return re;do O%2&&(re+=C),O=ts(O/2),O&&(C+=C);while(O);return re}function ci(C,O){return oo(Eu(C,O,Yi),C+"")}function Cl(C){return Bo(Ea(C))}function jl(C,O){var re=Ea(C);return ys(re,la(O,0,re.length))}function Fa(C,O,re,Se){if(!_i(C))return C;O=Xn(O,C);for(var Ne=-1,it=O.length,xt=it-1,Tt=C;Tt!=null&&++NeNe?0:Ne+O),re=re>Ne?Ne:re,re<0&&(re+=Ne),Ne=O>re?0:re-O>>>0,O>>>=0;for(var it=Mt(Ne);++Se>>1,xt=C[it];xt!==null&&!nn(xt)&&(re?xt<=O:xt=m){var wr=O?null:Ul(C);if(wr)return $n(wr);xt=!1,Ne=aa,zt=new fa}else zt=O?[]:Tt;e:for(;++Se=Se?C:dn(C,O,re)}var iu=yf||function(C){return yi.clearTimeout(C)};function nu(C,O){if(O)return C.slice();var re=C.length,Se=Mo?Mo(re):new C.constructor(re);return C.copy(Se),Se}function Zs(C){var O=new C.constructor(C.byteLength);return new Za(O).set(new Za(C)),O}function Rl(C,O){var re=O?Zs(C.buffer):C.buffer;return new C.constructor(re,C.byteOffset,C.byteLength)}function Il(C){var O=new C.constructor(C.source,Nt.exec(C));return O.lastIndex=C.lastIndex,O}function $l(C){return Ia?$r(Ia.call(C)):{}}function au(C,O){var re=O?Zs(C.buffer):C.buffer;return new C.constructor(re,C.byteOffset,C.length)}function su(C,O){if(C!==O){var re=C!==l,Se=C===null,Ne=C===C,it=nn(C),xt=O!==l,Tt=O===null,zt=O===O,wr=nn(O);if(!Tt&&!wr&&!it&&C>O||it&&xt&&zt&&!Tt&&!wr||Se&&xt&&zt||!re&&zt||!Ne)return 1;if(!Se&&!it&&!wr&&C=Tt)return zt;var wr=re[Se];return zt*(wr=="desc"?-1:1)}}return C.index-O.index}function ou(C,O,re,Se){for(var Ne=-1,it=C.length,xt=re.length,Tt=-1,zt=O.length,wr=ji(it-xt,0),xr=Mt(zt+wr),Er=!Se;++Tt1?re[Ne-1]:l,xt=Ne>2?re[2]:l;for(it=C.length>3&&typeof it=="function"?(Ne--,it):l,xt&&zi(re[0],re[1],xt)&&(it=Ne<3?l:it,Ne=1),O=$r(O);++Se-1?Ne[it?O[xt]:xt]:l}}function du(C){return zn(function(O){var re=O.length,Se=re,Ne=cn.prototype.thru;for(C&&O.reverse();Se--;){var it=O[Se];if(typeof it!="function")throw new li(S);if(Ne&&!xt&&vs(it)=="wrapper")var xt=new cn([],!0)}for(Se=xt?Se:re;++Se1&&vi.reverse(),xr&&ztTt))return!1;var wr=it.get(C),xr=it.get(O);if(wr&&xr)return wr==O&&xr==C;var Er=-1,Ir=!0,Hr=re&z?new fa:l;for(it.set(C,O),it.set(O,C);++Er1?"& ":"")+O[Se],O=O.join(re>2?", ":" "),C.replace(ce,`{ +/* [wrapped with `+O+`] */ +`)}function tc(C){return ai(C)||pa(C)||!!(Co&&C&&C[Co])}function Nn(C,O){var re=typeof C;return O=O??w,!!O&&(re=="number"||re!="symbol"&&rr.test(C))&&C>-1&&C%1==0&&C0){if(++O>=u)return arguments[0]}else O=0;return C.apply(l,arguments)}}function ys(C,O){var re=-1,Se=C.length,Ne=Se-1;for(O=O===l?Se:O;++re1?C[O-1]:l;return re=typeof re=="function"?(C.pop(),re):l,Lu(C,re)});function Ou(C){var O=Qe(C);return O.__chain__=!0,O}function vh(C,O){return O(C),C}function bs(C,O){return O(C)}var gh=zn(function(C){var O=C.length,re=O?C[0]:0,Se=this.__wrapped__,Ne=function(it){return Rs(it,C)};return O>1||this.__actions__.length||!(Se instanceof mi)||!Nn(re)?this.thru(Ne):(Se=Se.slice(re,+re+(O?1:0)),Se.__actions__.push({func:bs,args:[Ne],thisArg:l}),new cn(Se,this.__chain__).thru(function(it){return O&&!it.length&&it.push(l),it}))});function yh(){return Ou(this)}function bh(){return new cn(this.value(),this.__chain__)}function wh(){this.__values__===l&&(this.__values__=Ju(this.value()));var C=this.__index__>=this.__values__.length,O=C?l:this.__values__[this.__index__++];return{done:C,value:O}}function xh(){return this}function _h(C){for(var O,re=this;re instanceof ns;){var Se=qu(re);Se.__index__=0,Se.__values__=l,O?Ne.__wrapped__=Se:O=Se;var Ne=Se;re=re.__wrapped__}return Ne.__wrapped__=C,O}function kh(){var C=this.__wrapped__;if(C instanceof mi){var O=C;return this.__actions__.length&&(O=new mi(this)),O=O.reverse(),O.__actions__.push({func:bs,args:[uo],thisArg:l}),new cn(O,this.__chain__)}return this.thru(uo)}function Sh(){return tu(this.__wrapped__,this.__actions__)}var Mh=cs(function(C,O,re){ei.call(C,re)?++C[re]:On(C,re,1)});function Eh(C,O,re){var Se=ai(C)?Jt:fl;return re&&zi(C,O,re)&&(O=l),Se(C,Yr(O,3))}function Ah(C,O){var re=ai(C)?or:Lo;return re(C,Yr(O,3))}var jh=hu(Bu),Th=hu(Ru);function Ph(C,O){return qi(ws(C,O),1)}function qh(C,O){return qi(ws(C,O),y)}function Bh(C,O,re){return re=re===l?1:ui(re),qi(ws(C,O),re)}function Fu(C,O){var re=ai(C)?vt:Zn;return re(C,Yr(O,3))}function zu(C,O){var re=ai(C)?Dt:Do;return re(C,Yr(O,3))}var Rh=cs(function(C,O,re){ei.call(C,re)?C[re].push(O):On(C,re,[O])});function Ih(C,O,re,Se){C=Qi(C)?C:Ea(C),re=re&&!Se?ui(re):0;var Ne=C.length;return re<0&&(re=ji(Ne+re,0)),Ms(C)?re<=Ne&&C.indexOf(O,re)>-1:!!Ne&&wi(C,O,re)>-1}var $h=ci(function(C,O,re){var Se=-1,Ne=typeof O=="function",it=Qi(C)?Mt(C.length):[];return Zn(C,function(xt){it[++Se]=Ne?Ke(O,xt,re):La(xt,O,re)}),it}),Dh=cs(function(C,O,re){On(C,re,O)});function ws(C,O){var re=ai(C)?Dr:Uo;return re(C,Yr(O,3))}function Lh(C,O,re,Se){return C==null?[]:(ai(O)||(O=O==null?[]:[O]),re=Se?l:re,ai(re)||(re=re==null?[]:[re]),Go(C,O,re))}var Oh=cs(function(C,O,re){C[re?0:1].push(O)},function(){return[[],[]]});function Fh(C,O,re){var Se=ai(C)?ri:gn,Ne=arguments.length<3;return Se(C,Yr(O,4),re,Ne,Zn)}function zh(C,O,re){var Se=ai(C)?Ei:gn,Ne=arguments.length<3;return Se(C,Yr(O,4),re,Ne,Do)}function Nh(C,O){var re=ai(C)?or:Lo;return re(C,ks(Yr(O,3)))}function Hh(C){var O=ai(C)?Bo:Cl;return O(C)}function Uh(C,O,re){(re?zi(C,O,re):O===l)?O=1:O=ui(O);var Se=ai(C)?il:jl;return Se(C,O)}function Wh(C){var O=ai(C)?nl:Pl;return O(C)}function Vh(C){if(C==null)return 0;if(Qi(C))return Ms(C)?Cn(C):C.length;var O=$i(C);return O==rt||O==Ge?C.size:Fs(C).length}function Gh(C,O,re){var Se=ai(C)?xi:ql;return re&&zi(C,O,re)&&(O=l),Se(C,Yr(O,3))}var Qh=ci(function(C,O){if(C==null)return[];var re=O.length;return re>1&&zi(C,O[0],O[1])?O=[]:re>2&&zi(O[0],O[1],O[2])&&(O=[O[0]]),Go(C,qi(O,1),[])}),xs=bf||function(){return yi.Date.now()};function Zh(C,O){if(typeof O!="function")throw new li(S);return C=ui(C),function(){if(--C<1)return O.apply(this,arguments)}}function Nu(C,O,re){return O=re?l:O,O=C&&O==null?C.length:O,Fn(C,Q,l,l,l,l,O)}function Hu(C,O){var re;if(typeof O!="function")throw new li(S);return C=ui(C),function(){return--C>0&&(re=O.apply(this,arguments)),C<=1&&(O=l),re}}var lo=ci(function(C,O,re){var Se=N;if(re.length){var Ne=tn(re,Sa(lo));Se|=se}return Fn(C,Se,O,re,Ne)}),Uu=ci(function(C,O,re){var Se=N|F;if(re.length){var Ne=tn(re,Sa(Uu));Se|=se}return Fn(O,Se,C,re,Ne)});function Wu(C,O,re){O=re?l:O;var Se=Fn(C,J,l,l,l,l,l,O);return Se.placeholder=Wu.placeholder,Se}function Ku(C,O,re){O=re?l:O;var Se=Fn(C,te,l,l,l,l,l,O);return Se.placeholder=Ku.placeholder,Se}function Vu(C,O,re){var Se,Ne,it,xt,Tt,zt,wr=0,xr=!1,Er=!1,Ir=!0;if(typeof C!="function")throw new li(S);O=mn(O)||0,_i(re)&&(xr=!!re.leading,Er="maxWait"in re,it=Er?ji(mn(re.maxWait)||0,O):it,Ir="trailing"in re?!!re.trailing:Ir);function Hr(Mi){var kn=Se,Wn=Ne;return Se=Ne=l,wr=Mi,xt=C.apply(Wn,kn),xt}function Xr(Mi){return wr=Mi,Tt=Ha(pi,O),xr?Hr(Mi):xt}function fi(Mi){var kn=Mi-zt,Wn=Mi-wr,df=O-kn;return Er?Ii(df,it-Wn):df}function Jr(Mi){var kn=Mi-zt,Wn=Mi-wr;return zt===l||kn>=O||kn<0||Er&&Wn>=it}function pi(){var Mi=xs();if(Jr(Mi))return vi(Mi);Tt=Ha(pi,fi(Mi))}function vi(Mi){return Tt=l,Ir&&Se?Hr(Mi):(Se=Ne=l,xt)}function an(){Tt!==l&&iu(Tt),wr=0,Se=zt=Ne=Tt=l}function Ni(){return Tt===l?xt:vi(xs())}function sn(){var Mi=xs(),kn=Jr(Mi);if(Se=arguments,Ne=this,zt=Mi,kn){if(Tt===l)return Xr(zt);if(Er)return iu(Tt),Tt=Ha(pi,O),Hr(zt)}return Tt===l&&(Tt=Ha(pi,O)),xt}return sn.cancel=an,sn.flush=Ni,sn}var Yh=ci(function(C,O){return $o(C,1,O)}),Xh=ci(function(C,O,re){return $o(C,mn(O)||0,re)});function Jh(C){return Fn(C,he)}function _s(C,O){if(typeof C!="function"||O!=null&&typeof O!="function")throw new li(S);var re=function(){var Se=arguments,Ne=O?O.apply(this,Se):Se[0],it=re.cache;if(it.has(Ne))return it.get(Ne);var xt=C.apply(this,Se);return re.cache=it.set(Ne,xt)||it,xt};return re.cache=new(_s.Cache||Ln),re}_s.Cache=Ln;function ks(C){if(typeof C!="function")throw new li(S);return function(){var O=arguments;switch(O.length){case 0:return!C.call(this);case 1:return!C.call(this,O[0]);case 2:return!C.call(this,O[0],O[1]);case 3:return!C.call(this,O[0],O[1],O[2])}return!C.apply(this,O)}}function ed(C){return Hu(2,C)}var td=Bl(function(C,O){O=O.length==1&&ai(O[0])?Dr(O[0],Di(Yr())):Dr(qi(O,1),Di(Yr()));var re=O.length;return ci(function(Se){for(var Ne=-1,it=Ii(Se.length,re);++Ne=O}),pa=zo(function(){return arguments}())?zo:function(C){return ki(C)&&ei.call(C,"callee")&&!Ao.call(C,"callee")},ai=Mt.isArray,vd=V?Di(V):vl;function Qi(C){return C!=null&&Ss(C.length)&&!Hn(C)}function Si(C){return ki(C)&&Qi(C)}function gd(C){return C===!0||C===!1||ki(C)&&Fi(C)==D}var ea=xf||ko,yd=ie?Di(ie):gl;function bd(C){return ki(C)&&C.nodeType===1&&!Ua(C)}function wd(C){if(C==null)return!0;if(Qi(C)&&(ai(C)||typeof C=="string"||typeof C.splice=="function"||ea(C)||Ma(C)||pa(C)))return!C.length;var O=$i(C);if(O==rt||O==Ge)return!C.size;if(Na(C))return!Fs(C).length;for(var re in C)if(ei.call(C,re))return!1;return!0}function xd(C,O){return Oa(C,O)}function _d(C,O,re){re=typeof re=="function"?re:l;var Se=re?re(C,O):l;return Se===l?Oa(C,O,l,re):!!Se}function ho(C){if(!ki(C))return!1;var O=Fi(C);return O==fe||O==oe||typeof C.message=="string"&&typeof C.name=="string"&&!Ua(C)}function kd(C){return typeof C=="number"&&jo(C)}function Hn(C){if(!_i(C))return!1;var O=Fi(C);return O==ue||O==qe||O==L||O==We}function Qu(C){return typeof C=="number"&&C==ui(C)}function Ss(C){return typeof C=="number"&&C>-1&&C%1==0&&C<=w}function _i(C){var O=typeof C;return C!=null&&(O=="object"||O=="function")}function ki(C){return C!=null&&typeof C=="object"}var Zu=be?Di(be):bl;function Sd(C,O){return C===O||Os(C,O,ro(O))}function Md(C,O,re){return re=typeof re=="function"?re:l,Os(C,O,ro(O),re)}function Ed(C){return Yu(C)&&C!=+C}function Ad(C){if(nc(C))throw new yr(h);return No(C)}function Cd(C){return C===null}function jd(C){return C==null}function Yu(C){return typeof C=="number"||ki(C)&&Fi(C)==Ve}function Ua(C){if(!ki(C)||Fi(C)!=mt)return!1;var O=Ya(C);if(O===null)return!0;var re=ei.call(O,"constructor")&&O.constructor;return typeof re=="function"&&re instanceof re&&wn.call(re)==mf}var po=Ee?Di(Ee):wl;function Td(C){return Qu(C)&&C>=-w&&C<=w}var Xu=Ie?Di(Ie):xl;function Ms(C){return typeof C=="string"||!ai(C)&&ki(C)&&Fi(C)==nt}function nn(C){return typeof C=="symbol"||ki(C)&&Fi(C)==Et}var Ma=De?Di(De):_l;function Pd(C){return C===l}function qd(C){return ki(C)&&$i(C)==Oe}function Bd(C){return ki(C)&&Fi(C)==$t}var Rd=ms(zs),Id=ms(function(C,O){return C<=O});function Ju(C){if(!C)return[];if(Qi(C))return Ms(C)?Li(C):Gi(C);if(Pa&&C[Pa])return An(C[Pa]());var O=$i(C),re=O==rt?ga:O==Ge?$n:Ea;return re(C)}function Un(C){if(!C)return C===0?C:0;if(C=mn(C),C===y||C===-y){var O=C<0?-1:1;return O*v}return C===C?C:0}function ui(C){var O=Un(C),re=O%1;return O===O?re?O-re:O:0}function ef(C){return C?la(ui(C),0,x):0}function mn(C){if(typeof C=="number")return C;if(nn(C))return o;if(_i(C)){var O=typeof C.valueOf=="function"?C.valueOf():C;C=_i(O)?O+"":O}if(typeof C!="string")return C===0?C:+C;C=ln(C);var re=Mr.test(C);return re||Sr.test(C)?Kn(C.slice(2),re?2:8):Ut.test(C)?o:+C}function tf(C){return Tn(C,Zi(C))}function $d(C){return C?la(ui(C),-w,w):C===0?C:0}function bi(C){return C==null?"":rn(C)}var Dd=_a(function(C,O){if(Na(O)||Qi(O)){Tn(O,Pi(O),C);return}for(var re in O)ei.call(O,re)&&$a(C,re,O[re])}),rf=_a(function(C,O){Tn(O,Zi(O),C)}),Es=_a(function(C,O,re,Se){Tn(O,Zi(O),C,Se)}),Ld=_a(function(C,O,re,Se){Tn(O,Pi(O),C,Se)}),Od=zn(Rs);function Fd(C,O){var re=xa(C);return O==null?re:Ro(re,O)}var zd=ci(function(C,O){C=$r(C);var re=-1,Se=O.length,Ne=Se>2?O[2]:l;for(Ne&&zi(O[0],O[1],Ne)&&(Se=1);++re1),it}),Tn(C,eo(C),re),Se&&(re=hn(re,j|I|P,Wl));for(var Ne=O.length;Ne--;)Ks(re,O[Ne]);return re});function ap(C,O){return af(C,ks(Yr(O)))}var sp=zn(function(C,O){return C==null?{}:Ml(C,O)});function af(C,O){if(C==null)return{};var re=Dr(eo(C),function(Se){return[Se]});return O=Yr(O),Qo(C,re,function(Se,Ne){return O(Se,Ne[0])})}function op(C,O,re){O=Xn(O,C);var Se=-1,Ne=O.length;for(Ne||(Ne=1,C=l);++SeO){var Se=C;C=O,O=Se}if(re||C%1||O%1){var Ne=To();return Ii(C+Ne*(O-C+Xi("1e-"+((Ne+"").length-1))),O)}return Hs(C,O)}var yp=ka(function(C,O,re){return O=O.toLowerCase(),C+(re?uf(O):O)});function uf(C){return go(bi(C).toLowerCase())}function ff(C){return C=bi(C),C&&C.replace(er,Vn).replace(_r,"")}function bp(C,O,re){C=bi(C),O=rn(O);var Se=C.length;re=re===l?Se:la(ui(re),0,Se);var Ne=re;return re-=O.length,re>=0&&C.slice(re,Ne)==O}function wp(C){return C=bi(C),C&&ot.test(C)?C.replace(at,As):C}function xp(C){return C=bi(C),C&&Ot.test(C)?C.replace(Pt,"\\$&"):C}var _p=ka(function(C,O,re){return C+(re?"-":"")+O.toLowerCase()}),kp=ka(function(C,O,re){return C+(re?" ":"")+O.toLowerCase()}),Sp=cu("toLowerCase");function Mp(C,O,re){C=bi(C),O=ui(O);var Se=O?Cn(C):0;if(!O||Se>=O)return C;var Ne=(O-Se)/2;return ps(ts(Ne),re)+C+ps(es(Ne),re)}function Ep(C,O,re){C=bi(C),O=ui(O);var Se=O?Cn(C):0;return O&&Se>>0,re?(C=bi(C),C&&(typeof O=="string"||O!=null&&!po(O))&&(O=rn(O),!O&&Vi(C))?Jn(Li(C),0,re):C.split(O,re)):[]}var Bp=ka(function(C,O,re){return C+(re?" ":"")+go(O)});function Rp(C,O,re){return C=bi(C),re=re==null?0:la(ui(re),0,C.length),O=rn(O),C.slice(re,re+O.length)==O}function Ip(C,O,re){var Se=Qe.templateSettings;re&&zi(C,O,re)&&(O=l),C=bi(C),O=Es({},O,Se,yu);var Ne=Es({},O.imports,Se.imports,yu),it=Pi(Ne),xt=Aa(Ne,it),Tt,zt,wr=0,xr=O.interpolate||kr,Er="__p += '",Ir=oi((O.escape||kr).source+"|"+xr.source+"|"+(xr===Yt?ct:kr).source+"|"+(O.evaluate||kr).source+"|$","g"),Hr="//# sourceURL="+(ei.call(O,"sourceURL")?(O.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++qn+"]")+` +`;C.replace(Ir,function(Jr,pi,vi,an,Ni,sn){return vi||(vi=an),Er+=C.slice(wr,sn).replace(vr,Cs),pi&&(Tt=!0,Er+=`' + +__e(`+pi+`) + +'`),Ni&&(zt=!0,Er+=`'; +`+Ni+`; +__p += '`),vi&&(Er+=`' + +((__t = (`+vi+`)) == null ? '' : __t) + +'`),wr=sn+Jr.length,Jr}),Er+=`'; +`;var Xr=ei.call(O,"variable")&&O.variable;if(!Xr)Er=`with (obj) { +`+Er+` } -/* utils.js - various utils that don't belong anywhere else */ - -IriSP.jqEscape = function(_text) { - return _text.replace(/(:|\.)/g,'\\$1'); -}; - -IriSP.getLib = function(lib) { - if (IriSP.libFiles.useCdn && typeof IriSP.libFiles.cdn[lib] == "string") { - return IriSP.libFiles.cdn[lib]; - } - if (typeof IriSP.libFiles.locations[lib] == "string") { - return IriSP.libFiles.locations[lib]; - } - if (typeof IriSP.libFiles.inDefaultDir[lib] == "string") { - return IriSP.libFiles.defaultDir + '/' + IriSP.libFiles.inDefaultDir[lib]; - } -}; - -IriSP._cssCache = []; - -IriSP.loadCss = function(_cssFile) { - if (IriSP._(IriSP._cssCache).indexOf(_cssFile) === -1) { - IriSP.jQuery("", { - rel : "stylesheet", - type : "text/css", - href : _cssFile - }).appendTo('head'); - IriSP._cssCache.push(_cssFile); - } -}; - -IriSP.textFieldHtml = function(_text, _regexp, _extend) { - var list = [], - positions = [], - text = _text.replace(/(^\s+|\s+$)/g,''); - - function addToList(_rx, _startHtml, _endHtml) { - while(true) { - var result = _rx.exec(text); - if (!result) { - break; - } - var end = _rx.lastIndex, - start = result.index; - list.push({ - start: start, - end: end, - startHtml: (typeof _startHtml === "function" ? _startHtml(result) : _startHtml), - endHtml: (typeof _endHtml === "function" ? _endHtml(result) : _endHtml) - }); - positions.push(start); - positions.push(end); - } - } - - if (_regexp) { - addToList(_regexp, '', ''); - } - - addToList(/(https?:\/\/)?[\w\d\-]+\.[\w\d\-]+\S+/gm, function(matches) { - return ''; - }, ''); - addToList(/@([\d\w]{1,15})/gm, function(matches) { - return ''; - }, ''); - addToList(/\*[^*]+\*/gm, '', ''); - addToList(/[\n\r]+/gm, '', '
'); - - IriSP._(_extend).each(function(x) { - addToList.apply(null, x); - }); - - positions = IriSP._(positions) - .chain() - .uniq() - .sortBy(function(p) { return parseInt(p); }) - .value(); - - var res = "", lastIndex = 0; - - for (var i = 0; i < positions.length; i++) { - var pos = positions[i]; - res += text.substring(lastIndex, pos); - for (var j = list.length - 1; j >= 0; j--) { - var item = list[j]; - if (item.start < pos && item.end >= pos) { - res += item.endHtml; - } - } - for (var j = 0; j < list.length; j++) { - var item = list[j]; - if (item.start <= pos && item.end > pos) { - res += item.startHtml; - } - } - lastIndex = pos; - } - - res += text.substring(lastIndex); - - return res; - -}; - -IriSP.log = function() { - if (typeof console !== "undefined" && typeof IriSP.logging !== "undefined" && IriSP.logging) { - console.log.apply(console, arguments); - } -}; - -IriSP.attachDndData = function(jqSel, data) { - jqSel.attr("draggable", "true").on("dragstart", function(_event) { - var d = (typeof data === "function" ? data.call(this) : data); - try { - if (d.html === undefined && d.uri && d.text) { - d.html = '' + d.text + ''; - } - IriSP._(d).each(function(v, k) { - if (v && k != 'text' && k != 'html') { - _event.originalEvent.dataTransfer.setData("text/x-iri-" + k, v); - } - }); - if (d.uri && d.text) { - _event.originalEvent.dataTransfer.setData("text/x-moz-url", d.uri + "\n" + d.text.replace("\n", " ")); - _event.originalEvent.dataTransfer.setData("text/plain", d.text + " " + d.uri); - } - // Define generic text/html and text/plain last (least - // specific types, see - // https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Drag_operations#Drag_Data) - if (d.html !== undefined) { - _event.originalEvent.dataTransfer.setData("text/html", d.html); - } - if (d.text !== undefined && ! d.uri) { - _event.originalEvent.dataTransfer.setData("text/plain", d.text); - } - } catch(err) { - _event.originalEvent.dataTransfer.setData("Text", JSON.stringify(d)); - } - }); -}; - -IriSP.FakeClass = function(properties) { - var _this = this, - noop = (function() {}); - IriSP._(properties).each(function(p) { - _this[p] = noop; - }); -}; - -IriSP.timestamp2ms = function(t) { - // Convert timestamp to numeric value - // It accepts the following forms: - // [h:mm:ss] [mm:ss] [ss] - var s = t.split(":").reverse(); - while (s.length < 3) { - s.push("0"); - } - return 1000 * (3600 * parseInt(s[2], 10) + 60 * parseInt(s[1], 10) + parseInt(s[0], 10)); -}; - -IriSP.setFullScreen= function(elem, value) { - // Set fullscreen on or off - if (value) { - if (elem.requestFullscreen) { - elem.requestFullscreen(); - } else if (elem.mozRequestFullScreen) { - elem.mozRequestFullScreen(); - } else if (elem.webkitRequestFullscreen) { - elem.webkitRequestFullscreen(); - } else if (elem.msRequestFullscreen) { - elem.msRequestFullscreen(); - } - } else { - if (document.exitFullscreen) { - document.exitFullscreen(); - } else if (document.msExitFullscreen) { - document.msExitFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitExitFullscreen) { - document.webkitExitFullscreen(); - } - } -}; - -IriSP.isFullscreen = function() { - return (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement); -}; - -IriSP.getFullscreenElement = function () { - return (document.fullscreenElement - || document.webkitFullscreenElement - || document.mozFullScreenElement - || document.msFullscreenElement - || undefined); -}; - -IriSP.getFullscreenEventname = function () { - return ((document.exitFullscreen && "fullscreenchange") - || (document.webkitExitFullscreen && "webkitfullscreenchange") - || (document.mozExitFullScreen && "mozfullscreenchange") - || (document.msExitFullscreen && "msfullscreenchange") - || ""); -}; - -/* js is where data is stored in a standard form, whatever the serializer */ - -//TODO: Separate Project-specific data from Source - -IriSP.Model = (function (ns) { - - function pad(n, x, b) { - b = b || 10; - var s = (x).toString(b); - while (s.length < n) { - s = "0" + s; - } - return s; - } - - function rand16(n) { - return pad(n, Math.floor(Math.random()*Math.pow(16,n)), 16); - } - - var uidbase = rand16(8) + "-" + rand16(4) + "-", uidincrement = Math.floor(Math.random()*0x10000); - - var charsub = [ - '[aáàâä]', - '[cç]', - '[eéèêë]', - '[iíìîï]', - '[oóòôö]', - '[uùûü]' - ]; - - var removeChars = [ - String.fromCharCode(768), String.fromCharCode(769), String.fromCharCode(770), String.fromCharCode(771), String.fromCharCode(807), - "{", "}", "(", ")", "[", "]", "【", "】", "、", "・", "‥", "。", "「", "」", "『", "』", "〜", ":", "!", "?", " ", - ",", " ", ";", "(", ")", ".", "*", "+", "\\", "?", "|", "{", "}", "[", "]", "^", "#", "/" - ]; - -var Model = {}, - _SOURCE_STATUS_EMPTY = Model._SOURCE_STATUS_EMPTY = 0, - _SOURCE_STATUS_WAITING = Model._SOURCE_STATUS_WAITING = 1, - _SOURCE_STATUS_READY = Model._SOURCE_STATUS_READY = 2, - extendPrototype = Model.extendPrototype = function(toClass, fromClass) { - var fromP = fromClass.prototype, - toP = toClass.prototype; - for (var k in fromP) { - if (fromP.hasOwnProperty(k)) { - toP[k] = fromP[k]; - } - } - }, - getUID = Model.getUID = function() { - return uidbase + pad(4, (++uidincrement % 0x10000), 16) + "-" + rand16(4) + "-" + rand16(6) + rand16(6); - }, - isLocalURL = Model.isLocalURL = function(url) { - var matches = url.match(/^(\w+:)\/\/([^/]+)/); - if (matches) { - return(matches[1] === document.location.protocol && matches[2] === document.location.host); - } - return true; - }, - regexpFromTextOrArray = Model.regexpFromTextOrArray = function(_textOrArray, _testOnly, _iexact) { - var _testOnly = _testOnly || false, - _iexact = _iexact || false; - function escapeText(_text) { - return _text.replace(/([\\\*\+\?\|\{\[\}\]\(\)\^\$\.\#\/])/gm, '\\$1'); - } - var _source = - typeof _textOrArray === "string" - ? escapeText(_textOrArray) - : ns._(_textOrArray).map(escapeText).join("|"), - _flags = 'im'; - if (!_testOnly) { - _source = '(' + _source + ')'; - _flags += 'g'; - } - if (_iexact) { - _source = '^' + _source + '$'; - } - return new RegExp( _source, _flags); - }, - fullTextRegexps = Model.fullTextRegexps = function(_text) { - var remsrc = "[\\" + removeChars.join("\\") + "]", - remrx = new RegExp(remsrc,"gm"), - txt = _text.toLowerCase().replace(remrx,""), - res = [], - charsrx = ns._(charsub).map(function(c) { - return new RegExp(c); - }), - src = ""; - for (var j = 0; j < txt.length; j++) { - if (j) { - src += remsrc + "*"; - } - var l = txt[j]; - ns._(charsub).each(function(v, k) { - l = l.replace(charsrx[k], v); - }); - src += l; - } - return "(" + src + ")"; - }, - isoToDate = Model.isoToDate = function(_str) { - // http://delete.me.uk/2005/03/iso8601.html - var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?"; - var d = _str.match(new RegExp(regexp)); - - var offset = 0; - var date = new Date(d[1], 0, 1); - - if (d[3]) { date.setMonth(d[3] - 1); } - if (d[5]) { date.setDate(d[5]); } - if (d[7]) { date.setHours(d[7]); } - if (d[8]) { date.setMinutes(d[8]); } - if (d[10]) { date.setSeconds(d[10]); } - if (d[12]) { date.setMilliseconds(Number("0." + d[12]) * 1000); } - if (d[14]) { - offset = (Number(d[16]) * 60) + Number(d[17]); - offset *= ((d[15] == '-') ? 1 : -1); - } - - offset -= date.getTimezoneOffset(); - time = (Number(date) + (offset * 60 * 1000)); - var _res = new Date(); - _res.setTime(Number(time)); - return _res; - }, - dateToIso = Model.dateToIso = function(_d) { - var d = _d ? new Date(_d) : new Date(); - return d.getUTCFullYear()+'-' - + pad(2, d.getUTCMonth()+1)+'-' - + pad(2, d.getUTCDate())+'T' - + pad(2, d.getUTCHours())+':' - + pad(2, d.getUTCMinutes())+':' - + pad(2, d.getUTCSeconds())+'Z' ; - }; - -/* - * List is a class for a list of elements (e.g. annotations, medias, etc. that each have a distinct ID) - */ -var List = Model.List = function(_directory) { - Array.call(this); - this.directory = _directory; - this.idIndex = []; - this.__events = {}; - if (typeof _directory == "undefined") { - console.trace(); - throw "Error : new List(directory): directory is undefined"; - } - var _this = this; - this.on("clear-search", function() { - _this.searching = false; - _this.regexp = undefined; - _this.forEach(function(_element) { - _element.found = undefined; - }); - _this.trigger("search-cleared"); - }); -}; - -List.prototype = new Array(); - -List.prototype.hasId = function(_id) { - return ns._(this.idIndex).include(_id); -}; - -/* On recent browsers, forEach and map are defined and do what we want. - * Otherwise, we'll use the Underscore.js functions - */ -if (typeof Array.prototype.forEach === "undefined") { - List.prototype.forEach = function(_callback) { - var _this = this; - ns._(this).forEach(function(_value, _key) { - _callback(_value, _key, _this); - }); - }; -}; - -if (typeof Array.prototype.map === "undefined") { - List.prototype.map = function(_callback) { - var _this = this; - return ns._(this).map(function(_value, _key) { - return _callback(_value, _key, _this); - }); - }; -}; - -List.prototype.pluck = function(_key) { - return this.map(function(_value) { - return _value[_key]; - }); -}; - -/* We override Array's filter function because it doesn't return an List - */ -List.prototype.filter = function(_callback) { - var _this = this, - _res = new List(this.directory); - _res.addElements(ns._(this).filter(function(_value, _key) { - return _callback(_value, _key, _this); - })); - return _res; -}; - -List.prototype.slice = function(_start, _end) { - var _res = new List(this.directory); - _res.addElements(Array.prototype.slice.call(this, _start, _end)); - return _res; -}; - -List.prototype.splice = function(_start, _end) { - var _res = new List(this.directory); - _res.addElements(Array.prototype.splice.call(this, _start, _end)); - this.idIndex.splice(_start, _end); - return _res; -}; - -/* Array has a sort function, but it's not as interesting as Underscore.js's sortBy - * and won't return a new List - */ -List.prototype.sortBy = function(_callback) { - var _this = this, - _res = new List(this.directory); - _res.addElements(ns._(this).sortBy(function(_value, _key) { - return _callback(_value, _key, _this); - })); - return _res; -}; - -/* Title and Description are basic information for (almost) all element types, - * here we can search by these criteria - */ -List.prototype.searchByTitle = function(_text, _iexact) { - var _iexact = _iexact || false, - _rgxp = regexpFromTextOrArray(_text, true, _iexact); - return this.filter(function(_element) { - return _rgxp.test(_element.title); - }); -}; - -List.prototype.searchByDescription = function(_text, _iexact) { - var _iexact = _iexact || false, - _rgxp = regexpFromTextOrArray(_text, true, _iexact); - return this.filter(function(_element) { - return _rgxp.test(_element.description); - }); -}; - -List.prototype.searchByTextFields = function(_text, _iexact) { - var _iexact = _iexact || false, - _rgxp = regexpFromTextOrArray(_text, true, _iexact); - return this.filter(function(_element) { - var keywords = (_element.keywords || _element.getTagTexts() || []).join(", "); - return _rgxp.test(_element.description) || _rgxp.test(_element.title) || _rgxp.test(keywords); - }); -}; - -List.prototype.search = function(_text) { - if (!_text) { - this.trigger("clear-search"); - return this; - } - this.searching = true; - this.trigger("search", _text); - var rxsource = fullTextRegexps(_text), - rgxp = new RegExp(rxsource,"im"); - this.regexp = new RegExp(rxsource,"gim"); - var res = this.filter(function(_element, _k) { - var titlematch = rgxp.test(_element.title), - descmatch = rgxp.test(_element.description), - _isfound = !!(titlematch || descmatch); - _element.found = _isfound; - _element.trigger(_isfound ? "found" : "not-found"); - return _isfound; - }); - this.trigger(res.length ? "found" : "not-found",res); - return res; -}; - -List.prototype.searchByTags = function(_text) { - if (!_text) { - this.trigger("clear-search"); - return this; - } - this.searching = true; - this.trigger("search", _text); - var rxsource = fullTextRegexps(_text), - rgxp = new RegExp(rxsource,"im"); - this.regexp = new RegExp(rxsource,"gim"); - var res = this.filter(function(_element, _k) { - var _isfound = rgxp.test(_element.getTagTexts()); - _element.found = _isfound; - _element.trigger(_isfound ? "found" : "not-found"); - return _isfound; - }); - this.trigger(res.length ? "found" : "not-found",res); - return res; -}; - -List.prototype.getTitles = function() { - return this.map(function(_el) { - return _el.title; - }); -}; - -List.prototype.addId = function(_id) { - var _el = this.directory.getElement(_id); - if (!this.hasId(_id) && typeof _el !== "undefined") { - this.idIndex.push(_id); - Array.prototype.push.call(this, _el); - } -}; - -List.prototype.push = function(_el) { - if (typeof _el === "undefined") { - return; - } - var _index = (ns._(this.idIndex).indexOf(_el.id)); - if (_index === -1) { - this.idIndex.push(_el.id); - Array.prototype.push.call(this, _el); - } else { - this[_index] = _el; - } -}; - -List.prototype.addIds = function(_array) { - var _l = _array.length, - _this = this; - ns._(_array).forEach(function(_id) { - _this.addId(_id); - }); -}; - -List.prototype.addElements = function(_array) { - var _this = this; - ns._(_array).forEach(function(_el) { - _this.push(_el); - }); -}; - -List.prototype.removeId = function(_id, _deleteFromDirectory) { - var _deleteFromDirectory = _deleteFromDirectory || false, - _index = (ns._(this.idIndex).indexOf(_id)); - if (_index !== -1) { - this.splice(_index,1); - } - if (_deleteFromDirectory) { - delete this.directory.elements[_id]; - } -}; - -List.prototype.removeElement = function(_el, _deleteFromDirectory) { - var _deleteFromDirectory = _deleteFromDirectory || false; - this.removeId(_el.id); -}; - -List.prototype.removeIds = function(_list, _deleteFromDirectory) { - var _deleteFromDirectory = _deleteFromDirectory || false, - _this = this; - ns._(_list).forEach(function(_id) { - _this.removeId(_id); - }); -}; - -List.prototype.removeElements = function(_list, _deleteFromDirectory) { - var _deleteFromDirectory = _deleteFromDirectory || false, - _this = this; - ns._(_list).forEach(function(_el) { - _this.removeElement(_el); - }); -}; - -List.prototype.on = function(_event, _callback) { - if (typeof this.__events[_event] === "undefined") { - this.__events[_event] = []; - } - this.__events[_event].push(_callback); -}; - -List.prototype.off = function(_event, _callback) { - if (typeof this.__events[_event] !== "undefined") { - this.__events[_event] = ns._(this.__events[_event]).reject(function(_fn) { - return _fn === _callback; - }); - } -}; - -List.prototype.trigger = function(_event, _data) { - var _list = this; - ns._(this.__events[_event]).each(function(_callback) { - _callback.call(_list, _data); - }); -}; - -/* A simple time management object, that helps converting millisecs to seconds and strings, - * without the clumsiness of the original Date object. - */ - -var Time = Model.Time = function(_milliseconds) { - this.milliseconds = 0; - this.setMilliseconds(_milliseconds); -}; - -Time.prototype.setMilliseconds = function(_milliseconds) { - var _ante = this.milliseconds; - switch(typeof _milliseconds) { - case "string": - this.milliseconds = parseInt(_milliseconds); - break; - case "number": - this.milliseconds = Math.floor(_milliseconds); - break; - case "object": - this.milliseconds = parseInt(_milliseconds.valueOf()); - break; - default: - this.milliseconds = 0; - } - if (this.milliseconds === NaN) { - this.milliseconds = _ante; - } -}; - -Time.prototype.setSeconds = function(_seconds) { - this.milliseconds = 1000 * _seconds; -}; - -Time.prototype.getSeconds = function() { - return this.milliseconds / 1000; -}; - -Time.prototype.getHMS = function() { - var _totalSeconds = Math.abs(Math.floor(this.getSeconds())); - return { - hours : Math.floor(_totalSeconds / 3600), - minutes : (Math.floor(_totalSeconds / 60) % 60), - seconds : _totalSeconds % 60, - milliseconds: this.milliseconds % 1000 - }; -}; - -Time.prototype.add = function(_milliseconds) { - this.milliseconds += new Time(_milliseconds).milliseconds; -}; - -Time.prototype.valueOf = function() { - return this.milliseconds; -}; - -Time.prototype.toString = function(showCs) { - var _hms = this.getHMS(), - _res = ''; - if (_hms.hours) { - _res += _hms.hours + ':'; - } - _res += pad(2, _hms.minutes) + ':' + pad(2, _hms.seconds); - if (showCs) { - _res += "." + Math.floor(_hms.milliseconds / 100); - } - return _res; -}; - -/* Reference handles references between elements - */ - -var Reference = Model.Reference = function(_source, _idRef) { - this.source = _source; - this.id = _idRef; - if (typeof _idRef === "object") { - this.isList = true; - } else { - this.isList = false; - } - this.refresh(); -}; - -Reference.prototype.refresh = function() { - if (this.isList) { - this.contents = new List(this.source.directory); - this.contents.addIds(this.id); - } else { - this.contents = this.source.getElement(this.id); - } - -}; - -Reference.prototype.getContents = function() { - if (typeof this.contents === "undefined" || (this.isList && this.contents.length != this.id.length)) { - this.refresh(); - } - return this.contents; -}; - -Reference.prototype.isOrHasId = function(_idRef) { - if (this.isList) { - return (ns._(this.id).indexOf(_idRef) !== -1); - } else { - return (this.id == _idRef); - } -}; - -/* */ - -var BaseElement = Model.Element = function(_id, _source) { - this.elementType = 'element'; - this.title = ""; - this.description = ""; - this.__events = {}; - if (typeof _source === "undefined") { - return; - } - if (typeof _id === "undefined" || !_id) { - _id = getUID(); - } - this.id = _id; - this.source = _source; - if (_source !== this) { - this.source.directory.addElement(this); - } -}; - -BaseElement.prototype.toString = function() { - return this.elementType + (this.elementType !== 'element' ? ', id=' + this.id + ', title="' + this.title + '"' : ''); -}; - -BaseElement.prototype.setReference = function(_elementType, _idRef) { - this[_elementType] = new Reference(this.source, _idRef); -}; - -BaseElement.prototype.getReference = function(_elementType) { - if (typeof this[_elementType] !== "undefined") { - return this[_elementType].getContents(); - } -}; - -BaseElement.prototype.getRelated = function(_elementType, _global) { - _global = (typeof _global !== "undefined" && _global); - var _this = this; - return this.source.getList(_elementType, _global).filter(function(_el) { - var _ref = _el[_this.elementType]; - return _ref && _ref.isOrHasId(_this.id); - }); -}; - -BaseElement.prototype.on = function(_event, _callback) { - if (typeof this.__events[_event] === "undefined") { - this.__events[_event] = []; - } - this.__events[_event].push(_callback); -}; - -BaseElement.prototype.off = function(_event, _callback) { - if (typeof this.__events[_event] !== "undefined") { - this.__events[_event] = ns._(this.__events[_event]).reject(function(_fn) { - return _fn === _callback; - }); - } -}; - -BaseElement.prototype.trigger = function(_event, _data) { - var _element = this; - ns._(this.__events[_event]).each(function(_callback) { - _callback.call(_element, _data); - }); -}; - -/* */ - -var Playable = Model.Playable = function(_id, _source) { - BaseElement.call(this, _id, _source); - if (typeof _source === "undefined") { - return; - } - this.elementType = 'playable'; - this.currentTime = new Time(); - this.volume = .5; - this.paused = true; - this.muted = false; - this.timeRange = false; - this.loadedMetadata = false; - var _this = this; - this.on("play", function() { - _this.paused = false; - }); - this.on("pause", function() { - _this.paused = true; - }); - this.on("timeupdate", function(_time) { - _this.currentTime = _time; - _this.getAnnotations().filter(function(_a) { - return (_a.end <= _time || _a.begin > _time) && _a.playing; - }).forEach(function(_a) { - _a.playing = false; - _a.trigger("leave"); - _this.trigger("leave-annotation",_a); - }); - _this.getAnnotations().filter(function(_a) { - return _a.begin <= _time && _a.end > _time && !_a.playing; - }).forEach(function(_a) { - _a.playing = true; - _a.trigger("enter"); - _this.trigger("enter-annotation",_a); - }); - - if (_this.getTimeRange()){ - if (_this.getTimeRange()[0] > _time) { - _this.pause(); - _this.setCurrentTime(_this.getTimeRange()[0]); - } - if (_this.getTimeRange()[1] < _time){ - _this.pause(); - _this.setCurrentTime(_this.getTimeRange()[1]); - } - } - - }); - this.on("loadedmetadata", function() { - _this.loadedMetadata = true; - }); -}; - -extendPrototype(Playable, BaseElement); - -Playable.prototype.getCurrentTime = function() { - return this.currentTime; -}; - -Playable.prototype.getVolume = function() { - return this.volume; -}; - -Playable.prototype.getPaused = function() { - return this.paused; -}; - -Playable.prototype.getMuted = function() { - return this.muted; -}; - -Playable.prototype.getTimeRange = function() { - return this.timeRange; -} - -Playable.prototype.setCurrentTime = function(_time) { - this.trigger("setcurrenttime",_time); -}; - -Playable.prototype.setVolume = function(_vol) { - this.trigger("setvolume",_vol); -}; - -Playable.prototype.setMuted = function(_muted) { - this.trigger("setmuted",_muted); -}; - -Playable.prototype.setTimeRange = function(_timeBegin, _timeEnd) { - if ((_timeBegin < _timeEnd)&&(_timeBegin >= 0)&&(_timeEnd>0)){ - return this.trigger("settimerange", [_timeBegin, _timeEnd]); - } -} - -Playable.prototype.resetTimeRange = function() { - return this.trigger("resettimerange"); -} - -Playable.prototype.play = function() { - this.trigger("setplay"); -}; - -Playable.prototype.pause = function() { - this.trigger("setpause"); -}; - -Playable.prototype.show = function() {}; - -Playable.prototype.hide = function() {}; - -/* */ - -var Media = Model.Media = function(_id, _source) { - Playable.call(this, _id, _source); - this.elementType = 'media'; - this.duration = new Time(); - this.video = ''; - var _this = this; -}; - -extendPrototype(Media, Playable); -/* */ - -var Media = Model.Media = function(_id, _source) { - Playable.call(this, _id, _source); - this.elementType = 'media'; - this.duration = new Time(); - this.video = ''; - var _this = this; -}; - -extendPrototype(Media, Playable); - -/* Default functions to be overriden by players */ - -Media.prototype.setDuration = function(_durationMs) { - this.duration.setMilliseconds(_durationMs); -}; - -Media.prototype.getAnnotations = function() { - return this.getRelated("annotation"); -}; - -Media.prototype.getAnnotationsByTypeTitle = function(_title) { - var _annTypes = this.source.getAnnotationTypes().searchByTitle(_title).pluck("id"); - if (_annTypes.length) { - return this.getAnnotations().filter(function(_annotation) { - return ns._(_annTypes).indexOf(_annotation.getAnnotationType().id) !== -1; - }); - } else { - return new List(this.source.directory); - } -}; - -/* */ - -var Tag = Model.Tag = function(_id, _source) { - BaseElement.call(this, _id, _source); - this.elementType = 'tag'; -}; - -extendPrototype(Tag, BaseElement); - -Tag.prototype.getAnnotations = function() { - return this.getRelated("annotation"); -}; - -/* */ -var AnnotationType = Model.AnnotationType = function(_id, _source) { - BaseElement.call(this, _id, _source); - this.elementType = 'annotationType'; -}; - -extendPrototype(AnnotationType, BaseElement); - -AnnotationType.prototype.getAnnotations = function() { - return this.getRelated("annotation"); -}; - -/* Annotation - * */ - -var Annotation = Model.Annotation = function(_id, _source) { - BaseElement.call(this, _id, _source); - this.elementType = 'annotation'; - this.begin = new Time(); - this.end = new Time(); - this.tag = new Reference(_source, []); - this.playing = false; - var _this = this; - this.on("click", function() { - _this.getMedia().setCurrentTime(_this.begin); - }); -}; - -extendPrototype(Annotation, BaseElement); - -/* Set begin and end in one go, to avoid undesired side-effects in - * setBegin/setEnd interaction */ -Annotation.prototype.setBeginEnd = function(_beginMs, _endMs) { - _beginMs = Math.max(0,_beginMs); - _endMs = Math.max(0,_endMs); - if (_endMs < _beginMs) - _endMs = _beginMs; - this.begin.setMilliseconds(_beginMs); - this.end.setMilliseconds(_endMs); - this.trigger("change-begin"); - this.trigger("change-end"); -}; - -Annotation.prototype.setBegin = function(_beginMs) { - this.begin.setMilliseconds(Math.max(0,_beginMs)); - this.trigger("change-begin"); - if (this.end < this.begin) { - this.setEnd(this.begin); - } -}; - -Annotation.prototype.setEnd = function(_endMs) { - this.end.setMilliseconds(Math.min(_endMs, this.getMedia().duration.milliseconds)); - this.trigger("change-end"); - if (this.end < this.begin) { - this.setBegin(this.end); - } -}; - -Annotation.prototype.setDuration = function(_durMs) { - this.setEnd(_durMs + this.begin.milliseconds); -}; - -Annotation.prototype.setMedia = function(_idRef) { - this.setReference("media", _idRef); -}; - -Annotation.prototype.getMedia = function() { - return this.getReference("media"); -}; - -Annotation.prototype.setAnnotationType = function(_idRef) { - this.setReference("annotationType", _idRef); -}; - -Annotation.prototype.getAnnotationType = function() { - return this.getReference("annotationType"); -}; - -Annotation.prototype.setTags = function(_idRefs) { - this.setReference("tag", _idRefs); -}; - -Annotation.prototype.getTags = function() { - return this.getReference("tag"); -}; - -Annotation.prototype.getTagTexts = function() { - return this.getTags().getTitles(); -}; - -Annotation.prototype.getDuration = function() { - return new Time(this.end.milliseconds - this.begin.milliseconds); -}; - -/* */ - -var MashedAnnotation = Model.MashedAnnotation = function(_mashup, _annotation) { - BaseElement.call(this, _mashup.id + "_" + _annotation.id, _annotation.source); - this.elementType = 'mashedAnnotation'; - this.annotation = _annotation; - this.begin = new Time(); - this.end = new Time(); - this.duration = new Time(); - this.title = this.annotation.title; - this.description = this.annotation.description; - this.color = this.annotation.color; - var _this = this; - this.on("click", function() { - _mashup.setCurrentTime(_this.begin); - }); - this.on("enter", function() { - _this.annotation.trigger("enter"); - }); - this.on("leave", function() { - _this.annotation.trigger("leave"); - }); -}; - -extendPrototype(MashedAnnotation, BaseElement); - -MashedAnnotation.prototype.getMedia = function() { - return this.annotation.getReference("media"); -}; - -MashedAnnotation.prototype.getAnnotationType = function() { - return this.annotation.getReference("annotationType"); -}; - -MashedAnnotation.prototype.getTags = function() { - return this.annotation.getReference("tag"); -}; - -MashedAnnotation.prototype.getTagTexts = function() { - return this.annotation.getTags().getTitles(); -}; - -MashedAnnotation.prototype.getDuration = function() { - return this.annotation.getDuration(); -}; - -MashedAnnotation.prototype.setBegin = function(_begin) { - this.begin.setMilliseconds(_begin); - this.duration.setMilliseconds(this.annotation.getDuration()); - this.end.setMilliseconds(_begin + this.duration); -}; - -/* */ - -var Mashup = Model.Mashup = function(_id, _source) { - Playable.call(this, _id, _source); - this.elementType = 'mashup'; - this.duration = new Time(); - this.segments = new List(_source.directory); - this.loaded = false; - var _this = this; - this._updateTimes = function() { - _this.updateTimes(); - _this.trigger("change"); - }; - this.on("add", this._updateTimes); - this.on("remove", this._updateTimes); -}; - -extendPrototype(Mashup, Playable); - -Mashup.prototype.updateTimes = function() { - var _time = 0; - this.segments.forEach(function(_segment) { - _segment.setBegin(_time); - _time = _segment.end; - }); - this.duration.setMilliseconds(_time); -}; - -Mashup.prototype.addAnnotation = function(_annotation, _defer) { - var _mashedAnnotation = new MashedAnnotation(this, _annotation), - _defer = _defer || false; - this.segments.push(_mashedAnnotation); - _annotation.on("change-begin", this._updateTimes); - _annotation.on("change-end", this._updateTimes); - if (!_defer) { - this.trigger("add"); - } -}; - -Mashup.prototype.addAnnotationById = function(_elId, _defer) { - var _annotation = this.source.getElement(_elId), - _defer = _defer || false; - if (typeof _annotation !== "undefined") { - this.addAnnotation(_annotation, _defer); - } -}; - -Mashup.prototype.addAnnotations = function(_segments) { - var _this = this; - ns._(_segments).forEach(function(_segment) { - _this.addAnnotation(_segment, true); - }); - this.trigger("add"); -}; - -Mashup.prototype.addAnnotationsById = function(_segments) { - var _this = this; - ns._(_segments).forEach(function(_segment) { - _this.addAnnotationById(_segment, true); - }); - this.trigger("add"); -}; - -Mashup.prototype.removeAnnotation = function(_annotation, _defer) { - var _defer = _defer || false; - _annotation.off("change-begin", this._updateTimes); - _annotation.off("change-end", this._updateTimes); - this.segments.removeId(this.id + "_" + _annotation.id); - if (!_defer) { - this.trigger("remove"); - } -}; - -Mashup.prototype.removeAnnotationById = function(_annId, _defer) { - var _defer = _defer || false; - var _annotation = this.source.getElement(_annId); - - if (_annotation) { - this.removeAnnotation(_annotation, _defer); - } - if (!_defer) { - this.trigger("remove"); - } -}; - -Mashup.prototype.setAnnotations = function(_segments) { - while (this.segments.length) { - this.removeAnnotation(this.segments[0].annotation, true); - } - this.addAnnotations(_segments); -}; - -Mashup.prototype.setAnnotationsById = function(_segments) { - while (this.segments.length) { - this.removeAnnotation(this.segments[0].annotation, true); - } - this.addAnnotationsById(_segments); -}; - -Mashup.prototype.hasAnnotation = function(_annotation) { - return !!ns._(this.segments).find(function(_s) { - return _s.annotation === _annotation; - }); -}; - -Mashup.prototype.getAnnotation = function(_annotation) { - return ns._(this.segments).find(function(_s) { - return _s.annotation === _annotation; - }); -}; - -Mashup.prototype.getAnnotationById = function(_id) { - return ns._(this.segments).find(function(_s) { - return _s.annotation.id === _id; - }); -}; - -Mashup.prototype.getAnnotations = function() { - return this.segments; -}; - -Mashup.prototype.getOriginalAnnotations = function() { - var annotations = new List(this.source.directory); - this.segments.forEach(function(_s) { - annotations.push(_s.annotation); - }); - return annotations; -}; - -Mashup.prototype.getMedias = function() { - var medias = new List(this.source.directory); - this.segments.forEach(function(_annotation) { - medias.push(_annotation.getMedia()); - }); - return medias; -}; - -Mashup.prototype.getAnnotationsByTypeTitle = function(_title) { - var _annTypes = this.source.getAnnotationTypes().searchByTitle(_title).pluck("id"); - if (_annTypes.length) { - return this.getAnnotations().filter(function(_annotation) { - return ns._(_annTypes).indexOf(_annotation.getAnnotationType().id) !== -1; - }); - } else { - return new List(this.source.directory); - } -}; - -Mashup.prototype.getAnnotationAtTime = function(_time) { - var _list = this.segments.filter(function(_annotation) { - return _annotation.begin <= _time && _annotation.end > _time; - }); - if (_list.length) { - return _list[0]; - } else { - return undefined; - } -}; - -Mashup.prototype.getMediaAtTime = function(_time) { - var _annotation = this.getAnnotationAtTime(_time); - if (typeof _annotation !== "undefined") { - return _annotation.getMedia(); - } else { - return undefined; - } -}; - -/* */ - -var Source = Model.Source = function(_config) { - BaseElement.call(this, false, this); - this.status = _SOURCE_STATUS_EMPTY; - this.elementType = "source"; - if (typeof _config !== "undefined") { - var _this = this; - ns._(_config).forEach(function(_v, _k) { - _this[_k] = _v; - }); - this.callbackQueue = []; - this.contents = {}; - this.get(); - } -}; - -extendPrototype(Source, BaseElement); +`;else if(lt.test(Xr))throw new yr(k);Er=(zt?Er.replace(Rt,""):Er).replace(yt,"$1").replace(le,"$1;"),Er="function("+(Xr||"obj")+`) { +`+(Xr?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(Tt?", __e = _.escape":"")+(zt?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Er+`return __p +}`;var fi=cf(function(){return Lr(it,Hr+"return "+Er).apply(l,xt)});if(fi.source=Er,ho(fi))throw fi;return fi}function $p(C){return bi(C).toLowerCase()}function Dp(C){return bi(C).toUpperCase()}function Lp(C,O,re){if(C=bi(C),C&&(re||O===l))return ln(C);if(!C||!(O=rn(O)))return C;var Se=Li(C),Ne=Li(O),it=gi(Se,Ne),xt=sa(Se,Ne)+1;return Jn(Se,it,xt).join("")}function Op(C,O,re){if(C=bi(C),C&&(re||O===l))return C.slice(0,Ka(C)+1);if(!C||!(O=rn(O)))return C;var Se=Li(C),Ne=sa(Se,Li(O))+1;return Jn(Se,0,Ne).join("")}function Fp(C,O,re){if(C=bi(C),C&&(re||O===l))return C.replace(Te,"");if(!C||!(O=rn(O)))return C;var Se=Li(C),Ne=gi(Se,Li(O));return Jn(Se,Ne).join("")}function zp(C,O){var re=ke,Se=T;if(_i(O)){var Ne="separator"in O?O.separator:Ne;re="length"in O?ui(O.length):re,Se="omission"in O?rn(O.omission):Se}C=bi(C);var it=C.length;if(Vi(C)){var xt=Li(C);it=xt.length}if(re>=it)return C;var Tt=re-Cn(Se);if(Tt<1)return Se;var zt=xt?Jn(xt,0,Tt).join(""):C.slice(0,Tt);if(Ne===l)return zt+Se;if(xt&&(Tt+=zt.length-Tt),po(Ne)){if(C.slice(Tt).search(Ne)){var wr,xr=zt;for(Ne.global||(Ne=oi(Ne.source,bi(Nt.exec(Ne))+"g")),Ne.lastIndex=0;wr=Ne.exec(xr);)var Er=wr.index;zt=zt.slice(0,Er===l?Tt:Er)}}else if(C.indexOf(rn(Ne),Tt)!=Tt){var Ir=zt.lastIndexOf(Ne);Ir>-1&&(zt=zt.slice(0,Ir))}return zt+Se}function Np(C){return C=bi(C),C&&Be.test(C)?C.replace(wt,Ta):C}var Hp=ka(function(C,O,re){return C+(re?" ":"")+O.toUpperCase()}),go=cu("toUpperCase");function lf(C,O,re){return C=bi(C),O=re?l:O,O===l?Ca(C)?qt(C):hi(C):C.match(O)||[]}var cf=ci(function(C,O){try{return Ke(C,l,O)}catch(re){return ho(re)?re:new yr(re)}}),Up=zn(function(C,O){return vt(O,function(re){re=Pn(re),On(C,re,lo(C[re],C))}),C});function Wp(C){var O=C==null?0:C.length,re=Yr();return C=O?Dr(C,function(Se){if(typeof Se[1]!="function")throw new li(S);return[re(Se[0]),Se[1]]}):[],ci(function(Se){for(var Ne=-1;++New)return[];var re=x,Se=Ii(C,x);O=Yr(O),C-=x;for(var Ne=na(Se,O);++re0||O<0)?new mi(re):(C<0?re=re.takeRight(-C):C&&(re=re.drop(C)),O!==l&&(O=ui(O),re=O<0?re.dropRight(-O):re.take(O-C)),re)},mi.prototype.takeRightWhile=function(C){return this.reverse().takeWhile(C).reverse()},mi.prototype.toArray=function(){return this.take(x)},jn(mi.prototype,function(C,O){var re=/^(?:filter|find|map|reject)|While$/.test(O),Se=/^(?:head|last)$/.test(O),Ne=Qe[Se?"take"+(O=="last"?"Right":""):O],it=Se||/^find/.test(O);Ne&&(Qe.prototype[O]=function(){var xt=this.__wrapped__,Tt=Se?[1]:arguments,zt=xt instanceof mi,wr=Tt[0],xr=zt||ai(xt),Er=function(pi){var vi=Ne.apply(Qe,ni([pi],Tt));return Se&&Ir?vi[0]:vi};xr&&re&&typeof wr=="function"&&wr.length!=1&&(zt=xr=!1);var Ir=this.__chain__,Hr=!!this.__actions__.length,Xr=it&&!Ir,fi=zt&&!Hr;if(!it&&xr){xt=fi?xt:new mi(this);var Jr=C.apply(xt,Tt);return Jr.__actions__.push({func:bs,args:[Er],thisArg:l}),new cn(Jr,Ir)}return Xr&&fi?C.apply(this,Tt):(Jr=this.thru(Er),Xr?Se?Jr.value()[0]:Jr.value():Jr)})}),vt(["pop","push","shift","sort","splice","unshift"],function(C){var O=Ai[C],re=/^(?:push|sort|unshift)$/.test(C)?"tap":"thru",Se=/^(?:pop|shift)$/.test(C);Qe.prototype[C]=function(){var Ne=arguments;if(Se&&!this.__chain__){var it=this.value();return O.apply(ai(it)?it:[],Ne)}return this[re](function(xt){return O.apply(ai(xt)?xt:[],Ne)})}}),jn(mi.prototype,function(C,O){var re=Qe[O];if(re){var Se=re.name+"";ei.call(wa,Se)||(wa[Se]=[]),wa[Se].push({name:O,func:re})}}),wa[hs(l,F).name]=[{name:"wrapper",func:l}],mi.prototype.clone=qf,mi.prototype.reverse=Bf,mi.prototype.value=Rf,Qe.prototype.at=gh,Qe.prototype.chain=yh,Qe.prototype.commit=bh,Qe.prototype.next=wh,Qe.prototype.plant=_h,Qe.prototype.reverse=kh,Qe.prototype.toJSON=Qe.prototype.valueOf=Qe.prototype.value=Sh,Qe.prototype.first=Qe.prototype.head,Pa&&(Qe.prototype[Pa]=xh),Qe},Gt=Ht();Ui?((Ui.exports=Gt)._=Gt,Rn._=Gt):yi._=Gt}).call(commonjsGlobal)}(lodash,lodash.exports);var lodashExports=lodash.exports;const _$1=getDefaultExportFromCjs$1(lodashExports);window.$=jqueryExports.$,window.jQuery=jqueryExports.jQuery,global$1.$=jqueryExports.$,global$1.jQuery=jqueryExports.jQuery;const __APP_VERSION__="",APP_VERSION=__APP_VERSION__,IriSP$1={VERSION:APP_VERSION,jQuery:jqueryExports.jQuery,libFiles:{locations:{}}};window.IriSP=IriSP$1;const Model=function(t){function n(p,b,e){e=e||10;for(var c=b.toString(e);c.length"u")throw console.trace(),"Error : new List(directory): directory is undefined";var b=this;this.on("clear-search",function(){b.searching=!1,b.regexp=void 0,b.forEach(function(e){e.found=void 0}),b.trigger("search-cleared")})};z.prototype=new Array,z.prototype.hasId=function(p){return _$1(this.idIndex).includes(p)},typeof Array.prototype.forEach>"u"&&(z.prototype.forEach=function(p){var b=this;_$1(this).forEach(function(e,c){p(e,c,b)})}),typeof Array.prototype.map>"u"&&(z.prototype.map=function(p){var b=this;return _$1(this).map(function(e,c){return p(e,c,b)})}),z.prototype.pluck=function(p){return this.map(function(b){return b[p]})},z.prototype.filter=function(p){var b=this,e=new z(this.directory);return e.addElements(_$1(this).filter(function(c,y){return p(c,y,b)})),e},z.prototype.slice=function(p,b){var e=new z(this.directory);return e.addElements(Array.prototype.slice.call(this,p,b)),e},z.prototype.splice=function(p,b){var e=new z(this.directory);return e.addElements(Array.prototype.splice.call(this,p,b)),this.idIndex.splice(p,b),e},z.prototype.sortBy=function(p){var b=this,e=new z(this.directory);return e.addElements(_$1(this).sortBy(function(c,y){return p(c,y,b)})),e},z.prototype.searchByTitle=function(p,e){var e=e||!1,c=P(p,!0,e);return this.filter(function(y){return c.test(y.title)})},z.prototype.searchByDescription=function(p,e){var e=e||!1,c=P(p,!0,e);return this.filter(function(y){return c.test(y.description)})},z.prototype.searchByTextFields=function(p,e){var e=e||!1,c=P(p,!0,e);return this.filter(function(y){var w=(y.keywords||y.getTagTexts()||[]).join(", ");return c.test(y.description)||c.test(y.title)||c.test(w)})},z.prototype.search=function(p){if(!p)return this.trigger("clear-search"),this;this.searching=!0,this.trigger("search",p);var b=$(p),e=new RegExp(b,"im");this.regexp=new RegExp(b,"gim");var c=this.filter(function(y,w){var v=e.test(y.title),o=e.test(y.description),x=!!(v||o);return y.found=x,y.trigger(x?"found":"not-found"),x});return this.trigger(c.length?"found":"not-found",c),c},z.prototype.searchByTags=function(p){if(!p)return this.trigger("clear-search"),this;this.searching=!0,this.trigger("search",p);var b=$(p),e=new RegExp(b,"im");this.regexp=new RegExp(b,"gim");var c=this.filter(function(y,w){var v=e.test(y.getTagTexts());return y.found=v,y.trigger(v?"found":"not-found"),v});return this.trigger(c.length?"found":"not-found",c),c},z.prototype.getTitles=function(){return this.map(function(p){return p.title})},z.prototype.addId=function(p){var b=this.directory.getElement(p);!this.hasId(p)&&typeof b<"u"&&(this.idIndex.push(p),Array.prototype.push.call(this,b))},z.prototype.push=function(p){if(!(typeof p>"u")){var b=_$1(this.idIndex).indexOf(p.id);b===-1?(this.idIndex.push(p.id),Array.prototype.push.call(this,p)):this[b]=p}},z.prototype.addIds=function(p){p.length;var b=this;_$1(p).forEach(function(e){b.addId(e)})},z.prototype.addElements=function(p){var b=this;_$1(p).forEach(function(e){b.push(e)})},z.prototype.removeId=function(p,e){var e=e||!1,c=_$1(this.idIndex).indexOf(p);c!==-1&&this.splice(c,1),e&&delete this.directory.elements[p]},z.prototype.removeElement=function(p,b){this.removeId(p.id)},z.prototype.removeIds=function(p,b){var e=this;_$1(p).forEach(function(c){e.removeId(c)})},z.prototype.removeElements=function(p,b){var e=this;_$1(p).forEach(function(c){e.removeElement(c)})},z.prototype.on=function(p,b){typeof this.__events[p]>"u"&&(this.__events[p]=[]),this.__events[p].push(b)},z.prototype.off=function(p,b){typeof this.__events[p]<"u"&&(this.__events[p]=t._(this.__events[p]).reject(function(e){return e===b}))},z.prototype.trigger=function(p,b){var e=this;_$1(this.__events[p]).each(function(c){c.call(e,b)})};var N=k.Time=function(p){this.milliseconds=0,this.setMilliseconds(p)};N.prototype.setMilliseconds=function(p){var b=this.milliseconds;switch(typeof p){case"string":this.milliseconds=parseInt(p);break;case"number":this.milliseconds=Math.floor(p);break;case"object":this.milliseconds=parseInt(p.valueOf());break;default:this.milliseconds=0}this.milliseconds===NaN&&(this.milliseconds=b)},N.prototype.setSeconds=function(p){this.milliseconds=1e3*p},N.prototype.getSeconds=function(){return this.milliseconds/1e3},N.prototype.getHMS=function(){var p=Math.abs(Math.floor(this.getSeconds()));return{hours:Math.floor(p/3600),minutes:Math.floor(p/60)%60,seconds:p%60,milliseconds:this.milliseconds%1e3}},N.prototype.add=function(p){this.milliseconds+=new N(p).milliseconds},N.prototype.valueOf=function(){return this.milliseconds},N.prototype.toString=function(p){var b=this.getHMS(),e="";return b.hours&&(e+=b.hours+":"),e+=n(2,b.minutes)+":"+n(2,b.seconds),p&&(e+="."+Math.floor(b.milliseconds/100)),e};var F=k.Reference=function(p,b){this.source=p,this.id=b,typeof b=="object"?this.isList=!0:this.isList=!1,this.refresh()};F.prototype.refresh=function(){this.isList?(this.contents=new z(this.source.directory),this.contents.addIds(this.id)):this.contents=this.source.getElement(this.id)},F.prototype.getContents=function(){return(typeof this.contents>"u"||this.isList&&this.contents.length!=this.id.length)&&this.refresh(),this.contents},F.prototype.isOrHasId=function(p){return this.isList?_$1(this.id).indexOf(p)!==-1:this.id==p};var U=k.Element=function(p,b){this.elementType="element",this.title="",this.description="",this.__events={},!(typeof b>"u")&&((typeof p>"u"||!p)&&(p=I()),this.id=p,this.source=b,b!==this&&this.source.directory.addElement(this))};U.prototype.toString=function(){return this.elementType+(this.elementType!=="element"?", id="+this.id+', title="'+this.title+'"':"")},U.prototype.setReference=function(p,b){this[p]=new F(this.source,b)},U.prototype.getReference=function(p){if(typeof this[p]<"u")return this[p].getContents()},U.prototype.getRelated=function(p,b){b=typeof b<"u"&&b;var e=this;return this.source.getList(p,b).filter(function(c){var y=c[e.elementType];return y&&y.isOrHasId(e.id)})},U.prototype.on=function(p,b){typeof this.__events[p]>"u"&&(this.__events[p]=[]),this.__events[p].push(b)},U.prototype.off=function(p,b){typeof this.__events[p]<"u"&&(this.__events[p]=_$1(this.__events[p]).reject(function(e){return e===b}))},U.prototype.trigger=function(p,b){var e=this;_$1(this.__events[p]).each(function(c){c.call(e,b)})};var J=k.Playable=function(p,b){if(U.call(this,p,b),!(typeof b>"u")){this.elementType="playable",this.currentTime=new N,this.volume=.5,this.paused=!0,this.muted=!1,this.timeRange=!1,this.loadedMetadata=!1;var e=this;this.on("play",function(){e.paused=!1}),this.on("pause",function(){e.paused=!0}),this.on("timeupdate",function(c){e.currentTime=c,e.getAnnotations().filter(function(y){return(y.end<=c||y.begin>c)&&y.playing}).forEach(function(y){y.playing=!1,y.trigger("leave"),e.trigger("leave-annotation",y)}),e.getAnnotations().filter(function(y){return y.begin<=c&&y.end>c&&!y.playing}).forEach(function(y){y.playing=!0,y.trigger("enter"),e.trigger("enter-annotation",y)}),e.getTimeRange()&&(e.getTimeRange()[0]>c&&(e.pause(),e.setCurrentTime(e.getTimeRange()[0])),e.getTimeRange()[1]=0&&b>0)return this.trigger("settimerange",[p,b])},J.prototype.resetTimeRange=function(){return this.trigger("resettimerange")},J.prototype.play=function(){this.trigger("setplay")},J.prototype.pause=function(){this.trigger("setpause")},J.prototype.show=function(){},J.prototype.hide=function(){};var te=k.Media=function(p,b){J.call(this,p,b),this.elementType="media",this.duration=new N,this.video=""};j(te,J);var te=k.Media=function(p,b){J.call(this,p,b),this.elementType="media",this.duration=new N,this.video=""};j(te,J),te.prototype.setDuration=function(p){this.duration.setMilliseconds(p)},te.prototype.getAnnotations=function(){return this.getRelated("annotation")},te.prototype.getAnnotationsByTypeTitle=function(p){var b=this.source.getAnnotationTypes().searchByTitle(p).pluck("id");return b.length?this.getAnnotations().filter(function(e){return _$1(b).indexOf(e.getAnnotationType().id)!==-1}):new z(this.source.directory)};var se=k.Tag=function(p,b){U.call(this,p,b),this.elementType="tag"};j(se,U),se.prototype.getAnnotations=function(){return this.getRelated("annotation")};var de=k.AnnotationType=function(p,b){U.call(this,p,b),this.elementType="annotationType"};j(de,U),de.prototype.getAnnotations=function(){return this.getRelated("annotation")};var Q=k.Annotation=function(p,b){U.call(this,p,b),this.elementType="annotation",this.begin=new N,this.end=new N,this.tag=new F(b,[]),this.playing=!1;var e=this;this.on("click",function(){e.getMedia().setCurrentTime(e.begin)})};j(Q,U),Q.prototype.setBeginEnd=function(p,b){p=Math.max(0,p),b=Math.max(0,b),bp});if(b.length)return b[0]},he.prototype.getMediaAtTime=function(p){var b=this.getAnnotationAtTime(p);if(typeof b<"u")return b.getMedia()};var ke=k.Source=function(p){if(U.call(this,!1,this),this.status=A,this.elementType="source",typeof p<"u"){var b=this;_$1(p).forEach(function(e,c){b[c]=e}),this.callbackQueue=[],this.contents={},this.get()}};j(ke,U),ke.prototype.addList=function(p,b){typeof this.contents[p]>"u"&&(this.contents[p]=new z(this.directory)),this.contents[p].addElements(b)},ke.prototype.getList=function(p,b){return b=typeof b<"u"&&b,b?this.directory.getGlobalList().filter(function(e){return e.elementType===p}):(typeof this.contents[p]>"u"&&(this.contents[p]=new z(this.directory)),this.contents[p])},ke.prototype.forEach=function(p){var b=this;_$1(this.contents).forEach(function(e,c){p.call(b,e,c)})},ke.prototype.getElement=function(p){return this.directory.getElement(p)},ke.prototype.get=function(){this.status=B,this.handleCallbacks()},ke.prototype.deferCallback=function(p){var b=this;_$1.defer(function(){p.call(b)})},ke.prototype.handleCallbacks=function(){for(this.status=M;this.callbackQueue.length;)this.deferCallback(this.callbackQueue.splice(0,1)[0])},ke.prototype.onLoad=function(p){this.status===M?this.deferCallback(p):this.callbackQueue.push(p)},ke.prototype.serialize=function(){return this.serializer.serialize(this)},ke.prototype.deSerialize=function(p){this.serializer.deSerialize(p,this)},ke.prototype.getAnnotations=function(p){return p=typeof p<"u"&&p,this.getList("annotation",p)},ke.prototype.getMedias=function(p){return p=typeof p<"u"&&p,this.getList("media",p)},ke.prototype.getTags=function(p){return p=typeof p<"u"&&p,this.getList("tag",p)},ke.prototype.getMashups=function(p){return p=typeof p<"u"&&p,this.getList("mashup",p)},ke.prototype.getAnnotationTypes=function(p){return p=typeof p<"u"&&p,this.getList("annotationType",p)},ke.prototype.getAnnotationsByTypeTitle=function(p,b){b=typeof b<"u"&&b;var e=new z(this.directory),c=this.getAnnotationTypes(b).searchByTitle(p);return c.forEach(function(y){e.addElements(y.getAnnotations(b))}),e},ke.prototype.getDuration=function(){var p=this.currentMedia;if(typeof p<"u")return this.currentMedia.duration},ke.prototype.getCurrentMedia=function(p){if(typeof this.currentMedia>"u")if(p.is_mashup){var b=this.getMashups();b.length&&(this.currentMedia=b[0])}else{var e=this.getMedias();e.length&&(this.currentMedia=e[0])}return this.currentMedia},ke.prototype.merge=function(p){var b=this;p.forEach(function(e,c){b.getList(c).addElements(e)})};var T=k.RemoteSource=function(p){ke.call(this,p)};j(T,ke),T.prototype.get=function(){this.status=B;var p=this,b=this.url_params||{},e=this.dataType||"json";b.format=e,jQuery.ajax({url:this.url,dataType:e,data:b,traditional:!0,success:function(c){p.deSerialize(c),p.handleCallbacks()}})};var u=k.Directory=function(){this.remoteSources={},this.elements={}};return u.prototype.remoteSource=function(p){if(typeof p!="object"||typeof p.url>"u")throw"Error : Directory.remoteSource(configuration): configuration.url is undefined";var b=_$1({directory:this}).extend(p);b.url_params=b.url_params||{};var e=b.url+"?"+jQuery.param(b.url_params);return typeof this.remoteSources[e]>"u"&&(this.remoteSources[e]=new T(b)),this.remoteSources[e]},u.prototype.newLocalSource=function(p){var b=_$1({directory:this}).extend(p),e=new ke(b);return e},u.prototype.getElement=function(p){return this.elements[p]},u.prototype.addElement=function(p){this.elements[p.id]=p},u.prototype.getGlobalList=function(){var p=new z(this);return p.addIds(_$1(this.elements).keys()),p},k},htmlPlayer=function(t,n,l){var d=l||{},m=d.video||t.video;typeof d.url_transform=="function"&&(m=d.url_transform(m));var h=jQuery("
'),n},currentSegmentInfoboxStyles={},CurrentSegmentInfobox=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d)}draw(){var l=this;this.segments=this.getWidgetAnnotations(),this.renderTemplate(),this.currentSegment=!1,this.clearBox(),this.refresh(),this.onMediaEvent("timeupdate","refresh"),this.onMediaEvent("settimerange",function(d){var m=d[0],h=d[1],S=l.segments.filter(function(k){return k.begin.milliseconds==m.milliseconds&&k.end.milliseconds==h.milliseconds});S.length>0&&(l.$.toggleClass("editing",!1),l.currentSegment.id!=S[0].id&&(l.currentSegment=S[0],_data={editable_segments:l.editable_segments,edit:l.custom_edit_text?l.custom_edit_text:l.l10n.edit,title:l.currentSegment.title,description:l.currentSegment.description,description_placeholder:l.empty_description_placeholder,tags:l.currentSegment.getTagTexts()},l.$.html(mustache.render(l.template,_data)),l.editable_segments&&l.currentSegment&&l.$.find(".Ldt-CurrentSegmentInfobox").click(l.functionWrapper("enableEditMode"))))}),this.editable_segments&&this.currentSegment&&this.$.find(".Ldt-CurrentSegmentInfobox").click(l.functionWrapper("enableEditMode"))}enableEditMode(){this.currentSegment&&(_data={title:this.currentSegment.title,description:this.currentSegment.description,tags:this.currentSegment.getTagTexts(),submit:this.l10n.submit,cancel:this.l10n.cancel,headers:this.show_headers,tags_header:this.custom_tags_header?this.custom_tags_header:this.l10n.tags_header,fields_header:this.custom_fields_header?this.custom_fields_header:this.l10n.fields_header,new_tag:this.l10n.new_tag,delete_tag:this.l10n.delete_tag,new_tag_button:this.new_tag_button},this.$.toggleClass("editing",!0),this.$.html(mustache.render(this.editTemplate,_data)),this.$.find(".Ldt-CurrentSegmentInfobox-CancelButton").click(this.functionWrapper("disableEditMode")),this.new_tag_button?this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagButton").click(this.functionWrapper("insertTagInput")):(this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput").keypress(this.functionWrapper("insertTagInputKeypress")),this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput-Add").click(this.functionWrapper("insertTagInputKeypress"))),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput")),this.$.find(".Ldt-CurrentSegmentInfobox-SubmitButton").click(this.functionWrapper("onSubmit")))}disableEditMode(){this.currentSegment&&(_data={editable_segments:this.editable_segments,edit:this.custom_edit_text?this.custom_edit_text:this.l10n.edit,title:this.currentSegment.title,description:this.currentSegment.description,description_placeholder:this.empty_description_placeholder,tags:this.currentSegment.getTagTexts()},this.$.toggleClass("editing",!1),this.$.html(mustache.render(this.template,_data)),this.$.find(".Ldt-CurrentSegmentInfobox").click(this.functionWrapper("enableEditMode")))}insertTagInput(){!this.currentSegment.getTagTexts().length&&!this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").length&&this.$.find(".Ldt-CurrentSegmentInfobox-Tags").prepend('
    '),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").append('
  • '+this.l10n.delete_tag+"
  • "),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput"))}insertTagInputKeypress(l){var d=l.keyCode?l.keyCode:l.which;if(d=="13"||l.type=="click")return!this.currentSegment.getTagTexts().length&&!this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").length&&this.$.find(".Ldt-CurrentSegmentInfobox-Tags").prepend('
      '),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Ul").append('
    • '+this.l10n.delete_tag+"
    • "),this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-DeleteTagButton").click(this.functionWrapper("deleteTagInput")),this.$.find(".Ldt-CurrentSegmentInfobox-CreateTagInput").val(""),!1}deleteTagInput(l){jQuery(l.currentTarget).parent().remove()}onSubmit(){new_tags_titles=this.$.find(".Ldt-CurrentSegmentInfobox-Tags-Li-Input").map(function(){if(jQuery(this).val())return jQuery(this).val()}),new_title=this.$.find(".Ldt-CurrentSegmentInfobox-TitleInput").val(),new_description=this.$.find(".Ldt-CurrentSegmentInfobox-DescriptionInput").val();var l=this,d=new t.Model.List(this.player.sourceManager),m=this.player.sourceManager.newLocalSource({serializer:t.serializers[this.api_serializer]}),h=new t.Model.Annotation(this.currentSegment.id,m);h.setAnnotationType(this.currentSegment.getAnnotationType().id),h.setMedia(this.currentSegment.getMedia().id),h.setBegin(this.currentSegment.begin),h.setEnd(this.currentSegment.end),h.created=this.currentSegment.created,h.creator=this.currentSegment.creator,h.title=new_title,h.description=new_description;var S=_$1(new_tags_titles).map(function(k){var A=l.source.getTags(!0).searchByTitle(k,!0);if(A.length)var B=A[0];else B=new t.Model.Tag(k.replace(/\W/g,"_"),l.source),B.title=k,l.source.getTags().push(B);return B.id}).value();h.setTags(S),h.project_id=this.project_id,d.push(h),m.addList("annotation",d),_url=mustache.render(this.api_endpoint_template,{annotation_id:this.currentSegment.id}),t.jQuery.ajax({url:_url,type:this.api_method,contentType:"application/json",data:m.serialize(),success:function(k){m.getAnnotations().removeElement(h,!0),m.deSerialize(k),l.source.merge(m),l.segments.forEach(function(A){A.id==h.id&&l.segments.removeElement(A)}),l.segments.push(h),l.currentSegment=h,k={editable_segments:l.editable_segments,edit:l.custom_edit_text?l.custom_edit_text:l.l10n.edit,title:l.currentSegment.title,description:l.currentSegment.description,description_placeholder:l.empty_description_placeholder,tags:l.currentSegment.getTagTexts()},l.$.html(mustache.render(l.template,k)),l.editable_segments&&l.currentSegment&&l.$.find(".Ldt-CurrentSegmentInfobox").click(l.functionWrapper("enableEditMode")),l.$.toggleClass("editing",!1)},error:function(k,A,B){t.log("Error when sending annotation",B),m.getAnnotations().removeElement(h,!0)}})}refresh(){if(!this.media.getTimeRange()){var l=this.media.getCurrentTime(),d=this.segments.filter(function(m){return m.begin<=l&&m.end>=l});d.length>0?this.currentSegment.id!=d[0].id&&(this.currentSegment=d[0],_data={editable_segments:this.editable_segments,edit:this.custom_edit_text?this.custom_edit_text:this.l10n.edit,title:this.currentSegment.title,description:this.currentSegment.description,description_placeholder:this.empty_description_placeholder,tags:this.currentSegment.getTagTexts()},this.$.html(mustache.render(this.template,_data)),this.editable_segments&&this.currentSegment&&this.$.find(".Ldt-CurrentSegmentInfobox").click(this.functionWrapper("enableEditMode"))):(this.currentSegment=!1,this.clearBox())}}clearBox(){var l=this.l10n.empty;this.empty_message&&(l=this.empty_message),this.$.find(".Ldt-CurrentSegmentInfobox").html("
      "+l+"
      ")}},Cr(n,"defaults",{annotation_type:"chap",editable_segments:!1,empty_message:!1,project_id:!1,api_serializer:"ldt_annotate",api_method:"PUT",api_endpoint_template:"",new_tag_button:!0,show_headers:!1,custom_edit_text:!1,empty_description_placeholder:!1}),Cr(n,"template",'
      {{#editable_segments}}
      {{edit}}
      {{/editable_segments}}
      {{title}}
      {{description}}
      {{^description}}{{^tags.length}}{{#description_placeholder}}
      {{description_placeholder}}
      {{/description_placeholder}}{{/tags.length}}{{/description}}
      {{#tags.length}}
        {{#tags}}{{#.}}
      • {{.}}
      • {{/.}}{{/tags}}
      {{/tags.length}}
      '),Cr(n,"editTemplate",'
      {{#headers}}
      {{fields_header}}
      {{/headers}}
      {{#headers}}
      {{tags_header}}
      {{/headers}}{{#new_tag_button}}
      {{new_tag}}
      {{/new_tag_button}}{{^new_tag_button}}
      +
      {{/new_tag_button}}
        {{#tags}}{{#.}}
      • {{delete_tag}}
      • {{/.}}{{/tags}}
      {{submit}}
      {{cancel}}
      '),Cr(n,"messages",{fr:{submit:"Soumettre",cancel:"Annuler",edit:"Editer",new_tag:"Nouveau tag",delete_tag:"Supprimer",fields_header:"Commentaire associé à ce segment",tags_header:"Mots-clés associés à ce segment",empty:"Le player vidéo ne lit actuellement aucun segment"},en:{submit:"Submit",cancel:"Cancel",edit:"Edit",new_tag:"New tag",delete_tag:"Delete tag",fields_header:"Current segment content",tags_header:"Current segment tags",empty:"The player currently doesn't read any segment"}}),n},DailymotionPlayer=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"draw",function(){typeof this.video>"u"&&(this.video=this.media.video),this.height=this.height||Math.floor(this.width/this.aspect_ratio);var d=this.media,m=null,h=this,S={pause:!0,apiready:!1,volume:0,time:0,duration:0},k=this.video.match(/www.dailymotion.com\/video\/(.+)/);k&&(m=k[1]);var A=mustache.render("{{ protocol }}//www.dailymotion.com/embed/video/{{ videoid }}",{protocol:document.location.protocol.search("http")==0?document.location.protocol:"http:",videoid:m}),B={api:"postMessage",chromeless:1,id:"dm_player",related:0,autoplay:1};h.$.html(mustache.render('',{player_url:A,params:Object.keys(B).reduce(function(j,I){return j.push(I+"="+encodeURIComponent(B[I])),j},[]).join("&"),width:this.width,height:this.height,id:B.id}));function M(){var j=h.$.find("#"+B.id)[0].contentWindow,I=function(P,$){$!==void 0&&(P=P+"="+$),j.postMessage(P,"*")};d.getCurrentTime=function(){return S.time},d.getVolume=function(){return S.volume},d.getPaused=function(){return S.pause},d.getMuted=function(){return S.muted},d.setCurrentTime=function(P){I("seek",P/1e3)},d.setVolume=function(P){I("volume",P*100)},d.mute=function(){I("muted",1)},d.unmute=function(){I("muted",0)},d.play=function(){I("play")},d.pause=function(){I("pause")}}window.addEventListener("message",function(j){if(j.data.split!==void 0){var I=j.data.split("&").map(function(P){return P.split("=")}).reduce(function(P,$){return P[$[0]]=decodeURIComponent($[1]),P},{});switch(I.event){case"apiready":S.apiready=!0,M();break;case"durationchange":I.duration.slice(-2)=="sc"&&(S.duration=1e3*Number(I.duration.slice(0,-2)),d.setDuration(S.duration));break;case"ended":S.pause=!0;break;case"loadedmetadata":d.trigger("loadedmetadata");break;case"pause":S.pause=!0,d.trigger("pause");break;case"play":S.pause=!1,d.trigger("play");break;case"seeked":S.time=new t.Model.Time(1e3*Number(I.time)),d.trigger("seeked");break;case"timeupdate":S.time=new t.Model.Time(1e3*Number(I.time)),d.trigger("timeupdate",S.time);break;case"volumechange":S.muted=I.muted=="true",S.volume=Number(I.volume)/100;break}}},!1)})}},Cr(n,"defaults",{aspect_ratio:14/9}),n},enrichedPlanStyles={},EnrichedPlan=function(t){var n;return n=class extends t.Widgets.Widget{constructor(d,m){super(d,m);Cr(this,"annotationTemplate",'
      {{{ text }}} {{ author }}
      ')}draw(){var d=this;d.prefix="TODO";var m=this.getWidgetAnnotations().sortBy(function(B){return B.begin}),h=this.media.getAnnotations().filter(function(B){return B.getAnnotationType().title!=d.annotation_type}).sortBy(function(B){return B.begin});m.forEach(function(B){B.annotations=h.filter(function(M){return M.begin>=B.begin&&M.begin<=B.end})}),d.renderTemplate();var S=d.$.find(".Ldt-EnrichedPlan-Container"),k=d.$.find(".Ldt-EnrichedPlan-Content");function A(B){return B.title.indexOf("Anonyme")<0?"Own":"Other"}m.forEach(function(B){var M=mustache.render(d.slideTemplate,{id:B.id,atitle:t.textFieldHtml(B.title),level:B.content.level||1,begin:B.begin.toString(),begintc:B.begin.milliseconds,thumbnail:B.thumbnail,show_slides:d.show_slides,notes:B.annotations.map(function(I){return mustache.render(d.annotationTemplate,{id:I.id,text:t.textFieldHtml(I.description||I.title),author:I.creator,begin:I.begin.toString(),begintc:I.begin.milliseconds,atitle:I.title.slice(0,20),category:"Ldt-EnrichedPlan-Note-"+A(I),filtered:A(I)=="Own"&&!d.show_own_notes||A(I)=="Other"&&!d.show_other_notes||A(I)=="Teacher"&&!d.show_teacher_notes?"filtered_out":""})}).join(` +`)}),j=t.jQuery(M);k.append(j)}),S.on("click","[data-timecode]",function(){d.media.setCurrentTime(Number(this.dataset.timecode))}),S.on("click",".Ldt-EnrichedPlan-Control-Checkbox",function(){var B=_.first(_.filter(this.classList,function(M){return M!="Ldt-EnrichedPlan-Control-Checkbox"}));B!==void 0&&(jQuery(this).is(":checked")?k.find(".Ldt-EnrichedPlan-Slide ."+B).removeClass("filtered_out"):k.find(".Ldt-EnrichedPlan-Slide ."+B).addClass("filtered_out"))}),S.find(".Ldt-EnrichedPlan-Search-Input").on("search",function(){var B=jQuery(this).val().toLocaleLowerCase();B===""?k.find(".Ldt-EnrichedPlan-Note").removeClass("non_matching"):jQuery(".Ldt-EnrichedPlan-Note").each(function(){var M=jQuery(this);M.text().toLocaleLowerCase().indexOf(B)>-1?M.removeClass("non_matching"):M.addClass("non_matching")})})}},Cr(n,"defaults",{annotation_type:"Slides",annotation_types:[],show_controls:!0,show_slides:!0,show_teacher_notes:!0,show_other_notes:!0,show_own_notes:!0}),Cr(n,"template",'
      {{#show_controls}}
      {{/show_controls}}
      '),Cr(n,"slideTemplate",'
      {{ begin }}
      {{ atitle }}
      {{{ notes }}}
      '),n},highlighterStyles={},Highlighter=function(t){var n;return n=class extends t.Widgets.Widget{constructor(l,d){super(l,d);var m=this;this.throttledRefresh=_$1.throttle(function(){console.log("highlighter Refresh"),m.update()},800)}update(){var l=this,d=l.media.getCurrentTime();return l.$.find(".Ldt-Highlighter-Annotation",document).toggleClass("currentAnnotation",function(){return this.dataset.media===l.media.id&&this.dataset.begin<=d&&d=l.duration&&(l.paused||(l.paused=!0,l.trigger("pause")),B=0);var P=l.getAnnotationAtTime(B);if(typeof P>"u"){l.currentMedia&&(l.currentMedia.pause(),l.paused||(l.paused=!0,l.trigger("pause")));return}l.currentAnnotation=P,k=l.currentAnnotation.annotation.begin.milliseconds,A=l.currentAnnotation.annotation.end.milliseconds,M=k-l.currentAnnotation.begin.milliseconds,l.currentMedia=l.currentAnnotation.getMedia(),l.getMedias().forEach(function($){$!==l.currentMedia?($.hide(),$.pause()):$.show()}),l.currentMedia.setCurrentTime(B+M),l.currentMedia.seeking=!0,l.paused||(l.currentMedia.play(),l.seeking=!0),l.trigger("timeupdate",new t.Model.Time(B))}l.getMedias().forEach(I),j(),l.trigger("loadedmetadata");function I(P){if(!P.has_player){P.has_player=!0;var $=P.video;typeof S=="function"&&($=S(P.video));var z="video_"+P.id,N;P.show=function(){if(document.getElementById(z))return;P.loaded=!1,P.paused=!0;var J=jQuery("